Сворачивание левой панели графов файла

This commit is contained in:
2024-03-17 01:55:10 +03:00
parent 4e611e4333
commit 2a2000147c
15 changed files with 216 additions and 83 deletions

View File

@@ -58,4 +58,8 @@ public interface FileWindow extends VisualizerForm{
void ShowErrorsCount();
void ShowNotesCount();
void ShowRecommendationsCount();
//--
void CollapseGraphs();
void ExpandGraphs();
void SwitchGraphs();
}

View File

@@ -66,14 +66,13 @@ public class FileForm implements FileWindow, FormWithSplitters {
private TreeForm arraysForm;
//-
private SPFEditor Body = null; //времянка? не очень красиво.
FileMenuBar menuBar = null;
//-
public FileForm(DBProjectFile file_in) {
LoadSplitters();
//--
MessageWarning.filterValue = "";
MessageError.filterValue = "";
MessageNote.filterValue="";
MessageNote.filterValue = "";
//-
file = file_in;
file.father.db.notes.mountUI(notesPanel);
@@ -90,13 +89,17 @@ public class FileForm implements FileWindow, FormWithSplitters {
ShowGCOVLog();
ShowAllAnalyses();
Body.addCaretListener(ce -> ShowCaretInfo());
editorPanel.add(menuBar = new FileMenuBar(Body), BorderLayout.NORTH);
editorPanel.add(UI.fileMenuBar = new FileMenuBar(Body), BorderLayout.NORTH);
ShowCaretInfo();
Body.requestFocus();
RefreshTabsNames();
menuBar.sToGo.addChangeListener(e -> Body.gotoLine((Integer) menuBar.sToGo.getValue()));
UI.fileMenuBar.sToGo.addChangeListener(e -> Body.gotoLine((Integer) UI.fileMenuBar.sToGo.getValue()));
ShowProperties();
Pass_2021.passes.get(PassCode_2021.Save).setControlsEnabled(false);
//-
UI.fileMenuBar.LeftECButton.Switch(Global.properties.collapseFileGraphs);
if (Global.properties.collapseFileGraphs)
CollapseGraphs();
}
@Override
public void ShowLanguage() {
@@ -116,11 +119,11 @@ public class FileForm implements FileWindow, FormWithSplitters {
Body.setSyntaxEditingStyle(file.languageName.getStyleKey());
Body.setCodeFoldingEnabled(true);
Body.switching_language = false;
menuBar.ShowLanguage();
UI.fileMenuBar.ShowLanguage();
}
@Override
public void ShowType() {
menuBar.ShowType();
UI.fileMenuBar.ShowType();
}
@Override
public void ShowStyle() {
@@ -143,7 +146,7 @@ public class FileForm implements FileWindow, FormWithSplitters {
}
}
Body.switching_language = false;
menuBar.ShowStyle();
UI.fileMenuBar.ShowStyle();
}
@Override
public SPFEditorInterface getEditor() {
@@ -295,12 +298,12 @@ public class FileForm implements FileWindow, FormWithSplitters {
int new_current_line = Body.getCurrentLine();
boolean line_changed = (new_current_line != current_file_line);
current_file_line = new_current_line;
menuBar.sToGo.setModel(new SpinnerNumberModel(current_file_line,
UI.fileMenuBar.sToGo.setModel(new SpinnerNumberModel(current_file_line,
1, Body.getLineCount(), 1
));
//-
menuBar.ShowLinesCount();
menuBar.CurrentSymbolLabel.setText(String.valueOf(Body.getCurrentSymbol()));
UI.fileMenuBar.ShowLinesCount();
UI.fileMenuBar.CurrentSymbolLabel.setText(String.valueOf(Body.getCurrentSymbol()));
//если выделяем строку из графа, то тоже надо отключиьт события.
//чтобы по ней не начался поиск.
if (events_on && line_changed) {
@@ -359,4 +362,32 @@ public class FileForm implements FileWindow, FormWithSplitters {
public JPanel getContent() {
return content;
}
//--
@Override
public void CollapseGraphs() {
UI.Clear(graphsBackground);
SC12.setDividerLocation(0);
SC12.setDividerSize(0);
graphsBackground.revalidate();
graphsBackground.repaint();
}
@Override
public void ExpandGraphs() {
UI.Clear(graphsBackground);
graphsBackground.add(graphsTabs);
SC12.setDividerLocation(200);
SC12.setDividerSize(3);
graphsBackground.revalidate();
graphsBackground.repaint();
}
@Override
public void SwitchGraphs() {
if (Global.properties.collapseFileGraphs)
ExpandGraphs();
else
CollapseGraphs();
Global.properties.collapseFileGraphs =!Global.properties.collapseFileGraphs;
Global.properties.Update();
UI.fileMenuBar.LeftECButton.Switch(Global.properties.collapseFileGraphs);
}
}

View File

@@ -109,9 +109,8 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
);
//--->>>
RefreshTabsNames();
if (Global.properties.collapseCredentials) {
if (Global.properties.collapseCredentials)
CollapseCredentials();
}
//-
SC50.setLeftComponent(dvmTestingRunMaster.getContent());
SC50.setRightComponent(dvmTestingRunSlave.getContent());
@@ -258,37 +257,6 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
sapforPackageTreeMaster.DoComparePass();
testingTabs.setSelectedIndex(3);
}
@Override
public void CollapseCredentials() {
UI.Clear(credentialsPanel);
credentialsPanel.add(UI.credentialsBar);
SC71.setDividerLocation(30);
SC71.setDividerSize(0);
//SC71.setEnabled(false);
credentialsPanel.revalidate();
credentialsPanel.repaint();
}
@Override
public void ExpandCredentials() {
UI.Clear(credentialsPanel);
credentialsPanel.add(SC18);
SC71.setDividerLocation(200);
//SC71.setEnabled(true);
SC71.setDividerSize(3);
credentialsPanel.revalidate();
credentialsPanel.repaint();
}
@Override
public void SwitchCredentials(boolean flag) {
if (flag) {
ExpandCredentials();
} else {
CollapseCredentials();
}
Global.properties.collapseCredentials = !flag;
Global.properties.Update();
}
public void RestoreLastCredentials() {
Credentials credentials = (Credentials) Current.get(Current.Credentials);
if (credentials.machine_id != Constants.Nan) {
@@ -331,4 +299,34 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
}
}
}
@Override
public void CollapseCredentials() {
UI.Clear(credentialsPanel);
credentialsPanel.add(UI.credentialsBar);
SC71.setDividerLocation(30);
SC71.setDividerSize(0);
//SC71.setEnabled(false);
credentialsPanel.revalidate();
credentialsPanel.repaint();
}
@Override
public void ExpandCredentials() {
UI.Clear(credentialsPanel);
credentialsPanel.add(SC18);
SC71.setDividerLocation(200);
//SC71.setEnabled(true);
SC71.setDividerSize(3);
credentialsPanel.revalidate();
credentialsPanel.repaint();
}
@Override
public void SwitchCredentials(boolean flag) {
if (flag) {
ExpandCredentials();
} else {
CollapseCredentials();
}
Global.properties.collapseCredentials = !flag;
Global.properties.Update();
}
}

View File

@@ -1,11 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="Visual_DVM_2021.UI.Main.buffer_">
<grid id="27dc6" layout-manager="BorderLayout" hgap="0" vgap="0">
<grid id="27dc6" binding="panel1" default-binding="true" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<xy x="20" y="20" width="932" height="766"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
<children>
<toolbar id="1582f">
<constraints border-constraint="North"/>
<properties>
<orientation value="1"/>
</properties>
<border type="none"/>
<children/>
</toolbar>
</children>
</grid>
</form>

View File

@@ -1,5 +1,6 @@
package Visual_DVM_2021.UI.Main;
import javax.swing.*;
public class buffer_ {
private JPanel panel1;
//Скачать пакет задач
}