no message

This commit is contained in:
2024-10-08 23:21:42 +03:00
parent e0974fe4a8
commit 31c0cad38f
12 changed files with 230 additions and 517 deletions

View File

@@ -1,9 +1,10 @@
package Common_old.UI;
import Common.Database.Tables.DataSet;
import Common.Utils.CommonUtils;
import Common.Visual.Themes.ThemeElement;
import Common.Visual.CommonUI;
import Common.Visual.DataMenuBar;
import Common_old.Current;
import Common_old.UI.Menus_2023.CredentialsBar.CredentialsBar;
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;
@@ -13,10 +14,7 @@ import Common_old.UI.Menus_2023.VersionsMenuBar.VersionsMenuBar;
import Common_old.UI.Tables.*;
import Common_old.UI.Trees.GraphTreeCellRenderer;
import Common_old.UI.Trees.SelectionTreeCellRenderer;
import Common_old.UI.Windows.FormType;
import Common_old.UI.Windows.SearchReplaceForm;
import Common.Database.Tables.DataSet;
import Common.Visual.CommonUI;
import GlobalData.Compiler.CompilersDBTable;
import GlobalData.Compiler.CompilersMenuBar;
import GlobalData.CompilerEnvironment.UI.CompilerEnvironmentValueEditor;
@@ -102,7 +100,6 @@ import javax.swing.text.Highlighter;
import javax.swing.tree.TreeCellRenderer;
import java.awt.*;
import java.util.LinkedHashMap;
import java.util.Vector;
import static Common_old.UI.Tables.TableEditors.*;
import static Common_old.UI.Tables.TableRenderers.*;
@@ -115,27 +112,22 @@ public class UI {
public static FileMenuBar fileMenuBar = null;
public static VersionsMenuBar versionsMenuBar = null;
public static FastAccessMenuBar fastAccessMenuBar = null;
//------------
public static VersionsWindow versionsWindow = null;
public static DebugWindow debugWindow = null;
//ФОРМЫ
static MainWindow mainWindow = null;
static ComponentsForm componentsWindow = null;
static SearchReplaceForm searchReplaceWindow = null;
static ProfilesForm profilesWindow = null;
static VersionsWindow versionsWindow = null;
static DebugWindow debugWindow = null;
static RemoteFileChooser remoteFileChooser = null;
//------------
public static final Highlighter.HighlightPainter GoodLoopPainter = new DefaultHighlighter.DefaultHighlightPainter(new Color(152, 251, 152, 90));
public static final Highlighter.HighlightPainter BadLoopPainter = new DefaultHighlighter.DefaultHighlightPainter(new Color(240, 128, 128, 90));
public static LinkedHashMap<Common_old.UI.Tables.TableRenderers, TableCellRenderer> TableRenderers = new LinkedHashMap<>();
public static LinkedHashMap<Common_old.UI.Tables.TableEditors, TableCellEditor> TableEditors = new LinkedHashMap<>();
public static LinkedHashMap<Common_old.UI.Trees.TreeRenderers, TreeCellRenderer> TreeRenderers = new LinkedHashMap<>();
public static LinkedHashMap<FormType, ThemeElement> windows = new LinkedHashMap<>();
public static RemoteFileChooser getRemoteFileChooser() {
return (RemoteFileChooser) windows.get(FormType.RemoteFileChooser);
}
public static ComponentsForm getComponentsWindow() {
return (ComponentsForm) windows.get(FormType.Components);
}
public static boolean HasMainWindow() {
return getMainWindow() != null;
}
public static SearchReplaceForm getSearchReplaceForm() {
return (SearchReplaceForm) windows.get(FormType.SearchReplace);
return mainWindow != null;
}
public static void CreateMenus() {
mainMenuBar = new MainMenuBar();
@@ -185,15 +177,12 @@ public class UI {
//---->>
}
public static void CreateWindows() {
windows.put(FormType.SearchReplace, new SearchReplaceForm());
windows.put(FormType.RemoteFileChooser, new RemoteFileChooser());
windows.put(FormType.Profiles, new ProfilesForm());
windows.put(FormType.Main, new MainForm());
searchReplaceWindow = new SearchReplaceForm();
remoteFileChooser = new RemoteFileChooser();
profilesWindow = new ProfilesForm();
mainWindow = new MainForm();
//---------------------------------------
getMainWindow().Show();
}
public static MainWindow getMainWindow() {
return (MainWindow) windows.get(FormType.Main);
mainWindow.Show();
}
//-
public static void CreateAll() {
@@ -203,18 +192,15 @@ public class UI {
UIManager.put("FileChooser.lookInLabelText", "Смотреть в");
UIManager.put("FileChooser.fileNameLabelText", "Имя файла");
UIManager.put("FileChooser.filesOfTypeLabelText", "Тип файла");
UIManager.put("FileChooser.saveButtonText", "Сохранить");
UIManager.put("FileChooser.saveButtonToolTipText", "Сохранить");
UIManager.put("FileChooser.openButtonToolTipText", "Открыть");
UIManager.put("FileChooser.cancelButtonText", "Отмена");
UIManager.put("FileChooser.cancelButtonToolTipText", "Отмена");
UIManager.put("FileChooser.lookInLabelText", "Папка");
UIManager.put("FileChooser.saveInLabelText", "Папка");
UIManager.put("FileChooser.fileNameLabelText", "Имя файла");
UIManager.put("FileChooser.filesOfTypeLabelText", "Тип файлов");
UIManager.put("FileChooser.upFolderToolTipText", "На один уровень вверх");
UIManager.put("FileChooser.newFolderToolTipText", "Создание новой папки");
UIManager.put("FileChooser.listViewButtonToolTipText", "Список");
@@ -224,9 +210,7 @@ public class UI {
UIManager.put("FileChooser.fileTypeHeaderText", "Тип");
UIManager.put("FileChooser.fileDateHeaderText", "Изменен");
UIManager.put("FileChooser.fileAttrHeaderText", "Атрибуты");
UIManager.put("FileChooser.acceptAllFileFilterText", "Все файлы");
//</editor-fold>
//<editor-fold desc="Локализация компонентов окна подтверждения">
UIManager.put("OptionPane.yesButtonText", "Да");
@@ -260,7 +244,6 @@ public class UI {
TreeRenderers.put(RendererSapforVersion, new SapforVersionsTreeCellRenderer());
TreeRenderers.put(RendererRule, new RulesTreeCellRenderer());
TreeRenderers.put(RendererSelection, new SelectionTreeCellRenderer());
//----------------------------------------------
TableEditors.put(EditorSelect, new DBObjectSelector());
TableEditors.put(EditorHyperlinks, new VectorEditor());
@@ -271,58 +254,53 @@ public class UI {
//</editor-fold>
}
public static void CreateComponentsForm() {
windows.put(FormType.Components, new ComponentsForm());
}
public static ProfilesForm getProfilesWindow() {
return (ProfilesForm) windows.get(FormType.Profiles);
componentsWindow = new ComponentsForm();
}
//-----
public static void ShowTabsNames(JTabbedPane tabs) {
ShowTabsNames(tabs, 0);
}
public static void ShowTabsNames(JTabbedPane tabs, int startIndex) {
boolean flag = ((GlobalDatabase)CommonUtils.db).settings.get(SettingName.ShowFullTabsNames).toBoolean();
boolean flag = ((GlobalDatabase) CommonUtils.db).settings.get(SettingName.ShowFullTabsNames).toBoolean();
for (int i = startIndex; i < tabs.getTabCount(); ++i)
tabs.setTitleAt(i, flag ? tabs.getToolTipTextAt(i) : "");
}
public static boolean Contains(Vector<String> list, String line, int max_index) {
int last_index = -1;
for (int i = 0; i < list.size(); ++i)
if (list.get(i).equals(line)) last_index = i;
return (last_index >= max_index);
}
//--
public static VersionsWindow getVersionsWindow() {
return versionsWindow;
}
public static void CreateVersionsWindow() {
versionsWindow = new VersionsForm(Current.getRoot());
}
//-
public static void ShowSearchForm(boolean replace) {
searchReplaceWindow.setMode(replace);
searchReplaceWindow.ShowMode();
ShowSearchForm();
}
public static void HideSearchForm() {
if (searchReplaceWindow.isVisible())
searchReplaceWindow.setVisible(false);
}
public static void ShowSearchForm() {
if (searchReplaceWindow.isVisible())
searchReplaceWindow.Refresh();
else
searchReplaceWindow.Show();
}
public static void ShowComponentsWindow() {
componentsWindow.ShowDialog("");
}
public static void ShowProfilesWindow() {
profilesWindow.ShowDialog("");
}
//----
public static MainWindow getMainWindow(){return mainWindow;}
public static VersionsWindow getVersionsWindow(){return versionsWindow;}
public static ComponentsForm getComponentsWindow(){return componentsWindow;}
public static SearchReplaceForm getSearchReplaceWindow(){return searchReplaceWindow;}
public static ProfilesForm getProfilesWindow(){return profilesWindow;}
public static RemoteFileChooser getRemoteFileChooser(){return remoteFileChooser;}
//возможно перекинуть на тестирование. потом.
public static DebugWindow getDebugWindow() {
if (debugWindow == null)
debugWindow = new DebugForm();
return debugWindow;
}
//-
public static void ShowSearchForm(boolean replace) {
getSearchReplaceForm().setMode(replace);
getSearchReplaceForm().ShowMode();
ShowSearchForm();
}
public static void HideSearchForm() {
if (getSearchReplaceForm().isVisible())
getSearchReplaceForm().setVisible(false);
}
public static void ShowSearchForm() {
if (getSearchReplaceForm().isVisible())
getSearchReplaceForm().Refresh();
else
getSearchReplaceForm().Show();
}
public static void ShowComponentsWindow() {
getComponentsWindow().ShowDialog("");
}
public static void ShowProfilesWindow() {
getProfilesWindow().ShowDialog("");
}
}

View File

@@ -1,9 +0,0 @@
package Common_old.UI.Windows;
public enum FormType {
Undefined,
Main,
SearchReplace,
Components,
RemoteFileChooser,
Profiles
}