no message

This commit is contained in:
2024-10-07 17:46:38 +03:00
parent 6537eebe09
commit e7f661f7ad
87 changed files with 279 additions and 222 deletions

View File

@@ -1,5 +1,6 @@
package Common_old.UI;
import Common.CommonConstants;
import Common.Visual.CommonUI;
import Common_old.Current;
import Common.Database.Objects.DBObject;
import Common.Database.Tables.DBTable;
@@ -53,7 +54,7 @@ public class DataSetControlForm extends ControlWithCurrentForm<DataTable> {
@Override
public void Clear() {
super.Clear();
UI.Clear(dataPanel);
CommonUI.Clear(dataPanel);
}
public DataSet getDataSource() {
return dataSource;

View File

@@ -2,7 +2,7 @@ package Common_old.UI.Menus;
import Common.Utils.CommonUtils;
import Common_old.Current;
import Common_old.UI.Menus_2023.StableMenuItem;
import Common_old.UI.Selectable;
import Common.Visual.Selectable;
import Common_old.UI.Trees.DataTree;
import Common_old.UI.Trees.SelectableTree;

View File

@@ -1,5 +1,5 @@
package Common_old.UI.Menus;
import Common_old.UI.UI;
import Common.Visual.CommonUI;
import Common_old.Utils.Utils;
import javax.swing.*;
@@ -27,7 +27,7 @@ public class TextComboBoxMenu extends StyledPopupMenu {
new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
UI.TrySelect(box, Utils.getFromClipboard());
CommonUI.TrySelect(box, Utils.getFromClipboard());
}
});
add(m_paste);

View File

@@ -1,54 +0,0 @@
package Common_old.UI.Menus_2023;
import Common.Database.Tables.DataSet;
import Visual_DVM_2021.Passes.PassCode_2021;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;
public class DataMenuBar extends VisualiserMenuBar {
public JLabel countLabel = null;
JButton selectAllButton = null;
JButton unselectAllButton = null;
//-
public ActionListener selectAllListener = null;
public ActionListener unselectAllListener = null;
//-
public DataMenuBar(String dataName, PassCode_2021... passes) {
// Font font = Current.getTheme().Fonts.get(VisualiserFonts.TreeBoldItalic).deriveFont(12.0F);
add(new JLabel(dataName + " : "));
add(countLabel = new JLabel("?"));
addPasses(passes);
}
public void createSelectionButtons(DataSet dataSet) {
java.awt.Dimension d = new Dimension(25, 25);
if (selectAllButton == null) {
add(selectAllButton = new MenuBarButton() {
{
setIcon("/icons/SelectAll.png");
setToolTipText("Выбрать всё");
setPreferredSize(d);
setMinimumSize(d);
setMaximumSize(d);
}
}, 0);
}
if (unselectAllButton == null) {
add(unselectAllButton = new MenuBarButton() {
{
setIcon("/icons/UnselectAll.png");
setToolTipText("Отменить всё");
setPreferredSize(d);
setMinimumSize(d);
setMaximumSize(d);
}
}, 1);
}
if (selectAllListener != null) {
selectAllButton.removeActionListener(selectAllListener); }
selectAllButton.addActionListener(selectAllListener = e -> dataSet.CheckAll(true));
if (unselectAllListener != null) {
unselectAllButton.removeActionListener(unselectAllListener);
}
unselectAllButton.addActionListener(unselectAllListener = e -> dataSet.CheckAll(false));
}
}

View File

@@ -1,7 +1,7 @@
package Common_old.UI.Menus_2023.FastAccessMenuBar;
import Common.Visual.CommonUI;
import _VisualDVM.Global;
import Common_old.UI.Menus_2023.VisualiserMenuBar;
import Common_old.UI.UI;
import GlobalData.Settings.SettingName;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021;
@@ -33,7 +33,7 @@ public class FastAccessMenuBar extends VisualiserMenuBar {
repaint();
}
public void Refresh() {
UI.Clear(this);
CommonUI.Clear(this);
int i = 1;
for (Pass_2021 pass : Pass_2021.FAPasses) {
if (pass.stats.HasUsages()) {
@@ -44,6 +44,6 @@ public class FastAccessMenuBar extends VisualiserMenuBar {
}
}
public void Drop(){
UI.Clear(this);
CommonUI.Clear(this);
}
}

View File

@@ -1,5 +1,5 @@
package Common_old.UI.Menus_2023.VariantsMenuBar;
import Common_old.UI.Menus_2023.DataMenuBar;
import Common.Visual.DataMenuBar;
import Visual_DVM_2021.Passes.PassCode_2021;
public class VariantsMenuBar extends DataMenuBar {
public VariantsMenuBar() {

View File

@@ -1,38 +0,0 @@
package Common_old.UI;
import Common_old.Utils.Utils;
import javax.swing.*;
public interface Selectable {
boolean isSelected();
default void Select(boolean flag) {
if (isSelectionEnabled())
select(flag);
}
void select(boolean flag);
//-
default ImageIcon GetSelectionIcon() {
return
isSelectionEnabled() ?
Utils.getIcon("/Common/icons/" + (isSelected() ? "Pick" : "NotPick") + ".png") :
GetDisabledIcon();
}
default ImageIcon GetDisabledIcon() {
return Utils.getIcon("/Common/icons/Arrays/Unknown.png");
}
default void SwitchSelection() {
Select(!isSelected());
}
//строчный контент для передачи параметров проходам.
default String getSelectionContent() {
return toString();
}
//-
default String getSelectionText() {
return toString();
}
default boolean isSelectionEnabled() {
return true;
}
default void SelectAllChildren(boolean select) {
}
}

View File

@@ -1,8 +0,0 @@
package Common_old.UI;
import _VisualDVM.Syntax.VisualiserFonts;
public interface StatusEnum {
default String getDescription() {
return toString();
}
default VisualiserFonts getFont() {return VisualiserFonts.UnknownState;}
}

View File

@@ -1,6 +1,6 @@
package Common_old.UI.Tables;
import Common_old.Current;
import Common_old.UI.StatusEnum;
import Common.Visual.StatusEnum;
import javax.swing.*;
public class StatusEnumRenderer extends RendererCell<StatusEnum> {

View File

@@ -1,6 +1,6 @@
package Common_old.UI.Trees;
import Common_old.Current;
import Common_old.UI.Selectable;
import Common.Visual.Selectable;
import javax.swing.tree.DefaultMutableTreeNode;
public class SelectableTree extends DataTree {

View File

@@ -1,6 +1,6 @@
package Common_old.UI.Trees;
import Common_old.Current;
import Common_old.UI.Selectable;
import Common.Visual.Selectable;
import _VisualDVM.Syntax.VisualiserFonts;
import javax.swing.*;

View File

@@ -1,6 +1,6 @@
package Common_old.UI.Trees;
import Common.Visual.CommonUI;
import Common_old.UI.ControlForm;
import Common_old.UI.UI;
import java.awt.*;
public class TreeForm<C extends StyledTree> extends ControlForm<C> {
@@ -25,6 +25,6 @@ public class TreeForm<C extends StyledTree> extends ControlForm<C> {
@Override
public void Clear() {
super.Clear();
UI.Clear(content);
CommonUI.Clear(content);
}
}

View File

@@ -1,7 +1,7 @@
package Common_old.UI;
import Common_old.Current;
import Common_old.UI.Menus_2023.CredentialsBar.CredentialsBar;
import Common_old.UI.Menus_2023.DataMenuBar;
import Common.Visual.DataMenuBar;
import Common_old.UI.Menus_2023.FastAccessMenuBar.FastAccessMenuBar;
import Common_old.UI.Menus_2023.FileMenuBar.FileMenuBar;
import Common_old.UI.Menus_2023.MainMenuBar.MainMenuBar;
@@ -105,7 +105,6 @@ import javax.swing.text.Highlighter;
import javax.swing.tree.TreeCellRenderer;
import java.awt.*;
import java.util.LinkedHashMap;
import java.util.Stack;
import java.util.Vector;
import static Common_old.UI.Tables.TableEditors.*;
@@ -130,36 +129,6 @@ public class UI {
public static LinkedHashMap<Common_old.UI.Trees.TreeRenderers, TreeCellRenderer> TreeRenderers = new LinkedHashMap<>();
public static LinkedHashMap<VisualiserThemeName, VisualiserTheme> themes = new LinkedHashMap<>();
public static LinkedHashMap<FormType, ThemeElement> windows = new LinkedHashMap<>();
public static Stack<Component> windowsStack = new Stack<>();
//-----
public static void Clear(Container container) {
container.removeAll();
container.repaint();
container.revalidate();
}
// http://java-online.ru/swing-joptionpane.xhtml
public static <T> void TrySelect(JComboBox box, T value_in) {
if (value_in != null) {
for (int i = 0; i < box.getItemCount(); ++i) {
T value = (T) box.getItemAt(i);
if (value.equals(value_in)) {
box.setSelectedIndex(i);
return;
}
}
box.addItem(value_in);
box.setSelectedIndex(box.getItemCount() - 1);
}
}
public static void TrySelect_s(JComboBox box, String value_string_in) {
for (int i = 0; i < box.getItemCount(); ++i) {
Object value = box.getItemAt(i);
if (value.toString().equals(value_string_in)) {
box.setSelectedIndex(i);
return;
}
}
}
public static RemoteFileChooser getRemoteFileChooser() {
return (RemoteFileChooser) windows.get(FormType.RemoteFileChooser);
}
@@ -172,49 +141,6 @@ public class UI {
public static SearchReplaceForm getSearchReplaceForm() {
return (SearchReplaceForm) windows.get(FormType.SearchReplace);
}
public static void refreshTheme() {
Current.set(Current.Theme, themes.get(Global.db.settings.get(SettingName.DarkThemeOn).toBoolean() ? VisualiserThemeName.Dark : VisualiserThemeName.Light));
// refreshTheme_r(Visualiser.getMainWindow().MainPanel);
/* Открыть
refreshTheme_r(Visualiser.searchReplaceForm.MainPanel);
refreshTheme_r(Visualiser.ComponentsWindow.fields.MainPanel);
refreshTheme_r(Visualiser.remoteFileChooser.fields.MainPanel);
refreshTheme_r(Visualiser.runStatisticForm.fields.MainPanel);
//-----------------------------------------------------------------
UIManager.put("ToolTip.background", Current.getTheme().background);
UIManager.put("ToolTip.foreground", Current.getTheme().foreground);
UIManager.put("Panel.background", Current.getTheme().background);
UIManager.put("Panel.foreground", Current.getTheme().foreground);
UIManager.put("TextPane.background", Current.getTheme().background);
UIManager.put("TextPane.foreground", Current.getTheme().foreground);
UIManager.put("Label.background", Current.getTheme().background);
UIManager.put("Label.foreground", Current.getTheme().foreground);
UIManager.put("ToolBar.background", Current.getTheme().background);
UIManager.put("ToolBar.foreground", Current.getTheme().foreground);
for (TableCellRenderer renderer : TableRenderers.values()) {
if (renderer instanceof WindowControl) {
((WindowControl) renderer).applyTheme();
}
}
for (TreeCellRenderer renderer : TreeRenderers.values()) {
if (renderer instanceof WindowControl) {
((WindowControl) renderer).applyTheme();
}
}
//для текущего файла отдельно
/// if (Current.HasFile())
// Current.getFile().form.Body.applyTheme();
//------------
// UIManager.put("TabbedPane.unselectedForeground", Color.red);
// UIManager.put("TabbedPane.selectedBackground", Color.black);
//----------------------------
*/
}
public static void CreateMenus() {
mainMenuBar = new MainMenuBar();
testingBar = new TestingBar();
@@ -362,7 +288,7 @@ public class UI {
public static Component getFrontWindow() {
Component res = null;
try {
res = windowsStack.peek();
res = CommonUI.windowsStack.peek();
} catch (Exception ignored){
}

View File

@@ -1,4 +1,5 @@
package Common_old.UI.Windows.Dialog;
import Common.Visual.CommonUI;
import Common_old.Current;
import _VisualDVM.Global;
import _VisualDVM.Syntax.ThemeElement;
@@ -53,7 +54,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) {
UI.windowsStack.pop();
CommonUI.windowsStack.pop();
onCancel();
onClose();
}
@@ -119,7 +120,7 @@ public class Dialog<T, F extends DialogFields> extends JDialog implements ThemeE
Init(params);
ShowTitle();
setAlwaysOnTop(isOnTop());
UI.windowsStack.push(this);
CommonUI.windowsStack.push(this);
setVisible(true);
return OK;
}

View File

@@ -1,5 +1,6 @@
package Common_old.UI.Windows;
import Common.Utils.CommonUtils;
import Common.Visual.CommonUI;
import Common_old.Current;
import Common_old.UI.TextField.StyledTextField;
import Common_old.UI.Trees.StyledTree;
@@ -144,7 +145,7 @@ public class SearchReplaceForm extends Form {
}
public void showNoFilesMatches() {
lFilesMatchesCount.setText("");
UI.Clear(filesTreePanel);
CommonUI.Clear(filesTreePanel);
}
public void showFilesMatches() {
long total = 0;