no message
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
package Common.Visual.Controls;
|
||||
import Common.MainModule_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import Common.Visual.UI_;
|
||||
public class HyperlinksStyledList extends StyledList {
|
||||
@Override
|
||||
public void applyTheme() {
|
||||
super.applyTheme();
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.Hyperlink));
|
||||
setFont(MainModule_.instance.getUI().getTheme().Fonts.get(VisualiserFonts.Hyperlink));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Common.Visual.Controls;
|
||||
import Common.MainModule_;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import Common.Visual.UI_;
|
||||
@@ -9,7 +10,7 @@ import java.awt.*;
|
||||
public class MenuBarButton extends JButton {
|
||||
public MenuBarButton() {
|
||||
super();
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
setFont(MainModule_.instance.getUI().getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
//
|
||||
setBorderPainted(false);
|
||||
setContentAreaFilled(false);
|
||||
@@ -30,6 +31,6 @@ public class MenuBarButton extends JButton {
|
||||
setIcon(Utils_.getIcon(icon_path));
|
||||
}
|
||||
public void setFont(VisualiserFonts font_in) {
|
||||
setFont(UI_.getTheme().Fonts.get(font_in));
|
||||
setFont(MainModule_.instance.getUI().getTheme().Fonts.get(font_in));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Common.Visual.Controls;
|
||||
import Common.MainModule_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import Common.Visual.Themes.ThemeElement;
|
||||
import Common.Visual.UI_;
|
||||
@@ -6,12 +7,12 @@ import Common.Visual.UI_;
|
||||
import javax.swing.*;
|
||||
public class StyledList extends JList implements ThemeElement {
|
||||
public StyledList() {
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
setFont(MainModule_.instance.getUI().getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
applyTheme();
|
||||
}
|
||||
@Override
|
||||
public void applyTheme() {
|
||||
setBackground(UI_.getTheme().table_background);
|
||||
setForeground(UI_.getTheme().foreground);
|
||||
setBackground(MainModule_.instance.getUI().getTheme().table_background);
|
||||
setForeground(MainModule_.instance.getUI().getTheme().foreground);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Common.Visual.Controls;
|
||||
import Common.MainModule_;
|
||||
import Common.Visual.Themes.ThemeElement;
|
||||
import Common.Visual.UI_;
|
||||
|
||||
@@ -10,7 +11,7 @@ public class StyledProgressBar extends JProgressBar implements ThemeElement {
|
||||
}
|
||||
@Override
|
||||
public void applyTheme() {
|
||||
setBackground(UI_.getTheme().bar_background);
|
||||
setForeground(UI_.getTheme().bar_foreground);
|
||||
setBackground(MainModule_.instance.getUI().getTheme().bar_background);
|
||||
setForeground(MainModule_.instance.getUI().getTheme().bar_foreground);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Common.Visual.Menus;
|
||||
import Common.MainModule_;
|
||||
import Common.Visual.Themes.ThemeElement;
|
||||
import Common.Visual.UI_;
|
||||
|
||||
@@ -21,15 +22,15 @@ public class StyledPopupMenu extends JPopupMenu implements ThemeElement {
|
||||
});
|
||||
}
|
||||
private void refreshTheme_r(MenuElement element) {
|
||||
element.getComponent().setBackground(UI_.getTheme().background);
|
||||
element.getComponent().setForeground(UI_.getTheme().foreground);
|
||||
element.getComponent().setBackground(MainModule_.instance.getUI().getTheme().background);
|
||||
element.getComponent().setForeground(MainModule_.instance.getUI().getTheme().foreground);
|
||||
for (MenuElement se : element.getSubElements())
|
||||
refreshTheme_r(se);
|
||||
}
|
||||
@Override
|
||||
public void applyTheme() {
|
||||
setBackground(UI_.getTheme().background);
|
||||
setForeground(UI_.getTheme().foreground);
|
||||
setBackground(MainModule_.instance.getUI().getTheme().background);
|
||||
setForeground(MainModule_.instance.getUI().getTheme().foreground);
|
||||
refreshTheme_r(this);
|
||||
}
|
||||
public void CheckElementsVisibility() {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Common.Visual.Menus;
|
||||
import Common.MainModule_;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import Common.Visual.UI_;
|
||||
@@ -7,15 +8,15 @@ import javax.swing.*;
|
||||
public class VisualiserMenuItem extends JMenuItem {
|
||||
public VisualiserMenuItem(String text) {
|
||||
super(text, null);
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
setFont(MainModule_.instance.getUI().getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
}
|
||||
public VisualiserMenuItem(String text, String icon_path) {
|
||||
super(text);
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
setFont(MainModule_.instance.getUI().getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
if (icon_path != null)
|
||||
setIcon(Utils_.getIcon(icon_path));
|
||||
}
|
||||
public VisualiserMenuItem() {
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
setFont(MainModule_.instance.getUI().getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Common.Visual.Tables;
|
||||
import Common.MainModule_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import Common.Visual.UI_;
|
||||
|
||||
@@ -12,6 +13,6 @@ public class HiddenListRenderer extends RendererCell<Vector<String>> {
|
||||
@Override
|
||||
public void Display() {
|
||||
setText(String.join(";", value));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.TreePlain).deriveFont(12.0f));
|
||||
setFont(MainModule_.instance.getUI().getTheme().Fonts.get(VisualiserFonts.TreePlain).deriveFont(12.0f));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Common.Visual.Tables;
|
||||
import Common.MainModule_;
|
||||
import Common.Visual.StatusEnum;
|
||||
import Common.Visual.UI_;
|
||||
|
||||
@@ -12,7 +13,7 @@ public class StatusEnumRenderer extends RendererCell<StatusEnum> {
|
||||
public void Display() {
|
||||
if (value != null) {
|
||||
setText(value.getDescription());
|
||||
setFont(UI_.getTheme().Fonts.get(value.getFont()));
|
||||
setFont(MainModule_.instance.getUI().getTheme().Fonts.get(value.getFont()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Common.Visual.Tables;
|
||||
import Common.MainModule_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import Common.Visual.Themes.ThemeElement;
|
||||
import Common.Visual.UI_;
|
||||
@@ -7,7 +8,7 @@ import javax.swing.*;
|
||||
//наиболее распространенный случай. переотображение текста и/или изображения в ячейке таблицы.
|
||||
public class StyledCellLabel extends JLabel implements ThemeElement {
|
||||
public StyledCellLabel() {
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
setFont(MainModule_.instance.getUI().getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
setHorizontalAlignment(SwingConstants.LEFT);
|
||||
setVerticalAlignment(SwingConstants.CENTER);
|
||||
setOpaque(true);
|
||||
@@ -15,7 +16,7 @@ public class StyledCellLabel extends JLabel implements ThemeElement {
|
||||
}
|
||||
@Override
|
||||
public void applyTheme() {
|
||||
setBackground(UI_.getTheme().table_background);
|
||||
setForeground(UI_.getTheme().foreground);
|
||||
setBackground(MainModule_.instance.getUI().getTheme().table_background);
|
||||
setForeground(MainModule_.instance.getUI().getTheme().foreground);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Common.Visual.Tables;
|
||||
import Common.MainModule_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import Common.Visual.Menus.TableMenu;
|
||||
import Common.Visual.Themes.ThemeElement;
|
||||
@@ -16,9 +17,9 @@ public abstract class StyledTable extends JTable implements ThemeElement {
|
||||
setFillsViewportHeight(true);
|
||||
setAutoCreateRowSorter(dataModel.getRowCount() > 0);
|
||||
Init();
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
setFont(MainModule_.instance.getUI().getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
JTableHeader header = getTableHeader();
|
||||
header.setFont(UI_.getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
header.setFont(MainModule_.instance.getUI().getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);
|
||||
setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||
//текущий объет может определяться по первому столбцу. могут быть баги если не запретить
|
||||
@@ -77,10 +78,10 @@ public abstract class StyledTable extends JTable implements ThemeElement {
|
||||
}
|
||||
@Override
|
||||
public void applyTheme() {
|
||||
setBackground(UI_.getTheme().table_background);
|
||||
setForeground(UI_.getTheme().foreground);
|
||||
setSelectionBackground(UI_.getTheme().selection_background);
|
||||
setSelectionForeground(UI_.getTheme().foreground);
|
||||
setBackground(MainModule_.instance.getUI().getTheme().table_background);
|
||||
setForeground(MainModule_.instance.getUI().getTheme().foreground);
|
||||
setSelectionBackground(MainModule_.instance.getUI().getTheme().selection_background);
|
||||
setSelectionForeground(MainModule_.instance.getUI().getTheme().foreground);
|
||||
}
|
||||
public void SelectRow(int r) {
|
||||
getSelectionModel().setSelectionInterval(r, r);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Common.Visual.Tables;
|
||||
import Common.MainModule_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import Common.Visual.UI_;
|
||||
|
||||
@@ -10,7 +11,7 @@ public class WrapTextRenderer extends JTextArea implements TableCellRenderer {
|
||||
setLineWrap(true);
|
||||
setWrapStyleWord(true);
|
||||
// setOpaque(false);
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.Distribution).deriveFont(14.0f));
|
||||
setFont(MainModule_.instance.getUI().getTheme().Fonts.get(VisualiserFonts.Distribution).deriveFont(14.0f));
|
||||
}
|
||||
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
|
||||
setBackground(isSelected ? table.getSelectionBackground() : table.getBackground());
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Common.Visual.Trees;
|
||||
import Common.MainModule_;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import Common.Visual.UI_;
|
||||
@@ -16,10 +17,10 @@ public class GraphTreeCellRenderer extends StyledTreeCellRenderer {
|
||||
if (o instanceof FileObjectWithMessages) {
|
||||
FileObjectWithMessages target = (FileObjectWithMessages) o;
|
||||
setIcon(Utils_.getIcon(target.ImageKey()));
|
||||
setFont(UI_.getTheme().Fonts.get(target.getFont()));
|
||||
setFont(MainModule_.instance.getUI().getTheme().Fonts.get(target.getFont()));
|
||||
} else {
|
||||
setIcon(null);
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.TreeItalic));
|
||||
setFont(MainModule_.instance.getUI().getTheme().Fonts.get(VisualiserFonts.TreeItalic));
|
||||
}
|
||||
setForeground(tree.getForeground());
|
||||
return this;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Common.Visual.Trees;
|
||||
import Common.MainModule_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import Common.Visual.Selectable;
|
||||
import Common.Visual.UI_;
|
||||
@@ -17,7 +18,7 @@ public class SelectionTreeCellRenderer extends StyledTreeCellRenderer {
|
||||
setText(selectable.getSelectionText());
|
||||
setIcon(selectable.GetSelectionIcon());
|
||||
} else {
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.TreeItalic));
|
||||
setFont(MainModule_.instance.getUI().getTheme().Fonts.get(VisualiserFonts.TreeItalic));
|
||||
setIcon(null);
|
||||
}
|
||||
setForeground(tree.getForeground());
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Common.Visual.Trees;
|
||||
import Common.MainModule_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import Common.Visual.Themes.ThemeElement;
|
||||
import Common.Visual.UI_;
|
||||
@@ -22,7 +23,7 @@ public class StyledTree extends JTree implements ThemeElement {
|
||||
super(root_in);
|
||||
root = root_in;
|
||||
setOpaque(true);
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
setFont(MainModule_.instance.getUI().getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
setToggleClickCount(0); //отключение сворачивание разворачивания по двойному клику
|
||||
//--
|
||||
if (!getRenderer().equals(TreeRenderers.RendererUndefined))
|
||||
@@ -86,8 +87,8 @@ public class StyledTree extends JTree implements ThemeElement {
|
||||
}
|
||||
@Override
|
||||
public void applyTheme() {
|
||||
setBackground(UI_.getTheme().trees_background);
|
||||
setForeground(UI_.getTheme().foreground);
|
||||
setBackground(MainModule_.instance.getUI().getTheme().trees_background);
|
||||
setForeground(MainModule_.instance.getUI().getTheme().foreground);
|
||||
menu.applyTheme();
|
||||
}
|
||||
protected GraphMenu createMenu() {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Common.Visual.Trees;
|
||||
import Common.MainModule_;
|
||||
import Common.Visual.Themes.ThemeElement;
|
||||
import Common.Visual.UI_;
|
||||
|
||||
@@ -9,7 +10,7 @@ public class StyledTreeCellRenderer extends DefaultTreeCellRenderer implements T
|
||||
}
|
||||
@Override
|
||||
public void applyTheme() {
|
||||
setBackgroundNonSelectionColor(UI_.getTheme().trees_background);
|
||||
setBackgroundSelectionColor(UI_.getTheme().selection_background);
|
||||
setBackgroundNonSelectionColor(MainModule_.instance.getUI().getTheme().trees_background);
|
||||
setBackgroundSelectionColor(MainModule_.instance.getUI().getTheme().selection_background);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,18 @@
|
||||
package Common.Visual;
|
||||
import Common.Visual.Themes.DefaultTheme;
|
||||
import Common.Visual.Themes.VisualiserTheme;
|
||||
import Common.Visual.Windows.PassForm;
|
||||
import _VisualDVM.Visual.Menus.FastAccessMenuBar.FastAccessMenuBar;
|
||||
public class UIModule_ {
|
||||
//--
|
||||
VisualiserTheme theme = new DefaultTheme();
|
||||
public VisualiserTheme getTheme() {
|
||||
return theme;
|
||||
}
|
||||
public void setTheme(VisualiserTheme theme_in) {
|
||||
theme = theme_in;
|
||||
}
|
||||
//--
|
||||
PassForm passForm = null;//текущая форма прохода. нужна для
|
||||
public boolean HasPassForm(){return passForm!=null;}
|
||||
public PassForm GetPassForm(){return passForm;}
|
||||
@@ -8,4 +20,8 @@ public class UIModule_ {
|
||||
return passForm = passForm_in;
|
||||
}
|
||||
public void DropPassForm(){passForm=null;}
|
||||
//--
|
||||
//--
|
||||
FastAccessMenuBar fastAccessMenuBar = new FastAccessMenuBar();
|
||||
public FastAccessMenuBar getFastAccessMenuBar(){return fastAccessMenuBar;}
|
||||
}
|
||||
|
||||
@@ -17,16 +17,9 @@ public class UI_ {
|
||||
//---
|
||||
public static LinkedHashMap<Class<? extends DataSet>, DataMenuBar> menuBars = new LinkedHashMap<>();
|
||||
public static Stack<Component> windowsStack = new Stack<>();
|
||||
static VisualiserTheme theme = new DefaultTheme();
|
||||
public static boolean isActive() {
|
||||
return active;
|
||||
}
|
||||
public static VisualiserTheme getTheme() {
|
||||
return theme;
|
||||
}
|
||||
public static void setTheme(VisualiserTheme theme_in) {
|
||||
theme = theme_in;
|
||||
}
|
||||
public static Component getFrontWindow() {
|
||||
Component res = null;
|
||||
try {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Common.Visual.Windows.Dialog;
|
||||
import Common.MainModule_;
|
||||
import Common.Utils.TextLog;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
@@ -32,7 +33,7 @@ public class Dialog<T, F extends DialogFields> extends JDialog implements ThemeE
|
||||
setModal(true);
|
||||
toFront();
|
||||
getContentPane().setLayout(new BorderLayout());
|
||||
lTitle.setFont(UI_.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
lTitle.setFont(MainModule_.instance.getUI().getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
if (!getIconPath().isEmpty()) {
|
||||
setIconImage(Utils_.getIcon(getIconPath()).getImage());
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Common.Visual.Windows.Dialog;
|
||||
import Common.MainModule_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import Common.Visual.UI_;
|
||||
|
||||
@@ -6,7 +7,7 @@ import javax.swing.*;
|
||||
import java.awt.*;
|
||||
public class DialogTextComboBox extends JComboBox<String> implements DialogFields {
|
||||
public DialogTextComboBox() {
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
setFont(MainModule_.instance.getUI().getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
setEditable(false);
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Common.Visual.Windows.Dialog;
|
||||
import Common.MainModule_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import Common.Visual.UI_;
|
||||
|
||||
@@ -8,7 +9,7 @@ public class DialogWrapText extends JTextPane implements DialogFields {
|
||||
public DialogWrapText() {
|
||||
setOpaque(true);
|
||||
setBackground(Color.WHITE);
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.TreeBold));
|
||||
setFont(MainModule_.instance.getUI().getTheme().Fonts.get(VisualiserFonts.TreeBold));
|
||||
setEditable(false);
|
||||
}
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user