no message
This commit is contained in:
@@ -15,8 +15,6 @@ public class DataMenuBar extends VisualiserMenuBar {
|
||||
JButton unselectAllButton = null;
|
||||
//-
|
||||
public DataMenuBar(String dataName, PassCode... passes) {
|
||||
System.out.println("create bar for "+dataName);
|
||||
// Font font = Current.getTheme().Fonts.get(VisualiserFonts.TreeBoldItalic).deriveFont(12.0F);
|
||||
add(new JLabel(dataName + " : "));
|
||||
add(countLabel = new JLabel("?"));
|
||||
addPasses(passes);
|
||||
|
||||
@@ -6,7 +6,10 @@ import Common.Visual.Themes.VisualiserTheme;
|
||||
import Common.Visual.Windows.PassForm;
|
||||
import _VisualDVM.Visual.Menus.FastAccessMenuBar.FastAccessMenuBar;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Stack;
|
||||
public class UIModule_ {
|
||||
//--
|
||||
VisualiserTheme theme = new DefaultTheme();
|
||||
@@ -30,4 +33,48 @@ public class UIModule_ {
|
||||
public FastAccessMenuBar getFastAccessMenuBar(){return fastAccessMenuBar;}
|
||||
//-
|
||||
public LinkedHashMap<Class<? extends DataSet>, DataMenuBar> menuBars = new LinkedHashMap<>();
|
||||
//--
|
||||
public Stack<Component> windowsStack = new Stack<>();
|
||||
public Component getFrontWindow() {
|
||||
Component res = null;
|
||||
try {
|
||||
res = windowsStack.peek();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
public UIModule_(){
|
||||
//<editor-fold desc="Локализация компонентов окна JFileChooser">
|
||||
UIManager.put("FileChooser.openButtonText", "Открыть");
|
||||
UIManager.put("FileChooser.cancelButtonText", "Отмена");
|
||||
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", "Список");
|
||||
UIManager.put("FileChooser.detailsViewButtonToolTipText", "Таблица");
|
||||
UIManager.put("FileChooser.fileNameHeaderText", "Имя");
|
||||
UIManager.put("FileChooser.fileSizeHeaderText", "Размер");
|
||||
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", "Да");
|
||||
UIManager.put("OptionPane.noButtonText", "Нет");
|
||||
UIManager.put("OptionPane.cancelButtonText", "Отмена");
|
||||
UIManager.put("OptionPane.okButtonText", "Готово");
|
||||
//</editor-fold>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Common.Visual;
|
||||
import Common.MainModule_;
|
||||
import Common.Utils.Utils_;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -9,18 +10,9 @@ import java.util.Stack;
|
||||
public class UI_ {
|
||||
public static boolean active = false; //есть ли интерфейс. в консольных версиях не нужен.
|
||||
//---
|
||||
public static Stack<Component> windowsStack = new Stack<>();
|
||||
public static boolean isActive() {
|
||||
return active;
|
||||
}
|
||||
public static Component getFrontWindow() {
|
||||
Component res = null;
|
||||
try {
|
||||
res = windowsStack.peek();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
//-----
|
||||
public static void Clear(Container container) {
|
||||
container.removeAll();
|
||||
@@ -67,21 +59,21 @@ public class UI_ {
|
||||
JOptionPane.QUESTION_MESSAGE) == 0);
|
||||
}
|
||||
public static boolean Question(String text) {
|
||||
return Question(getFrontWindow(), text);
|
||||
return Question(MainModule_.instance.getUI().getFrontWindow(), text);
|
||||
}
|
||||
public static void Info(String message) {
|
||||
Utils_.CopyToClipboard(message);
|
||||
if (UI_.isActive())
|
||||
JOptionPane.showMessageDialog(getFrontWindow(), message, "", 1);
|
||||
JOptionPane.showMessageDialog(MainModule_.instance.getUI().getFrontWindow(), message, "", 1);
|
||||
}
|
||||
public static void Error(String message) {
|
||||
Utils_.CopyToClipboard(message);
|
||||
if (UI_.isActive())
|
||||
JOptionPane.showMessageDialog(getFrontWindow(), message, "", 0);
|
||||
JOptionPane.showMessageDialog(MainModule_.instance.getUI().getFrontWindow(), message, "", 0);
|
||||
}
|
||||
public static boolean Warning(String text) {
|
||||
return !UI_.isActive() ||
|
||||
JOptionPane.showConfirmDialog(getFrontWindow(),
|
||||
JOptionPane.showConfirmDialog(MainModule_.instance.getUI().getFrontWindow(),
|
||||
text + "\nВы уверены?",
|
||||
"Подтверждение",
|
||||
JOptionPane.YES_NO_OPTION,
|
||||
|
||||
@@ -49,7 +49,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();
|
||||
MainModule_.instance.getUI().windowsStack.pop();
|
||||
onCancel();
|
||||
onClose();
|
||||
}
|
||||
@@ -117,7 +117,7 @@ public class Dialog<T, F extends DialogFields> extends JDialog implements ThemeE
|
||||
Init(params);
|
||||
ShowTitle();
|
||||
setAlwaysOnTop(isOnTop());
|
||||
UI_.windowsStack.push(this);
|
||||
MainModule_.instance.getUI().windowsStack.push(this);
|
||||
setVisible(true);
|
||||
return OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user