no message
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package _VisualDVM;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common.Mode;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Loggable;
|
||||
import Common.Visual.CommonUI;
|
||||
@@ -27,6 +28,7 @@ import TestingSystem.DVM.RemoteDVMTestingPlanner;
|
||||
import TestingSystem.SAPFOR.PackageModeSupervisor;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
import _VisualDVM.Syntax.LightSPFEditorTheme;
|
||||
import org.fife.ui.rsyntaxtextarea.AbstractTokenMakerFactory;
|
||||
import org.fife.ui.rsyntaxtextarea.TokenMakerFactory;
|
||||
|
||||
@@ -74,9 +76,11 @@ public class Global {
|
||||
public static int bad_state = 0;
|
||||
public static int need_update = 0;
|
||||
public static int need_publish = 0;
|
||||
//Режим
|
||||
public static Mode mode = Mode.Undefined;
|
||||
public static void SynschronizeProperties() {
|
||||
try {
|
||||
File new_propertiesFile = Paths.get(CommonUtils.Home, "properties").toFile();
|
||||
File new_propertiesFile = new File(CommonUtils.getHomeDirectory(), "properties");
|
||||
if (new_propertiesFile.exists())
|
||||
properties = (GlobalProperties) CommonUtils.jsonFromFile(new_propertiesFile, GlobalProperties.class);
|
||||
CommonUtils.jsonToFile(properties, new_propertiesFile);
|
||||
@@ -85,45 +89,45 @@ public class Global {
|
||||
}
|
||||
}
|
||||
public static void CheckVisualiserDirectories() {
|
||||
Utils.CheckDirectory(ComponentsDirectory = Paths.get(CommonUtils.Home, Constants.ComponentsDirectoryName).toFile());
|
||||
Utils.CheckAndCleanDirectory(TempDirectory = Paths.get(CommonUtils.Home, Constants.TempDirectoryName).toFile());
|
||||
Utils.CheckDirectory(DataDirectory = Paths.get(CommonUtils.Home, Constants.DataDirectoryName).toFile());
|
||||
Utils.CheckDirectory(ComponentsDirectory = new File(CommonUtils.getHomeDirectory(), Constants.ComponentsDirectoryName));
|
||||
Utils.CheckAndCleanDirectory(TempDirectory = new File(CommonUtils.getHomeDirectory(), Constants.TempDirectoryName));
|
||||
Utils.CheckDirectory(DataDirectory = new File(CommonUtils.getHomeDirectory(), Constants.DataDirectoryName));
|
||||
//-
|
||||
Utils.CheckDirectory(RepoDirectory = Paths.get(CommonUtils.Home, Constants.RepoDirectoryName).toFile());
|
||||
Utils.CheckDirectory(BugReportsDirectory = Paths.get(CommonUtils.Home, Constants.BugsDirectoryName).toFile());
|
||||
Utils.CheckDirectory(BackUpsDirectory = Paths.get(CommonUtils.Home, Constants.BackUpsDirectoryName).toFile());
|
||||
Utils.CheckDirectory(ProjectsDirectory = Paths.get(CommonUtils.Home, Constants.ProjectsDirectoryName).toFile());
|
||||
Utils.CheckDirectory(CompilationTasksDirectory = Paths.get(CommonUtils.Home, Constants.CompilationTasksDirectoryName).toFile());
|
||||
Utils.CheckDirectory(RunTasksDirectory = Paths.get(CommonUtils.Home, Constants.RunTasksDirectoryName).toFile());
|
||||
Utils.CheckDirectory(StsDirectory = Paths.get(CommonUtils.Home, Constants.StsDirectoryName).toFile());
|
||||
Utils.CheckDirectory(TestsDirectory = Paths.get(CommonUtils.Home, Constants.TestsDirectoryName).toFile());
|
||||
Utils.CheckDirectory(PerformanceAnalyzerDirectory = Paths.get(CommonUtils.Home, Constants.PerformanceAnalyzerDirectoryName).toFile());
|
||||
Utils.CheckDirectory(DVMPackagesDirectory = Paths.get(CommonUtils.Home, Constants.DVMPackagesDirectoryName).toFile());
|
||||
Utils.CheckDirectory(RepoDirectory = new File(CommonUtils.getHomeDirectory(), Constants.RepoDirectoryName));
|
||||
Utils.CheckDirectory(BugReportsDirectory = new File(CommonUtils.getHomeDirectory(), Constants.BugsDirectoryName));
|
||||
Utils.CheckDirectory(BackUpsDirectory = new File(CommonUtils.getHomeDirectory(), Constants.BackUpsDirectoryName));
|
||||
Utils.CheckDirectory(ProjectsDirectory = new File(CommonUtils.getHomeDirectory(), Constants.ProjectsDirectoryName));
|
||||
Utils.CheckDirectory(CompilationTasksDirectory = new File(CommonUtils.getHomeDirectory(), Constants.CompilationTasksDirectoryName));
|
||||
Utils.CheckDirectory(RunTasksDirectory = new File(CommonUtils.getHomeDirectory(), Constants.RunTasksDirectoryName));
|
||||
Utils.CheckDirectory(StsDirectory = new File(CommonUtils.getHomeDirectory(), Constants.StsDirectoryName));
|
||||
Utils.CheckDirectory(TestsDirectory = new File(CommonUtils.getHomeDirectory(), Constants.TestsDirectoryName));
|
||||
Utils.CheckDirectory(PerformanceAnalyzerDirectory = new File(CommonUtils.getHomeDirectory(), Constants.PerformanceAnalyzerDirectoryName));
|
||||
Utils.CheckDirectory(DVMPackagesDirectory = new File(CommonUtils.getHomeDirectory(), Constants.DVMPackagesDirectoryName));
|
||||
//через пару версий заменить на clean.
|
||||
Utils.CheckDirectory(SapforPackagesDirectory = Paths.get(CommonUtils.Home, "SapforPackages").toFile());
|
||||
Utils.CheckDirectory(MachinesDirectory = Paths.get(CommonUtils.Home, "Machines").toFile());
|
||||
Utils.CheckDirectory(SapforPackagesDirectory = new File(CommonUtils.getHomeDirectory(), "SapforPackages"));
|
||||
Utils.CheckDirectory(MachinesDirectory = new File(CommonUtils.getHomeDirectory(), "Machines"));
|
||||
}
|
||||
public static void CheckServerDirectories() {
|
||||
Utils.CheckDirectory(ComponentsDirectory = Paths.get(CommonUtils.Home, Constants.ComponentsDirectoryName).toFile());
|
||||
Utils.CheckAndCleanDirectory(TempDirectory = Paths.get(CommonUtils.Home, Constants.TempDirectoryName).toFile());
|
||||
Utils.CheckDirectory(DataDirectory = Paths.get(CommonUtils.Home, Constants.DataDirectoryName).toFile());
|
||||
Utils.CheckDirectory(ComponentsDirectory = new File(CommonUtils.getHomeDirectory(), Constants.ComponentsDirectoryName));
|
||||
Utils.CheckAndCleanDirectory(TempDirectory = new File(CommonUtils.getHomeDirectory(), Constants.TempDirectoryName));
|
||||
Utils.CheckDirectory(DataDirectory = new File(CommonUtils.getHomeDirectory(), Constants.DataDirectoryName));
|
||||
//-
|
||||
Utils.CheckDirectory(BugReportsDirectory = Paths.get(CommonUtils.Home, Constants.BugsDirectoryName).toFile());
|
||||
Utils.CheckDirectory(DataBackUpsDirectory = Paths.get(CommonUtils.Home, Constants.DataBackUpsDirectoryName).toFile());
|
||||
Utils.CheckDirectory(MachinesDirectory = Paths.get(CommonUtils.Home, "Machines").toFile());
|
||||
Utils.CheckDirectory(BugReportsDirectory = new File(CommonUtils.getHomeDirectory(), Constants.BugsDirectoryName));
|
||||
Utils.CheckDirectory(DataBackUpsDirectory = new File(CommonUtils.getHomeDirectory(), Constants.DataBackUpsDirectoryName));
|
||||
Utils.CheckDirectory(MachinesDirectory = new File(CommonUtils.getHomeDirectory(), "Machines"));
|
||||
}
|
||||
public static void CheckTestingSystemDirectories() {
|
||||
Utils.CheckDirectory(ComponentsDirectory = Paths.get(CommonUtils.Home, Constants.ComponentsDirectoryName).toFile());
|
||||
Utils.CheckAndCleanDirectory(TempDirectory = Paths.get(CommonUtils.Home, Constants.TempDirectoryName).toFile());
|
||||
Utils.CheckDirectory(DataDirectory = Paths.get(CommonUtils.Home, Constants.DataDirectoryName).toFile());
|
||||
Utils.CheckDirectory(ComponentsDirectory = new File(CommonUtils.getHomeDirectory(), Constants.ComponentsDirectoryName));
|
||||
Utils.CheckAndCleanDirectory(TempDirectory = new File(CommonUtils.getHomeDirectory(), Constants.TempDirectoryName));
|
||||
Utils.CheckDirectory(DataDirectory = new File(CommonUtils.getHomeDirectory(), Constants.DataDirectoryName));
|
||||
//-
|
||||
Utils.CheckDirectory(TestsDirectory = Paths.get(CommonUtils.Home, Constants.TestsDirectoryName).toFile());
|
||||
Utils.CheckDirectory(RepoDirectory = Paths.get(CommonUtils.Home, Constants.RepoDirectoryName).toFile());
|
||||
Utils.CheckDirectory(DVMPackagesDirectory = Paths.get(CommonUtils.Home, Constants.DVMPackagesDirectoryName).toFile());
|
||||
Utils.CheckDirectory(SapforsDirectory = Paths.get(CommonUtils.Home, "Sapfors").toFile());
|
||||
Utils.CheckDirectory(SapforPackagesDirectory = Paths.get(CommonUtils.Home, "SapforPackages").toFile());
|
||||
Utils.CheckDirectory(TestsDirectory = new File(CommonUtils.getHomeDirectory(), Constants.TestsDirectoryName));
|
||||
Utils.CheckDirectory(RepoDirectory = new File(CommonUtils.getHomeDirectory(), Constants.RepoDirectoryName));
|
||||
Utils.CheckDirectory(DVMPackagesDirectory = new File(CommonUtils.getHomeDirectory(), Constants.DVMPackagesDirectoryName));
|
||||
Utils.CheckDirectory(SapforsDirectory = new File(CommonUtils.getHomeDirectory(), "Sapfors"));
|
||||
Utils.CheckDirectory(SapforPackagesDirectory = new File(CommonUtils.getHomeDirectory(), "SapforPackages"));
|
||||
//CheclAndClean через неделю
|
||||
Utils.CheckDirectory(MachinesDirectory = Paths.get(CommonUtils.Home, "Machines").toFile());
|
||||
Utils.CheckDirectory(MachinesDirectory = new File(CommonUtils.getHomeDirectory(), "Machines"));
|
||||
}
|
||||
public static void CreateLogAtComponentsPath() {
|
||||
CommonUtils.MainLog = new Loggable() {
|
||||
@@ -142,11 +146,11 @@ public class Global {
|
||||
CommonUtils.MainLog = new Loggable() {
|
||||
@Override
|
||||
public String getLogHomePath() {
|
||||
return CommonUtils.Home;
|
||||
return CommonUtils.getHomePath();
|
||||
}
|
||||
@Override
|
||||
public String getLogName() {
|
||||
return CommonUtils.mode.toString();
|
||||
return mode.toString();
|
||||
}
|
||||
};
|
||||
CommonUtils.MainLog.ClearLog();
|
||||
@@ -214,15 +218,6 @@ public class Global {
|
||||
}
|
||||
return (bad_state == 0);
|
||||
}
|
||||
//возможно заменить settings на properties
|
||||
public static DBSetting getSetting(SettingName settingName) throws Exception {
|
||||
switch (CommonUtils.mode) {
|
||||
case Normal:
|
||||
return ((GlobalDatabase)CommonUtils.db).settings.get(settingName);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public static void changeSetting(SettingName settingName, Object new_value) throws Exception {
|
||||
Pass_2021.passes.get(PassCode_2021.UpdateSetting).Do(settingName, new_value);
|
||||
}
|
||||
@@ -233,7 +228,7 @@ public class Global {
|
||||
forbidden.add(SettingName.Precompilation);
|
||||
forbidden.add(SettingName.DVMConvertationOptions);
|
||||
forbidden.add(SettingName.SaveModifications);
|
||||
for (DBSetting setting : ((GlobalDatabase)CommonUtils.db).settings.getSettingsByOwner(ComponentType.SapforOptions)) {
|
||||
for (DBSetting setting : ((GlobalDatabase) CommonUtils.db).settings.getSettingsByOwner(ComponentType.SapforOptions)) {
|
||||
if (!forbidden.contains(setting.Name))
|
||||
res_.add(setting.Value);
|
||||
}
|
||||
@@ -256,7 +251,8 @@ public class Global {
|
||||
}
|
||||
}
|
||||
public static void NormalMode(int port) throws Exception {
|
||||
CommonUtils.isWindows = System.getProperty("os.name").startsWith("Windows");
|
||||
CommonUI.active = true;
|
||||
CommonUI.setTheme(new LightSPFEditorTheme());
|
||||
removeOldDatabases();
|
||||
CheckVisualiserDirectories();
|
||||
CreateLogAtComponentsPath();
|
||||
@@ -265,8 +261,8 @@ public class Global {
|
||||
visualizer_2.Connect();
|
||||
visualizer_2.refreshPid();
|
||||
//если делать раньше, то не удастся убить сервер.
|
||||
if (CommonUtils.ContainsCyrillic(CommonUtils.Home)) {
|
||||
UI.Info("В пути к корневой папке " + CommonUtils.DQuotes(CommonUtils.Home) + "\n" +
|
||||
if (CommonUtils.ContainsCyrillic(CommonUtils.getHomePath())) {
|
||||
CommonUI.Info("В пути к корневой папке " + CommonUtils.DQuotes(CommonUtils.getHomePath()) + "\n" +
|
||||
"Найдены русские буквы.\n" +
|
||||
"Визуализатор завершает работу."); //
|
||||
FinishApplication();
|
||||
@@ -304,10 +300,10 @@ public class Global {
|
||||
do {
|
||||
UI.ShowComponentsWindow();
|
||||
if (flag = (!ValidateComponentsStates())) {
|
||||
if (!UI.Question("Найдено " + bad_state + " некорректных необходимых компонент.Работа визуализатора невозможна.\n" +
|
||||
if (!CommonUI.Question("Найдено " + bad_state + " некорректных необходимых компонент.Работа визуализатора невозможна.\n" +
|
||||
"Вернуться к окну компонент"
|
||||
)) {
|
||||
UI.Info("Визуализатор завершает работу.");
|
||||
CommonUI.Info("Визуализатор завершает работу.");
|
||||
FinishApplication();
|
||||
}
|
||||
}
|
||||
@@ -316,24 +312,23 @@ public class Global {
|
||||
//---
|
||||
ActivateDB(); //тут current getAccount; роль по умолчанию всегда неизвестна.
|
||||
///--------------
|
||||
|
||||
CurrentAnchestor.set(Current.Account, new Account(){
|
||||
CurrentAnchestor.set(Current.Account, new Account() {
|
||||
{
|
||||
name = "M";
|
||||
email= "vmk-post@yandex.ru";
|
||||
email = "vmk-post@yandex.ru";
|
||||
role = AccountRole.Admin;
|
||||
}
|
||||
});
|
||||
// Pass_2021.passes.get(PassCode_2021.CheckAccount).Do();
|
||||
// Pass_2021.passes.get(PassCode_2021.CheckAccount).Do();
|
||||
//---------------
|
||||
componentsServer.ActivateDB();
|
||||
testingServer.ActivateDB();
|
||||
//в проперти их!
|
||||
//-- чисто чтобы создать таблицы. соединения на стороне клиента не предвидится.
|
||||
if (((GlobalDatabase)CommonUtils.db).settings.get(SettingName.AutoBugReportsLoad).toBoolean())
|
||||
if (((GlobalDatabase) CommonUtils.db).settings.get(SettingName.AutoBugReportsLoad).toBoolean())
|
||||
Pass_2021.passes.get(PassCode_2021.SynchronizeBugReports).Do();
|
||||
//--
|
||||
if (((GlobalDatabase)CommonUtils.db).settings.get(SettingName.AutoTestsLoad).toBoolean())
|
||||
if (((GlobalDatabase) CommonUtils.db).settings.get(SettingName.AutoTestsLoad).toBoolean())
|
||||
Pass_2021.passes.get(PassCode_2021.SynchronizeTests).Do();
|
||||
Pass_2021.CheckAllStats();
|
||||
Current.getSapfor().refreshPid(); //без сапфора сюда это все равно не дойдет.
|
||||
@@ -341,7 +336,6 @@ public class Global {
|
||||
UI.CreateWindows();
|
||||
}
|
||||
public static void ServerMode() throws Exception {
|
||||
CommonUtils.isWindows = false;
|
||||
CheckServerDirectories();
|
||||
CreateLogAtComponentsPath();
|
||||
Utils.createEmptyFile("kek");
|
||||
@@ -351,18 +345,16 @@ public class Global {
|
||||
System.exit(0);
|
||||
}
|
||||
public static void TestingSystemMode() throws Exception {
|
||||
CommonUtils.isWindows = false;
|
||||
CheckTestingSystemDirectories();
|
||||
CreateLogAtComponentsPath();
|
||||
testingServer = new TestingServer();
|
||||
testingServer.ActivateDB();
|
||||
// testingServer.PATCH();
|
||||
// testingServer.PATCH();
|
||||
testingServer.Start();
|
||||
System.exit(0);
|
||||
}
|
||||
//режим запуска пакета Сапфор
|
||||
public static void PackageMode() throws Exception {
|
||||
CommonUtils.isWindows = System.getProperty("os.name").startsWith("Windows");
|
||||
CreateLogAtHome();
|
||||
PackageModeSupervisor planner = new PackageModeSupervisor();
|
||||
planner.Start();
|
||||
@@ -382,14 +374,13 @@ public class Global {
|
||||
//---
|
||||
public static void Init(String... args) {
|
||||
System.out.println("VisualSapfor.jar started..");
|
||||
CommonUtils.Home = System.getProperty("user.dir"); //если Linux, дает без слеша в конце !!!
|
||||
System.out.println("home directory is" + CommonUtils.Brackets(CommonUtils.Home));
|
||||
System.out.println("home directory is" + CommonUtils.Brackets(CommonUtils.getHomePath()));
|
||||
//---
|
||||
SynschronizeProperties();
|
||||
CommonUtils.mode = properties.Mode;
|
||||
System.out.println("mode is " + CommonUtils.mode);
|
||||
mode = properties.Mode;
|
||||
System.out.println("mode is " + mode);
|
||||
try {
|
||||
switch (CommonUtils.mode) {
|
||||
switch (mode) {
|
||||
case Normal:
|
||||
NormalMode(Integer.parseInt(args[1]));
|
||||
break;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package _VisualDVM.Syntax;
|
||||
import Common.Visual.Themes.VisualiserTheme;
|
||||
|
||||
import java.awt.*;
|
||||
public class DarkVisualiserTheme extends VisualiserTheme {
|
||||
public class DarkVisualiserTheme extends SPFEditorTheme {
|
||||
@Override
|
||||
protected String getEditorThemePath() {
|
||||
return "/_VisualDVM/Syntax/dark_editor.xml";
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package _VisualDVM.Syntax;
|
||||
import Common.Visual.Themes.VisualiserTheme;
|
||||
|
||||
import java.awt.*;
|
||||
public class LightVisualiserTheme extends VisualiserTheme {
|
||||
public class LightSPFEditorTheme extends SPFEditorTheme {
|
||||
@Override
|
||||
protected String getEditorThemePath() {
|
||||
return "/_VisualDVM/Syntax/light_editor.xml";
|
||||
20
src/_VisualDVM/Syntax/SPFEditorTheme.java
Normal file
20
src/_VisualDVM/Syntax/SPFEditorTheme.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package _VisualDVM.Syntax;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.Themes.VisualiserTheme;
|
||||
import org.fife.ui.rsyntaxtextarea.Theme;
|
||||
|
||||
import java.awt.*;
|
||||
public abstract class SPFEditorTheme extends VisualiserTheme {
|
||||
protected abstract String getEditorThemePath(); //-
|
||||
//если использовать один и тот же объект на все едиторы пявляются странности
|
||||
//значит при применении выделяем новый экземпляр.
|
||||
public Theme getEditorTheme() {
|
||||
Theme res = null;
|
||||
try {
|
||||
res = Theme.load(getClass().getResourceAsStream(getEditorThemePath()));
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package _VisualDVM.Syntax;
|
||||
public interface ThemeElement {
|
||||
default void FontUp() {
|
||||
}
|
||||
default void FontDown() {
|
||||
}
|
||||
void applyTheme();
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package _VisualDVM.Syntax;
|
||||
public enum VisualiserColor {
|
||||
ToolTip_background,
|
||||
ToolTip_foreground
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package _VisualDVM.Syntax;
|
||||
public enum VisualiserFonts {
|
||||
GoodState,
|
||||
ReadyState,
|
||||
BadState,
|
||||
Fatal,
|
||||
ProgressState,
|
||||
UnknownState,
|
||||
Hyperlink,
|
||||
Disabled,
|
||||
//бесцветные
|
||||
Distribution,
|
||||
//---
|
||||
TreeItalic,
|
||||
TreePlain,
|
||||
TreeBold,
|
||||
TreeBoldItalic,
|
||||
BlueState,
|
||||
NewVersion, //---
|
||||
Menu
|
||||
}
|
||||
@@ -1,183 +0,0 @@
|
||||
package _VisualDVM.Syntax;
|
||||
import Common.Utils.CommonUtils;
|
||||
import org.fife.ui.rsyntaxtextarea.Theme;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.font.TextAttribute;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
import static java.awt.Font.MONOSPACED;
|
||||
public abstract class VisualiserTheme {
|
||||
public Color foreground;
|
||||
public Color background;
|
||||
public Color selection_background;
|
||||
public Color trees_background;
|
||||
public Color bar_foreground;
|
||||
public Color bar_background;
|
||||
public Color table_background;
|
||||
public LinkedHashMap<VisualiserFonts, Font> Fonts = new LinkedHashMap<>();
|
||||
public LinkedHashMap<VisualiserColor, Color> Colors = new LinkedHashMap<>();
|
||||
public VisualiserTheme() {
|
||||
try {
|
||||
//-----------------------------------------------
|
||||
//-----------------------------------------------
|
||||
foreground = Color.decode(getForegroundHex());
|
||||
background = Color.decode(getBackgroundHex());
|
||||
selection_background = Color.decode(getSelectionBackgroundHex());
|
||||
trees_background = Color.decode(getTreeBackgroundHex());
|
||||
bar_foreground = Color.decode(getBarForegroundHex());
|
||||
bar_background = Color.decode(getBarBackgroundHex());
|
||||
table_background = Color.decode(getTableBackgroundHex());
|
||||
//<editor-fold desc="шрифты">
|
||||
Fonts.put(VisualiserFonts.GoodState,
|
||||
new Font(
|
||||
new HashMap<TextAttribute, Object>() {
|
||||
{
|
||||
put(TextAttribute.FAMILY, "Times New Roman");
|
||||
put(TextAttribute.FOREGROUND, getGoodFontColor());
|
||||
put(TextAttribute.SIZE, 16);
|
||||
}
|
||||
}
|
||||
));
|
||||
Fonts.put(VisualiserFonts.ReadyState,
|
||||
new Font(
|
||||
new HashMap<TextAttribute, Object>() {
|
||||
{
|
||||
put(TextAttribute.FAMILY, "Times New Roman");
|
||||
put(TextAttribute.FOREGROUND, getReadyFontColor2());
|
||||
put(TextAttribute.SIZE, 16);
|
||||
}
|
||||
}
|
||||
));
|
||||
Fonts.put(VisualiserFonts.BadState,
|
||||
new Font(
|
||||
new HashMap<TextAttribute, Object>() {
|
||||
{
|
||||
put(TextAttribute.FAMILY, "Times New Roman");
|
||||
put(TextAttribute.FOREGROUND, getBadFontColor());
|
||||
put(TextAttribute.SIZE, 16);
|
||||
}
|
||||
}
|
||||
));
|
||||
Fonts.put(VisualiserFonts.BlueState,
|
||||
new Font(
|
||||
new HashMap<TextAttribute, Object>() {
|
||||
{
|
||||
put(TextAttribute.FAMILY, "Times New Roman");
|
||||
put(TextAttribute.FOREGROUND, getHyperlinkFontColor());
|
||||
put(TextAttribute.SIZE, 16);
|
||||
}
|
||||
}
|
||||
));
|
||||
Fonts.put(VisualiserFonts.Fatal,
|
||||
new Font(
|
||||
new HashMap<TextAttribute, Object>() {
|
||||
{
|
||||
put(TextAttribute.FAMILY, "Times New Roman");
|
||||
put(TextAttribute.FOREGROUND, getFatalFontColor());
|
||||
put(TextAttribute.SIZE, 16);
|
||||
}
|
||||
}
|
||||
));
|
||||
Fonts.put(VisualiserFonts.UnknownState,
|
||||
new Font(
|
||||
new HashMap<TextAttribute, Object>() {
|
||||
{
|
||||
put(TextAttribute.FAMILY, "Times New Roman");
|
||||
put(TextAttribute.FOREGROUND, getUnknownFontColor());
|
||||
put(TextAttribute.SIZE, 16);
|
||||
}
|
||||
}
|
||||
));
|
||||
Fonts.put(VisualiserFonts.Hyperlink,
|
||||
new Font(
|
||||
new HashMap<TextAttribute, Object>() {
|
||||
{
|
||||
put(TextAttribute.FAMILY, MONOSPACED);
|
||||
put(TextAttribute.FOREGROUND, getHyperlinkFontColor());
|
||||
put(TextAttribute.SIZE, 18);
|
||||
put(TextAttribute.WEIGHT, TextAttribute.WEIGHT_BOLD);
|
||||
put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);
|
||||
}
|
||||
}
|
||||
));
|
||||
Fonts.put(VisualiserFonts.ProgressState,
|
||||
new Font(
|
||||
new HashMap<TextAttribute, Object>() {
|
||||
{
|
||||
put(TextAttribute.FAMILY, "Times New Roman");
|
||||
put(TextAttribute.FOREGROUND, getProgressFontColor());
|
||||
put(TextAttribute.SIZE, 16);
|
||||
}
|
||||
}
|
||||
));
|
||||
Fonts.put(VisualiserFonts.Disabled, new Font(
|
||||
new HashMap<TextAttribute, Object>() {
|
||||
{
|
||||
put(TextAttribute.FAMILY, MONOSPACED);
|
||||
put(TextAttribute.BACKGROUND, Color.lightGray);
|
||||
put(TextAttribute.FOREGROUND, Color.lightGray);
|
||||
put(TextAttribute.SIZE, 18);
|
||||
put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);
|
||||
}
|
||||
}
|
||||
));
|
||||
Fonts.put(VisualiserFonts.Distribution,
|
||||
new Font(
|
||||
new HashMap<TextAttribute, Object>() {
|
||||
{
|
||||
put(TextAttribute.FAMILY, MONOSPACED);
|
||||
put(TextAttribute.SIZE, 16);
|
||||
}
|
||||
}
|
||||
)
|
||||
);
|
||||
Fonts.put(VisualiserFonts.TreePlain, new Font("Times New Roman", Font.PLAIN, 16));
|
||||
Fonts.put(VisualiserFonts.TreeItalic, new Font("Times New Roman", Font.ITALIC, 16));
|
||||
Fonts.put(VisualiserFonts.TreeBold, new Font("Times New Roman", Font.BOLD, 16));
|
||||
Fonts.put(VisualiserFonts.TreeBoldItalic, new Font("Times New Roman", Font.BOLD|Font.ITALIC, 16));
|
||||
Fonts.put(VisualiserFonts.Menu, new Font("Times New Roman", Font.ITALIC, 16));
|
||||
Fonts.put(VisualiserFonts.NewVersion, new Font(
|
||||
new HashMap<TextAttribute, Object>() {
|
||||
{
|
||||
put(TextAttribute.FAMILY, "Times New Roman");
|
||||
put(TextAttribute.FOREGROUND, Color.BLACK);
|
||||
put(TextAttribute.BACKGROUND, Color.YELLOW);
|
||||
put(TextAttribute.SIZE, 16);
|
||||
}
|
||||
}
|
||||
|
||||
));
|
||||
//</editor-fold>
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
}
|
||||
}
|
||||
protected abstract String getEditorThemePath();
|
||||
protected abstract String getForegroundHex();
|
||||
protected abstract String getBackgroundHex();
|
||||
protected abstract String getSelectionBackgroundHex();
|
||||
protected abstract String getTreeBackgroundHex();
|
||||
protected abstract String getBarForegroundHex();
|
||||
protected abstract String getBarBackgroundHex();
|
||||
protected abstract String getTableBackgroundHex();
|
||||
protected abstract Color getGoodFontColor();
|
||||
protected abstract Color getReadyFontColor2();
|
||||
protected abstract Color getProgressFontColor();
|
||||
protected abstract Color getBadFontColor();
|
||||
protected abstract Color getFatalFontColor();
|
||||
protected abstract Color getUnknownFontColor();
|
||||
protected abstract Color getHyperlinkFontColor(); //-
|
||||
//если использовать один и тот же объект на все едиторы пявляются странности
|
||||
//значит при применении выделяем новый экземпляр.
|
||||
public Theme getEditorTheme() {
|
||||
Theme res = null;
|
||||
try {
|
||||
res = Theme.load(getClass().getResourceAsStream(getEditorThemePath()));
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package _VisualDVM.Syntax;
|
||||
public enum VisualiserThemeName {
|
||||
Light,
|
||||
Dark
|
||||
}
|
||||
Reference in New Issue
Block a user