no message
This commit is contained in:
@@ -3,30 +3,30 @@ import Common.Database.Objects.iDBObject;
|
||||
import Common.Utils.TextLog;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
public interface CurrentAnchestor {
|
||||
public interface Current_ {
|
||||
default String getDescription(){
|
||||
return "?";
|
||||
}
|
||||
LinkedHashMap<CurrentAnchestor, Object> objects = new LinkedHashMap<>();
|
||||
static Object get(CurrentAnchestor name) {
|
||||
LinkedHashMap<Current_, Object> objects = new LinkedHashMap<>();
|
||||
static Object get(Current_ name) {
|
||||
if (!objects.containsKey(name))
|
||||
objects.put(name,null);
|
||||
return objects.get(name);
|
||||
}
|
||||
static Object set(CurrentAnchestor name, Object object) {
|
||||
static Object set(Current_ name, Object object) {
|
||||
if (objects.containsKey(name))
|
||||
objects.replace(name, object);
|
||||
else objects.put(name, object);
|
||||
return object;
|
||||
}
|
||||
static boolean Check(TextLog Log, CurrentAnchestor... names) {
|
||||
for (CurrentAnchestor name : names)
|
||||
if (CurrentAnchestor.get(name) == null)
|
||||
static boolean Check(TextLog Log, Current_... names) {
|
||||
for (Current_ name : names)
|
||||
if (Current_.get(name) == null)
|
||||
Log.Writeln_(name.getDescription() + " не выбран(а)");
|
||||
return Log.isEmpty();
|
||||
}
|
||||
//применять только для наследников iDBObject
|
||||
static boolean matchCurrentID(CurrentAnchestor name, int id) {
|
||||
return (CurrentAnchestor.get(name) != null) && (((iDBObject) CurrentAnchestor.get(name)).id == id);
|
||||
static boolean matchCurrentID(Current_ name, int id) {
|
||||
return (Current_.get(name) != null) && (((iDBObject) Current_.get(name)).id == id);
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
import _VisualDVM.Repository.RepositoryRefuseException;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.PassCode;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -278,5 +278,5 @@ public abstract class Database {
|
||||
dataSet.RestoreLastSelections();
|
||||
}
|
||||
//---
|
||||
public abstract PassCode_2021 getSynchronizePassCode(); //если бд есть на сервере.
|
||||
public abstract PassCode getSynchronizePassCode(); //если бд есть на сервере.
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Database.Tables;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Current_;
|
||||
import Common.Visual.DataSetFilter;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
@@ -240,23 +240,23 @@ public class DataSet<K, D extends DBObject> extends DataSetAnchestor {
|
||||
return true;
|
||||
}
|
||||
//------------------------------------------------------------------------------------
|
||||
public CurrentAnchestor CurrentName() {
|
||||
public Current_ CurrentName() {
|
||||
return null;
|
||||
}
|
||||
public boolean CheckCurrent(TextLog log) {
|
||||
return CurrentAnchestor.Check(log, CurrentName());
|
||||
return Current_.Check(log, CurrentName());
|
||||
}
|
||||
public boolean hasCurrent() {
|
||||
return CurrentAnchestor.get(CurrentName()) != null;
|
||||
return Current_.get(CurrentName()) != null;
|
||||
}
|
||||
public void dropCurrent() {
|
||||
CurrentAnchestor.set(CurrentName(), null);
|
||||
Current_.set(CurrentName(), null);
|
||||
}
|
||||
public D getCurrent() {
|
||||
return (D) CurrentAnchestor.get(CurrentName());
|
||||
return (D) Current_.get(CurrentName());
|
||||
}
|
||||
public void setCurrent(D o) {
|
||||
CurrentAnchestor.set(CurrentName(), o);
|
||||
Current_.set(CurrentName(), o);
|
||||
}
|
||||
public Vector<D> getCheckedOrCurrent() {
|
||||
Vector<D> res = new Vector<>();
|
||||
|
||||
@@ -3,7 +3,7 @@ import Common.Database.SQLITE.SQLiteDatabase;
|
||||
import Common.Database.Objects.DBForm.FormsDBTable;
|
||||
import _VisualDVM.GlobalData.Grid.TablesVisualDatasDBTable;
|
||||
import _VisualDVM.GlobalData.Splitter.SplittersDBTable;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.PassCode;
|
||||
|
||||
import java.io.File;
|
||||
public class VisualiserDatabase extends SQLiteDatabase {
|
||||
@@ -20,7 +20,7 @@ public class VisualiserDatabase extends SQLiteDatabase {
|
||||
addTable(splitters = new SplittersDBTable());
|
||||
}
|
||||
@Override
|
||||
public PassCode_2021 getSynchronizePassCode() {
|
||||
public PassCode getSynchronizePassCode() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
3
src/Common/Utils/Passes/PassCode_.java
Normal file
3
src/Common/Utils/Passes/PassCode_.java
Normal file
@@ -0,0 +1,3 @@
|
||||
package Common.Utils.Passes;
|
||||
public interface PassCode_ {
|
||||
}
|
||||
3
src/Common/Utils/Passes/Pass_.java
Normal file
3
src/Common/Utils/Passes/Pass_.java
Normal file
@@ -0,0 +1,3 @@
|
||||
package Common.Utils.Passes;
|
||||
public class Pass_ {
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Current_;
|
||||
|
||||
import java.awt.*;
|
||||
public class ControlWithCurrentForm<C extends Component> extends ControlForm<C> {
|
||||
@@ -7,7 +7,7 @@ public class ControlWithCurrentForm<C extends Component> extends ControlForm<C>
|
||||
super(class_in);
|
||||
}
|
||||
//-
|
||||
public CurrentAnchestor CurrentName() {
|
||||
public Current_ CurrentName() {
|
||||
return null;
|
||||
}
|
||||
public void ShowCurrentObject() throws Exception {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package Common.Visual;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Current_;
|
||||
public interface DataControl_OLD {
|
||||
//todo скорее всего устареет.
|
||||
default CurrentAnchestor getCurrent() {
|
||||
default Current_ getCurrent() {
|
||||
return null;
|
||||
}
|
||||
//-?
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package Common.Visual;
|
||||
import Common.CommonConstants;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Current_;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.DBTable;
|
||||
@@ -60,7 +60,7 @@ public class DataSetControlForm extends ControlWithCurrentForm<DataTable> {
|
||||
return dataSource;
|
||||
}
|
||||
@Override
|
||||
public CurrentAnchestor CurrentName() {
|
||||
public Current_ CurrentName() {
|
||||
return getDataSource().CurrentName();
|
||||
}
|
||||
public void SaveColumns() {
|
||||
|
||||
@@ -2,7 +2,7 @@ package Common.Visual.Menus;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common.Visual.Controls.MenuBarButton;
|
||||
import _VisualDVM.Visual.Menus.VisualiserMenuBar;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.PassCode;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
@@ -15,7 +15,7 @@ public class DataMenuBar extends VisualiserMenuBar {
|
||||
public ActionListener selectAllListener = null;
|
||||
public ActionListener unselectAllListener = null;
|
||||
//-
|
||||
public DataMenuBar(String dataName, PassCode_2021... passes) {
|
||||
public DataMenuBar(String dataName, PassCode... passes) {
|
||||
// Font font = Current.getTheme().Fonts.get(VisualiserFonts.TreeBoldItalic).deriveFont(12.0F);
|
||||
add(new JLabel(dataName + " : "));
|
||||
add(countLabel = new JLabel("?"));
|
||||
|
||||
@@ -4,7 +4,7 @@ import _VisualDVM.ServerObjectsCache.VisualCaches;
|
||||
import _VisualDVM.TestingSystem.Common.Configuration.Configuration;
|
||||
import _VisualDVM.TestingSystem.Common.TestingServer;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
import Visual_DVM_2021.Passes.Pass;
|
||||
import Visual_DVM_2021.Passes.Server.EditServerObject;
|
||||
public class ConfigurationAutoSwitcher extends DBObjectEditor<Configuration> {
|
||||
@Override
|
||||
@@ -12,7 +12,7 @@ public class ConfigurationAutoSwitcher extends DBObjectEditor<Configuration> {
|
||||
value.SwitchAuto();
|
||||
setIcon(value.GetAutoIcon());
|
||||
///-
|
||||
Pass_2021 pass = new EditServerObject<TestingServer,Configuration> (Global.testingServer, Configuration.class){
|
||||
Pass pass = new EditServerObject<TestingServer,Configuration> (Global.testingServer, Configuration.class){
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = (Configuration) args[0];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Trees;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Current_;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.DataControl_OLD;
|
||||
|
||||
@@ -11,7 +11,7 @@ public class DataTree extends StyledTree implements DataControl_OLD {
|
||||
}
|
||||
public void ChangeCurrentObject(DefaultMutableTreeNode node) {
|
||||
if (getCurrent() != null)
|
||||
CurrentAnchestor.set(getCurrent(), node.getUserObject());
|
||||
Current_.set(getCurrent(), node.getUserObject());
|
||||
}
|
||||
@Override
|
||||
public void ShowCurrentObject() throws Exception {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Trees;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Current_;
|
||||
import Common.Visual.Selectable;
|
||||
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
@@ -9,7 +9,7 @@ public class SelectableTree extends DataTree {
|
||||
}
|
||||
@Override
|
||||
public void LeftMouseAction1() {
|
||||
Object element = CurrentAnchestor.get(getCurrent());
|
||||
Object element = Current_.get(getCurrent());
|
||||
if ((element instanceof Selectable)) {
|
||||
((Selectable) element).SwitchSelection();
|
||||
updateUI();
|
||||
|
||||
Reference in New Issue
Block a user