no message
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
package Common.Visual;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
@@ -34,7 +34,7 @@ public class ControlForm<C extends Component> {
|
||||
try {
|
||||
control = control_class.newInstance();
|
||||
} catch (Exception e) {
|
||||
CommonUtils.MainLog.PrintException(e);
|
||||
Utils_.MainLog.PrintException(e);
|
||||
}
|
||||
}
|
||||
public boolean isShown() {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package Common.Visual.Controls;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
public class HyperlinksStyledList extends StyledList {
|
||||
@Override
|
||||
public void applyTheme() {
|
||||
super.applyTheme();
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.Hyperlink));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.Hyperlink));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package Common.Visual.Controls;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -9,7 +9,7 @@ import java.awt.*;
|
||||
public class MenuBarButton extends JButton {
|
||||
public MenuBarButton() {
|
||||
super();
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
//
|
||||
setBorderPainted(false);
|
||||
setContentAreaFilled(false);
|
||||
@@ -27,9 +27,9 @@ public class MenuBarButton extends JButton {
|
||||
super.paintComponent(g);
|
||||
}
|
||||
public void setIcon(String icon_path) {
|
||||
setIcon(CommonUtils.getIcon(icon_path));
|
||||
setIcon(Utils_.getIcon(icon_path));
|
||||
}
|
||||
public void setFont(VisualiserFonts font_in){
|
||||
setFont(CommonUI.getTheme().Fonts.get(font_in));
|
||||
setFont(UI_.getTheme().Fonts.get(font_in));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
package Common.Visual.Controls;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Themes.ThemeElement;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
|
||||
import javax.swing.*;
|
||||
public class StyledList extends JList implements ThemeElement {
|
||||
public StyledList() {
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
applyTheme();
|
||||
}
|
||||
@Override
|
||||
public void applyTheme() {
|
||||
setBackground(CommonUI.getTheme().table_background);
|
||||
setForeground(CommonUI.getTheme().foreground);
|
||||
setBackground(UI_.getTheme().table_background);
|
||||
setForeground(UI_.getTheme().foreground);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Controls;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Themes.ThemeElement;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -10,7 +10,7 @@ public class StyledProgressBar extends JProgressBar implements ThemeElement {
|
||||
}
|
||||
@Override
|
||||
public void applyTheme() {
|
||||
setBackground(CommonUI.getTheme().bar_background);
|
||||
setForeground(CommonUI.getTheme().bar_foreground);
|
||||
setBackground(UI_.getTheme().bar_background);
|
||||
setForeground(UI_.getTheme().bar_foreground);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Visual.Menus.StableMenuItem;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.DataSet;
|
||||
@@ -20,7 +20,7 @@ public abstract class DBObjectFilter<D extends DBObject> {
|
||||
return "/Common/icons/Pick.png";
|
||||
}
|
||||
void Mark() {
|
||||
menuItem.setIcon(CommonUtils.getIcon(active ? getActiveIconPath() : getNotActiveIconPath()));
|
||||
menuItem.setIcon(Utils_.getIcon(active ? getActiveIconPath() : getNotActiveIconPath()));
|
||||
}
|
||||
//-------
|
||||
public boolean Validate(D object) {
|
||||
@@ -53,7 +53,7 @@ public abstract class DBObjectFilter<D extends DBObject> {
|
||||
count = 0;
|
||||
}
|
||||
public void Refresh() {
|
||||
menuItem.setText(description + " " + CommonUtils.RBrackets(count));
|
||||
menuItem.setText(description + " " + Utils_.RBrackets(count));
|
||||
}
|
||||
public boolean isActive() {
|
||||
return active;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package Common.Visual;
|
||||
import Common.CommonConstants;
|
||||
import Common.Current_;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.DBTable;
|
||||
import Common.Database.Tables.DataSet;
|
||||
@@ -54,7 +54,7 @@ public class DataSetControlForm extends ControlWithCurrentForm<DataTable> {
|
||||
@Override
|
||||
public void Clear() {
|
||||
super.Clear();
|
||||
CommonUI.Clear(dataPanel);
|
||||
UI_.Clear(dataPanel);
|
||||
}
|
||||
public DataSet getDataSource() {
|
||||
return dataSource;
|
||||
@@ -64,21 +64,21 @@ public class DataSetControlForm extends ControlWithCurrentForm<DataTable> {
|
||||
return getDataSource().CurrentName();
|
||||
}
|
||||
public void SaveColumns() {
|
||||
if (CommonUtils.db != null) {
|
||||
if (Utils_.db != null) {
|
||||
try {
|
||||
if ((CurrentName() != null)) {
|
||||
String tableName= CurrentName().toString();
|
||||
Vector<String> widths = IntStream.range(0, columns.size()).mapToObj(i -> String.valueOf(control.getColumnModel().getColumn(i).getWidth())).collect(Collectors.toCollection(Vector::new));
|
||||
String packed = String.join("|", widths);
|
||||
TableVisualData tableVisualData;
|
||||
if (CommonUtils.db.tablesVisualData.containsKey(tableName)) {
|
||||
tableVisualData = CommonUtils.db.tablesVisualData.get(tableName);
|
||||
if (Utils_.db.tablesVisualData.containsKey(tableName)) {
|
||||
tableVisualData = Utils_.db.tablesVisualData.get(tableName);
|
||||
} else {
|
||||
tableVisualData = new TableVisualData(tableName);
|
||||
CommonUtils.db.Insert(tableVisualData);
|
||||
Utils_.db.Insert(tableVisualData);
|
||||
}
|
||||
tableVisualData.sizes = packed;
|
||||
CommonUtils.db.Update(tableVisualData);
|
||||
Utils_.db.Update(tableVisualData);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
@@ -149,9 +149,9 @@ public class DataSetControlForm extends ControlWithCurrentForm<DataTable> {
|
||||
//-----------------------------NEW-------------------------------------
|
||||
@Override
|
||||
public void CorrectColumnsSizes() {
|
||||
if ((CommonUtils.db != null) && CurrentName() != null && CommonUtils.db.tablesVisualData.containsKey(CurrentName().toString())) {
|
||||
if ((Utils_.db != null) && CurrentName() != null && Utils_.db.tablesVisualData.containsKey(CurrentName().toString())) {
|
||||
if (!getColumnsProfile().equalsIgnoreCase(colNamesAndSizes)) {
|
||||
TableVisualData grid = CommonUtils.db.tablesVisualData.get(CurrentName().toString());
|
||||
TableVisualData grid = Utils_.db.tablesVisualData.get(CurrentName().toString());
|
||||
String[] data = grid.sizes.split("\\|");
|
||||
for (int i = 0; i < columns.size(); ++i) {
|
||||
if (i <= (data.length - 1)) {
|
||||
@@ -220,7 +220,7 @@ public class DataSetControlForm extends ControlWithCurrentForm<DataTable> {
|
||||
try {
|
||||
ShowCurrentObject();
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -231,7 +231,7 @@ public class DataSetControlForm extends ControlWithCurrentForm<DataTable> {
|
||||
try {
|
||||
ShowNoCurrentObject();
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -244,7 +244,7 @@ public class DataSetControlForm extends ControlWithCurrentForm<DataTable> {
|
||||
try {
|
||||
MouseAction2();
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -255,7 +255,7 @@ public class DataSetControlForm extends ControlWithCurrentForm<DataTable> {
|
||||
try {
|
||||
ShowNoCurrentObject();
|
||||
} catch (Exception e) {
|
||||
CommonUtils.MainLog.PrintException(e);
|
||||
Utils_.MainLog.PrintException(e);
|
||||
}
|
||||
}
|
||||
//---
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.DragDrop;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
|
||||
import java.awt.datatransfer.DataFlavor;
|
||||
import java.io.*;
|
||||
@@ -314,12 +314,12 @@ public class FileDrop {
|
||||
} // end try
|
||||
catch (IOException io) {
|
||||
log(out, "FileDrop: IOException - abort:");
|
||||
CommonUtils.MainLog.PrintException(io);
|
||||
Utils_.MainLog.PrintException(io);
|
||||
evt.rejectDrop();
|
||||
} // end catch IOException
|
||||
catch (java.awt.datatransfer.UnsupportedFlavorException ufe) {
|
||||
log(out, "FileDrop: UnsupportedFlavorException - abort:");
|
||||
CommonUtils.MainLog.PrintException(ufe);
|
||||
Utils_.MainLog.PrintException(ufe);
|
||||
evt.rejectDrop();
|
||||
} // end catch: UnsupportedFlavorException
|
||||
finally {
|
||||
@@ -446,7 +446,7 @@ public class FileDrop {
|
||||
dt.addDropTargetListener(dropListener);
|
||||
} // end try
|
||||
catch (java.util.TooManyListenersException e) {
|
||||
CommonUtils.MainLog.PrintException(e);
|
||||
Utils_.MainLog.PrintException(e);
|
||||
log(out, "FileDrop: Drop will not work due to previous error. Do you have another listener attached?");
|
||||
} // end catch
|
||||
// Listen for hierarchy changes and remove the drop target when the parent gets cleared out.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Menus;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Themes.ThemeElement;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -21,15 +21,15 @@ public class StyledPopupMenu extends JPopupMenu implements ThemeElement {
|
||||
});
|
||||
}
|
||||
private void refreshTheme_r(MenuElement element) {
|
||||
element.getComponent().setBackground(CommonUI.getTheme().background);
|
||||
element.getComponent().setForeground(CommonUI.getTheme().foreground);
|
||||
element.getComponent().setBackground(UI_.getTheme().background);
|
||||
element.getComponent().setForeground(UI_.getTheme().foreground);
|
||||
for (MenuElement se : element.getSubElements())
|
||||
refreshTheme_r(se);
|
||||
}
|
||||
@Override
|
||||
public void applyTheme() {
|
||||
setBackground(CommonUI.getTheme().background);
|
||||
setForeground(CommonUI.getTheme().foreground);
|
||||
setBackground(UI_.getTheme().background);
|
||||
setForeground(UI_.getTheme().foreground);
|
||||
refreshTheme_r(this);
|
||||
}
|
||||
public void CheckElementsVisibility() {
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package Common.Visual.Menus;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.Menus.StyledPopupMenu;
|
||||
import Common.Visual.Menus.VisualiserMenuItem;
|
||||
import Common.Utils.Utils_;
|
||||
|
||||
import javax.swing.*;
|
||||
public class TableMenu extends StyledPopupMenu {
|
||||
@@ -16,7 +14,7 @@ public class TableMenu extends StyledPopupMenu {
|
||||
owner = owner_in;
|
||||
mcopy = new VisualiserMenuItem("Копировать текст текущей ячейки", "/icons/Editor/Copy.png");
|
||||
//если удалось нажать значит все условия выполнены
|
||||
mcopy.addActionListener(e -> CommonUtils.CopyToClipboard(target.toString()));
|
||||
mcopy.addActionListener(e -> Utils_.CopyToClipboard(target.toString()));
|
||||
add(mcopy);
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package Common.Visual.Menus;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.Menus.StyledPopupMenu;
|
||||
import Common.Visual.Menus.VisualiserMenuItem;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI_;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
@@ -20,7 +18,7 @@ public class TextComboBoxMenu extends StyledPopupMenu {
|
||||
new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
CommonUtils.CopyToClipboard(box.getSelectedItem().toString());
|
||||
Utils_.CopyToClipboard(box.getSelectedItem().toString());
|
||||
}
|
||||
});
|
||||
add(m_copy);
|
||||
@@ -29,7 +27,7 @@ public class TextComboBoxMenu extends StyledPopupMenu {
|
||||
new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
CommonUI.TrySelect(box, CommonUtils.getFromClipboard());
|
||||
UI_.TrySelect(box, Utils_.getFromClipboard());
|
||||
}
|
||||
});
|
||||
add(m_paste);
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package Common.Visual.Menus;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.Menus.StyledPopupMenu;
|
||||
import Common.Visual.Menus.VisualiserMenuItem;
|
||||
import Common.Utils.Utils_;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.text.JTextComponent;
|
||||
@@ -54,7 +52,7 @@ public class TextEditorMenu extends StyledPopupMenu {
|
||||
String[] data = selectedText.split("\n");
|
||||
Vector<String> new_data = new Vector<>();
|
||||
for (String line: data){
|
||||
new_data.add(CommonUtils.strikeThrough(line));
|
||||
new_data.add(Utils_.strikeThrough(line));
|
||||
}
|
||||
editor.replaceSelection(String.join("\n", new_data));
|
||||
}
|
||||
@@ -68,7 +66,7 @@ public class TextEditorMenu extends StyledPopupMenu {
|
||||
String[] data = selectedText.split("\n");
|
||||
Vector<String> new_data = new Vector<>();
|
||||
for (String line: data){
|
||||
new_data.add(CommonUtils.noStrikeThrough(line));
|
||||
new_data.add(Utils_.noStrikeThrough(line));
|
||||
}
|
||||
editor.replaceSelection(String.join("\n", new_data));
|
||||
}
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
package Common.Visual.Menus;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
|
||||
import javax.swing.*;
|
||||
public class VisualiserMenuItem extends JMenuItem {
|
||||
public VisualiserMenuItem(String text) {
|
||||
super(text, null);
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
}
|
||||
public VisualiserMenuItem(String text, String icon_path) {
|
||||
super(text);
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
if (icon_path != null)
|
||||
setIcon(CommonUtils.getIcon(icon_path));
|
||||
setIcon(Utils_.getIcon(icon_path));
|
||||
}
|
||||
public VisualiserMenuItem(){
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
|
||||
import javax.swing.*;
|
||||
public interface Selectable {
|
||||
@@ -13,11 +13,11 @@ public interface Selectable {
|
||||
default ImageIcon GetSelectionIcon() {
|
||||
return
|
||||
isSelectionEnabled() ?
|
||||
CommonUtils.getIcon("/Common/icons/" + (isSelected() ? "Pick" : "NotPick") + ".png") :
|
||||
Utils_.getIcon("/Common/icons/" + (isSelected() ? "Pick" : "NotPick") + ".png") :
|
||||
GetDisabledIcon();
|
||||
}
|
||||
default ImageIcon GetDisabledIcon() {
|
||||
return CommonUtils.getIcon("/Common/icons/Arrays/Unknown.png");
|
||||
return Utils_.getIcon("/Common/icons/Arrays/Unknown.png");
|
||||
}
|
||||
default void SwitchSelection() {
|
||||
Select(!isSelected());
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package Common.Visual.Tables;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.TextField.StyledTextField;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -47,7 +47,7 @@ public class ColumnFilter {
|
||||
//--
|
||||
dataSet.getUi().control.getColumnModel().getColumn(columnIndex).setHeaderRenderer((table, value, isSelected, hasFocus, row, column1) -> new JLabel() {
|
||||
{
|
||||
setIcon(CommonUtils.getIcon("/icons/Filter.png"));
|
||||
setIcon(Utils_.getIcon("/icons/Filter.png"));
|
||||
setForeground(dataSet.getUi().control.getTableHeader().getForeground());
|
||||
setBackground(dataSet.getUi().control.getTableHeader().getBackground());
|
||||
setFont(dataSet.getUi().control.getTableHeader().getFont());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Tables;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.Date;
|
||||
@@ -13,6 +13,6 @@ public class DateRenderer_ extends RendererCell<Date> {
|
||||
@Override
|
||||
public void Display() {
|
||||
if (value != null)
|
||||
setText(value.equals(zero) ? "нет" : CommonUtils.print_date(value));
|
||||
setText(value.equals(zero) ? "нет" : Utils_.print_date(value));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Tables;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -12,6 +12,6 @@ public class HiddenListRenderer extends RendererCell<Vector<String>> {
|
||||
@Override
|
||||
public void Display() {
|
||||
setText(String.join(";", value));
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.TreePlain).deriveFont(12.0f));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.TreePlain).deriveFont(12.0f));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Tables;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.StatusEnum;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -12,7 +12,7 @@ public class StatusEnumRenderer extends RendererCell<StatusEnum> {
|
||||
public void Display() {
|
||||
if (value != null) {
|
||||
setText(value.getDescription());
|
||||
setFont(CommonUI.getTheme().Fonts.get(value.getFont()));
|
||||
setFont(UI_.getTheme().Fonts.get(value.getFont()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Tables;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Themes.ThemeElement;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
|
||||
@@ -7,7 +7,7 @@ import javax.swing.*;
|
||||
//наиболее распространенный случай. переотображение текста и/или изображения в ячейке таблицы.
|
||||
public class StyledCellLabel extends JLabel implements ThemeElement {
|
||||
public StyledCellLabel() {
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
setHorizontalAlignment(SwingConstants.LEFT);
|
||||
setVerticalAlignment(SwingConstants.CENTER);
|
||||
setOpaque(true);
|
||||
@@ -15,7 +15,7 @@ public class StyledCellLabel extends JLabel implements ThemeElement {
|
||||
}
|
||||
@Override
|
||||
public void applyTheme() {
|
||||
setBackground(CommonUI.getTheme().table_background);
|
||||
setForeground(CommonUI.getTheme().foreground);
|
||||
setBackground(UI_.getTheme().table_background);
|
||||
setForeground(UI_.getTheme().foreground);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Tables;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Menus.TableMenu;
|
||||
import Common.Visual.Themes.ThemeElement;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
@@ -16,9 +16,9 @@ public abstract class StyledTable extends JTable implements ThemeElement {
|
||||
setFillsViewportHeight(true);
|
||||
setAutoCreateRowSorter(dataModel.getRowCount() > 0);
|
||||
Init();
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
JTableHeader header = getTableHeader();
|
||||
header.setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
header.setFont(UI_.getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);
|
||||
setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||
//текущий объет может определяться по первому столбцу. могут быть баги если не запретить
|
||||
@@ -77,10 +77,10 @@ public abstract class StyledTable extends JTable implements ThemeElement {
|
||||
}
|
||||
@Override
|
||||
public void applyTheme() {
|
||||
setBackground(CommonUI.getTheme().table_background);
|
||||
setForeground(CommonUI.getTheme().foreground);
|
||||
setSelectionBackground(CommonUI.getTheme().selection_background);
|
||||
setSelectionForeground(CommonUI.getTheme().foreground);
|
||||
setBackground(UI_.getTheme().table_background);
|
||||
setForeground(UI_.getTheme().foreground);
|
||||
setSelectionBackground(UI_.getTheme().selection_background);
|
||||
setSelectionForeground(UI_.getTheme().foreground);
|
||||
}
|
||||
public void SelectRow(int r) {
|
||||
getSelectionModel().setSelectionInterval(r, r);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Tables;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -10,7 +10,7 @@ public class WrapTextRenderer extends JTextArea implements TableCellRenderer {
|
||||
setLineWrap(true);
|
||||
setWrapStyleWord(true);
|
||||
// setOpaque(false);
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.Distribution).deriveFont(14.0f));
|
||||
setFont(UI_.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,8 +1,7 @@
|
||||
package Common.Visual.Themes;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import Common.Visual.VisualiserColor;
|
||||
import org.fife.ui.rsyntaxtextarea.Theme;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.font.TextAttribute;
|
||||
@@ -169,7 +168,7 @@ public abstract class VisualiserTheme {
|
||||
table_background = Color.decode(getTableBackgroundHex());
|
||||
createFonts();
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package Common.Visual.Trees;
|
||||
import Common.Current_;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.DataControl_OLD;
|
||||
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
@@ -25,7 +25,7 @@ public class DataTree extends StyledTree implements DataControl_OLD {
|
||||
try {
|
||||
ShowCurrentObject();
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
}
|
||||
}
|
||||
public void SelectNodeByCriteria(Object criteria) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package Common.Visual.Trees;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import _VisualDVM.ProjectData.SapforData.FileObjectWithMessages;
|
||||
|
||||
@@ -15,11 +15,11 @@ public class GraphTreeCellRenderer extends StyledTreeCellRenderer {
|
||||
Object o = ((DefaultMutableTreeNode) value).getUserObject();
|
||||
if (o instanceof FileObjectWithMessages) {
|
||||
FileObjectWithMessages target = (FileObjectWithMessages) o;
|
||||
setIcon(CommonUtils.getIcon(target.ImageKey()));
|
||||
setFont(CommonUI.getTheme().Fonts.get(target.getFont()));
|
||||
setIcon(Utils_.getIcon(target.ImageKey()));
|
||||
setFont(UI_.getTheme().Fonts.get(target.getFont()));
|
||||
} else {
|
||||
setIcon(null);
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.TreeItalic));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.TreeItalic));
|
||||
}
|
||||
setForeground(tree.getForeground());
|
||||
return this;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Trees;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Selectable;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
|
||||
@@ -17,7 +17,7 @@ public class SelectionTreeCellRenderer extends StyledTreeCellRenderer {
|
||||
setText(selectable.getSelectionText());
|
||||
setIcon(selectable.GetSelectionIcon());
|
||||
} else {
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.TreeItalic));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.TreeItalic));
|
||||
setIcon(null);
|
||||
}
|
||||
setForeground(tree.getForeground());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Trees;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import _VisualDVM.Visual.Menus.GraphMenu;
|
||||
import Common.Visual.Themes.ThemeElement;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
@@ -22,7 +22,7 @@ public class StyledTree extends JTree implements ThemeElement {
|
||||
super(root_in);
|
||||
root = root_in;
|
||||
setOpaque(true);
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
setToggleClickCount(0); //отключение сворачивание разворачивания по двойному клику
|
||||
//--
|
||||
if (!getRenderer().equals(TreeRenderers.RendererUndefined))
|
||||
@@ -86,8 +86,8 @@ public class StyledTree extends JTree implements ThemeElement {
|
||||
}
|
||||
@Override
|
||||
public void applyTheme() {
|
||||
setBackground(CommonUI.getTheme().trees_background);
|
||||
setForeground(CommonUI.getTheme().foreground);
|
||||
setBackground(UI_.getTheme().trees_background);
|
||||
setForeground(UI_.getTheme().foreground);
|
||||
menu.applyTheme();
|
||||
}
|
||||
protected GraphMenu createMenu() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Trees;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Themes.ThemeElement;
|
||||
|
||||
import javax.swing.tree.DefaultTreeCellRenderer;
|
||||
@@ -9,7 +9,7 @@ public class StyledTreeCellRenderer extends DefaultTreeCellRenderer implements T
|
||||
}
|
||||
@Override
|
||||
public void applyTheme() {
|
||||
setBackgroundNonSelectionColor(CommonUI.getTheme().trees_background);
|
||||
setBackgroundSelectionColor(CommonUI.getTheme().selection_background);
|
||||
setBackgroundNonSelectionColor(UI_.getTheme().trees_background);
|
||||
setBackgroundSelectionColor(UI_.getTheme().selection_background);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Trees;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.ControlForm;
|
||||
|
||||
import java.awt.*;
|
||||
@@ -25,6 +25,6 @@ public class TreeForm<C extends StyledTree> extends ControlForm<C> {
|
||||
@Override
|
||||
public void Clear() {
|
||||
super.Clear();
|
||||
CommonUI.Clear(content);
|
||||
UI_.Clear(content);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package Common.Visual;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Common.Visual.Themes.DefaultTheme;
|
||||
import Common.Visual.Themes.VisualiserTheme;
|
||||
@@ -11,7 +11,7 @@ import javax.swing.text.DefaultFormatter;
|
||||
import java.awt.*;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Stack;
|
||||
public class CommonUI {
|
||||
public class UI_ {
|
||||
public static boolean active=false; //есть ли интерфейс. в консольных версиях не нужен.
|
||||
public static MenuElement[] last_menu_path; //для меню
|
||||
public static boolean isActive() {
|
||||
@@ -75,7 +75,7 @@ public class CommonUI {
|
||||
}
|
||||
//Примитивные диалоговые элементы
|
||||
public static boolean Question(Component parent, String text) {
|
||||
return !CommonUI.isActive() || (JOptionPane.showConfirmDialog(parent,
|
||||
return !UI_.isActive() || (JOptionPane.showConfirmDialog(parent,
|
||||
text + "?",
|
||||
"Подтверждение",
|
||||
JOptionPane.YES_NO_OPTION,
|
||||
@@ -85,17 +85,17 @@ public class CommonUI {
|
||||
return Question(getFrontWindow(), text);
|
||||
}
|
||||
public static void Info(String message) {
|
||||
CommonUtils.CopyToClipboard(message);
|
||||
if (CommonUI.isActive())
|
||||
Utils_.CopyToClipboard(message);
|
||||
if (UI_.isActive())
|
||||
JOptionPane.showMessageDialog(getFrontWindow(), message, "", 1);
|
||||
}
|
||||
public static void Error(String message) {
|
||||
CommonUtils.CopyToClipboard(message);
|
||||
if (CommonUI.isActive())
|
||||
Utils_.CopyToClipboard(message);
|
||||
if (UI_.isActive())
|
||||
JOptionPane.showMessageDialog(getFrontWindow(), message, "", 0);
|
||||
}
|
||||
public static boolean Warning(String text) {
|
||||
return !CommonUI.isActive() ||
|
||||
return !UI_.isActive() ||
|
||||
JOptionPane.showConfirmDialog(getFrontWindow(),
|
||||
text + "\nВы уверены?",
|
||||
"Подтверждение",
|
||||
@@ -1,6 +1,6 @@
|
||||
package Common.Visual.Windows.Dialog;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Themes.ThemeElement;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import Common.Utils.TextLog;
|
||||
@@ -35,9 +35,9 @@ public class Dialog<T, F extends DialogFields> extends JDialog implements ThemeE
|
||||
setModal(true);
|
||||
toFront();
|
||||
getContentPane().setLayout(new BorderLayout());
|
||||
lTitle.setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
lTitle.setFont(UI_.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
if (!getIconPath().isEmpty()) {
|
||||
setIconImage(CommonUtils.getIcon(getIconPath()).getImage());
|
||||
setIconImage(Utils_.getIcon(getIconPath()).getImage());
|
||||
}
|
||||
//делаем титульную надпись в самом окне чтобы не зависеть от языковой политики ОС
|
||||
getContentPane().add(lTitle, BorderLayout.NORTH);
|
||||
@@ -51,7 +51,7 @@ public class Dialog<T, F extends DialogFields> extends JDialog implements ThemeE
|
||||
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
|
||||
addWindowListener(new WindowAdapter() {
|
||||
public void windowClosing(WindowEvent e) {
|
||||
CommonUI.windowsStack.pop();
|
||||
UI_.windowsStack.pop();
|
||||
onCancel();
|
||||
onClose();
|
||||
}
|
||||
@@ -65,7 +65,7 @@ public class Dialog<T, F extends DialogFields> extends JDialog implements ThemeE
|
||||
content = (fields = f.newInstance()).getContent();
|
||||
//--?
|
||||
} catch (Exception e) {
|
||||
CommonUtils.MainLog.PrintException(e);
|
||||
Utils_.MainLog.PrintException(e);
|
||||
}
|
||||
}
|
||||
public void onClose() {
|
||||
@@ -117,7 +117,7 @@ public class Dialog<T, F extends DialogFields> extends JDialog implements ThemeE
|
||||
Init(params);
|
||||
ShowTitle();
|
||||
setAlwaysOnTop(isOnTop());
|
||||
CommonUI.windowsStack.push(this);
|
||||
UI_.windowsStack.push(this);
|
||||
setVisible(true);
|
||||
return OK;
|
||||
}
|
||||
@@ -137,7 +137,7 @@ public class Dialog<T, F extends DialogFields> extends JDialog implements ThemeE
|
||||
OK = true;
|
||||
CloseAction();
|
||||
} else
|
||||
CommonUI.Error("Валидация не пройдена:\n" + Log.toString());
|
||||
UI_.Error("Валидация не пройдена:\n" + Log.toString());
|
||||
}
|
||||
protected void onCancel() {
|
||||
CloseAction();
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package Common.Visual.Windows.Dialog;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
public class DialogTextComboBox extends JComboBox<String> implements DialogFields {
|
||||
public DialogTextComboBox() {
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
setEditable(false);
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Windows.Dialog;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -8,7 +8,7 @@ public class DialogWrapText extends JTextPane implements DialogFields {
|
||||
public DialogWrapText(){
|
||||
setOpaque(true);
|
||||
setBackground(Color.WHITE);
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.TreeBold));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.TreeBold));
|
||||
setEditable(false);
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Windows.Dialog;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.filechooser.FileFilter;
|
||||
@@ -9,7 +9,7 @@ public class VDirectoryChooser extends VFileChooser_ {
|
||||
super(title, new FileFilter() {
|
||||
@Override
|
||||
public boolean accept(File f) {
|
||||
return !CommonUtils.ContainsCyrillic(f.getAbsolutePath());
|
||||
return !Utils_.ContainsCyrillic(f.getAbsolutePath());
|
||||
}
|
||||
@Override
|
||||
public String getDescription() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Windows.Dialog;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.filechooser.FileFilter;
|
||||
@@ -20,7 +20,7 @@ public class VFileChooser extends VFileChooser_ {
|
||||
fileChooser.setFileFilter(new FileFilter() {
|
||||
@Override
|
||||
public boolean accept(File f) {
|
||||
return !CommonUtils.ContainsCyrillic(f.getName())
|
||||
return !Utils_.ContainsCyrillic(f.getName())
|
||||
&& (f.isDirectory() || acceptExtensions(f));
|
||||
}
|
||||
@Override
|
||||
@@ -36,7 +36,7 @@ public class VFileChooser extends VFileChooser_ {
|
||||
}
|
||||
public boolean acceptExtensions(File file) {
|
||||
if (Extensions.isEmpty()) return true;
|
||||
String file_ext = CommonUtils.getExtension(file);
|
||||
String file_ext = Utils_.getExtension(file);
|
||||
for (String ext : Extensions)
|
||||
if (ext.equalsIgnoreCase(file_ext)) return true;
|
||||
return false;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Windows;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.Themes.ThemeElement;
|
||||
import Common.Database.Objects.DBForm.DBForm;
|
||||
|
||||
@@ -10,9 +10,9 @@ import java.awt.event.WindowEvent;
|
||||
public abstract class Form extends JFrame implements ThemeElement {
|
||||
private DBForm dbInfo = null;
|
||||
public Form() {
|
||||
if (getIconPath()!=null) setIconImage(CommonUtils.getIcon(getIconPath()).getImage());
|
||||
if (getIconPath()!=null) setIconImage(Utils_.getIcon(getIconPath()).getImage());
|
||||
SetListener();
|
||||
this.setTitle(CommonUtils.isWindows() ? getWTitleText() : getUTitleText());
|
||||
this.setTitle(Utils_.isWindows() ? getWTitleText() : getUTitleText());
|
||||
pack();
|
||||
setMinimumSize(new Dimension(getDefaultWidth(), getDefaultHeight()));
|
||||
}
|
||||
@@ -54,7 +54,7 @@ public abstract class Form extends JFrame implements ThemeElement {
|
||||
try {
|
||||
LoadWindowParameters();
|
||||
} catch (Exception e) {
|
||||
CommonUtils.MainLog.PrintException(e);
|
||||
Utils_.MainLog.PrintException(e);
|
||||
}
|
||||
setContentPane(getMainPanel());
|
||||
setVisible(true);
|
||||
@@ -63,7 +63,7 @@ public abstract class Form extends JFrame implements ThemeElement {
|
||||
try {
|
||||
SaveWindowParameters();
|
||||
} catch (Exception e) {
|
||||
CommonUtils.MainLog.PrintException(e);
|
||||
Utils_.MainLog.PrintException(e);
|
||||
}
|
||||
setVisible(false);
|
||||
dispose();
|
||||
@@ -73,8 +73,8 @@ public abstract class Form extends JFrame implements ThemeElement {
|
||||
}
|
||||
public void LoadWindowParameters() throws Exception {
|
||||
if (getFormKey()!=null)
|
||||
if (CommonUtils.db.forms.Data.containsKey(getFormKey())) {
|
||||
dbInfo = CommonUtils.db.forms.Data.get(getFormKey());
|
||||
if (Utils_.db.forms.Data.containsKey(getFormKey())) {
|
||||
dbInfo = Utils_.db.forms.Data.get(getFormKey());
|
||||
dbInfo.Apply(this);
|
||||
return;
|
||||
}
|
||||
@@ -85,9 +85,9 @@ public abstract class Form extends JFrame implements ThemeElement {
|
||||
if (getFormKey()!=null) {
|
||||
if (dbInfo != null) {
|
||||
dbInfo.Init(this);
|
||||
CommonUtils.db.Update(dbInfo);
|
||||
Utils_.db.Update(dbInfo);
|
||||
} else
|
||||
CommonUtils.db.Insert(new DBForm(getFormKey(), this));
|
||||
Utils_.db.Insert(new DBForm(getFormKey(), this));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user