рефакторинг. переносил текущие объекты в другое место
This commit is contained in:
@@ -15,7 +15,7 @@ import java.awt.event.KeyAdapter;
|
||||
import java.awt.event.KeyEvent;
|
||||
public class VersionsTree extends DataTree {
|
||||
public VersionsTree() {
|
||||
super(Current.getRoot().node);
|
||||
super(Global.mainModule.getRoot().node);
|
||||
SelectCurrentProject();
|
||||
this.addKeyListener(new KeyAdapter() {
|
||||
@Override
|
||||
@@ -25,8 +25,8 @@ public class VersionsTree extends DataTree {
|
||||
Pass.passes.get(PassCode.DeleteVersion).Do();
|
||||
break;
|
||||
case KeyEvent.VK_ENTER:
|
||||
if (Current.HasVersion())
|
||||
Pass.passes.get(PassCode.OpenCurrentProject).Do(Current.getVersion());
|
||||
if (Global.mainModule.HasVersion())
|
||||
Pass.passes.get(PassCode.OpenCurrentProject).Do(Global.mainModule.getVersion());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -41,7 +41,7 @@ public class VersionsTree extends DataTree {
|
||||
return Current.Version;
|
||||
}
|
||||
public void SelectCurrentProject() {
|
||||
setSelectionPath(new TreePath(Current.getProject().node.getPath()));
|
||||
setSelectionPath(new TreePath(Global.mainModule.getProject().node.getPath()));
|
||||
}
|
||||
@Override
|
||||
protected GraphMenu createMenu() {
|
||||
@@ -51,7 +51,7 @@ public class VersionsTree extends DataTree {
|
||||
public void LeftMouseAction1() {
|
||||
if (Global.versions_multiselection) {
|
||||
// только если есть режим выбора версий.
|
||||
Object element = Current_.get(getCurrent());
|
||||
Object element = Global.mainModule.get(getCurrent());
|
||||
if ((element instanceof Selectable)) {
|
||||
((Selectable) element).SwitchSelection();
|
||||
updateUI();
|
||||
@@ -60,7 +60,7 @@ public class VersionsTree extends DataTree {
|
||||
}
|
||||
@Override
|
||||
public void LeftMouseAction2() {
|
||||
Pass.passes.get(PassCode.OpenCurrentProject).Do(Current.getVersion());
|
||||
Pass.passes.get(PassCode.OpenCurrentProject).Do(Global.mainModule.getVersion());
|
||||
}
|
||||
@Override
|
||||
protected int getStartLine() {
|
||||
|
||||
@@ -24,9 +24,9 @@ public class VersionsTreeCellRenderer extends StyledTreeCellRenderer {
|
||||
setIcon(((Selectable) o).GetSelectionIcon());
|
||||
} else {
|
||||
URL imageUrl = null;
|
||||
boolean current = Current.HasProject() && version.Home.equals(Current.getProject().Home);
|
||||
boolean current = Global.mainModule.HasProject() && version.Home.equals(Global.mainModule.getProject().Home);
|
||||
String type_image_key = "";
|
||||
if (version.Home.equals(Current.getRoot().Home))
|
||||
if (version.Home.equals(Global.mainModule.getRoot().Home))
|
||||
type_image_key = "Root";
|
||||
else if (version.IsMCopy())
|
||||
type_image_key = "M";
|
||||
|
||||
@@ -435,8 +435,8 @@ public class db_project_info extends DBObject {
|
||||
db.ResetAI(MessageWarning.class);
|
||||
db.ResetAI(MessageRecommendation.class);
|
||||
//-
|
||||
Current_.set(Current.Function, null);
|
||||
Current_.set(Current.SelectedFunction, null);
|
||||
Global.mainModule.set(Current.Function, null);
|
||||
Global.mainModule.set(Current.SelectedFunction, null);
|
||||
}
|
||||
public void CleanVersions() throws Exception {
|
||||
node.removeAllChildren();
|
||||
@@ -660,7 +660,7 @@ public class db_project_info extends DBObject {
|
||||
}
|
||||
public Vector<DBProjectFile> getFilesForComparsion() {
|
||||
Vector<DBProjectFile> res = new Vector<>();
|
||||
if (Current.HasProject() && this.Home.equals(Current.getProject().Home)) {
|
||||
if (Global.mainModule.HasProject() && this.Home.equals(Global.mainModule.getProject().Home)) {
|
||||
//
|
||||
res = db.files.Data.values().stream().filter(file -> !file.state.equals(FileState.Excluded)).collect(Collectors.toCollection(Vector::new));
|
||||
} else {
|
||||
@@ -1069,7 +1069,7 @@ public class db_project_info extends DBObject {
|
||||
target.Close();
|
||||
}
|
||||
public void undoLastTransformation() throws Exception {
|
||||
Current_.set(Current.Version, null);
|
||||
Global.mainModule.set(Current.Version, null);
|
||||
//---
|
||||
UI.getVersionsWindow().getVersionsForm().getTree().RemoveNode(last_version.node);
|
||||
Utils.forceDeleteWithCheck(last_version.Home);
|
||||
@@ -1498,8 +1498,8 @@ public class db_project_info extends DBObject {
|
||||
}
|
||||
public String getLocalName() {
|
||||
//требует отображения рута. без него работать не будет.
|
||||
if (Current.HasRoot())
|
||||
return Home.getAbsolutePath().substring(Current.getRoot().Home.getParentFile().getAbsolutePath().length() + 1);
|
||||
if (Global.mainModule.HasRoot())
|
||||
return Home.getAbsolutePath().substring(Global.mainModule.getRoot().Home.getParentFile().getAbsolutePath().length() + 1);
|
||||
else return Home.getName();
|
||||
}
|
||||
public void SelectAllFiles(boolean b) {
|
||||
|
||||
Reference in New Issue
Block a user