Перенос.

This commit is contained in:
2023-09-17 22:13:42 +03:00
parent dd2e0ca7e0
commit 629d8b8477
1239 changed files with 61161 additions and 1 deletions

View File

@@ -0,0 +1,143 @@
<?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.AnalysisForm">
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="744" height="530"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="da14d" binding="SCX">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<dividerLocation value="250"/>
<dividerSize value="0"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="5d21" layout-manager="GridLayoutManager" row-count="8" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<maximumSize width="-1" height="250"/>
<minimumSize width="-1" height="250"/>
<preferredSize width="-1" height="250"/>
</properties>
<border type="none"/>
<children>
<component id="15930" class="javax.swing.JLabel" binding="l_lines">
<constraints>
<grid row="2" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<horizontalAlignment value="10"/>
<icon value="icons/Lines.png"/>
<text value="Label"/>
</properties>
</component>
<component id="63feb" class="javax.swing.JLabel" binding="l_loops">
<constraints>
<grid row="3" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<icon value="icons/Loop.png"/>
<text value="Label"/>
</properties>
</component>
<component id="aa1a6" class="javax.swing.JLabel" binding="l_arrays">
<constraints>
<grid row="4" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<icon value="icons/Arrays.png"/>
<text value=" Label"/>
</properties>
</component>
<component id="a2d2e" class="javax.swing.JLabel" binding="l_functions">
<constraints>
<grid row="5" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<icon value="icons/Function.png"/>
<text value="Label"/>
</properties>
</component>
<component id="6500d" class="javax.swing.JLabel" binding="l_spf_dirs">
<constraints>
<grid row="6" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<icon value="icons/Menu/Privates.png"/>
<text value="Label"/>
</properties>
</component>
<component id="375fa" class="javax.swing.JLabel" binding="l_dvm_dirs">
<constraints>
<grid row="7" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<icon value="icons/Menu/Dvm.png"/>
<text value="Label"/>
</properties>
</component>
<component id="acfc" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="9" fill="0" indent="1" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="18" style="1"/>
<text value="Данные по проекту"/>
</properties>
</component>
<component id="c6963" class="javax.swing.JLabel" binding="l_maxdim">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<horizontalAlignment value="10"/>
<icon value="icons/Dimensions.png"/>
<text value="Наибольшая размерность DVM-шаблона:"/>
</properties>
</component>
</children>
</grid>
<grid id="aa66b" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="-1" height="100"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="b285f" binding="regionsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
</form>

View File

@@ -0,0 +1,65 @@
package Visual_DVM_2021.UI.Main;
import Common.Current;
import Visual_DVM_2021.UI.Interface.AnalysisWindow;
import javax.swing.*;
public class AnalysisForm implements AnalysisWindow {
private JSplitPane SCX;
private JPanel content;
private JLabel l_lines;
private JLabel l_loops;
private JLabel l_arrays;
private JLabel l_functions;
private JLabel l_spf_dirs;
private JLabel l_dvm_dirs;
private JLabel l_maxdim;
private JPanel regionsPanel;
public AnalysisForm() {
LoadSplitters();
Current.getProject().parallelRegions.mountUI(regionsPanel);
}
@Override
public JPanel getContent() {
return content;
}
@Override
public void ShowProjectMaxDim() {
l_maxdim.setText("Наибольшая размерность DVM-шаблона: " + Current.getProject().maxdim);
}
@Override
public void ShowNoProjectMaxDim() {
l_maxdim.setText("Наибольшая размерность DVM-шаблона: ?");
}
@Override
public void ShowMetrics() {
l_lines.setText("Общее количество строк кода: " + Current.getProject().LinesCount());
l_spf_dirs.setText("Всего объявлено SPF директив: " + Current.getProject().SPFCount());
l_dvm_dirs.setText("Всего объявлено DVM директив: " + Current.getProject().DVMCount());
}
@Override
public void ShowNoMetrics() {
l_lines.setText("Общее количество строк кода: ?");
l_spf_dirs.setText("Всего объявлено SPF директив: ?");
l_dvm_dirs.setText("Всего объявлено DVM директив: ?");
}
@Override
public void ShowRegions() {
Current.getProject().parallelRegions.ShowUI();
}
@Override
public void ShowNoRegions() {
Current.getProject().parallelRegions.ClearUI();
}
@Override
public void ShowLoopsCount() {
l_loops.setText("Общее количество циклов: " + Current.getProject().LoopsCount());
}
@Override
public void ShowFunctionsCount() {
l_functions.setText("Всего объявлено процедур: " + Current.getProject().FunctionsCount());
}
@Override
public void ShowArraysCount() {
l_arrays.setText(" Всего объявлено массивов: " + Current.getProject().ArraysCount());
}
}

View File

@@ -0,0 +1,166 @@
<?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.ArraysForm">
<grid id="27dc6" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<xy x="20" y="20" width="723" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<toolbar id="7e722">
<constraints border-constraint="North"/>
<properties>
<floatable value="false"/>
</properties>
<border type="none"/>
<children>
<component id="821d4" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="14" style="2"/>
<foreground color="-16777216"/>
<text value="имя "/>
<toolTipText value="по имени"/>
</properties>
</component>
<component id="9113a" class="javax.swing.JTextField" binding="filterName" custom-create="true">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="0"/>
<maximumSize width="75" height="25"/>
<minimumSize width="75" height="25"/>
<preferredSize width="75" height="25"/>
<text value=""/>
</properties>
</component>
<component id="6c0cc" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="14" style="2"/>
<foreground color="-16777216"/>
<text value="обл. описания "/>
<toolTipText value="по области описания"/>
</properties>
</component>
<component id="8e8ac" class="javax.swing.JTextField" binding="filterLocationName" custom-create="true">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="0"/>
<maximumSize width="75" height="25"/>
<minimumSize width="75" height="25"/>
<preferredSize width="75" height="25"/>
</properties>
</component>
<component id="d8df6" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="14" style="2"/>
<foreground color="-16777216"/>
<text value=" : "/>
</properties>
</component>
<component id="5c030" class="javax.swing.JTextField" binding="filterLocation" custom-create="true">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="0"/>
<maximumSize width="75" height="25"/>
<minimumSize width="75" height="25"/>
<preferredSize width="75" height="25"/>
</properties>
</component>
<component id="d0c01" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="14" style="2"/>
<foreground color="-16777216"/>
<text value="файл "/>
<toolTipText value="по файлу объявления"/>
</properties>
</component>
<component id="7e2df" class="javax.swing.JTextField" binding="filterFile" custom-create="true">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="0"/>
<maximumSize width="75" height="25"/>
<minimumSize width="75" height="25"/>
<preferredSize width="75" height="25"/>
</properties>
</component>
<component id="f7cde" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<foreground color="-16777216"/>
<text value="обл. распараллеливания"/>
<toolTipText value="по области распаралеливания"/>
</properties>
</component>
<component id="5ddd8" class="javax.swing.JTextField" binding="filterRegion" custom-create="true">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="0"/>
<maximumSize width="75" height="25"/>
<minimumSize width="75" height="25"/>
<preferredSize width="75" height="25"/>
</properties>
</component>
</children>
</toolbar>
<grid id="611ac" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children>
<splitpane id="f86e7" binding="SC8">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="500"/>
<dividerSize value="3"/>
</properties>
<border type="none"/>
<children>
<grid id="29e5b" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="200" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="2a8de" binding="arraysPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="6e1c1" binding="savedArraysBackground" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="200" height="150"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="1ca4e" binding="savedArraysPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
</children>
</grid>
</form>

View File

@@ -0,0 +1,134 @@
package Visual_DVM_2021.UI.Main;
import Common.Current;
import Common.UI.TextField.StyledTextField;
import ProjectData.SapforData.Arrays.ProjectArray;
import Visual_DVM_2021.UI.Interface.ArraysWindow;
import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
public class ArraysForm implements ArraysWindow {
private JPanel content;
private JPanel arraysPanel;
private JPanel savedArraysPanel;
public JSplitPane SC8;
private JTextField filterName;
private JLabel arraysMatchesLabel;
private JTextField filterLocationName;
private JTextField filterLocation;
private JTextField filterFile;
private JTextField filterRegion;
private JPanel savedArraysBackground;
public ArraysForm(){
LoadSplitters();
Current.getProject().declaratedArrays.mountUI(arraysPanel);
Current.getProject().db.savedArrays.mountUI(savedArraysPanel);
//--
filterName.setText(ProjectArray.filterName);
filterName.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
ProjectArray.filterName = filterName.getText();
ShowArrays();
}
@Override
public void removeUpdate(DocumentEvent e) {
ProjectArray.filterName = filterName.getText();
ShowArrays();
}
@Override
public void changedUpdate(DocumentEvent e) {
}
});
//-
filterLocation.setText(ProjectArray.filterLocation);
filterLocation.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
ProjectArray.filterLocation = filterLocation.getText();
ShowArrays();
}
@Override
public void removeUpdate(DocumentEvent e) {
ProjectArray.filterLocation = filterLocation.getText();
ShowArrays();
}
@Override
public void changedUpdate(DocumentEvent e) {
}
});
//-
filterLocationName.setText(ProjectArray.filterLocationName);
filterLocationName.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
ProjectArray.filterLocationName = filterLocationName.getText();
ShowArrays();
}
@Override
public void removeUpdate(DocumentEvent e) {
ProjectArray.filterLocationName = filterLocationName.getText();
ShowArrays();
}
@Override
public void changedUpdate(DocumentEvent e) {
}
});
//-
filterFile.setText(ProjectArray.filterFile);
filterFile.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
ProjectArray.filterFile = filterFile.getText();
ShowArrays();
}
@Override
public void removeUpdate(DocumentEvent e) {
ProjectArray.filterFile = filterFile.getText();
ShowArrays();
}
@Override
public void changedUpdate(DocumentEvent e) {
}
});
//-
filterRegion.setText(ProjectArray.filterRegion);
filterRegion.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
ProjectArray.filterRegion = filterRegion.getText();
ShowArrays();
}
@Override
public void removeUpdate(DocumentEvent e) {
ProjectArray.filterRegion = filterRegion.getText();
ShowArrays();
}
@Override
public void changedUpdate(DocumentEvent e) {
}
}); }
@Override
public JPanel getContent() {
return content;
}
@Override
public void ShowArrays() {
Current.getProject().declaratedArrays.ShowUI();
Current.getProject().db.savedArrays.ShowUI();
}
@Override
public void ShowNoArrays() {
Current.getProject().declaratedArrays.ClearUI();
Current.getProject().db.savedArrays.ClearUI();
}
private void createUIComponents() {
// TODO: place custom component creation code here
filterName = new StyledTextField();
filterLocationName = new StyledTextField();
filterLocation = new StyledTextField();
filterFile = new StyledTextField();
filterRegion = new StyledTextField();
}
}

View File

@@ -0,0 +1,431 @@
<?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.CallbackForm">
<grid id="27dc6" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<xy x="20" y="20" width="1360" height="574"/>
</constraints>
<properties>
<minimumSize width="-1" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<toolbar id="b57af" binding="accountTools">
<constraints border-constraint="North"/>
<properties>
<floatable value="false"/>
<maximumSize width="396" height="30"/>
<minimumSize width="396" height="30"/>
<preferredSize width="396" height="30"/>
</properties>
<border type="none"/>
<children>
<component id="7f6d2" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="3"/>
<foreground color="-16777216"/>
<text value=" имя пользователя: "/>
</properties>
</component>
<component id="65fb1" class="javax.swing.JLabel" binding="lAccountName">
<constraints/>
<properties>
<font name="Times New Roman" size="18" style="0"/>
<foreground color="-16777216"/>
<text value="Label"/>
</properties>
</component>
<component id="20df1" class="javax.swing.JLabel">
<constraints/>
<properties>
<font style="0"/>
<foreground color="-16777216"/>
<text value=" "/>
</properties>
</component>
<component id="13b74" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="3"/>
<foreground color="-16777216"/>
<text value="адрес: "/>
</properties>
</component>
<component id="9bf2f" class="javax.swing.JLabel" binding="lAccountMail">
<constraints/>
<properties>
<font name="Times New Roman" size="18" style="0"/>
<foreground color="-16777216"/>
<text value="Label"/>
</properties>
</component>
<component id="dc662" class="javax.swing.JLabel">
<constraints/>
<properties>
<font style="0"/>
<foreground color="-16777216"/>
<text value=" "/>
</properties>
</component>
<component id="20d68" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="3"/>
<foreground color="-16777216"/>
<text value="роль: "/>
</properties>
</component>
<component id="db256" class="javax.swing.JLabel" binding="lAccountRole">
<constraints/>
<properties>
<font name="Times New Roman" size="18" style="0"/>
<foreground color="-16777216"/>
<text value="Label"/>
</properties>
</component>
<component id="ac02f" class="javax.swing.JLabel">
<constraints/>
<properties>
<font style="0"/>
<foreground color="-16777216"/>
<text value=" "/>
</properties>
</component>
</children>
</toolbar>
<grid id="3838e" binding="accountPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children>
<splitpane id="11d1a" binding="SC10">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="200"/>
<dividerSize value="3"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="4c636" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<minimumSize width="-1" height="200"/>
</properties>
<border type="none"/>
<children>
<splitpane id="6b542" binding="SCX">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties>
<dividerLocation value="30"/>
<dividerSize value="0"/>
<enabled value="true"/>
<oneTouchExpandable value="false"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="a8d9e" binding="filterFormPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="-1" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<toolbar id="41213">
<constraints border-constraint="Center"/>
<properties>
<floatable value="false"/>
</properties>
<border type="none"/>
<children>
<component id="c248" class="javax.swing.JCheckBox" binding="BugReportsMyOnlyFilter">
<constraints/>
<properties>
<font name="Times New Roman" size="12" style="2"/>
<horizontalAlignment value="10"/>
<icon value="icons/NotPick.png"/>
<maximumSize width="65" height="30"/>
<minimumSize width="65" height="30"/>
<preferredSize width="65" height="30"/>
<selectedIcon value="icons/Pick.png"/>
<text value="свои"/>
<verticalTextPosition value="0"/>
</properties>
</component>
<component id="f2af4" class="javax.swing.JCheckBox" binding="BugReportsOpenedOnly">
<constraints/>
<properties>
<font name="Times New Roman" size="12" style="2"/>
<horizontalAlignment value="10"/>
<icon value="icons/NotPick.png"/>
<maximumSize width="100" height="30"/>
<minimumSize width="100" height="30"/>
<preferredSize width="100" height="30"/>
<selectedIcon value="icons/Pick.png"/>
<text value="открытые"/>
<verticalTextPosition value="0"/>
</properties>
</component>
<component id="94f20" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="14" style="2"/>
<foreground color="-16777216"/>
<text value="bug_"/>
</properties>
</component>
<component id="a9e5" class="javax.swing.JTextField" binding="BugReportsKeyFilter" custom-create="true">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="0"/>
<maximumSize width="75" height="25"/>
<minimumSize width="75" height="25"/>
<preferredSize width="75" height="25"/>
</properties>
</component>
<component id="b937b" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="12" style="2"/>
<foreground color="-16777216"/>
<text value="автор"/>
</properties>
</component>
<component id="4587b" class="javax.swing.JTextField" binding="BugReportsSenderNameFilter" custom-create="true">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="0"/>
<maximumSize width="75" height="25"/>
<minimumSize width="75" height="25"/>
<preferredSize width="75" height="25"/>
</properties>
</component>
<component id="f7f29" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="12" style="2"/>
<foreground color="-16777216"/>
<text value="описание"/>
</properties>
</component>
<component id="26dad" class="javax.swing.JTextField" binding="BugReportsDescriptionFilter" custom-create="true">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="0"/>
<maximumSize width="75" height="25"/>
<minimumSize width="75" height="25"/>
<preferredSize width="75" height="25"/>
</properties>
</component>
<component id="f9296" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="12" style="2"/>
<foreground color="-16777216"/>
<text value="проект"/>
</properties>
</component>
<component id="4c6c3" class="javax.swing.JTextField" binding="BugReportsVersionFilter" custom-create="true">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="0"/>
<maximumSize width="75" height="25"/>
<minimumSize width="75" height="25"/>
<preferredSize width="75" height="25"/>
</properties>
</component>
<component id="fd9e5" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="12" style="2"/>
<foreground color="-16777216"/>
<text value="исполн."/>
</properties>
</component>
<component id="de2e4" class="javax.swing.JTextField" binding="BugReportsExecutorFilter" custom-create="true">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="0"/>
<maximumSize width="75" height="25"/>
<minimumSize width="75" height="25"/>
<preferredSize width="75" height="25"/>
</properties>
</component>
<component id="d5478" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="12" style="2"/>
<foreground color="-16777216"/>
<text value="коммент."/>
</properties>
</component>
<component id="344dc" class="javax.swing.JTextField" binding="BugReportsCommentFilter" custom-create="true">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="0"/>
<maximumSize width="75" height="25"/>
<minimumSize width="75" height="25"/>
<preferredSize width="75" height="25"/>
</properties>
</component>
</children>
</toolbar>
</children>
</grid>
<grid id="2de34" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<minimumSize width="24" height="75"/>
</properties>
<border type="none"/>
<children>
<grid id="5155b" binding="bugReportsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
<grid id="b15c4" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<minimumSize width="-1" height="200"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<tabbedpane id="b318" binding="currentBugReportTabs">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="9469" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="Описание и комментарий"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="-1" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<splitpane id="17145" binding="SC6">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<dividerLocation value="500"/>
<dividerSize value="3"/>
</properties>
<border type="none"/>
<children>
<grid id="8ef9b" binding="descriptionPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="200" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children/>
</grid>
<grid id="3efc9" binding="commentPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="200" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children/>
</grid>
</children>
</splitpane>
</children>
</grid>
<grid id="a54d" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<tabbedpane title="Настройки"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<toolbar id="93e2c" binding="settingsTools" custom-create="true">
<constraints border-constraint="North"/>
<properties>
<floatable value="false"/>
</properties>
<border type="none"/>
<children/>
</toolbar>
<scrollpane id="7db0c" binding="bugSettingsScroll" custom-create="true">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</scrollpane>
</children>
</grid>
<grid id="df141" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<tabbedpane title="Адресаты и исполнитель"/>
</constraints>
<properties>
<minimumSize width="-1" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="acf24" binding="subscribersPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</tabbedpane>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
</children>
</grid>
</form>

View File

@@ -0,0 +1,581 @@
package Visual_DVM_2021.UI.Main;
import Common.Current;
import Common.Global;
import Common.UI.Editor.BaseEditor;
import Common.UI.Editor.Viewer;
import Common.UI.Menus_2023.VisualiserMenuBar;
import Common.UI.TextField.StyledTextField;
import Common.UI.UI;
import Common.Utils.Utils;
import GlobalData.Settings.SettingName;
import Repository.BugReport.BugReport;
import Repository.BugReport.BugReportInterface;
import Repository.BugReport.BugReportState;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021;
import Visual_DVM_2021.UI.Interface.CallbackWindow;
import Visual_DVM_2021.UI.Interface.CommentInterface;
import Visual_DVM_2021.UI.Interface.DescriptionInterface;
import Visual_DVM_2021.UI.Interface.FormWithSplitters;
import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
public class CallbackForm implements FormWithSplitters, CallbackWindow {
private final JScrollPane bugCommentScroll;
private final JScrollPane bugReportCommentAdditionScroll;
private final BaseEditor BugReportComment;
private final BaseEditor BugReportCommentAddition;
//-------------------------------------------
private final JScrollPane bugDescriptionScroll;
private final JScrollPane bugReportDescriptionAdditionScroll;
private final BaseEditor BugReportDescription;
private final BaseEditor BugReportDescriptionAddition;
private JPanel content;
public JSplitPane SC10;
public DescriptionInterface descriptionInterface;
public CommentInterface commentInterface;
DocumentListener descriptionAdditionListener = new DocumentListener() {
@Override
public void removeUpdate(DocumentEvent e) {
}
@Override
public void insertUpdate(DocumentEvent e) {
}
@Override
public void changedUpdate(DocumentEvent e) {
if (!Current.getBugReport().state.equals(BugReportState.draft))
Current.getBugReport().descriptionAdditionDraft =
BugReportDescriptionAddition.getText();
}
};
DocumentListener commentAdditionListener = new DocumentListener() {
@Override
public void removeUpdate(DocumentEvent e) {
}
@Override
public void insertUpdate(DocumentEvent e) {
}
@Override
public void changedUpdate(DocumentEvent e) {
if (!Current.getBugReport().state.equals(BugReportState.draft))
Current.getBugReport().commentAdditionDraft = BugReportCommentAddition.getText();
}
};
DocumentListener descriptionListener = new DocumentListener() {
@Override
public void removeUpdate(DocumentEvent e) {
}
@Override
public void insertUpdate(DocumentEvent e) {
}
@Override
public void changedUpdate(DocumentEvent e) {
if (Current.getBugReport().state.equals(BugReportState.draft))
Current.getBugReport().description =
BugReportDescription.getText();
Global.componentsServer.db.bugReports.RefreshUI();
}
};
DocumentListener commentListener = new DocumentListener() {
@Override
public void removeUpdate(DocumentEvent e) {
}
@Override
public void insertUpdate(DocumentEvent e) {
}
@Override
public void changedUpdate(DocumentEvent e) {
if (Current.getBugReport().state.equals(BugReportState.draft))
Current.getBugReport().comment = BugReportComment.getText();
}
};
//-
private JToolBar accountTools;
private JLabel lAccountName;
private JLabel lAccountMail;
private JLabel lAccountRole;
private JPanel accountPanel;
private JPanel bugReportsPanel;
private JPanel filterFormPanel;
private JPanel subscribersPanel;
private JTabbedPane currentBugReportTabs;
private JScrollPane bugSettingsScroll;
private JCheckBox BugReportsMyOnlyFilter;
private JCheckBox BugReportsOpenedOnly;
private JToolBar bugsTools;
private JToolBar settingsTools;
private JToolBar descriptionTools;
private JToolBar commentTools;
private JToolBar descriptionAdditionTools;
private JToolBar commentAdditionTools;
private JPanel descriptionPanel;
private JPanel commentPanel;
private JSplitPane SCX;
public JSplitPane SC6;
private JTextField BugReportsKeyFilter;
private JTextField BugReportsSenderNameFilter;
private JTextField BugReportsDescriptionFilter;
private JTextField BugReportsVersionFilter;
private JTextField BugReportsExecutorFilter;
private JTextField BugReportsCommentFilter;
private Viewer BugReportSettings;
public void LockMyOnly() {
if (!BugReportsMyOnlyFilter.isSelected()) {
BugReportsMyOnlyFilter.doClick();
}
BugReportsMyOnlyFilter.setEnabled(false);
}
public void UnlockMyOnly() {
BugReportsMyOnlyFilter.setEnabled(true);
if (BugReportsMyOnlyFilter.isSelected()) {
BugReportsMyOnlyFilter.doClick();
}
}
public CallbackForm() {
LoadSplitters();
//---------------------------------
//чтобы не было индусятины, лучше создать контролы здесь
BugReportDescription = new BaseEditor();
BugReportDescription.setLineWrap(true);
bugDescriptionScroll = new JScrollPane(BugReportDescription);
//----------------------------------------------
BugReportDescriptionAddition = new BaseEditor();
BugReportDescriptionAddition.setLineWrap(true);
bugReportDescriptionAdditionScroll = new JScrollPane(BugReportDescriptionAddition);
BugReportDescription.setWrapStyleWord(true);
BugReportDescriptionAddition.setWrapStyleWord(true);
//---------------------------------------------
//-
BugReportComment = new BaseEditor();
BugReportComment.setLineWrap(true);
bugCommentScroll = new JScrollPane(BugReportComment);
//-
BugReportCommentAddition = new BaseEditor();
BugReportCommentAddition.setLineWrap(true);
bugReportCommentAdditionScroll = new JScrollPane(BugReportCommentAddition);
BugReportComment.setWrapStyleWord(true);
BugReportCommentAddition.setWrapStyleWord(true);
//----------------------------------------------
//тут развилка на то вкладки или поля.
SwitchScreen(Global.db.settings.get(SettingName.SmallScreen).toBoolean());
//-
Global.componentsServer.db.bugReports.mountUI(bugReportsPanel);
Global.componentsServer.db.subscribers.mountUI(subscribersPanel);
settingsTools.add(Pass_2021.passes.get(PassCode_2021.ApplyBugReportSettings).createButton());
// accountTools.add(Pass_2021.passes.get(PassCode_2021.CheckAccount).createButton());
//--
BugReportsKeyFilter.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
BugReportInterface.filterKey = BugReportsKeyFilter.getText();
ShowBugReports();
}
@Override
public void removeUpdate(DocumentEvent e) {
BugReportInterface.filterKey = BugReportsKeyFilter.getText();
ShowBugReports();
}
@Override
public void changedUpdate(DocumentEvent e) {
}
});
BugReportsSenderNameFilter.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
BugReportInterface.filterSenderName = BugReportsSenderNameFilter.getText();
ShowBugReports();
}
@Override
public void removeUpdate(DocumentEvent e) {
BugReportInterface.filterSenderName = BugReportsSenderNameFilter.getText();
ShowBugReports();
}
@Override
public void changedUpdate(DocumentEvent e) {
}
});
BugReportsDescriptionFilter.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
BugReportInterface.filterDescription = BugReportsDescriptionFilter.getText();
ShowBugReports();
}
@Override
public void removeUpdate(DocumentEvent e) {
BugReportInterface.filterDescription = BugReportsDescriptionFilter.getText();
ShowBugReports();
}
@Override
public void changedUpdate(DocumentEvent e) {
}
});
//------->>>
BugReportsCommentFilter.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
BugReportInterface.filterComment = BugReportsCommentFilter.getText();
ShowBugReports();
}
@Override
public void removeUpdate(DocumentEvent e) {
BugReportInterface.filterComment = BugReportsCommentFilter.getText();
ShowBugReports();
}
@Override
public void changedUpdate(DocumentEvent e) {
}
});
BugReportsExecutorFilter.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
BugReportInterface.filterExecutor = BugReportsExecutorFilter.getText();
ShowBugReports();
}
@Override
public void removeUpdate(DocumentEvent e) {
BugReportInterface.filterExecutor = BugReportsExecutorFilter.getText();
ShowBugReports();
}
@Override
public void changedUpdate(DocumentEvent e) {
}
});
BugReportsVersionFilter.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
BugReportInterface.filterVersion = BugReportsVersionFilter.getText();
ShowBugReports();
}
@Override
public void removeUpdate(DocumentEvent e) {
BugReportInterface.filterVersion = BugReportsVersionFilter.getText();
ShowBugReports();
}
@Override
public void changedUpdate(DocumentEvent e) {
}
});
//--------
BugReportsMyOnlyFilter.addActionListener(e -> {
BugReportInterface.filterMyOnly = BugReportsMyOnlyFilter.isSelected();
ShowBugReports();
});
BugReportsOpenedOnly.addActionListener(e -> {
BugReportInterface.filterOpenedOnly = BugReportsOpenedOnly.isSelected();
ShowBugReports();
});
}
//-------------------------------------------
DescriptionTabs descriptionTabs = new DescriptionTabs();
DescriptionFields descriptionFields = new DescriptionFields();
CommentTabs commentTabs = new CommentTabs();
CommentFields commentFields = new CommentFields();
@Override
public void SwitchScreen(boolean small) {
UI.Clear(descriptionPanel);
//------------------------------------------------------------------
descriptionInterface = small ? descriptionTabs : descriptionFields;
descriptionInterface.setEditorScroll(bugDescriptionScroll);
descriptionInterface.setAdditionScroll(bugReportDescriptionAdditionScroll);
descriptionPanel.add(descriptionInterface.getContent());
//----------
descriptionPanel.revalidate();
descriptionPanel.repaint();
//---------
UI.Clear(commentPanel);
//------------------------------------------------------------------
commentInterface = small ? commentTabs : commentFields;
commentInterface.setEditorScroll(bugCommentScroll);
commentInterface.setAdditionScroll(bugReportCommentAdditionScroll);
commentPanel.add(commentInterface.getContent());
//----------
commentPanel.revalidate();
commentPanel.repaint();
}
@Override
public void SaveSplitters() {
FormWithSplitters.super.SaveSplitters();
descriptionInterface.SaveSplitters();
commentInterface.SaveSplitters();
}
@Override
public String getBugReportDescriptionText() {
return BugReportDescription.getText();
}
@Override
public String getBugReportDescriptionAdditionText() {
return BugReportDescriptionAddition.getText();
}
@Override
public String getBugReportCommentText() {
return BugReportComment.getText();
}
@Override
public String getBugReportCommentAdditionText() {
return BugReportCommentAddition.getText();
}
@Override
public void ClearBugReportDescriptionAdditionText() {
BugReportDescriptionAddition.setText("");
}
@Override
public void ClearBugReportCommentAdditionText() {
BugReportCommentAddition.setText("");
}
@Override
public void FocusRecipients() {
currentBugReportTabs.setSelectedIndex(2);
}
public void SwitchListeners(boolean on) {
//System.out.println("switching listeners " + on);
if (on) {
BugReportDescriptionAddition.getDocument().addDocumentListener(descriptionAdditionListener);
BugReportCommentAddition.getDocument().addDocumentListener(commentAdditionListener);
BugReportDescription.getDocument().addDocumentListener(descriptionListener);
BugReportComment.getDocument().addDocumentListener(commentListener);
} else {
BugReportDescriptionAddition.getDocument().removeDocumentListener(descriptionAdditionListener);
BugReportCommentAddition.getDocument().removeDocumentListener(commentAdditionListener);
BugReportDescription.getDocument().removeDocumentListener(descriptionListener);
BugReportComment.getDocument().removeDocumentListener(commentListener);
}
}
private void createUIComponents() {
BugReportSettings = new Viewer();
bugSettingsScroll = new JScrollPane(BugReportSettings);
//--
BugReportsKeyFilter = new StyledTextField();
BugReportsSenderNameFilter = new StyledTextField();
BugReportsDescriptionFilter = new StyledTextField();
BugReportsCommentFilter = new StyledTextField();
BugReportsExecutorFilter = new StyledTextField();
BugReportsVersionFilter = new StyledTextField();
settingsTools = new VisualiserMenuBar();
}
public void EnableBugreports() {
UI.Clear(accountPanel);
accountPanel.add(SC10);
UI.getMainWindow().ShowTestingTab();
}
@Override
public void setUserRights() {
LockMyOnly();
Pass_2021.passes.get(PassCode_2021.AddSubscriber).setControlsVisible(false);
Pass_2021.passes.get(PassCode_2021.EditSubscriber).setControlsVisible(false);
Pass_2021.passes.get(PassCode_2021.DeleteSubscriber).setControlsVisible(false);
Pass_2021.passes.get(PassCode_2021.DownloadAllBugReportsArchives).setControlsVisible(false);
}
private void setDeveloperRights() {
UnlockMyOnly();
Pass_2021.passes.get(PassCode_2021.AddSubscriber).setControlsVisible(false);
Pass_2021.passes.get(PassCode_2021.EditSubscriber).setControlsVisible(false);
Pass_2021.passes.get(PassCode_2021.DeleteSubscriber).setControlsVisible(false);
Pass_2021.passes.get(PassCode_2021.DownloadAllBugReportsArchives).setControlsVisible(true);
}
@Override
public void setAdminRights() {
UnlockMyOnly();
Pass_2021.passes.get(PassCode_2021.AddSubscriber).setControlsVisible(true);
Pass_2021.passes.get(PassCode_2021.EditSubscriber).setControlsVisible(true);
Pass_2021.passes.get(PassCode_2021.DeleteSubscriber).setControlsVisible(true);
Pass_2021.passes.get(PassCode_2021.DownloadAllBugReportsArchives).setControlsVisible(true);
}
@Override
public void ShowAccount() {
lAccountName.setText(Utils.Brackets(Current.getAccount().name));
lAccountMail.setText(Utils.Brackets(Current.getAccount().email));
lAccountRole.setText(Utils.Brackets(Current.getAccount().role.getDescription()));
switch (Current.getAccount().role) {
case Undefined:
UI.Clear(accountPanel);
accountPanel.add(new CallbackWelcomeForm().content);
UI.getMainWindow().HideTestingTab();
break;
case User:
//видит только свои баги.
EnableBugreports();
setUserRights();
UI.getMainWindow().getTestingWindow().setUserRights();
break;
case Developer:
EnableBugreports();
setDeveloperRights();
UI.getMainWindow().getTestingWindow().setDeveloperRights();
break;
case Admin:
EnableBugreports();
setAdminRights();
UI.getMainWindow().getTestingWindow().setAdminRights();
break;
default:
EnableBugreports();
break;
}
}
@Override
public void ShowBugReports() {
Global.componentsServer.db.bugReports.ShowUI();
}
@Override
public void ShowNoBugReports() {
Global.componentsServer.db.bugReports.ClearUI();
}
@Override
public void ShowSubscribers() {
Global.componentsServer.db.subscribers.ShowUI();
}
@Override
public void ShowNoSubscribers() {
Global.componentsServer.db.subscribers.ClearUI();
}
private void ShowDraft() {
Pass_2021.setPassesControlsVisible(true,
PassCode_2021.PublishBugReport,
PassCode_2021.SaveBugReportRecipients,
PassCode_2021.SaveBugReportExecutor,
PassCode_2021.DeleteBugReport
);
Pass_2021.setPassesControlsVisible(false,
PassCode_2021.AppendBugReportDescription,
PassCode_2021.AppendBugReportComment,
PassCode_2021.SaveBugReportDescription,
PassCode_2021.SaveBugReportComment,
PassCode_2021.OpenBugReport,
PassCode_2021.CloseBugReport,
PassCode_2021.OpenBugReportTestProject,
PassCode_2021.UpdateBugReportProgress
);
}
private void ShowUserExecutor() {
Pass_2021.setPassesControlsVisible(true,
PassCode_2021.AppendBugReportComment,
PassCode_2021.UpdateBugReportProgress,
PassCode_2021.OpenBugReportTestProject
);
Pass_2021.setPassesControlsVisible(false,
PassCode_2021.PublishBugReport,
PassCode_2021.SaveBugReportRecipients,
PassCode_2021.SaveBugReportExecutor,
PassCode_2021.SaveBugReportDescription,
PassCode_2021.SaveBugReportComment,
PassCode_2021.AppendBugReportDescription,
PassCode_2021.OpenBugReport,
PassCode_2021.CloseBugReport,
PassCode_2021.DeleteBugReport
);
}
private void ShowSender() {
Pass_2021.setPassesControlsVisible(true,
PassCode_2021.AppendBugReportComment,
PassCode_2021.UpdateBugReportProgress,
PassCode_2021.OpenBugReportTestProject,
PassCode_2021.SaveBugReportRecipients,
PassCode_2021.SaveBugReportExecutor,
PassCode_2021.SaveBugReportDescription,
PassCode_2021.SaveBugReportComment,
PassCode_2021.AppendBugReportDescription,
PassCode_2021.OpenBugReport,
PassCode_2021.CloseBugReport,
PassCode_2021.DeleteBugReport
);
Pass_2021.setPassesControlsVisible(false,
PassCode_2021.PublishBugReport
);
}
private void ShowUser() {
Pass_2021.setPassesControlsVisible(false,
PassCode_2021.PublishBugReport,
PassCode_2021.SaveBugReportRecipients,
PassCode_2021.SaveBugReportExecutor,
PassCode_2021.SaveBugReportDescription,
PassCode_2021.SaveBugReportComment,
PassCode_2021.AppendBugReportDescription,
PassCode_2021.OpenBugReport,
PassCode_2021.CloseBugReport,
PassCode_2021.DeleteBugReport,
PassCode_2021.AppendBugReportComment,
PassCode_2021.UpdateBugReportProgress,
PassCode_2021.OpenBugReportTestProject
);
}
@Override
public void ShowCurrentBugReport() {
SwitchListeners(false);
// currentBugReportTabs.setSelectedIndex(0);
BugReport target = Current.getBugReport();
BugReportInterface.CheckSubscribers(target);
Global.componentsServer.db.subscribers.ShowUI();
//-
BugReportDescription.setText(target.description);
BugReportDescription.ShowBegin();
BugReportDescriptionAddition.setText(target.descriptionAdditionDraft);
//-
BugReportComment.setText(target.comment);
BugReportComment.ShowBegin();
BugReportCommentAddition.setText(target.commentAdditionDraft);
BugReportSettings.setText(
String.join("\n",
("Версия SAPFOR: " + target.sapfor_version),
("Версия визуализатора: " + target.visualiser_version),
target.sapfor_settings
)
);
Pass_2021.setPassesControlsVisible(true, PassCode_2021.ApplyBugReportSettings);
//
if (target.state.equals(BugReportState.draft)) {
ShowDraft();
} else {
switch (Current.getAccount().role) {
case User:
if (Current.getAccount().email.equalsIgnoreCase(target.sender_address)) {
ShowSender(); //отправитель.может делать с багом все.
} else {
if (Current.getAccount().email.equalsIgnoreCase(target.executor_address)) {
ShowUserExecutor(); //исполнитель. может менять прогресс и дополнять комментарий.
} else ShowUser(); //недоступно ничего. и баг ему невидим. но на всякий случай.
}
break;
case Developer:
case Admin:
//разработчик может все то же что и админ. они равны по правам владельцу любого бага.
ShowSender();
break;
}
}
SwitchListeners(true);
}
@Override
public void ShowNoCurrentBugReport() {
SwitchListeners(false);
Global.componentsServer.db.subscribers.ShowUI();
//-
BugReportDescription.setText("");
BugReportComment.setText("");
BugReportDescriptionAddition.setText("");
BugReportCommentAddition.setText("");
BugReportSettings.setText("");
//-
Pass_2021.setPassesControlsVisible(false, PassCode_2021.SaveBugReportExecutor,
PassCode_2021.SaveBugReportRecipients,
PassCode_2021.AppendBugReportDescription,
PassCode_2021.SaveBugReportDescription,
PassCode_2021.SaveBugReportComment,
PassCode_2021.AppendBugReportComment,
PassCode_2021.ApplyBugReportSettings,
PassCode_2021.PublishBugReport,
PassCode_2021.OpenBugReport,
PassCode_2021.CloseBugReport,
PassCode_2021.OpenBugReportTestProject,
PassCode_2021.UpdateBugReportProgress,
PassCode_2021.DeleteBugReport
);
}
@Override
public void ShowSubscription() {
}
@Override
public JPanel getContent() {
return content;
}
}

View File

@@ -0,0 +1,21 @@
<?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.CallbackWelcomeForm">
<grid id="27dc6" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<xy x="20" y="20" width="893" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="e8af5" class="javax.swing.JTextArea" binding="WelcomeText">
<constraints border-constraint="Center"/>
<properties>
<editable value="false"/>
<enabled value="true"/>
<font name="Times New Roman" size="25" style="1"/>
<text value="&#10;&#10;&#10;&#10;&#10; &#9;Чтобы получить доступ к обратной связи, пройдите регистрацию"/>
</properties>
</component>
</children>
</grid>
</form>

View File

@@ -0,0 +1,6 @@
package Visual_DVM_2021.UI.Main;
import javax.swing.*;
public class CallbackWelcomeForm {
public JPanel content;
private JTextArea WelcomeText;
}

View File

@@ -0,0 +1,23 @@
package Visual_DVM_2021.UI.Main;
import Common.Current;
import Common.UI.Windows.Dialog.Text.ComboTextDialog;
import Common.Utils.Utils;
import java.util.Vector;
public class CombineFilesDialog extends ComboTextDialog {
public CombineFilesDialog() {
fields.setEditable(true);
}
@Override
public void validateFields() {
super.validateFields();
if (Log.isEmpty()) {
String fileName = (String) fields.getSelectedItem();
// тут 2 случая. если имя файла совпадает с 1 из существующих, то все хорошо.
//если нет. тогда проверяем отсуствие слешей и полная валидация имени одиночного файла.
Vector<String> files_order = Current.getProject().files_order;
if (!files_order.contains(fileName))
Utils.validateFileShortNewName(fileName, Log);
}
}
}

View File

@@ -0,0 +1,96 @@
<?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.CommentFields">
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="21cc1" binding="SC26">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties>
<dividerLocation value="100"/>
<dividerSize value="3"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="f6bb7" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<minimumSize width="0" height="100"/>
</properties>
<border type="none"/>
<children>
<toolbar id="ae65d" binding="commentTools" custom-create="true">
<constraints border-constraint="North"/>
<properties>
<floatable value="false"/>
</properties>
<border type="none"/>
<children>
<component id="ad5e0" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="3"/>
<foreground color="-16777216"/>
<text value="Комментарий"/>
</properties>
</component>
</children>
</toolbar>
<grid id="49216" binding="editorPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="217fe" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<minimumSize width="0" height="100"/>
</properties>
<border type="none"/>
<children>
<toolbar id="5f4e8" binding="commentAdditionTools" custom-create="true">
<constraints border-constraint="North"/>
<properties>
<floatable value="false"/>
</properties>
<border type="none"/>
<children>
<component id="8669c" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="3"/>
<foreground color="-16777216"/>
<text value="Дополнение комментария"/>
</properties>
</component>
</children>
</toolbar>
<grid id="e4591" binding="additionPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
</form>

View File

@@ -0,0 +1,37 @@
package Visual_DVM_2021.UI.Main;
import Common.UI.Menus_2023.VisualiserMenuBar;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021;
import Visual_DVM_2021.UI.Interface.CommentInterface;
import javax.swing.*;
public class CommentFields implements CommentInterface {
public JSplitPane SC26;
private JPanel content;
private JToolBar commentTools;
private JToolBar commentAdditionTools;
private JPanel editorPanel;
private JPanel additionPanel;
public CommentFields() {
LoadSplitters();
commentTools.add(Pass_2021.passes.get(PassCode_2021.SaveBugReportComment).createButton());
commentAdditionTools.add(Pass_2021.passes.get(PassCode_2021.AppendBugReportComment).createButton());
}
@Override
public void setEditorScroll(JScrollPane scroll_in) {
editorPanel.add(scroll_in);
}
@Override
public void setAdditionScroll(JScrollPane scroll_in) {
additionPanel.add(scroll_in);
}
@Override
public JPanel getContent() {
return content;
}
private void createUIComponents() {
// TODO: place custom component creation code here
commentTools = new VisualiserMenuBar();
commentAdditionTools = new VisualiserMenuBar();
}
}

View File

@@ -0,0 +1,40 @@
<?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.CommentTabs">
<grid id="27dc6" binding="comment" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<tabbedpane id="84c83" binding="tabs">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="bd63f" binding="editorPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<tabbedpane title="Описание"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
<grid id="8f344" binding="additionPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<tabbedpane title="Дополнение описания"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</tabbedpane>
</children>
</grid>
</form>

View File

@@ -0,0 +1,38 @@
package Visual_DVM_2021.UI.Main;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.UI.Interface.CommentInterface;
import javax.swing.*;
public class CommentTabs implements CommentInterface {
private JPanel comment;
private JTabbedPane tabs;
private JPanel editorPanel;
private JPanel additionPanel;
public CommentTabs() {
tabs.setTabComponentAt(0, new TabToolBar("Комментарий", PassCode_2021.SaveBugReportComment) {
@Override
public void leftMouseAction() {
tabs.setSelectedIndex(0);
}
});
tabs.setTabComponentAt(1, new TabToolBar("Дополнение", PassCode_2021.AppendBugReportComment) {
@Override
public void leftMouseAction() {
tabs.setSelectedIndex(1);
}
});
}
@Override
public void setEditorScroll(JScrollPane scroll_in) {
editorPanel.add(scroll_in);
}
@Override
public void setAdditionScroll(JScrollPane scroll_in) {
additionPanel.add(scroll_in);
}
@Override
public JPanel getContent() {
return comment;
}
}

View File

@@ -0,0 +1,99 @@
<?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.ComparisonForm">
<grid id="27dc6" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<xy x="20" y="20" width="500" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<toolbar id="63a72" binding="tools" custom-create="true">
<constraints border-constraint="North"/>
<properties>
<floatable value="false"/>
<maximumSize width="32929" height="30"/>
</properties>
<border type="none"/>
<children>
<component id="5992c" class="javax.swing.JLabel" binding="lObjectName" custom-create="true">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="1"/>
<foreground color="-16777216"/>
<text value="? "/>
</properties>
</component>
<component id="d59fd" class="javax.swing.JButton" binding="bApplyObject">
<constraints/>
<properties>
<borderPainted value="false"/>
<icon value="icons/Apply.png"/>
<maximumSize width="30" height="30"/>
<minimumSize width="30" height="30"/>
<preferredSize width="30" height="30"/>
<text value=""/>
<toolTipText value="Назначить объект для сравнения"/>
</properties>
</component>
<component id="dd7b1" class="javax.swing.JButton" binding="bClose">
<constraints/>
<properties>
<borderPainted value="false"/>
<icon value="icons/Close.png"/>
<maximumSize width="30" height="30"/>
<minimumSize width="30" height="30"/>
<preferredSize width="30" height="30"/>
<text value=""/>
<toolTipText value="Открепить объект"/>
</properties>
</component>
<component id="7a4ca" class="javax.swing.JSeparator">
<constraints/>
<properties/>
</component>
<component id="75549" class="javax.swing.JButton" binding="bPrevious">
<constraints/>
<properties>
<borderPainted value="false"/>
<icon value="icons/Prev.png"/>
<maximumSize width="30" height="30"/>
<minimumSize width="30" height="30"/>
<preferredSize width="30" height="30"/>
<text value=""/>
<toolTipText value="Перейти к предыдущему различию "/>
</properties>
</component>
<component id="f8e56" class="javax.swing.JButton" binding="bNext">
<constraints/>
<properties>
<borderPainted value="false"/>
<icon value="icons/Next.png"/>
<maximumSize width="30" height="30"/>
<minimumSize width="30" height="30"/>
<preferredSize width="30" height="30"/>
<text value=""/>
<toolTipText value="Перейти к следующему различию"/>
</properties>
</component>
<component id="42c3c" class="javax.swing.JButton" binding="bCompare">
<constraints/>
<properties>
<icon value="icons/Menu/Undo.png"/>
<maximumSize width="30" height="30"/>
<minimumSize width="30" height="30"/>
<preferredSize width="30" height="30"/>
<text value=""/>
<toolTipText value="Сравнить объекты"/>
</properties>
</component>
</children>
</toolbar>
<grid id="8b423" binding="editorPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</form>

View File

@@ -0,0 +1,434 @@
package Visual_DVM_2021.UI.Main;
import Common.Current;
import Common.Database.DBObject;
import Common.Global;
import Common.UI.Editor.BaseEditor;
import Common.UI.Label.ShortLabel;
import Common.UI.Menus_2023.VisualiserMenuBar;
import Common.UI.UI;
import Common.Utils.TextLog;
import Common.Utils.Utils;
import GlobalData.Settings.SettingName;
import Visual_DVM_2021.Passes.Pass_2021;
import javafx.util.Pair;
import org.fife.ui.rsyntaxtextarea.RSyntaxTextAreaHighlighter;
import org.fife.ui.rtextarea.RTextScrollPane;
import javax.swing.*;
import java.util.LinkedHashMap;
import java.util.Vector;
public abstract class ComparisonForm<T extends DBObject> {
public Class<T> t; //класс объектов.
//-->>
private JPanel content;
public JPanel getContent() {
return content;
}
protected JToolBar tools;
private JPanel editorPanel;
protected JLabel lObjectName;
private JButton bApplyObject;
private JButton bPrevious;
private JButton bNext;
private JButton bCompare;
private JButton bClose;
//-->>
ComparisonForm<T> this_ = null; //?
ComparisonForm<T> slave = null;
ComparisonForm<T> master = null;
//-->>
protected T object = null;
//-->>
protected BaseEditor Body;
private RTextScrollPane Scroll;
//-->>
public Vector<String> lines = new Vector<>(); //строки с учетом/неучетом пробелов. для сравнения
public Vector<String> visible_lines = new Vector<>(); //строки с нетронутыми пробелами. для отображения
//подсветка.
public LinkedHashMap<Integer, Pair<Integer, Boolean>> colors = new LinkedHashMap<>();
public RSyntaxTextAreaHighlighter slave_highlighter = null; //погонщик рабов
//-----
private boolean events_on = false;//относится только к мастеру, отвечает за скроллы.
private int current_diff_line = -1;
//--->>
public boolean isMaster() {
return slave != null;
}
public boolean isSlave() {
return master != null;
}
//--->>
//неперегружаемые методы
protected void RemoveObject() {
object = null;
removeObject();
showNoObject();
ClearText();
if (isMaster())
slave.ClearText();
else if (isSlave())
master.ClearText();
}
public void ApplyObject() {
RemoveObject();
TextLog log = new TextLog();
if (Current.Check(log, getCurrentObjectName())) {
object = (T) Current.get(getCurrentObjectName());
applyObject();
showObject();
} else
UI.Info(log.toString());
}
private void ShowCurrentDiff() {
Body.gotoLine_(colors.get(current_diff_line).getKey());
}
public static boolean CompareLines(String line1_raw, String line2_raw) {
String line1 = line1_raw;
String line2 = line2_raw;
if (!Global.db.settings.get(SettingName.RegisterOn).toBoolean()) {
line1 = line1.toUpperCase();
line2 = line2.toUpperCase();
}
if (!Global.db.settings.get(SettingName.SpacesOn).toBoolean()) {
line1 = Utils.remove(line1, " ", "\t");
line2 = Utils.remove(line2, " ", "\t");
}
return line1.equals(line2);
}
public static boolean Contains(Vector<String> list, String line, int max_index) {
int last_index = -1;
for (int i = 0; i < list.size(); ++i)
if (CompareLines(list.get(i), line)) last_index = i;
return (last_index >= max_index);
}
private void getLines() {
lines.clear();
visible_lines.clear();
//1.прочитать весь текст.
char[] chars = getText().toCharArray();
//по символам получить строки.
char c = 0; //текущий символ
int i = 0; //индекс текущего символа.
StringBuilder line = new StringBuilder(); //текущая строка
StringBuilder v_line = new StringBuilder(); //текущая строка
while (i < chars.length) {
c = chars[i];
//System.out.print("`"+c+"`");
++i;
switch (c) {
case '\r': //возврат каретки, игнор
break;
case ' ':
case '\t':
if (Global.db.settings.get(SettingName.SpacesOn).toBoolean()) line.append(c);
v_line.append(c);
break;
case '\n': //конец строки
if (fortranWrapsOn()) {
//оракул. лезем в начало следующей строки
//и анализируем первые 5 символов
boolean hasWrap = false;
int wi;
//------
//System.out.println("checking wrap...");
//с нуля потому что и уже увеличено.
for (int j = 0; (j < 6) && ((wi = i + j) < chars.length); ++j) {
char s = chars[wi];
// System.out.print(s);
if ((j == 0) && ((s == 'c') || (s == 'C') || (s == '!'))) {
// System.out.println("next line is FL comment");
break;
}
if ((j > 0) && (j < 5) && (s == '!')) {
// System.out.println("next line is comment");
break;
}
if ((j == 5) && (s != ' ')) {
hasWrap = true;
i = wi + 1;
// System.out.println("next line is WRAP");
break;
}
}
// System.out.println();
//-----
if (hasWrap)
break;
}
// System.out.println();
//добавление строки в результат.
if ((line.length() > 0) || Global.db.settings.get(SettingName.EmptyLinesOn).toBoolean() &&
Global.db.settings.get(SettingName.SpacesOn).toBoolean()) {
lines.add(line.toString());
visible_lines.add(v_line.toString());
}
//сброс
line = new StringBuilder();
v_line = new StringBuilder();
break;
default:
line.append(c);
v_line.append(c);
break;
}
}
if ((i > 0) && (c != '\n')) {
//строка оборвалась на EOF
//добавление строки в результат.
if ((line.length() > 0) || Global.db.settings.get(SettingName.EmptyLinesOn).toBoolean() && Global.db.settings.get(SettingName.SpacesOn).toBoolean()) {
lines.add(line.toString());
visible_lines.add(v_line.toString());
}
}
}
protected void ClearText() {
events_on = false;
Body.setText("");
}
//предполагаем что оба объекта есть и мы можем получить с них текст.
protected void Compare() throws Exception {
events_on = false;
current_diff_line = Utils.Nan;
colors.clear();
//-----------------------------------------------------------------------------------------------
Body.setText("");
slave.Body.setText("");
int d = 0;
getLines();
slave.getLines();
//--------------------------------------------------------------------
Vector<String> t1 = new Vector<>();
Vector<String> t2 = new Vector<>();
//------
int old_j = 0;
int j = 0;
for (int i = 0; i < lines.size(); ++i) {
if (Contains(slave.lines, lines.get(i), old_j)) {
for (int k = old_j; k < slave.lines.size(); ++k) {
j = k;
if (CompareLines(lines.get(i), slave.lines.get(k))) {
j++;
t1.add(visible_lines.get(i));
t2.add(slave.visible_lines.get(k));
break;
} else {
t1.add("+");
t2.add("+ " + slave.visible_lines.get(k));
colors.put(d, new Pair(t2.size() - 1, true));
++d;
}
}
old_j = j;
} else {
//строки гарантированно нет.
t1.add("- " + visible_lines.get(i));
t2.add("- " + visible_lines.get(i));
colors.put(d, new Pair(t2.size() - 1, false));
++d;
}
}
//теперь граничное условие. если первый файл кончился а второй нет, его остаток это добавление.
for (int i = j; i < slave.lines.size(); ++i) {
t1.add("+");
t2.add("+ " + slave.visible_lines.get(i));
colors.put(d, new Pair(t2.size() - 1, true));
++d;
}
///----------------
Body.setText(String.join("\n", t1));
slave.Body.setText(String.join("\n", t2));
Body.setCaretPosition(0);
slave.Body.setCaretPosition(0);
//теперь покрас.
for (Integer diff_num : colors.keySet()) {
slave_highlighter.addHighlight(
slave.Body.getLineStartOffset(colors.get(diff_num).getKey()),
slave.Body.getLineEndOffset(colors.get(diff_num).getKey()),
colors.get(diff_num).getValue() ? UI.GoodLoopPainter : UI.BadLoopPainter
);
}
if (colors.size() > 0) current_diff_line = 0;
events_on = true;
}
public void Show() throws Exception {
events_on = false;
current_diff_line = Utils.Nan;
colors.clear();
//----------------------------------------------------------------------------------------------
Body.setText("");
slave.Body.setText("");
int d = 0;
getLines();
slave.getLines();
//--------------------------------------------------------------------
Vector<String> t1 = new Vector<>();
Vector<String> t2 = new Vector<>();
//------
t1.addAll(visible_lines);
t2.addAll(slave.visible_lines);
//просто выясняем кто из них длиннее, и короткий дополняем пустыми строками.]
int delta = Math.abs(t1.size() - t2.size());
if (lines.size() > slave.lines.size()) {
Utils.addEmptyLines(t2, delta);
} else if (lines.size() < slave.lines.size()) {
Utils.addEmptyLines(t1, delta);
}
///----------------
Body.setText(String.join("\n", t1));
slave.Body.setText(String.join("\n", t2));
Body.setCaretPosition(0);
slave.Body.setCaretPosition(0);
events_on = true;
}
//Перегружаемые методы.
//--->>
protected abstract Current getCurrentObjectName();
protected void showNoObject() {
lObjectName.setText("?");
lObjectName.setToolTipText("Объект не назначен.");
}
protected void showObject() {
lObjectName.setText(object.getPK().toString());
lObjectName.setToolTipText(object.getPK().toString());
}
protected void removeObject() {
}
protected void applyObject() {
}
protected abstract String getText();
protected boolean fortranWrapsOn() {
return false;
}
//--->>
// protected Object ownScrollModel = null;
//---<<
public ComparisonForm(Class<T> t_in, ComparisonForm<T> slave_in) {
//-
Body = new BaseEditor();
Scroll = new RTextScrollPane(Body);
editorPanel.add(Scroll);
// ownScrollModel = Scroll.getVerticalScrollBar().getModel();
//-
t = t_in;
this_ = this;
slave = slave_in;
bPrevious.setVisible(isMaster());
bNext.setVisible(isMaster());
Scroll.setLineNumbersEnabled(true);
bApplyObject.addActionListener(e -> {
ApplyObject();
});
//--->>>
Body.setWhitespaceVisible(true);
Body.setEditable(false);
if (isMaster()) {
//<editor-fold desc="синхронизация скроллов">
slave.Scroll.getVerticalScrollBar().setModel(Scroll.getVerticalScrollBar().getModel());
slave_highlighter = (RSyntaxTextAreaHighlighter) slave.Body.getHighlighter();
//бяк быть не должно при условии что строк одинаковое количество. а это должно выполняться.
Body.addCaretListener(e -> {
if (events_on && isReady() && slave.isReady()) {
try {
int master_lineNum = Body.getCaretLineNumber();
slave.Body.setCaretPosition(slave.Body.getLineStartOffset(master_lineNum));
} catch (Exception ex) {
Global.Log.PrintException(ex);
}
}
});
//</editor-fold>
slave.master = this;
bPrevious.addActionListener(e -> {
if (current_diff_line != Utils.Nan) {
if (current_diff_line > 0)
current_diff_line--;
else
current_diff_line = colors.size() - 1;
ShowCurrentDiff();
}
});
bNext.addActionListener(e -> {
if (current_diff_line != Utils.Nan) {
if (current_diff_line < colors.size() - 1)
current_diff_line++;
else
current_diff_line = 0;
ShowCurrentDiff();
}
});
bCompare.addActionListener(e -> {
DoComparePass(isReady() && slave.isReady());
});
} else {
//рабу сравнивать не положено.
bCompare.setVisible(false);
}
//--->>>
bClose.addActionListener(e -> {
onClose();
});
}
//-->>
private void createUIComponents() {
// TODO: place custom component creation code here
lObjectName = new ShortLabel(40);
tools = new VisualiserMenuBar();
}
//для сравнения по кнопке.
public boolean isReady() {
return object != null;
}
public void onClose() {
RemoveObject();
}
public void DoComparePass(boolean startCondition) {
Pass_2021 pass = new Pass_2021() {
@Override
public String getDescription() {
return "Сравнение";
}
@Override
protected boolean needsAnimation() {
return true;
}
@Override
public boolean needsConfirmations() {
return false;
}
@Override
protected boolean canStart(Object... args) throws Exception {
return startCondition;
}
@Override
protected void body() throws Exception {
Compare();
}
};
pass.Do();
}
public void DoShowPass(boolean startCondition) {
Pass_2021 pass = new Pass_2021() {
@Override
public String getDescription() {
return "Отображение";
}
@Override
protected boolean needsAnimation() {
return false;
}
@Override
public boolean needsConfirmations() {
return false;
}
@Override
protected boolean canStart(Object... args) throws Exception {
return startCondition;
}
@Override
protected void body() throws Exception {
Show();
}
};
pass.Do();
}
}

View File

@@ -0,0 +1,31 @@
package Visual_DVM_2021.UI.Main;
import Common.Current;
import GlobalData.Tasks.CompilationTask.CompilationTask;
public class CompilationTasksComparisonForm extends TasksComparisonForm<CompilationTask> {
public CompilationTasksComparisonForm(ComparisonForm<CompilationTask> slave_in) {
super(CompilationTask.class, slave_in);
}
@Override
protected Current getCurrentObjectName() {
return Current.CompilationTask;
}
@Override
protected String getTextByTab() {
switch (status) {
case CompilationOutput:
return object.getOutput();
case CompilationErrors:
return object.getErrors();
default:
return "";
}
}
@Override
protected TasksComparisonState[] getForbiddenStates() {
return new TasksComparisonState[]{
TasksComparisonState.RunOutput,
TasksComparisonState.RunErrors,
TasksComparisonState.Sts
};
}
}

View File

@@ -0,0 +1,91 @@
<?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.DescriptionFields">
<grid id="27dc6" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<xy x="20" y="20" width="500" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="5c980" binding="SC25">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="100"/>
<dividerSize value="3"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="e0641" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<minimumSize width="0" height="100"/>
</properties>
<border type="none"/>
<children>
<toolbar id="db173" binding="descriptionTools" custom-create="true">
<constraints border-constraint="North"/>
<properties>
<floatable value="false"/>
</properties>
<border type="none"/>
<children>
<component id="45f1e" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="3"/>
<foreground color="-16777216"/>
<text value="Описание"/>
</properties>
</component>
</children>
</toolbar>
<grid id="c78b" binding="editorPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="893bb" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<minimumSize width="0" height="100"/>
</properties>
<border type="none"/>
<children>
<toolbar id="c3176" binding="descriptionAdditionTools" custom-create="true">
<constraints border-constraint="North"/>
<properties>
<floatable value="false"/>
</properties>
<border type="none"/>
<children>
<component id="7d653" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="3"/>
<foreground color="-16777216"/>
<text value="Дополнение описания"/>
</properties>
</component>
</children>
</toolbar>
<grid id="e6c00" binding="additionPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
</form>

View File

@@ -0,0 +1,38 @@
package Visual_DVM_2021.UI.Main;
import Common.UI.Menus_2023.VisualiserMenuBar;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021;
import Visual_DVM_2021.UI.Interface.DescriptionInterface;
import javax.swing.*;
public class DescriptionFields implements DescriptionInterface {
public JSplitPane SC25;
private JPanel content;
private JToolBar descriptionTools;
private JToolBar descriptionAdditionTools;
private JPanel editorPanel;
private JPanel additionPanel;
public DescriptionFields() {
LoadSplitters();
descriptionAdditionTools.add(Pass_2021.passes.get(PassCode_2021.AppendBugReportDescription).createButton());
descriptionTools.add(Pass_2021.passes.get(PassCode_2021.SaveBugReportDescription).createButton());
}
//---------
@Override
public void setEditorScroll(JScrollPane scroll_in) {
editorPanel.add(scroll_in);
}
@Override
public void setAdditionScroll(JScrollPane scroll_in) {
additionPanel.add(scroll_in);
}
@Override
public JPanel getContent() {
return content;
}
private void createUIComponents() {
// TODO: place custom component creation code here
descriptionTools = new VisualiserMenuBar();
descriptionAdditionTools = new VisualiserMenuBar();
}
}

View File

@@ -0,0 +1,40 @@
<?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.DescriptionTabs">
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<tabbedpane id="c1d95" binding="tabs">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="8093b" binding="editorPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<tabbedpane title="Описание"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
<grid id="2f41a" binding="additionPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<tabbedpane title="Дополнение описания"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</tabbedpane>
</children>
</grid>
</form>

View File

@@ -0,0 +1,37 @@
package Visual_DVM_2021.UI.Main;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.UI.Interface.DescriptionInterface;
import javax.swing.*;
public class DescriptionTabs implements DescriptionInterface {
private JPanel content;
private JTabbedPane tabs;
private JPanel editorPanel;
private JPanel additionPanel;
public DescriptionTabs() {
tabs.setTabComponentAt(0, new TabToolBar("Описание", PassCode_2021.SaveBugReportDescription) {
@Override
public void leftMouseAction() {
tabs.setSelectedIndex(0);
}
});
tabs.setTabComponentAt(1, new TabToolBar("Дополнение", PassCode_2021.AppendBugReportDescription) {
@Override
public void leftMouseAction() {
tabs.setSelectedIndex(1);
}
});
}
@Override
public void setEditorScroll(JScrollPane scroll_in) {
editorPanel.add(scroll_in);
}
@Override
public void setAdditionScroll(JScrollPane scroll_in) {
additionPanel.add(scroll_in);
}
@Override
public JPanel getContent() {
return content;
}
}

View File

@@ -0,0 +1,311 @@
<?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.FileForm">
<grid id="27dc6" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<xy x="20" y="20" width="1046" height="655"/>
</constraints>
<properties>
<minimumSize width="-1" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<splitpane id="c0fc1" binding="SC1">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="350"/>
<dividerSize value="3"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="9272e" binding="messagesBackground" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<minimumSize width="200" height="100"/>
<preferredSize width="200" height="100"/>
</properties>
<border type="none"/>
<children>
<tabbedpane id="2e27d" binding="messagesTabs">
<constraints border-constraint="Center"/>
<properties>
<tabLayoutPolicy value="1"/>
<toolTipText value=""/>
</properties>
<border type="none"/>
<children>
<grid id="97642" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="Примечания" icon="icons/Notes.png">
<tooltip value="Примечания"/>
</tabbedpane>
</constraints>
<properties>
<toolTipText value=""/>
</properties>
<border type="none"/>
<children>
<grid id="c43ed" binding="notesPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="8ff87" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="Предупреждения" icon="icons/Warnings.png">
<tooltip value="Предупреждения"/>
</tabbedpane>
</constraints>
<properties>
<toolTipText value=""/>
</properties>
<border type="none"/>
<children>
<grid id="3ea79" binding="warningsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="e3e70" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="Ошибки" icon="icons/Errors.png">
<tooltip value="Ошибки"/>
</tabbedpane>
</constraints>
<properties>
<toolTipText value=""/>
</properties>
<border type="none"/>
<children>
<grid id="894a8" binding="errorsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="59a3a" binding="recommendationsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<tabbedpane title="Рекомендации" icon="icons/Recomendations.png">
<tooltip value="Рекомендации"/>
</tabbedpane>
</constraints>
<properties>
<toolTipText value="Рекоммендации"/>
</properties>
<border type="none"/>
<children/>
</grid>
<grid id="35438" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="Компиляция" icon="icons/CompilationOutput.png">
<tooltip value="Компиляция"/>
</tabbedpane>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="e0364" binding="compilation_out_panel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="907aa" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="Запуск" icon="icons/RunOutput.png">
<tooltip value="Запуск"/>
</tabbedpane>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="6231d" binding="run_out_panel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="b52a6" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="GCOV" icon="icons/GCOV.PNG">
<tooltip value="GCOV"/>
</tabbedpane>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="cf888" binding="gcov_log_panel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</tabbedpane>
</children>
</grid>
<grid id="a0d95" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="left"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="9b595" binding="SC12">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties>
<dividerLocation value="145"/>
<dividerSize value="3"/>
</properties>
<border type="none"/>
<children>
<grid id="30351" binding="graphsBackground" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<minimumSize width="150" height="150"/>
<preferredSize width="150" height="150"/>
</properties>
<border type="none"/>
<children>
<tabbedpane id="dfe2a" binding="graphsTabs">
<constraints border-constraint="Center"/>
<properties>
<tabLayoutPolicy value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="cd053" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="" icon="icons/Loop.png">
<tooltip value="Циклы"/>
</tabbedpane>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="f6da5" binding="loopsGraphPanel" custom-create="true" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="bbf0" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="" icon="icons/Function.png">
<tooltip value="Процедуры"/>
</tabbedpane>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="f80d0" binding="functionsGraphPanel" custom-create="true" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="44976" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="" icon="icons/Arrays.png">
<tooltip value="Массивы"/>
</tabbedpane>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="1d5e4" binding="arraysGraphPanel" custom-create="true" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</tabbedpane>
</children>
</grid>
<grid id="8202e" binding="editorPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</splitpane>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
</form>

View File

@@ -0,0 +1,358 @@
package Visual_DVM_2021.UI.Main;
import Common.Global;
import Common.UI.Editor.Viewer;
import Common.UI.Menus_2023.FileMenuBar.FileMenuBar;
import Common.UI.Trees.TreeForm;
import Common.UI.UI;
import Common.Utils.Utils;
import GlobalData.Settings.SettingName;
import ProjectData.Files.DBProjectFile;
import ProjectData.Files.UI.Editor.SPFEditor;
import ProjectData.LanguageName;
import ProjectData.Messages.Errors.MessageError;
import ProjectData.Messages.Notes.MessageNote;
import ProjectData.Messages.Warnings.MessageWarning;
import ProjectData.SapforData.Arrays.UI.FileArraysTree;
import ProjectData.SapforData.Functions.UI.FileFunctionsTree;
import ProjectData.SapforData.Loops.UI.FileLoopsTree;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021;
import Visual_DVM_2021.UI.Interface.FileWindow;
import Visual_DVM_2021.UI.Interface.FormWithSplitters;
import Visual_DVM_2021.UI.Interface.SPFEditorInterface;
import com.sun.org.glassfish.gmbal.Description;
import org.fife.ui.rtextarea.RTextScrollPane;
import javax.swing.*;
import java.awt.*;
public class FileForm implements FileWindow, FormWithSplitters {
//контролы в столбцах
//https://stackoverflow.com/questions/7137786/how-can-i-put-a-control-in-the-jtableheader-of-a-jtable
//todo _ временно
public static int current_file_line = Utils.Nan;
private final Viewer compilationOutput;
private final Viewer runOutput;
private final Viewer gcovLog;
private final DBProjectFile file;
//-
public JSplitPane SC1;
public JSplitPane SC12;
//-
private JPanel content;
@Description("IGNORE")
protected boolean events_on = true;
private JButton bClose;
private JToolBar Tools;
private JPanel editorPanel;
private JTabbedPane messagesTabs;
private JPanel notesPanel;
private JPanel warningsPanel;
private JPanel errorsPanel;
private JTabbedPane graphsTabs;
private JPanel loopsGraphPanel;
private JPanel functionsGraphPanel;
private JPanel arraysGraphPanel;
private JPanel gcov_log_panel;
private JPanel compilation_out_panel;
private JPanel run_out_panel;
//---------------->
private JPanel recommendationsPanel;
private JPanel graphsBackground;
private JPanel messagesBackground;
//--------------->
//-
private TreeForm loopsForm; //рудиментарно. следует сделать интерфейс такой же как у таблиц
private TreeForm functionsForm;
private TreeForm arraysForm;
//-
private SPFEditor Body = null; //времянка? не очень красиво.
FileMenuBar menuBar = null;
//-
public FileForm(DBProjectFile file_in) {
LoadSplitters();
//--
MessageWarning.filterValue = "";
MessageError.filterValue = "";
MessageNote.filterValue="";
//-
file = file_in;
file.father.db.notes.mountUI(notesPanel);
file.father.db.warnings.mountUI(warningsPanel);
file.father.db.errors.mountUI(errorsPanel);
file.father.db.recommendations.mountUI(recommendationsPanel);
//---------------------------------------------------------------------------
compilation_out_panel.add(new JScrollPane(compilationOutput = new Viewer()));
run_out_panel.add(new JScrollPane(runOutput = new Viewer()));
gcov_log_panel.add(new JScrollPane(gcovLog = new Viewer()));
//----------------------------------------------------------------------------
ShowText();
ShowMessages();
ShowGCOVLog();
ShowAllAnalyses();
Body.addCaretListener(ce -> ShowCaretInfo());
editorPanel.add(menuBar = new FileMenuBar(Body), BorderLayout.NORTH);
ShowCaretInfo();
Body.requestFocus();
RefreshTabsNames();
menuBar.sToGo.addChangeListener(e -> Body.gotoLine((Integer) menuBar.sToGo.getValue()));
ShowProperties();
Pass_2021.passes.get(PassCode_2021.Save).setControlsEnabled(false);
}
@Override
public void ShowLanguage() {
Body.switching_language = true;
if (file.languageName.equals(LanguageName.fortran)) {
switch (file.style) {
case fixed:
case extended:
case none:
Body.setSyntaxEditingStyle("text/FortranSPF");
break;
case free:
Body.setSyntaxEditingStyle("text/FreeFortranSPF");
break;
}
} else
Body.setSyntaxEditingStyle(file.languageName.getStyleKey());
Body.setCodeFoldingEnabled(true);
Body.switching_language = false;
menuBar.ShowLanguage();
}
@Override
public void ShowType() {
menuBar.ShowType();
}
@Override
public void ShowStyle() {
Body.switching_language = true;
int m = file.style.getMargin();
Body.setMarginLineEnabled(true);
Body.setMarginLinePosition(m);
if (m <= 0)
Body.setMarginLineEnabled(false);
if (file.languageName.equals(LanguageName.fortran)) {
switch (file.style) {
case fixed:
case extended:
case none:
Body.setSyntaxEditingStyle("text/FortranSPF");
break;
case free:
Body.setSyntaxEditingStyle("text/FreeFortranSPF");
break;
}
}
Body.switching_language = false;
menuBar.ShowStyle();
}
@Override
public SPFEditorInterface getEditor() {
return Body;
}
@Override
public void FocusLoops() {
graphsTabs.setSelectedIndex(0);
}
@Override
public void FocusFunctions() {
graphsTabs.setSelectedIndex(1);
}
@Override
public void FocusArrays() {
graphsTabs.setSelectedIndex(2);
}
//----
@Override
public void ShowWarningsCount() {
boolean flag = Global.db.settings.get(SettingName.ShowFullTabsNames).toBoolean();
messagesTabs.setTitleAt(1, (flag ? "Предупреждения: " : "") + file.father.db.warnings.getVisibleKeys().size());
}
@Override
public void ShowErrorsCount() {
boolean flag = Global.db.settings.get(SettingName.ShowFullTabsNames).toBoolean();
messagesTabs.setTitleAt(2, (flag ? "Ошибки: " : "") + file.father.db.errors.getVisibleKeys().size());
}
@Override
public void ShowNotesCount() {
boolean flag = Global.db.settings.get(SettingName.ShowFullTabsNames).toBoolean();
messagesTabs.setTitleAt(0, (flag ? "Примечания: " : "") + file.father.db.notes.getVisibleKeys().size());
}
@Override
public void ShowRecommendationsCount() {
boolean flag = Global.db.settings.get(SettingName.ShowFullTabsNames).toBoolean();
messagesTabs.setTitleAt(3, (flag ? "Рекомендации: " : "") + file.father.db.recommendations.getVisibleKeys().size());
}
//---
@Override
public void RefreshTabsNames() {
UI.ShowTabsNames(graphsTabs);
boolean flag = Global.db.settings.get(SettingName.ShowFullTabsNames).toBoolean();
//--
ShowNotesCount();
ShowWarningsCount();
ShowErrorsCount();
ShowRecommendationsCount();
//--
messagesTabs.setTitleAt(4, (flag ? "Компиляция" : ""));
messagesTabs.setTitleAt(5, (flag ? "Запуск" : ""));
messagesTabs.setTitleAt(6, (flag ? "Журнал GCOV" : ""));
}
@Override
public void FocusCompilationOut() {
messagesTabs.setSelectedIndex(4);
}
@Override
public void ShowText() {
UI.Clear(editorPanel);
editorPanel.add(new RTextScrollPane(Body = new SPFEditor(file)));
UI.getSearchReplaceForm().setEditor(Body);
if (UI.getSearchReplaceForm().isVisible())
UI.getSearchReplaceForm().requestFocus();
}
@Override
public void ShowMessages() {
file.father.db.notes.ShowUI();
file.father.db.warnings.ShowUI();
file.father.db.errors.ShowUI();
file.father.db.recommendations.ShowUI();
ShowNotesCount();
ShowWarningsCount();
ShowErrorsCount();
ShowRecommendationsCount();
//-
FocusMessagesPriority();
}
@Override
public void ShowNoMessages() {
boolean full_tiles = Global.db.settings.get(SettingName.ShowFullTabsNames).toBoolean();
file.father.db.notes.ClearUI();
file.father.db.warnings.ClearUI();
file.father.db.errors.ClearUI();
file.father.db.recommendations.ClearUI();
messagesTabs.setTitleAt(0, (full_tiles ? "Примечания: " : "") + "-");
messagesTabs.setTitleAt(1, (full_tiles ? "Предупреждения: " : "") + "-");
messagesTabs.setTitleAt(2, (full_tiles ? "Ошибки: " : "") + "-");
messagesTabs.setTitleAt(3, (full_tiles ? "Рекомендации: " : "") + "-");
}
@Override
public void ShowLoops() {
loopsForm.Show();
Body.HighlightLoops();
}
@Override
public void ShowNoLoops() {
loopsForm.Clear();
Body.ClearLoopsHighLights();
}
@Override
public void ShowGCOVLog() {
gcovLog.setText(file.GCOVLog);
}
@Override
public void ShowGCOV() {
Body.HighlightGCOV();
}
@Override
public void ShowNoGCOVLog() {
gcovLog.setText("");
}
@Override
public void FocusGCOVLog() {
messagesTabs.setSelectedIndex(6);
}
@Override
public void ShowNoGCOV() {
Body.ClearGOCVHighlights();
}
@Override
public void ShowFunctions() {
functionsForm.Show();
}
@Override
public void ShowNoFunctions() {
functionsForm.Clear();
}
@Override
public void ShowArrays() {
arraysForm.Show();
}
@Override
public void ShowNoArrays() {
arraysForm.Clear();
}
public void EventsOn() {
events_on = true;
}
public void EventsOff() {
events_on = false;
}
@Override
public void ShowCaretInfo() {
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,
1, Body.getLineCount(), 1
));
//-
menuBar.ShowLinesCount();
menuBar.CurrentSymbolLabel.setText(String.valueOf(Body.getCurrentSymbol()));
//если выделяем строку из графа, то тоже надо отключиьт события.
//чтобы по ней не начался поиск.
if (events_on && line_changed) {
// System.out.println("Search in graphs by line...");
if (loopsForm.getTree() != null)
loopsForm.getTree().SelectNodeByCriteria(current_file_line);
if (functionsForm.getTree() != null)
functionsForm.getTree().SelectNodeByCriteria(current_file_line);
if (arraysForm.getTree() != null)
arraysForm.getTree().SelectNodeByCriteria(current_file_line);
// System.out.println("DONE");
}
}
@Override
public void FocusMessagesPriority() {
switch (file.state) {
case HasErrors:
messagesTabs.setSelectedIndex(2);
break;
case HasWarnings:
messagesTabs.setSelectedIndex(1);
break;
default:
messagesTabs.setSelectedIndex(0);
break;
}
}
@Override
public void ShowFirstError() {
if (file.father.db.errors.ui_.control.getRowCount() > 0)
file.father.db.errors.ui_.control.SelectRow(0);
}
@Override
public void ShowCompilationOutput() {
compilationOutput.setText(file.father.compilation_output);
}
@Override
public void ShowNoCompilationOutput() {
compilationOutput.setText("");
}
@Override
public void ShowRunOutput() {
runOutput.setText(file.father.run_output);
}
@Override
public void ShowNoRunOutput() {
runOutput.setText("");
}
private void createUIComponents() {
// TODO: place custom component creation code here
loopsGraphPanel = (loopsForm = new TreeForm(FileLoopsTree.class)).getContent();
functionsGraphPanel = (functionsForm = new TreeForm(FileFunctionsTree.class)).getContent();
arraysGraphPanel = (arraysForm = new TreeForm(FileArraysTree.class)).getContent();
}
@Override
public JPanel getContent() {
return content;
}
}

View File

@@ -0,0 +1,276 @@
<?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.FunctionsForm">
<grid id="27dc6" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<xy x="20" y="20" width="1142" height="539"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<toolbar id="c0a67" binding="tools">
<constraints border-constraint="North"/>
<properties>
<floatable value="false"/>
</properties>
<border type="none"/>
<children>
<component id="c7ef9" class="javax.swing.JButton" binding="bZoomIn">
<constraints/>
<properties>
<borderPainted value="false"/>
<icon value="icons/Editor/Font+.png"/>
<maximumSize width="30" height="30"/>
<minimumSize width="30" height="30"/>
<preferredSize width="30" height="30"/>
<text value=""/>
<toolTipText value="Приблизить граф"/>
</properties>
</component>
<component id="169ae" class="javax.swing.JButton" binding="bZoomOut">
<constraints/>
<properties>
<borderPainted value="false"/>
<icon value="icons/Editor/Font-.png"/>
<maximumSize width="30" height="30"/>
<minimumSize width="30" height="30"/>
<preferredSize width="30" height="30"/>
<text value=""/>
<toolTipText value="Отдалить граф"/>
</properties>
</component>
<component id="752bf" class="javax.swing.JButton" binding="bSaveGraphAsImage">
<constraints/>
<properties>
<borderPainted value="false"/>
<icon value="icons/ScreenShot.png"/>
<maximumSize width="30" height="30"/>
<minimumSize width="30" height="30"/>
<preferredSize width="30" height="30"/>
<text value=""/>
<toolTipText value="Сохранить граф как изображение"/>
</properties>
</component>
<component id="6e55b" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="14" style="0"/>
<foreground color="-16777216"/>
<text value=" итераций "/>
</properties>
</component>
<component id="f28ef" class="javax.swing.JSpinner" binding="sIterations">
<constraints/>
<properties>
<font name="Times New Roman" size="14" style="0"/>
<maximumSize width="60" height="26"/>
<minimumSize width="60" height="26"/>
<preferredSize width="60" height="26"/>
</properties>
</component>
<component id="9c7af" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="14" style="0"/>
<foreground color="-16777216"/>
<text value=" связность "/>
</properties>
</component>
<component id="db983" class="javax.swing.JSpinner" binding="sResistance">
<constraints/>
<properties>
<font name="Times New Roman" size="14" style="0"/>
<maximumSize width="60" height="26"/>
<minimumSize width="60" height="26"/>
<preferredSize width="60" height="26"/>
</properties>
</component>
<component id="ce20c" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="14" style="0"/>
<foreground color="-16777216"/>
<text value=" шкала экрана "/>
</properties>
</component>
<component id="7c318" class="javax.swing.JSpinner" binding="sScreen">
<constraints/>
<properties>
<font name="Times New Roman" size="14" style="0"/>
<maximumSize width="60" height="26"/>
<minimumSize width="60" height="26"/>
<preferredSize width="60" height="26"/>
</properties>
</component>
</children>
</toolbar>
<grid id="77a07" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children>
<toolbar id="af12" binding="filtersBar">
<constraints border-constraint="North"/>
<properties>
<floatable value="false"/>
<font name="Times New Roman" size="10"/>
<preferredSize width="0" height="30"/>
</properties>
<border type="none"/>
<children>
<component id="14db3" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="12" style="0"/>
<foreground color="-16777216"/>
<text value="по имени: "/>
</properties>
</component>
<component id="882a1" class="javax.swing.JTextField" binding="filterName" custom-create="true">
<constraints/>
<properties>
<font name="Times New Roman" size="12"/>
<maximumSize width="150" height="30"/>
<minimumSize width="150" height="30"/>
<preferredSize width="150" height="30"/>
</properties>
</component>
<component id="8ac16" class="javax.swing.JCheckBox" binding="ShowStandardFilter">
<constraints/>
<properties>
<font name="Times New Roman" size="12" style="2"/>
<horizontalAlignment value="10"/>
<icon value="icons/NotPick.png"/>
<maximumSize width="115" height="30"/>
<minimumSize width="115" height="30"/>
<preferredSize width="115" height="30"/>
<selected value="true"/>
<selectedIcon value="icons/Pick.png"/>
<text value="стандартные"/>
<toolTipText value="Отображать стандартные процедуры"/>
<verticalTextPosition value="0"/>
</properties>
</component>
<component id="1334f" class="javax.swing.JCheckBox" binding="ShowExternalFilter">
<constraints/>
<properties>
<font name="Times New Roman" size="12" style="2"/>
<horizontalAlignment value="10"/>
<icon value="icons/NotPick.png"/>
<maximumSize width="85" height="30"/>
<minimumSize width="85" height="30"/>
<preferredSize width="85" height="30"/>
<selected value="true"/>
<selectedIcon value="icons/Pick.png"/>
<text value="внешние"/>
<toolTipText value="Отображать внешние процедуры"/>
<verticalTextPosition value="0"/>
</properties>
</component>
<component id="b366c" class="javax.swing.JCheckBox" binding="ShowUnreachableFilter">
<constraints/>
<properties>
<font name="Times New Roman" size="12" style="2"/>
<horizontalAlignment value="10"/>
<icon value="icons/NotPick.png"/>
<maximumSize width="124" height="30"/>
<minimumSize width="124" height="30"/>
<preferredSize width="124" height="30"/>
<selected value="true"/>
<selectedIcon value="icons/Pick.png"/>
<text value="недостижимые"/>
<toolTipText value="Отображать недостижимые процедуры"/>
<verticalTextPosition value="0"/>
</properties>
</component>
<component id="6b691" class="javax.swing.JCheckBox" binding="cbShowByCurrentFunction">
<constraints/>
<properties>
<font name="Times New Roman" size="12" style="2"/>
<horizontalAlignment value="10"/>
<icon value="icons/NotPick.png"/>
<maximumSize width="154" height="30"/>
<minimumSize width="154" height="30"/>
<preferredSize width="154" height="30"/>
<selected value="false"/>
<selectedIcon value="icons/Pick.png"/>
<text value="смежные c текущей: "/>
<toolTipText value="будут отображены только процедуры смежные с текущей"/>
<verticalTextPosition value="0"/>
</properties>
</component>
<component id="abdcb" class="javax.swing.JLabel" binding="lCurrentFunction">
<constraints/>
<properties>
<font name="Times New Roman" size="12"/>
<foreground color="-16777216"/>
<text value="? "/>
</properties>
</component>
<component id="61dd9" class="javax.swing.JLabel" binding="depthLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="12"/>
<foreground color="-16777216"/>
<text value=" глубина "/>
<toolTipText value="глубина вызовов"/>
</properties>
</component>
<component id="30af9" class="javax.swing.JSpinner" binding="sDepth">
<constraints/>
<properties>
<font name="Times New Roman" size="12"/>
<maximumSize width="60" height="26"/>
<minimumSize width="60" height="26"/>
<preferredSize width="60" height="26"/>
</properties>
</component>
<component id="e180e" class="javax.swing.JCheckBox" binding="ShowIn">
<constraints/>
<properties>
<font name="Times New Roman" size="12" style="2"/>
<horizontalAlignment value="10"/>
<icon value="icons/NotPick.png"/>
<maximumSize width="91" height="30"/>
<minimumSize width="91" height="30"/>
<preferredSize width="91" height="30"/>
<selected value="true"/>
<selectedIcon value="icons/Pick.png"/>
<text value="входящие"/>
<toolTipText value="Отображать входящие в текущую процедуру вызовы"/>
<verticalTextPosition value="0"/>
</properties>
</component>
<component id="fa7b2" class="javax.swing.JCheckBox" binding="ShowOut">
<constraints/>
<properties>
<font name="Times New Roman" size="12" style="2"/>
<horizontalAlignment value="10"/>
<icon value="icons/NotPick.png"/>
<maximumSize width="97" height="30"/>
<minimumSize width="97" height="30"/>
<preferredSize width="97" height="30"/>
<selected value="true"/>
<selectedIcon value="icons/Pick.png"/>
<text value="исходящие"/>
<toolTipText value="Отображать исходящие из текущей процедуры вызовы"/>
<verticalTextPosition value="0"/>
</properties>
</component>
</children>
</toolbar>
<grid id="9d9dc" binding="functionsGraphPanel" custom-create="true" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties>
<background color="-4144960"/>
<font/>
<foreground color="-10197916"/>
<opaque value="false"/>
</properties>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</grid>
</form>

View File

@@ -0,0 +1,195 @@
package Visual_DVM_2021.UI.Main;
import Common.Current;
import Common.UI.TextField.StyledTextField;
import Common.UI.UI;
import ProjectData.SapforData.Functions.UI.Graph.FunctionsGraphForm;
import ProjectData.SapforData.Functions.UI.Graph.FunctionsGraphUI;
import Visual_DVM_2021.Passes.All.SPF_GetGraphFunctionPositions;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021;
import Visual_DVM_2021.UI.Interface.FunctionsWindow;
import javafx.util.Pair;
import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class FunctionsForm implements FunctionsWindow {
private JPanel content;
private JButton bFitToScreen;
private JButton bZoomIn;
private JButton bZoomOut;
private JButton bSaveGraphAsImage;
private JSpinner sIterations;
private JSpinner sResistance;
private JSpinner sScreen;
private JToolBar tools;
private JTextField filterName;
private JCheckBox ShowStandardFilter;
private JCheckBox ShowExternalFilter;
private JCheckBox ShowUnreachableFilter;
private JSpinner sDepth;
private JCheckBox ShowIn;
private JCheckBox ShowOut;
private JPanel functionsGraphPanel;
private JCheckBox cbShowByCurrentFunction;
private JLabel lCurrentFunction;
private JToolBar filtersBar;
private JLabel depthLabel;
private JButton bSaveCoordinates;
private JToolBar currentFunctionTools;
private FunctionsGraphForm functionsGraphForm;
@Override
public JPanel getContent() {
return content;
}
@Override
public Pair<Integer, Integer> getFunctionsGraphPanelSizes() {
return new Pair<>(functionsGraphPanel.getWidth(), functionsGraphPanel.getHeight());
}
@Override
public FunctionsGraphForm getFunctionsGraphWindow() {
return functionsGraphForm;
}
@Override
public void ShowFunctions() {
functionsGraphForm.Show();
}
@Override
public void ShowNoFunctions() {
functionsGraphForm.Clear();
}
@Override
public void ShowCurrentFunction() {
lCurrentFunction.setText(Current.getFunction().funcName);
}
@Override
public void ShowNoCurrentFunction() {
lCurrentFunction.setText("?");
}
public void ShowFunctionGraphSettings() {
ShowStandardFilter.setSelected(SPF_GetGraphFunctionPositions.showStandardFunctions);
ShowExternalFilter.setSelected(SPF_GetGraphFunctionPositions.showExternalFunctions);
ShowUnreachableFilter.setSelected(SPF_GetGraphFunctionPositions.showUnreachableFunctions);
//-
sIterations.setValue(Current.getProject().fgIterations);
sResistance.setValue(Current.getProject().fgResistance);
sScreen.setValue(Current.getProject().fgScreen);
//-
cbShowByCurrentFunction.setSelected(SPF_GetGraphFunctionPositions.showByCurrentFunction);
ShowIn.setSelected(SPF_GetGraphFunctionPositions.showIn);
ShowOut.setSelected(SPF_GetGraphFunctionPositions.showOut);
sDepth.setValue(SPF_GetGraphFunctionPositions.depth);
}
public FunctionsForm() {
LoadSplitters();
bZoomIn.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
functionsGraphForm.control.zoomIn();
}
});
bZoomOut.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
functionsGraphForm.control.zoomOut();
}
});
bSaveGraphAsImage.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Pass_2021.passes.get(PassCode_2021.SaveGraph).Do();
}
});
sIterations.setModel(new SpinnerNumberModel(Current.getProject().fgIterations,
100, 5000, 100
));
sResistance.setModel(new SpinnerNumberModel(Current.getProject().fgResistance,
10, 5000, 50
));
sScreen.setModel(new SpinnerNumberModel(Current.getProject().fgScreen,
0.25, 2.0, 0.05
));
sDepth.setModel(new SpinnerNumberModel(1,
0, 64, 1
));
UI.MakeSpinnerRapid(sIterations, e -> {
Current.getProject().UpdatefgIterations((int) sIterations.getValue());
FunctionsGraphUI.ffTimer.restart();
});
UI.MakeSpinnerRapid(sResistance, e -> {
Current.getProject().UpdatefgResistance((int) sResistance.getValue());
FunctionsGraphUI.ffTimer.restart();
});
UI.MakeSpinnerRapid(sScreen, e -> {
Current.getProject().UpdatefgScreen((double) sScreen.getValue());
FunctionsGraphUI.ffTimer.restart();
});
UI.MakeSpinnerRapid(sDepth, e -> {
SPF_GetGraphFunctionPositions.depth = (int) sDepth.getValue();
FunctionsGraphUI.ffTimer.restart();
});
//----фильтрация функций
//<editor-fold desc="Фильтрация функций">
FunctionsGraphUI.ffTimer.setRepeats(false);
filterName.setText(SPF_GetGraphFunctionPositions.filterName);
filterName.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
SPF_GetGraphFunctionPositions.filterName = filterName.getText();
FunctionsGraphUI.ffTimer.restart();
}
@Override
public void removeUpdate(DocumentEvent e) {
SPF_GetGraphFunctionPositions.filterName = filterName.getText();
FunctionsGraphUI.ffTimer.restart();
}
@Override
public void changedUpdate(DocumentEvent e) {
}
});
ShowFunctionGraphSettings();
//-
ShowStandardFilter.addActionListener(e -> {
SPF_GetGraphFunctionPositions.showStandardFunctions = ShowStandardFilter.isSelected();
FunctionsGraphUI.ffTimer.stop();
Pass_2021.passes.get(PassCode_2021.SPF_GetGraphFunctionPositions).Do();
});
ShowExternalFilter.addActionListener(e -> {
SPF_GetGraphFunctionPositions.showExternalFunctions = ShowExternalFilter.isSelected();
FunctionsGraphUI.ffTimer.stop();
Pass_2021.passes.get(PassCode_2021.SPF_GetGraphFunctionPositions).Do();
});
ShowUnreachableFilter.addActionListener(e -> {
SPF_GetGraphFunctionPositions.showUnreachableFunctions = ShowUnreachableFilter.isSelected();
FunctionsGraphUI.ffTimer.stop();
Pass_2021.passes.get(PassCode_2021.SPF_GetGraphFunctionPositions).Do();
});
cbShowByCurrentFunction.addActionListener(e -> {
SPF_GetGraphFunctionPositions.showByCurrentFunction = cbShowByCurrentFunction.isSelected();
FunctionsGraphUI.ffTimer.stop();
Pass_2021.passes.get(PassCode_2021.SPF_GetGraphFunctionPositions).Do();
});
ShowIn.addActionListener(e -> {
SPF_GetGraphFunctionPositions.showIn = ShowIn.isSelected();
FunctionsGraphUI.ffTimer.stop();
Pass_2021.passes.get(PassCode_2021.SPF_GetGraphFunctionPositions).Do();
});
ShowOut.addActionListener(e -> {
SPF_GetGraphFunctionPositions.showOut = ShowOut.isSelected();
FunctionsGraphUI.ffTimer.stop();
Pass_2021.passes.get(PassCode_2021.SPF_GetGraphFunctionPositions).Do();
});
//---------------------------------------------------------
filtersBar.add(Pass_2021.passes.get(PassCode_2021.SPF_GetGraphFunctionPositions).createButton(), 0);
filtersBar.add(Pass_2021.passes.get(PassCode_2021.ApplyCurrentFunction).createButton(), 6);
filtersBar.setPreferredSize(new Dimension(0,30));
}
private void createUIComponents() {
// TODO: place custom component creation code here
functionsGraphPanel = (functionsGraphForm = new FunctionsGraphForm()).getContent();
filterName = new StyledTextField();
}
}

View File

@@ -0,0 +1,28 @@
<?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.MainForm">
<grid id="27dc6" binding="Content" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<xy x="20" y="20" width="1105" height="424"/>
</constraints>
<properties>
<minimumSize width="-1" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="cea1" binding="mainPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children>
<tabbedpane id="7434f" binding="globalTabs">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</tabbedpane>
</children>
</grid>
</children>
</grid>
</form>

View File

@@ -0,0 +1,194 @@
package Visual_DVM_2021.UI.Main;
import Common.Current;
import Common.Global;
import Common.UI.UI;
import Common.UI.Windows.Form;
import Common.UI.Windows.FormType;
import Common.Utils.Utils;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021;
import Visual_DVM_2021.UI.Interface.CallbackWindow;
import Common.UI.Menus_2023.MainMenuBar.MainWindow;
import Visual_DVM_2021.UI.Interface.ProjectWindow;
import Visual_DVM_2021.UI.Interface.TestingWindow;
import javax.swing.*;
import java.awt.*;
public class MainForm extends Form implements MainWindow {
private final WelcomeForm welcomeForm = new WelcomeForm(); //заглушка когда проекта нет.
int global_index = 0;
//-----------------
private ProjectForm projectForm;
private CallbackForm callbackForm;
private TestingForm testingForm;
//-----------------
private JPanel Content;
private JTabbedPane globalTabs;
private JPanel mainPanel;
public MainForm() {
mainPanel.add(UI.mainMenuBar, BorderLayout.NORTH);
InstallWelcomePanel();
InstallCallbackPanel();
InstallTestingPanel();
ShowUpdatesIcon();
//----------------------
}
@Override
protected JPanel getMainPanel() {
return Content;
}
@Override
protected FormType getFormType() {
return FormType.Main;
}
@Override
public String getIconName() {
return "Sapfor.png";
}
@Override
public String getWTitleText() {
return "Visual Sapfor 3.0";
}
@Override
public String getUTitleText() {
return "Visual Sapfor 3.0";
}
@Override
public void AfterClose() {
Pass_2021.passes.get(PassCode_2021.CloseCurrentProject).Do();
if (UI.getVersionsWindow() != null)
((VersionsForm) UI.getVersionsWindow()).SaveSplitters();
SaveCallbackPanel();
SaveTestingPanel();
Global.FinishApplication();
}
private void InstallWelcomePanel() {
globalTabs.insertTab("Начало работы",
null,
welcomeForm.content,
"Для начала работы откройте проект с помощью правой панели инструментов или перетащите его сюда", 0
);
}
private void InstallProjectPanel() {
// globalTabs.insertTab("Проект: " + Current.getProject().name,
// Utils.getIcon("/icons/Common.png"),
// (projectForm = new ProjectForm()).content, Current.getProject().description, 0);
globalTabs.insertTab("", null,
(projectForm = new ProjectForm()).content, Current.getProject().description, 0);
globalTabs.setTabComponentAt(0,
new TabToolBar("Проект: " + Current.getProject().name, PassCode_2021.CloseCurrentProject){
@Override
public void leftMouseAction() {
globalTabs.setSelectedIndex(0);
}
});
}
private void RemoveProjectPanel() {
globalTabs.removeTabAt(0);
if (projectForm != null) {
projectForm.SaveSplitters();
projectForm = null;
}
}
private void InstallCallbackPanel() {
globalTabs.insertTab("Обратная связь",
Utils.getIcon("/icons/Bug.png"),
(callbackForm = new CallbackForm()).getContent(),
"Журнал ошибок и связь с разработчиками", 1);
}
private void SaveCallbackPanel() {
if (callbackForm != null) {
callbackForm.SaveSplitters();
callbackForm = null;
}
}
private void InstallTestingPanel() {
testingForm = new TestingForm();
ShowTestingTab();
}
@Override
public void ShowTestingTab() {
if (globalTabs.getTabCount() < 4)
globalTabs.insertTab("Тестирование",
Utils.getIcon("/icons/Session.png"),
testingForm.getContent(),
"Система тестирования", 2);
}
@Override
public void HideTestingTab() {
if (globalTabs.getTabCount() == 3)
globalTabs.removeTabAt(2);
}
private void SaveTestingPanel() {
if (testingForm != null) {
testingForm.SaveSplitters();
testingForm = null;
}
}
private void saveGlobalTab() {
global_index = globalTabs.getSelectedIndex();
}
private void restoreGlobalTab() {
globalTabs.setSelectedIndex(global_index);
}
@Override
public ProjectWindow getProjectWindow() {
return projectForm;
}
@Override
public CallbackWindow getCallbackWindow() {
return callbackForm;
}
@Override
public void ShowUpdatesIcon() {
UI.mainMenuBar.ShowUpdatesIcon();
}
@Override
public void FocusProject() {
globalTabs.setSelectedIndex(0);
}
@Override
public void FocusCallback() {
globalTabs.setSelectedIndex(1);
}
@Override
public void FocusTesting() {
globalTabs.setSelectedIndex(2);
}
@Override
public TestingWindow getTestingWindow() {
return testingForm;
}
@Override
public void Show() {
//приходится идти на это только ПОСЛЕ создания главного окна.
// иначе ссылка на главное окно в методах пустая.
getCallbackWindow().ShowAll();
if (getTestingWindow() != null)
getTestingWindow().ShowAll();
UI.windowsStack.push(this);
System.out.println("New Front Window");
super.Show();
}
@Override
public void ShowProject() {
getTestingWindow().ShowProject();
//-
saveGlobalTab();
RemoveProjectPanel();
InstallProjectPanel();
restoreGlobalTab();
getTestingWindow().DropCompilationTasksComparison();
UI.mainMenuBar.ShowProject(true);
}
@Override
public void ShowNoProject() {
getTestingWindow().ShowNoProject();
//-
saveGlobalTab();
RemoveProjectPanel();
InstallWelcomePanel();
restoreGlobalTab();
UI.mainMenuBar.ShowProject(false);
}
}

View File

@@ -0,0 +1,11 @@
package Visual_DVM_2021.UI.Main;
import Common.Current;
public class PackageVersionsComparisonForm extends VersionsComparisonForm{
public PackageVersionsComparisonForm(PackageVersionsComparisonForm slave_in) {
super(slave_in);
}
@Override
protected Current getCurrentObjectName() {
return Current.PackageVersion;
}
}

View File

@@ -0,0 +1,43 @@
<?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.ProfilesFields">
<grid id="27dc6" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<xy x="20" y="20" width="500" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="67149" binding="SC61">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="100"/>
<dividerSize value="3"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="84c7b" binding="profilesPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<minimumSize width="-1" height="120"/>
</properties>
<border type="none"/>
<children/>
</grid>
<grid id="d663" binding="settingsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<minimumSize width="-1" height="120"/>
</properties>
<border type="none"/>
<children/>
</grid>
</children>
</splitpane>
</children>
</grid>
</form>

View File

@@ -0,0 +1,21 @@
package Visual_DVM_2021.UI.Main;
import Common.Global;
import Common.UI.Windows.Dialog.DialogFields;
import Visual_DVM_2021.UI.Interface.FormWithSplitters;
import javax.swing.*;
import java.awt.*;
public class ProfilesFields implements DialogFields, FormWithSplitters {
private JPanel content;
public JSplitPane SC61;
private JPanel profilesPanel;
private JPanel settingsPanel;
@Override
public Component getContent() {
return content;
}
public ProfilesFields(){
Global.db.sapforProfiles.mountUI(profilesPanel);
Global.db.sapforProfilesSettings.mountUI(settingsPanel);
}
}

View File

@@ -0,0 +1,71 @@
package Visual_DVM_2021.UI.Main;
import Common.Global;
import Common.UI.Windows.Dialog.Dialog;
import Common.UI.Windows.FormType;
import GlobalData.FormsParams.DBForm;
public class ProfilesForm extends Dialog<Object, ProfilesFields> {
private DBForm info = null;
public ProfilesForm() {
super(ProfilesFields.class);
}
@Override
public boolean NeedsScroll() {
return false;
}
@Override
public void CreateButtons() {
}
@Override
public void Init(Object... params) {
if (Global.db.sapforProfiles.size() > 0) {
for (Object key : Global.db.sapforProfiles.Data.keySet()) {
Global.db.sapforProfiles.ShowUI(key);
return;
}
} else {
Global.db.sapforProfiles.ShowUI();
}
}
@Override
public int getDefaultWidth() {
return 400;
}
@Override
public int getDefaultHeight() {
return 300;
}
@Override
public void CreateContent() {
super.CreateContent();
fields.LoadSplitters();
try {
LoadWindowParameters();
} catch (Exception ex) {
ex.printStackTrace();
}
}
@Override
public void onClose() {
fields.SaveSplitters();
try {
SaveWindowParameters();
} catch (Exception ex) {
ex.printStackTrace();
}
}
public void LoadWindowParameters() throws Exception {
if (Global.db.forms.Data.containsKey(FormType.Profiles)) {
info = Global.db.forms.Data.get(FormType.Profiles);
info.Apply(this);
return;
}
setSize(getDefaultWidth(), getDefaultHeight());
}
public void SaveWindowParameters() throws Exception {
if (info != null) {
info.Init(this);
Global.db.Update(info);
} else
Global.db.Insert(new DBForm(FormType.Profiles, this));
}
}

View File

@@ -0,0 +1,189 @@
<?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.ProjectForm">
<grid id="27dc6" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<xy x="20" y="20" width="1330" height="468"/>
</constraints>
<properties>
<minimumSize width="-1" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="bf9cd" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children>
<tabbedpane id="11ba1" binding="projectTabs">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<tabLayoutPolicy value="1"/>
<tabPlacement value="1"/>
</properties>
<border type="none"/>
<children>
<grid id="7bb8d" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="Файл: -" icon="icons/Generate.png">
<tooltip value="Код"/>
</tabbedpane>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="-1" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<splitpane id="68abc" binding="SC3">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties>
<dividerLocation value="650"/>
<dividerSize value="3"/>
<orientation value="1"/>
</properties>
<border type="none"/>
<children>
<grid id="b29f8" binding="filePanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="550" height="250"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children/>
</grid>
<grid id="45a5e" binding="projectBackground" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="250" height="250"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="12cee" binding="projectViewPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties>
<minimumSize width="0" height="0"/>
</properties>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
<grid id="c4ea6" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="" icon="icons/Arrays.png">
<tooltip value="Массивы"/>
</tabbedpane>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="-1" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="143c4" binding="arraysFormPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="a4700" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="" icon="icons/Function.png">
<tooltip value="Процедуры"/>
</tabbedpane>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="-1" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="a93f7" binding="functionsFormPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="-1" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="3cb4d" binding="analysisFormPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<tabbedpane title="" icon="icons/Metrics.png">
<tooltip value="Анализ"/>
</tabbedpane>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="-1" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children/>
</grid>
<grid id="59473" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="" icon="icons/Log.png">
<tooltip value="Журнал"/>
</tabbedpane>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="-1" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<scrollpane id="43580" binding="logScroll" custom-create="true">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</scrollpane>
</children>
</grid>
</children>
</tabbedpane>
</children>
</grid>
</children>
</grid>
</form>

View File

@@ -0,0 +1,292 @@
package Visual_DVM_2021.UI.Main;
import Common.Current;
import Common.Global;
import Common.UI.Editor.Viewer;
import Common.UI.Menus_2023.ProjectMenuBar.ProjectMenuBar;
import Common.UI.Trees.TreeForm;
import Common.UI.UI;
import Common.Utils.Utils;
import GlobalData.Settings.SettingName;
import ProjectData.Files.DBProjectFile;
import ProjectData.Files.UI.FilesTree;
import ProjectData.ProjectView;
import ProjectData.SapforData.Functions.UI.InlineTree;
import ProjectData.SapforData.Functions.UI.InlineTree2;
import ProjectData.SapforData.Includes.UI.IncludesTree;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021;
import Visual_DVM_2021.UI.Interface.*;
import javax.swing.*;
import java.awt.*;
public class ProjectForm implements FormWithSplitters, ProjectWindow {
private final ArraysWindow arraysForm;
private final FunctionsWindow functionsForm;
private final AnalysisWindow analysisForm;
public JSplitPane SC3;
//</editor-fold>
public JPanel content;
public TreeForm includesForm;
private JTabbedPane projectTabs;
private TreeForm filesForm;
private Viewer projectDescription = null;
private JScrollPane logScroll;
private JPanel inlinePanel2;
private JPanel inlinePanel;
private TreeForm inlineForm;
private TreeForm inlineForm2;
private Viewer logText;
private JPanel includesPanel;
private JPanel filePanel;
private JPanel arraysFormPanel;
private JPanel functionsFormPanel;
private JPanel analysisFormPanel;
private final JScrollPane FastAccessScroll;
private JPanel projectViewPanel;
private JPanel projectBackground;
ProjectMenuBar menuBar;
//-
@Override
public ArraysWindow getArraysWindow() {
return arraysForm;
}
@Override
public FunctionsWindow getFunctionsWindow() {
return functionsForm;
}
@Override
public AnalysisWindow getAnalysisWindow() {
return analysisForm;
}
public ProjectForm() {
LoadSplitters();
//-
projectBackground.add(menuBar = new ProjectMenuBar(), BorderLayout.NORTH);
arraysFormPanel.add((arraysForm = new ArraysForm()).getContent());
functionsFormPanel.add((functionsForm = new FunctionsForm()).getContent());
analysisFormPanel.add((analysisForm = new AnalysisForm()).getContent());
//-
FastAccessScroll = new JScrollPane(UI.fastAccessMenuBar) {
{
getHorizontalScrollBar().setPreferredSize(new Dimension(0, 10));
setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER);
setPreferredSize(new Dimension(-1, 45));
}
};
content.add(FastAccessScroll, BorderLayout.NORTH);
//-
filesForm.Show();
InstallVersionsPanel();
ShowAllAnalyses();
ShowProjectView();
SwitchScreen(Global.db.settings.get(SettingName.SmallScreen).toBoolean());
RefreshTabsNames();
/*
SC3.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent pce) {
// do here
UI.Info(pce.getNewValue().toString());
}
});
*/
}
@Override
public void SaveSplitters() {
FormWithSplitters.super.SaveSplitters();
arraysForm.SaveSplitters();
analysisForm.SaveSplitters();
functionsForm.SaveSplitters();
}
private void createUIComponents() {
// TODO: place custom component creation code here
filesForm = new TreeForm(FilesTree.class);
projectDescription = new Viewer();
logText = new Viewer();
logScroll = new JScrollPane(logText);
includesForm = new TreeForm(IncludesTree.class);
inlineForm = new TreeForm(InlineTree.class);
inlineForm2 = new TreeForm(InlineTree2.class);
}
@Override
public void RefreshProjectFiles() {
filesForm.Refresh();
}
@Override
public void ShowSelectedDirectory() {
System.out.println(Current.getSelectedDirectory().getAbsolutePath());
}
@Override
public void ShowSelectedFile() {
System.out.println(Current.getSelectedFile().file.getAbsolutePath());
}
@Override
public void ShowNoSelectedFile() {
System.out.println("?");
}
@Override
public void ShowProjectSapforLog() {
logText.setText(Current.getProject().Log);
logText.setCaretPosition(0);
}
@Override
public void ShowFunctions() {
functionsForm.ShowFunctions();
inlineForm.Show();
inlineForm2.Show();
}
@Override
public void ShowNoFunctions() {
functionsForm.ShowNoFunctions();
inlineForm.Clear();
inlineForm2.Clear();
}
@Override
public void ShowNoIncludes() {
includesForm.Clear();
}
@Override
public void ShowIncludes() {
includesForm.Show();
}
@Override
public void ShowFile() {
//пока текущий файл только один.
//filesTabs.insertTab(null, null, (Current.getFile().form = new FileForm(Current.getFile())).content,
// "текущий файл проекта", 0);
//filesTabs.setTabComponentAt(0,
// new TabToolBar(Current.getFile().name, PassCode_2021.CloseCurrentFile));
// projectTabs.setTitleAt(0, "Файл: " + Current.getFile().name);
filePanel.add((Current.getFile().form = new FileForm(Current.getFile())).getContent());
projectTabs.setTabComponentAt(0,
new TabToolBar("Файл: " + Current.getFile().name, PassCode_2021.CloseCurrentFile) {
@Override
public void leftMouseAction() {
projectTabs.setSelectedIndex(0);
}
});
}
@Override
public void ShowNoFile() {
// projectTabs.setTitleAt(0, "Файл: -");
projectTabs.setTabComponentAt(0, new TabToolBar("Файл: -"){
@Override
public void leftMouseAction() {
projectTabs.setSelectedIndex(0);
}
});
UI.Clear(filePanel);
//filesTabs.removeAll();
}
@Override
public void GotoFile(String fileName, int line, boolean focus) {
if (focus) FocusFile();
if (Current.HasFile() && Current.getFile().name.equals(fileName))
Current.getFile().form.getEditor().gotoLine(line);
else if (Current.getProject().db.files.containsKey(fileName)) {
DBProjectFile targetFile = Current.getProject().db.files.get(fileName);
targetFile.UpdateLastLine(line);
Pass_2021.passes.get(PassCode_2021.OpenCurrentFile).Do(targetFile);
}
}
@Override
public void FocusFile() {
projectTabs.setSelectedIndex(0);
}
@Override
public void FocusFileTabs() {
projectTabs.requestFocus();
}
@Override
public void FocusDependencies() {
FocusFile();
menuBar.projectViewMenu.SelectView(ProjectView.Includes);
}
@Override
public void FocusArrays() {
projectTabs.setSelectedIndex(1);
}
@Override
public void FocusFunctions() {
projectTabs.setSelectedIndex(2);
menuBar.projectViewMenu.SelectView(ProjectView.FunctionsHierarchy);
}
@Override
public void FocusAnalysis() {
projectTabs.setSelectedIndex(3);
}
@Override
public void FocusHierarchy() {
FocusFile();
menuBar.projectViewMenu.SelectView(ProjectView.FunctionsHierarchy);
}
@Override
public void FocusPoints() {
FocusFile();
menuBar.projectViewMenu.SelectView(ProjectView.FunctionsCallsPoints);
}
@Override
public void RefreshTabsNames() {
UI.ShowTabsNames(projectTabs, 1);
}
@Override
public void RefreshProjectTreeAndMessages() {
RefreshProjectFiles();
DBProjectFile badFile = Current.getProject().getFirstBadFile();
if (badFile != null) {
Pass_2021.passes.get(PassCode_2021.OpenCurrentFile).Do(badFile);
UI.getMainWindow().FocusProject();
UI.getMainWindow().getProjectWindow().FocusFile();
}
//-
if (Current.HasFile()) {
Current.getFile().form.ShowMessages();
if (badFile != null && badFile.equals(Current.getFile()))
Current.getFile().form.ShowFirstError();
}
}
@Override
public TreeForm getFilesTreeForm() {
return filesForm;
}
@Override
public void SwitchScreen(boolean small) {
FastAccessScroll.setVisible(!small);
content.repaint();
content.revalidate();
}
@Override
public void ShowProjectView() {
UI.Clear(projectViewPanel);
ProjectView view = Current.getProjectView();
menuBar.getProjectViewMenu().setToolTipText(view.getDescription());
menuBar.getProjectViewMenu().setIcon(Utils.getIcon(view.getIcon()));
switch (view) {
case Files:
projectViewPanel.add(filesForm.getContent());
break;
case Includes:
projectViewPanel.add(includesForm.getContent());
break;
case FunctionsHierarchy:
projectViewPanel.add(inlineForm2.getContent());
break;
case FunctionsCallsPoints:
projectViewPanel.add(inlineForm.getContent());
break;
}
projectViewPanel.revalidate();
}
//-
private void InstallVersionsPanel() {
projectTabs.insertTab("",
Utils.getIcon("/icons/VersionsTree.png"),
UI.getVersionsWindow().getContent(),
"Версии", 5);
}
@Override
public void FocusVersions() {
projectTabs.setSelectedIndex(5);
}
}

View File

@@ -0,0 +1,36 @@
package Visual_DVM_2021.UI.Main;
import Common.Current;
import GlobalData.Tasks.RunTask.RunTask;
public class RunTasksComparisonForm extends TasksComparisonForm<RunTask> {
public RunTasksComparisonForm(ComparisonForm<RunTask> slave_in) {
super(RunTask.class, slave_in);
}
@Override
protected Current getCurrentObjectName() {
return Current.RunTask;
}
@Override
protected TasksComparisonState getFirstState() {
return TasksComparisonState.RunOutput;
}
@Override
protected TasksComparisonState[] getForbiddenStates() {
return new TasksComparisonState[]{
TasksComparisonState.CompilationOutput,
TasksComparisonState.CompilationErrors
};
}
@Override
protected String getTextByTab() {
switch (status) {
case RunOutput:
return object.getOutput();
case RunErrors:
return object.getErrors();
case Sts:
return object.getLocalStsText();
default:
return "";
}
}
}

View File

@@ -0,0 +1,130 @@
<?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.SapforPackagesComparisonForm">
<grid id="27dc6" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<xy x="20" y="20" width="500" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="90950" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children>
<toolbar id="9400d" binding="tools" custom-create="true">
<constraints border-constraint="North"/>
<properties>
<floatable value="false"/>
<maximumSize width="32929" height="30"/>
</properties>
<border type="none"/>
<children>
<component id="9e365" class="javax.swing.JLabel" binding="lObjectName" custom-create="true">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="1"/>
<foreground color="-16777216"/>
<text value="? "/>
</properties>
</component>
<component id="d1041" class="javax.swing.JButton" binding="bApplyObject">
<constraints/>
<properties>
<borderPainted value="false"/>
<icon value="icons/Apply.png"/>
<maximumSize width="30" height="30"/>
<minimumSize width="30" height="30"/>
<preferredSize width="30" height="30"/>
<text value=""/>
<toolTipText value="Назначить объект для сравнения"/>
</properties>
</component>
<component id="c8651" class="javax.swing.JButton" binding="bClose">
<constraints/>
<properties>
<borderPainted value="false"/>
<icon value="icons/Close.png"/>
<maximumSize width="30" height="30"/>
<minimumSize width="30" height="30"/>
<preferredSize width="30" height="30"/>
<text value=""/>
<toolTipText value="Открепить объект"/>
</properties>
</component>
<component id="37251" class="javax.swing.JSeparator">
<constraints/>
<properties/>
</component>
<component id="335a7" class="javax.swing.JButton" binding="bPrevious">
<constraints/>
<properties>
<borderPainted value="false"/>
<icon value="icons/Prev.png"/>
<maximumSize width="30" height="30"/>
<minimumSize width="30" height="30"/>
<preferredSize width="30" height="30"/>
<text value=""/>
<toolTipText value="Перейти к предыдущему различию "/>
</properties>
</component>
<component id="1f666" class="javax.swing.JButton" binding="bNext">
<constraints/>
<properties>
<borderPainted value="false"/>
<icon value="icons/Next.png"/>
<maximumSize width="30" height="30"/>
<minimumSize width="30" height="30"/>
<preferredSize width="30" height="30"/>
<text value=""/>
<toolTipText value="Перейти к следующему различию"/>
</properties>
</component>
<component id="155b4" class="javax.swing.JButton" binding="bCompare">
<constraints/>
<properties>
<icon value="icons/Menu/Undo.png"/>
<maximumSize width="30" height="30"/>
<minimumSize width="30" height="30"/>
<preferredSize width="30" height="30"/>
<text value=""/>
<toolTipText value="Сравнить объекты"/>
</properties>
</component>
</children>
</toolbar>
<grid id="69fc0" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children>
<toolbar id="b1fde">
<constraints border-constraint="North"/>
<properties>
<floatable value="false"/>
</properties>
<border type="none"/>
<children>
<component id="a856" class="javax.swing.JLabel" binding="flagsLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="1"/>
<foreground color="-16777216"/>
<text value="? "/>
</properties>
</component>
</children>
</toolbar>
<grid id="ecc39" binding="tasksPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</grid>
</children>
</grid>
</form>

View File

@@ -0,0 +1,236 @@
package Visual_DVM_2021.UI.Main;
import Common.Current;
import Common.Database.DataSet;
import Common.Global;
import Common.UI.DataSetControlForm;
import Common.UI.Label.ShortLabel;
import Common.UI.Menus_2023.VisualiserMenuBar;
import Common.UI.UI;
import Common.Utils.TextLog;
import TestingSystem.Sapfor.SapforTask.SapforTaskResult;
import TestingSystem.Sapfor.SapforTasksPackage.SapforTasksPackage_2023;
import TestingSystem.Test.ProjectFiles_json;
import Visual_DVM_2021.Passes.Pass_2021;
import javax.swing.*;
public class SapforPackagesComparisonForm {
//-->>
private JPanel content;
public JPanel getContent() {
return content;
}
protected JToolBar tools;
protected JLabel lObjectName;
private JButton bApplyObject;
private JButton bPrevious;
private JButton bNext;
private JButton bCompare;
private JButton bClose;
private JPanel tasksPanel;
private JLabel flagsLabel;
//-->>
SapforPackagesComparisonForm this_ = null; //?
SapforPackagesComparisonForm slave = null;
SapforPackagesComparisonForm master = null;
//-->>
protected SapforTasksPackage_2023 object = null;
//-->>
protected DataSet<String, SapforTaskResult> packageTasks;
protected DataSetControlForm Body;
//--->>
public boolean isMaster() {
return slave != null;
}
public boolean isSlave() {
return master != null;
}
//--->>
//неперегружаемые методы
protected void RemoveObject() {
object = null;
showNoObject();
}
public void ApplyObject() {
RemoveObject();
TextLog log = new TextLog();
if (Current.Check(log, getCurrentObjectName())) {
object = Current.getSapforTasksPackage();
try {
packageTasks = isMaster() ? Global.db.getSapforPackagesMasterDataSet(object) :
Global.db.getSapforPackagesSlaveDataSet(object);
} catch (Exception ex) {
ex.printStackTrace();
}
showObject();
} else
UI.Info(log.toString());
}
//предполагаем что оба объекта есть и мы можем получить с них текст.
protected void Compare() throws Exception {
//это всегда форма мастер
//1. Получить файл теста.Для сапфора ограничение что файл может быть только один.Возможно и для других тоже.
// File project_db = new File(object.Home, "project.json");
for (String masterTaskKey : packageTasks.Data.keySet()) {
for (String slaveTaskKey : slave.packageTasks.Data.keySet()) {
if (masterTaskKey.equals(slaveTaskKey)) {
compareTasks(packageTasks.get(masterTaskKey), slave.packageTasks.get(masterTaskKey));
}
}
}
}
protected void compareTasks(SapforTaskResult masterTask, SapforTaskResult slaveTask) throws Exception {
/*
//надо сравнить все сраниваемых проектов.
ProjectFiles_json masterFiles = getTaskFiles(masterTask);
ProjectFiles_json slaveFiles = getTaskFiles(slaveTask);
if (masterFiles.files.size() != slaveFiles.files.size()) {
slaveTask.match_state = MatchState.NotMatch;
return;
}
for (DBProjectFile masterDBFile : masterFiles.files) {
boolean hasSameFile = false;
for (DBProjectFile slaveDBFile : slaveFiles.files) {
if (masterDBFile.name.equals(slaveDBFile.name)) {
hasSameFile = true;
File masterFile = new File(masterTask.last_version, masterDBFile.name);
File slaveFile = new File(slaveTask.last_version, slaveDBFile.name);
String masterFileText = FileUtils.readFileToString(masterFile);
String slaveFileText = FileUtils.readFileToString(slaveFile);
slaveTask.match_state = masterFileText.equals(slaveFileText) ? MatchState.Match : MatchState.NotMatch;
break;
}
}
if (!hasSameFile) {
slaveTask.match_state = MatchState.NotMatch;
return;
}
}
*/
}
ProjectFiles_json getTaskFiles(SapforTaskResult task) throws Exception {
// File project = new File(task.last_version);
// File file_json = new File(project, "project.json");
// return Utils.gson.fromJson(FileUtils.readFileToString(file_json), ProjectFiles_json.class);
return null;
}
public void Show() throws Exception {
}
//Перегружаемые методы.
//--->>
protected Current getCurrentObjectName() {
return Current.SapforTasksPackage;
}
protected void showNoObject() {
lObjectName.setText("?");
lObjectName.setToolTipText("Объект не назначен.");
flagsLabel.setText("?");
UI.Clear(tasksPanel);
}
protected void showObject() {
lObjectName.setText(object.getPK().toString() + (isMaster() ? "(эталон)" : ""));
lObjectName.setToolTipText(object.getPK().toString());
flagsLabel.setText(object.flags);
//-
packageTasks.mountUI(tasksPanel);
packageTasks.ShowUI();
}
protected String getText() {
return "";
}
public SapforPackagesComparisonForm(SapforPackagesComparisonForm slave_in) {
//-
this_ = this;
slave = slave_in;
bPrevious.setVisible(isMaster());
bNext.setVisible(isMaster());
bApplyObject.addActionListener(e -> {
ApplyObject();
});
//--->>>
if (isMaster()) {
slave.master = this;
bPrevious.addActionListener(e -> {
});
bNext.addActionListener(e -> {
});
bCompare.addActionListener(e -> {
DoComparePass(isReady() && slave.isReady());
});
} else {
//рабу сравнивать не положено.
bCompare.setVisible(false);
}
//--->>>
bClose.addActionListener(e -> {
onClose();
});
}
//-->>
private void createUIComponents() {
// TODO: place custom component creation code here
lObjectName = new ShortLabel(40);
tools = new VisualiserMenuBar();
}
//для сравнения по кнопке.
public boolean isReady() {
return object != null;
}
public void onClose() {
RemoveObject();
}
public void DoComparePass(boolean startCondition) {
Pass_2021 pass = new Pass_2021() {
@Override
public String getDescription() {
return "Сравнение";
}
@Override
protected boolean needsAnimation() {
return true;
}
@Override
public boolean needsConfirmations() {
return false;
}
@Override
protected boolean canStart(Object... args) throws Exception {
return startCondition;
}
@Override
protected void body() throws Exception {
Compare();
}
};
pass.Do();
}
public void DoShowPass(boolean startCondition) {
Pass_2021 pass = new Pass_2021() {
@Override
public String getDescription() {
return "Отображение";
}
@Override
protected boolean needsAnimation() {
return false;
}
@Override
public boolean needsConfirmations() {
return false;
}
@Override
protected boolean canStart(Object... args) throws Exception {
return startCondition;
}
@Override
protected void body() throws Exception {
Show();
}
};
pass.Do();
}
public void CheckObject(SapforTasksPackage_2023 object_in) {
if ((object != null) && object_in.id == (object.id)) {
RemoveObject();
}
}
}

View File

@@ -0,0 +1,24 @@
package Visual_DVM_2021.UI.Main;
import Common.Current;
import TestingSystem.Sapfor.SapforTask.SapforTask_2023;
//упразднить.
public class SapforTasksComparisonForm extends TasksComparisonForm<SapforTask_2023> {
public SapforTasksComparisonForm(ComparisonForm<SapforTask_2023> slave_in) {
super(SapforTask_2023.class, slave_in);
}
@Override
protected Current getCurrentObjectName() {
return Current.SapforTask;
}
@Override
protected String getTextByTab() {
return "";
}
@Override
protected TasksComparisonState[] getForbiddenStates() {
return new TasksComparisonState[]{
TasksComparisonState.Sts
};
}
}

View File

@@ -0,0 +1,35 @@
package Visual_DVM_2021.UI.Main;
import Common.UI.Menus_2023.VisualiserMenuBar;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021;
import javax.swing.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
public class TabToolBar extends VisualiserMenuBar {
public TabToolBar(String titleText, PassCode_2021... passes) {
setFloatable(false);
setOpaque(false);
//-
JLabel title = new JLabel(titleText);
title.setOpaque(false);
add(title);
addSeparator();
//-
for (PassCode_2021 code : passes)
add(Pass_2021.passes.get(code).createTabButton());
MouseAdapter adapter = new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
leftMouseAction();
}
};
addMouseListener(adapter);
title.addMouseListener(adapter);
}
public void leftMouseAction(){}
@Override
public void setSizeLimits() {
// setPreferredSize(new Dimension(-1, 18));
}
}

View File

@@ -0,0 +1,103 @@
package Visual_DVM_2021.UI.Main;
import Common.Database.DBObject;
import Common.Global;
import Common.UI.Menus_2023.MenuBarButton;
import GlobalData.Settings.SettingName;
import javax.swing.*;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Vector;
public abstract class TasksComparisonForm<T extends DBObject> extends ComparisonForm<T> {
public TasksComparisonForm(Class<T> t_in, ComparisonForm<T> slave_in) {
super(t_in, slave_in);
buttons = new LinkedHashMap<>();
int i = 3;
status = getFirstState();
Vector<TasksComparisonState> forbidden = new Vector(Arrays.asList(getForbiddenStates()));
for (TasksComparisonState state : TasksComparisonState.values()) {
if (!forbidden.contains(state)) {
MenuBarButton button = new MenuBarButton();
button.setIcon( "/icons/" + state.toString() + ".png");
button.setToolTipText(state.getDescription());
button.addActionListener(e -> {
ChangeState(state);
if (isMaster()) {
TasksComparisonForm slave_ = (TasksComparisonForm) slave;
slave_.ChangeState(state);
//в отличие от комбо боксов, тут события нажатия на кнопку, нет.
if (isReady()) {
if (slave.isReady()) {
if (Global.db.settings.get(SettingName.ComparsionDiffMergeOn).toBoolean()) {
DoComparePass(true);
} else
DoShowPass(true);
} else {
DoShowPass(true);
}
}
} else {
if (isReady()) {
if (master.isReady()) {
if (Global.db.settings.get(SettingName.ComparsionDiffMergeOn).toBoolean()) {
master.DoComparePass(true);
} else
master.DoShowPass(true);
} else {
master.DoShowPass(true); //!!!
}
}
}
});
tools.add(button, i);
buttons.put(state, button);
++i;
}
}
}
protected TasksComparisonState status = TasksComparisonState.CompilationOutput;
protected LinkedHashMap<TasksComparisonState, JButton> buttons = null;
protected void DropTabsSelection() {
for (JButton button : buttons.values()){
button.setBorderPainted(false);
button.repaint();
button.revalidate();
}
}
public void ChangeState(TasksComparisonState status_in) {
status = status_in;
DropTabsSelection();
ClearText();
JButton button = buttons.get(status_in);
button.setBorderPainted(false);
button.repaint();
button.revalidate();
}
@Override
protected void showObject() {
super.showObject();
buttons.get(status).doClick();
}
@Override
public void onClose() {
super.onClose();
if (isMaster())
DoShowPass(true);
else
master.DoShowPass(true);
}
@Override
protected String getText() {
return isReady()?getTextByTab():"объект не назначен";
}
//-----------перегружаемые
protected abstract String getTextByTab();
protected TasksComparisonState[] getForbiddenStates() {
return new TasksComparisonState[]{};
}
protected TasksComparisonState getFirstState() {
return TasksComparisonState.CompilationOutput;
}
}

View File

@@ -0,0 +1,25 @@
package Visual_DVM_2021.UI.Main;
public enum TasksComparisonState {
CompilationOutput,
CompilationErrors,
RunOutput,
RunErrors,
Sts;
public String getDescription(){
switch (this){
case CompilationOutput:
return "Поток вывода компиляции";
case CompilationErrors:
return "Поток ошибок компиляции";
case RunOutput:
return "Поток вывода запуска";
case RunErrors:
return "Поток ошибок запуска";
case Sts:
return "DVM статистика запуска";
default:
return "?";
}
}
}

View File

@@ -0,0 +1,29 @@
package Visual_DVM_2021.UI.Main;
import Common.Current;
import TestingSystem.Tasks.TestRunTask;
public class TestRunTasksComparisonForm extends TasksComparisonForm<TestRunTask> {
public TestRunTasksComparisonForm(ComparisonForm<TestRunTask> slave_in) {
super(TestRunTask.class, slave_in);
}
@Override
protected Current getCurrentObjectName() {
return Current.TestRunTask;
}
@Override
protected String getTextByTab() {
switch (status) {
case CompilationOutput:
return object.compilation_output;
case CompilationErrors:
return object.compilation_errors;
case RunOutput:
return object.output;
case RunErrors:
return object.errors;
case Sts:
return object.statistic;
default:
return "";
}
}
}

View File

@@ -0,0 +1,911 @@
<?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.TestingForm">
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="1034" height="666"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<tabbedpane id="2a81a" binding="testingTabs">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="c1ee7" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<tabbedpane title="Учётные данные" icon="icons/Machine.png">
<tooltip value="Учётные данные"/>
</tabbedpane>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="67dc2" binding="SC18">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="400"/>
<dividerSize value="3"/>
</properties>
<border type="none"/>
<children>
<grid id="4bdeb" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="450" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<splitpane id="6afcf" binding="SC58">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="300"/>
<dividerSize value="3"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="694be" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<minimumSize width="250" height="200"/>
</properties>
<border type="none"/>
<children>
<grid id="fbc16" binding="compilersPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="9edad" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<minimumSize width="250" height="200"/>
</properties>
<border type="none"/>
<children>
<grid id="46ef8" binding="sapforsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
<grid id="c209a" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<minimumSize width="450" height="100"/>
</properties>
<border type="none"/>
<children>
<splitpane id="43e0e" binding="SC19">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="197"/>
<dividerSize value="3"/>
<maximumSize width="-1" height="-1"/>
<minimumSize width="300" height="100"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="ef1ac" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="200" height="0"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="4976c" binding="machinesPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="77bde" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="250" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="61db6" binding="usersPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
<grid id="b96d9" binding="projectDebugPanel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="Текущий проект" icon="icons/Common.png">
<tooltip value="Текущий проект"/>
</tabbedpane>
</constraints>
<properties/>
<border type="none"/>
<children>
<tabbedpane id="99328" binding="debugTabs">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="a6120" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<tabbedpane title="Компиляция">
<tooltip value="Компиляция"/>
</tabbedpane>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="f14b8" binding="SC51">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="200"/>
<dividerSize value="3"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="40572" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="138bf" binding="SC40">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="197"/>
<dividerSize value="3"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="42d3f" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="b9a7e" binding="compilationTasksPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties>
<minimumSize width="0" height="150"/>
</properties>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="5e526" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="right"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="df2e5" binding="SC41">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties>
<dividerLocation value="500"/>
<dividerSize value="3"/>
</properties>
<border type="none"/>
<children>
<grid id="670e9" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<minimumSize width="200" height="200"/>
</properties>
<border type="none"/>
<children/>
</grid>
<grid id="ae368" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<minimumSize width="200" height="200"/>
</properties>
<border type="none"/>
<children/>
</grid>
</children>
</splitpane>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
<grid id="a0603" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<minimumSize width="600" height="200"/>
</properties>
<border type="none"/>
<children>
<splitpane id="b6a2c" binding="SC20">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="548"/>
<dividerSize value="3"/>
</properties>
<border type="none"/>
<children>
<grid id="194c9" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="300" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="a8eaf" binding="makefilesPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="21871" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="300" height="-1"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="81257" binding="modulesPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
<grid id="b2bea" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<tabbedpane title="Запуск">
<tooltip value="Запуск"/>
</tabbedpane>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="2d25c" binding="SC52">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="150"/>
<dividerSize value="3"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="47241" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="77aeb" binding="SC42">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="200"/>
<dividerSize value="3"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="dcf3e" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<minimumSize width="0" height="200"/>
</properties>
<border type="none"/>
<children>
<splitpane id="21e91" binding="SC43">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties>
<dividerLocation value="500"/>
<dividerSize value="3"/>
</properties>
<border type="none"/>
<children>
<grid id="5a1b6" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<minimumSize width="150" height="100"/>
</properties>
<border type="none"/>
<children/>
</grid>
<grid id="66252" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<minimumSize width="150" height="100"/>
</properties>
<border type="none"/>
<children/>
</grid>
</children>
</splitpane>
</children>
</grid>
<grid id="b31c4" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<minimumSize width="0" height="100"/>
</properties>
<border type="none"/>
<children>
<grid id="4741" binding="runTasksPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
<grid id="c6f6f" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="ca886" binding="SC21">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="450"/>
<dividerSize value="3"/>
</properties>
<border type="none"/>
<children>
<grid id="cf37b" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="350" height="100"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="b814c" binding="runConfigurationsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties>
<minimumSize width="0" height="0"/>
</properties>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="11dcc" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="500" height="100"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<splitpane id="b83b4" binding="SC35">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<minimum-size width="200" height="-1"/>
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties>
<dividerLocation value="250"/>
<dividerSize value="3"/>
</properties>
<border type="none"/>
<children>
<grid id="3f228" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<minimumSize width="250" height="100"/>
</properties>
<border type="none"/>
<children>
<grid id="553a0" binding="environmentsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="55d2b" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<minimumSize width="250" height="100"/>
</properties>
<border type="none"/>
<children>
<grid id="e5966" binding="dvmParametersPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
</children>
</tabbedpane>
</children>
</grid>
<grid id="79bb4" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<tabbedpane title="Тесты (0)" icon="icons/Library.PNG">
<tooltip value="Тесты"/>
</tabbedpane>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="66a49" binding="SC45">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="700"/>
<dividerSize value="3"/>
</properties>
<border type="none"/>
<children>
<grid id="e708e" binding="groupsBackground" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<minimumSize width="400" height="200"/>
</properties>
<border type="none"/>
<children>
<grid id="acd67" binding="groupsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="56f09" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<minimumSize width="250" height="200"/>
</properties>
<border type="none"/>
<children>
<grid id="f518d" binding="testsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
<grid id="e6dae" binding="dvmTestingPanel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="DVM система" icon="icons/DVM.png">
<tooltip value="DVM система"/>
</tabbedpane>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="f4599" binding="SC48">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties>
<dividerLocation value="150"/>
<dividerSize value="3"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="2ead5" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<minimumSize width="0" height="150"/>
</properties>
<border type="none"/>
<children>
<grid id="8060d" binding="configurationsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="2ad88" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="c6872" binding="SC49">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="100"/>
<dividerSize value="3"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="89d8b" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<minimumSize width="0" height="150"/>
</properties>
<border type="none"/>
<children>
<grid id="b1fe2" binding="packagesPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="a8520" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="right"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="670fe" binding="SC46">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties>
<dividerLocation value="131"/>
<dividerSize value="3"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="148f3" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="242a7" binding="testsRunTasksPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties>
<minimumSize width="0" height="150"/>
</properties>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="77cf1" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<minimumSize width="240" height="150"/>
</properties>
<border type="none"/>
<children>
<splitpane id="6ef86" binding="SC50">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="300"/>
<dividerSize value="3"/>
</properties>
<border type="none"/>
<children/>
</splitpane>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
<grid id="530e" binding="sapforTestingPanel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="SAPFOR" icon="icons/Arrays/SpfPrivate.png">
<tooltip value="SAPFOR"/>
</tabbedpane>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="b68b4" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="8543b" binding="SC53">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="86"/>
<dividerSize value="3"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="208f9" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="760d4" binding="SC56">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="250"/>
<dividerSize value="3"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="e5393" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="ff9dc" binding="SC57">
<constraints border-constraint="Center"/>
<properties>
<dividerSize value="3"/>
</properties>
<border type="none"/>
<children/>
</splitpane>
</children>
</grid>
<grid id="7718" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<minimumSize width="24" height="200"/>
<preferredSize width="204" height="200"/>
</properties>
<border type="none"/>
<children>
<grid id="7cddb" binding="sapforPackagesPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<minimumSize width="0" height="200"/>
</properties>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
<grid id="6e6e0" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="left"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="d917c" binding="SC59">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties>
<dividerLocation value="450"/>
<dividerSize value="3"/>
</properties>
<border type="none"/>
<children>
<grid id="43138" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<minimumSize width="300" height="100"/>
</properties>
<border type="none"/>
<children>
<grid id="4efae" binding="sapforConfigurationsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="40870" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<minimumSize width="300" height="0"/>
</properties>
<border type="none"/>
<children>
<grid id="e7342" binding="sapforConfigurationCommandsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
</children>
</grid>
</children>
</tabbedpane>
</children>
</grid>
</form>

View File

@@ -0,0 +1,481 @@
package Visual_DVM_2021.UI.Main;
import Common.Current;
import Common.Global;
import Common.UI.Menus_2023.TasksPackagesMenuBar.TasksPackagesMenuBar;
import Common.UI.TextField.StyledTextField;
import Common.UI.UI;
import Common.Utils.Utils;
import GlobalData.Compiler.CompilerType;
import GlobalData.Credentials.Credentials;
import TestingSystem.Configuration.UI.ConfigurationDBTable;
import TestingSystem.Group.Group;
import TestingSystem.MachineMaxKernels.MachineMaxKernels;
import TestingSystem.Sapfor.SapforTasksPackage.SapforTasksPackage_2023;
import TestingSystem.TasksPackage.TasksPackageDBTable;
import TestingSystem.Test.Test;
import Visual_DVM_2021.UI.Interface.FormWithSplitters;
import Visual_DVM_2021.UI.Interface.TestingWindow;
import javax.swing.*;
import java.util.Vector;
public class TestingForm implements FormWithSplitters, TestingWindow {
private JPanel content;
@Override
public JPanel getContent() {
return content;
}
public JSplitPane SC18;
public JSplitPane SC20;
public JSplitPane SC21;
public JSplitPane SC35;
public JSplitPane SC40;
public JSplitPane SC41;
public JSplitPane SC42;
public JSplitPane SC43;
public JSplitPane SC45;
public JSplitPane SC50;
public JSplitPane SC51;
public JSplitPane SC52;
public JSplitPane SC48;
public JSplitPane SC49;
public JSplitPane SC46;
public JSplitPane SC53;
public JSplitPane SC56;
public JSplitPane SC57;
public JSplitPane SC58;
public JSplitPane SC59;
public JSplitPane SC19;
//-
//---
private JPanel machinesPanel;
private JPanel usersPanel;
private JPanel compilersPanel;
private JTabbedPane testingTabs;
private JTabbedPane debugTabs;
private JPanel makefilesPanel;
private JPanel modulesPanel;
private JPanel runConfigurationsPanel;
private JToolBar environmentsTools;
private JPanel environmentsPanel;
private JToolBar parametersTools;
private JPanel dvmParametersPanel;
private JPanel groupsPanel;
private JPanel testsPanel;
private JPanel testsRunTasksPanel;
private JToolBar testsResultsTools;
private JButton bChangeKernels;
private JTextField filterName;
private JLabel testsMatchesLabel;
private JPanel configurationsPanel;
private JLabel configurationsMatchesLabel;
private JLabel packagesMatchesLabel;
private JPanel packagesPanel;
private JButton bCompilationFilter;
private JPanel dvmTestingPanel;
private JPanel projectDebugPanel;
private JPanel runTasksPanel;
private JPanel compilationTasksPanel;
private JPanel sapforTestingPanel;
private JPanel packageVersionsPanel;
private JPanel sapforsPanel;
private JPanel sapforConfigurationsPanel;
private JLabel sapforConfigurationsLabel;
private JLabel sapforConfigurationsCommandsLabel;
private JPanel sapforConfigurationCommandsPanel;
private JPanel sapforPackagesPanel;
private JLabel sapforTasksPackagesLabel;
private JLabel sapforTasksLabel;
private JPanel groupsBackground;
private JPanel testsRunTasksBackground;
private JCheckBox filterFinished;
private JButton bTest;
private JButton bDownloadTestProject;
private JToolBar compilationTasksTools;
private JToolBar runTasksTools;
//-
public RunTasksComparisonForm singleRunTaskMaster; // одиночные запуски
public RunTasksComparisonForm singleRunTaskSlave;
//
public CompilationTasksComparisonForm singleCompilationTaskMaster; // одиночная компиляция
public CompilationTasksComparisonForm singleCompilationTaskSlave;
//--
//-
private TestRunTasksComparisonForm dvmTestingRunMaster; //сравнение тестов двм системы.
private TestRunTasksComparisonForm dvmTestingRunSlave;
//-
//сравнение версий полученных в результате выполнения пакета.
public SapforPackagesComparisonForm sapforTestingMaster;
public SapforPackagesComparisonForm sapforTestingSlave;
//-
public TestingForm() {
LoadSplitters();
//-
singleCompilationTaskMaster = new CompilationTasksComparisonForm(singleCompilationTaskSlave = new CompilationTasksComparisonForm(null));
singleRunTaskMaster = new RunTasksComparisonForm(singleRunTaskSlave = new RunTasksComparisonForm(null));
dvmTestingRunMaster = new TestRunTasksComparisonForm(dvmTestingRunSlave = new TestRunTasksComparisonForm(null));
//-
Global.db.machines.mountUI(machinesPanel);
Global.db.users.mountUI(usersPanel);
Global.db.compilers.mountUI(compilersPanel);
Global.db.remoteSapfors.mountUI(sapforsPanel);
Global.db.makefiles.mountUI(makefilesPanel);
//-----------------------------------------------
Global.db.modules.mountUI(modulesPanel);
Global.db.runConfigurations.mountUI(runConfigurationsPanel);
Global.db.environmentValues.mountUI(environmentsPanel);
Global.db.dvmParameters.mountUI(dvmParametersPanel);
//-
Global.db.compilationTasks.mountUI(compilationTasksPanel);
Global.db.runTasks.mountUI(runTasksPanel);
//--->>>
RefreshTabsNames();
//-
SC41.setLeftComponent(singleCompilationTaskMaster.getContent());
SC41.setRightComponent(singleCompilationTaskSlave.getContent());
SC43.setLeftComponent(singleRunTaskMaster.getContent());
SC43.setRightComponent(singleRunTaskSlave.getContent());
//-
SC50.setLeftComponent(dvmTestingRunMaster.getContent());
SC50.setRightComponent(dvmTestingRunSlave.getContent());
ShowNoProject();
//-
Global.testingServer.db.configurations.mountUI(configurationsPanel);
Global.testingServer.db.groups.mountUI(groupsPanel);
Global.testingServer.db.tests.mountUI(testsPanel);
Global.testingServer.account_db.packages.mountUI(packagesPanel);
Global.testingServer.account_db.testRunTasks.mountUI(testsRunTasksPanel);
// Global.testingServer.account_db.testRunTasks.setFilterUI(count -> tasksMatchesLabel.setText(String.valueOf(count)));
//--
Global.testingServer.db.sapforConfigurations.mountUI(sapforConfigurationsPanel);
Global.testingServer.db.sapforConfigurationCommands.mountUI(sapforConfigurationCommandsPanel);
Global.db.sapforTasksPackages.mountUI(sapforPackagesPanel);
//Global.db.sapforTasks.mountUI(sapforTasksPanel);
// Global.testingServer.account_db.sapforTasksPackages.mountUI(sapforPackagesPanel);
// Global.testingServer.account_db.sapforTasks.mountUI(sapforTasksPanel);
//--------------------------------------------------------------------->>>>
/*
filterName.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
TestRunTaskInterface.filterName = filterName.getText();
Global.testingServer.account_db.testRunTasks.ShowUI();
}
@Override
public void removeUpdate(DocumentEvent e) {
TestRunTaskInterface.filterName = filterName.getText();
Global.testingServer.account_db.testRunTasks.ShowUI();
}
@Override
public void changedUpdate(DocumentEvent e) {
}
});
*/
sapforTestingMaster = new SapforPackagesComparisonForm(sapforTestingSlave = new SapforPackagesComparisonForm(null));
SC57.setLeftComponent(sapforTestingMaster.getContent());
SC57.setRightComponent(sapforTestingSlave.getContent());
}
//-
@Override
public void ShowAll() {
Global.db.machines.ShowUI();
this.RestoreLastCredentials();
Global.testingServer.db.configurations.ShowUI();
Global.testingServer.db.groups.ShowUI();
Global.testingServer.account_db.packages.ShowUI();
Global.testingServer.db.sapforConfigurations.ShowUI();
Global.db.sapforTasksPackages.ShowUI();
}
//-
@Override
public void ShowProjectMaxCompilationTime() {
// mCompilationMaxtime.setText(Current.getProject().compilation_maxtime + " сек.");
}
@Override
public void ShowProjectMaxRunTime() {
//mRunMaxtime.setText(Current.getProject().run_maxtime + " сек.");
}
@Override
public void ShowCurrentTestsPackage() {
ShowCurrentTestRunTask();
}
@Override
public void DropTestRunTasksComparison() {
dvmTestingRunMaster.RemoveObject();
dvmTestingRunSlave.RemoveObject();
}
@Override
public void DropRunTasksComparison() {
singleRunTaskMaster.RemoveObject();
singleRunTaskSlave.RemoveObject();
}
@Override
public void DropCompilationTasksComparison() {
singleCompilationTaskMaster.RemoveObject();
singleCompilationTaskSlave.RemoveObject();
}
@Override
public void FocusCredentials() {
testingTabs.setSelectedIndex(0);
}
@Override
public void ShowProject() {
testingTabs.setEnabledAt(1, true);
// testingTabs.setSelectedIndex(0);
//-
ShowSession();
//-
Global.db.compilationTasks.ShowUI(); //их видимость зависит от текущего проекта.
Global.db.runTasks.ShowUI();
}
@Override
public void ShowNoProject() {
Global.db.compilationTasks.ClearUI();
Global.db.runTasks.ClearUI();
//-
if (testingTabs.getSelectedIndex() == 1)
testingTabs.setSelectedIndex(0);
testingTabs.setEnabledAt(1, false);
}
@Override
public void SaveSplitters() {
FormWithSplitters.super.SaveSplitters();
try {
Global.db.SaveCredentials();
} catch (Exception ex) {
Global.Log.PrintException(ex);
}
}
//-
@Override
public void ShowCurrentCompilationTask() {
// if (singleCompilationTaskMaster.isActive()) singleCompilationTaskMaster.ShowTask();
// else singleCompilationTaskSlave.ShowTask();
}
@Override
public void ShowNoCurrentCompilationTask() {
// if (singleCompilationTaskMaster.isActive()) singleCompilationTaskMaster.Clear();
// else singleCompilationTaskSlave.Clear();
}
@Override
public void ShowCurrentRunTask() {
// if (singleRunTaskMaster.isActive()) singleRunTaskMaster.ShowTask();
// else singleRunTaskSlave.ShowTask();
}
@Override
public void ShowNoCurrentRunTask() {
// if (singleRunTaskMaster.isActive()) singleRunTaskMaster.Clear();
// else singleRunTaskSlave.Clear();
}
@Override
public void ShowCurrentTestRunTask() {
// if (dvmTestingRunMaster.isActive()) dvmTestingRunMaster.ShowTask();
// else dvmTestingRunSlave.ShowTask();
}
@Override
public void ShowNoTestRunTask() {
// dvmTestingRunMaster.Clear();
// dvmTestingRunSlave.Clear();
}
@Override
public void RefreshTabsNames() {
}
@Override
public void ShowCurrentMachine() {
String url = Current.getMachine().getURL();
int kernelsNum = 0;
if (Global.testingServer.db.machinesMaxKernels.containsKey(url)) {
MachineMaxKernels kernels = Global.testingServer.db.machinesMaxKernels.get(url);
kernelsNum = kernels.limit;
} else kernelsNum = 4;
// bChangeKernels.setText("Ядра: " + kernelsNum);
}
@Override
public void ShowNoCurrentMachine() {
//bChangeKernels.setText("Ядра: ?");
}
private void createUIComponents() {
// TODO: place custom component creation code here
filterName = new StyledTextField();
}
@Override
public void FocusTestingSystem() {
testingTabs.setSelectedIndex(2);
}
@Override
public void ShowAutoActualizeTestsState() {
((TasksPackagesMenuBar) UI.menuBars.get(TasksPackageDBTable.class)).ShowAutorefresh();
}
@Override
public void FocusTestingTasks() {
}
@Override
public boolean isEmailTestingOn() {
return
ConfigurationDBTable.email;
}
@Override
public void RemountTestTable() {
UI.Clear(packagesPanel);
UI.Clear(testsRunTasksPanel);
Global.testingServer.account_db.packages.mountUI(packagesPanel);
Global.testingServer.account_db.testRunTasks.mountUI(testsRunTasksPanel);
}
@Override
public void setUserRights() {
// testingTabs.removeTabAt(2);
}
@Override
public void setAdminRights() {
/*
testingTabs.insertTab("DVM система",
Utils.getIcon("/icons/DVM.png"),
dvmTestingPanel,
"DVM система", 2);
*/
}
@Override
public void setDeveloperRights() {
/*
testingTabs.insertTab("DVM система",
Utils.getIcon("/icons/DVM.png"),
dvmTestingPanel,
"DVM система", 2);
*/
}
@Override
public void FocusScenarios() {
testingTabs.setSelectedIndex(3);
}
//-
@Override
public void RestoreLastCredentials() {
Credentials credentials = (Credentials) Current.get(Current.Credentials);
if (credentials.machine_id != Utils.Nan) {
if (Global.db.machines.containsKey(credentials.machine_id)) {
Global.db.machines.ShowUI(credentials.machine_id);
if (Global.db.users.containsKey(credentials.user_id)) {
Global.db.users.ShowUI(credentials.user_id);
} else {
credentials.user_id = Utils.Nan;
Global.db.UpdateCredentials();
}
if (Global.db.compilers.containsKey(credentials.compiler_id)) {
Global.db.compilers.ShowUI(credentials.compiler_id);
} else {
credentials.compiler_id = Utils.Nan;
Global.db.UpdateCredentials();
}
//-
if (Global.db.makefiles.containsKey(credentials.makefile_id)) {
Global.db.makefiles.ShowUI(credentials.makefile_id);
} else {
credentials.makefile_id = Utils.Nan;
Global.db.UpdateCredentials();
}
//-
if (Global.db.runConfigurations.containsKey(credentials.runconfiguration_id)) {
Global.db.runConfigurations.ShowUI(credentials.runconfiguration_id);
} else {
credentials.runconfiguration_id = Utils.Nan;
Global.db.UpdateCredentials();
}
if (Global.db.remoteSapfors.containsKey(credentials.remotesapfor_id)) {
Global.db.remoteSapfors.ShowUI(credentials.remotesapfor_id);
} else {
credentials.remotesapfor_id = Utils.Nan;
Global.db.UpdateCredentials();
}
} else {
credentials.machine_id = Utils.Nan;
credentials.user_id = Utils.Nan;
credentials.compiler_id = Utils.Nan;
credentials.remotesapfor_id = Utils.Nan;
credentials.makefile_id = Utils.Nan;
credentials.runconfiguration_id = Utils.Nan;
Global.db.UpdateCredentials();
}
}
}
// testingTabs.setTitleAt(4, "Cистема SAPFOR: " + Current.getRemoteSapfor().version);
@Override
public void ShowCredentials() {
String res = "";
if (Current.HasMachine()) {
res += "@" + Current.getMachine().getURL();
if (Current.HasUser()) {
res = Current.getUser().login + res;
} else res = "?" + res;
if (Current.HasCompiler() && Current.getCompiler().type.equals(CompilerType.dvm)) {
testingTabs.setTitleAt(3, "DVM система: " + Current.getCompiler().description);
} else {
testingTabs.setTitleAt(3, "DVM система: ?");
}
} else {
res += "?@?";
}
testingTabs.setTitleAt(0, res);
}
@Override
public void FocusSapforTasksPackages() {
}
@Override
public void ShowCurrentSapforTasksPackage() {
/*
UI.Clear(packageVersionsPanel);
if (Current.getSapforTasksPackage().root != null) {
PackageVersionsTree tree = new PackageVersionsTree();
packageVersionsPanel.add(new JScrollPane(tree));
packageVersionsPanel.revalidate();
packageVersionsPanel.repaint();
}
*/
}
@Override
public void ShowNoSapforTasksPackage() {
UI.Clear(packageVersionsPanel);
}
//--->>>
@Override
public void ShowCheckedTestsCount() {
int res = 0;
for (Group group : Global.testingServer.db.groups.getCheckedItems()) {
Vector<Test> selected_tests = new Vector<>();
Vector<Test> group_tests = new Vector<>();
for (Test test : Global.testingServer.db.tests.Data.values()) {
if (test.group_id.equals(group.id)) {
if (test.isSelected())
selected_tests.add(test);
else
group_tests.add(test);
}
}
//-
if (selected_tests.isEmpty())
res += group_tests.size();
else
res += selected_tests.size();
}
//--
testingTabs.setTitleAt(2, "Тесты: " + res);
}
@Override
public void ShowLastCompilationTask() {
singleCompilationTaskMaster.ApplyObject();
}
@Override
public void ShowLastRunTask() {
singleRunTaskMaster.ApplyObject();
}
@Override
public void RemoveSapforPackageFromComparison(SapforTasksPackage_2023 package_2023) {
sapforTestingMaster.CheckObject(package_2023);
sapforTestingSlave.CheckObject(package_2023);
}
@Override
public void DropSapforTasksComparison() {
sapforTestingMaster.RemoveObject();
sapforTestingSlave.RemoveObject();
}
}

View File

@@ -0,0 +1,200 @@
<?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.VariantsForm">
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="870" height="407"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="eea1" binding="SC4">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<dividerLocation value="200"/>
<dividerSize value="3"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="1f7ed" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="200" height="200"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<splitpane id="4573f" binding="SC5">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<dividerLocation value="500"/>
<dividerSize value="3"/>
</properties>
<border type="none"/>
<children>
<grid id="779b" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="200" height="50"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<toolbar id="9c35e" binding="variantsFilterTools1">
<constraints border-constraint="South"/>
<properties>
<floatable value="false"/>
</properties>
<border type="none"/>
<children>
<component id="f436e" class="javax.swing.JButton" binding="BDistributed">
<constraints/>
<properties>
<borderPainted value="false"/>
<font name="Courier New" size="14" style="2"/>
<horizontalAlignment value="2"/>
<maximumSize width="90" height="30"/>
<minimumSize width="90" height="30"/>
<preferredSize width="90" height="30"/>
<text value="BLOCK"/>
<toolTipText value="Фильтрация по распределённым измерениям "/>
<verticalAlignment value="1"/>
<verticalTextPosition value="0"/>
</properties>
</component>
<component id="5de27" class="javax.swing.JButton" binding="bMultiplied">
<constraints/>
<properties>
<borderPainted value="false"/>
<font name="Courier New" size="14" style="2"/>
<horizontalAlignment value="2"/>
<maximumSize width="90" height="30"/>
<minimumSize width="90" height="30"/>
<preferredSize width="90" height="30"/>
<text value=" * "/>
<toolTipText value="Фильтрация по размноженным измерениям "/>
<verticalAlignment value="1"/>
<verticalTextPosition value="0"/>
</properties>
</component>
<component id="2cbf5" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<foreground color="-16777216"/>
<text value=" соответствует фильтру "/>
<verticalAlignment value="1"/>
<verticalTextPosition value="1"/>
</properties>
</component>
<component id="dc7dd" class="javax.swing.JLabel" binding="VisibleVariantsCount">
<constraints/>
<properties>
<font style="0"/>
<foreground color="-16777216"/>
<text value="?"/>
<verticalAlignment value="1"/>
<verticalTextPosition value="1"/>
</properties>
</component>
<component id="64f66" class="javax.swing.JLabel">
<constraints/>
<properties>
<font style="0"/>
<foreground color="-16777216"/>
<text value=" | "/>
</properties>
</component>
<component id="8d745" class="javax.swing.JLabel">
<constraints/>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<foreground color="-16777216"/>
<text value="возможных "/>
<verticalAlignment value="1"/>
<verticalTextPosition value="1"/>
</properties>
</component>
<component id="deeb8" class="javax.swing.JLabel" binding="TotalVariantsCount">
<constraints/>
<properties>
<font style="0"/>
<foreground color="-16777216"/>
<text value="?"/>
<verticalAlignment value="1"/>
<verticalTextPosition value="1"/>
</properties>
</component>
</children>
</toolbar>
<grid id="c476f" binding="dimensionsPanel" custom-create="true" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="b1916" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="200" height="200"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="d862" binding="distributionPanel" custom-create="true" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
<grid id="ef6e3" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<maximumSize width="-1" height="-1"/>
<minimumSize width="200" height="200"/>
<preferredSize width="-1" height="-1"/>
</properties>
<border type="none"/>
<children>
<grid id="11216" binding="variantsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
</form>

View File

@@ -0,0 +1,119 @@
package Visual_DVM_2021.UI.Main;
import Common.Current;
import Common.UI.Trees.TreeForm;
import Common.Utils.Utils;
import ProjectData.SapforData.Arrays.UI.DimensionsTableForm;
import ProjectData.SapforData.Arrays.UI.RulesTree;
import Visual_DVM_2021.UI.Interface.VariantsWindow;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class VariantsForm implements VariantsWindow {
public JSplitPane SC4;
public JSplitPane SC5;
private JButton BDistributed;
private JButton bMultiplied;
private JPanel dimensionsPanel;
private JPanel distributionPanel;
// private JLabel SelectedVariantsCount;
private JLabel VisibleVariantsCount;
private JLabel TotalVariantsCount;
private JPanel variantsPanel;
private JPanel content;
private JToolBar variantsFilterTools1;
//--
public TreeForm distributionForm1;
private DimensionsTableForm dimensionsForm;
//--
public VariantsForm() {
LoadSplitters();
Current.getProject().parallelVariants.mountUI(variantsPanel);
//-
BDistributed.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Current.getProject().SwitchFilterDistributed();
BDistributed.setIcon(Utils.getIcon(Current.getProject().f_distributed() ? "/icons/Pick.png" : "/icons/NotPick.png"));
ShowVariantsFilter();
ShowFilteredVariantsCount();
}
});
bMultiplied.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Current.getProject().SwitchFilterMultiplied();
bMultiplied.setIcon(Utils.getIcon(Current.getProject().f_multiplied() ? "/icons/Pick.png" : "/icons/NotPick.png"));
ShowVariantsFilter();
ShowFilteredVariantsCount();
}
});
}
private void createUIComponents() {
// TODO: place custom component creation code here
distributionPanel = (distributionForm1 = new TreeForm(RulesTree.class)).getContent();
dimensionsPanel = (dimensionsForm = new DimensionsTableForm()).getContent();
}
@Override
public JPanel getContent() {
return content;
}
@Override
public void ShowProjectDistribution() {
distributionForm1.Show();
}
@Override
public void ShowNoProjectDistribution() {
distributionForm1.Clear();
}
@Override
public void ShowVariantsFilterButtons() {
BDistributed.setIcon(Utils.getIcon(Current.getProject().f_distributed() ? "/icons/Pick.png" : "/icons/NotPick.png"));
bMultiplied.setIcon(Utils.getIcon(Current.getProject().f_multiplied() ? "/icons/Pick.png" : "/icons/NotPick.png"));
}
@Override
public void ShowVariantsFilter() {
dimensionsForm.Show();
}
@Override
public void ShowNoVariantsFilter() {
dimensionsForm.Clear();
}
@Override
public void ShowFilteredVariantsCount() {
VisibleVariantsCount.setText(String.valueOf(Current.getProject().getFilteredVariantsCount()));
}
@Override
public void ShowTotalVariantsCount() {
TotalVariantsCount.setText(String.valueOf(Current.getProject().getTotalVariantsCount()));
}
@Override
public void ShowCheckedVariantsCount() {
// SelectedVariantsCount.setText(Current.getProject().CheckedVariantsCounter.toString());
}
@Override
public void ShowVariants() {
Current.getProject().parallelVariants.ShowUI();
}
@Override
public void RefreshVariants() {
Current.getProject().parallelVariants.RefreshUI();
}
@Override
public void ShowNoVariants() {
Current.getProject().parallelVariants.ClearUI();
}
@Override
public void ShowNoCheckedVariantsCount() {
//SelectedVariantsCount.setText("0");
}
@Override
public void ShowNoFilteredVariantsCount() {
VisibleVariantsCount.setText("0");
}
@Override
public void ShowNoTotalVariantsCount() {
TotalVariantsCount.setText("0");
}
}

View File

@@ -0,0 +1,109 @@
package Visual_DVM_2021.UI.Main;
import Common.Current;
import Common.Global;
import Common.Utils.Utils;
import GlobalData.Settings.SettingName;
import ProjectData.Files.DBProjectFile;
import ProjectData.Project.db_project_info;
import javax.swing.*;
import java.util.Vector;
public class VersionsComparisonForm extends ComparisonForm<db_project_info> {
private final JComboBox<DBProjectFile> cbFile;
protected DBProjectFile file = null;
private VersionsComparisonForm getMaster() {
return (VersionsComparisonForm) master;
}
private VersionsComparisonForm getSlave() {
return (VersionsComparisonForm) slave;
}
public VersionsComparisonForm(VersionsComparisonForm slave_in) {
super(db_project_info.class, slave_in);
cbFile = new JComboBox<>();
tools.add(cbFile, 3);
cbFile.addActionListener(e -> {
DBProjectFile File1 = null;
DBProjectFile File2 = null;
ClearText();
file = (cbFile.getSelectedItem() instanceof DBProjectFile) ?
((DBProjectFile) cbFile.getSelectedItem()) : null;
if (file != null) {
if (isMaster()) {
getSlave().selectSameFile(file);
} else {
File1 = getMaster().file;
File2 = file;
//---
if ((File1 != null) && (File2 != null)) {
boolean ExtensionsOn = Global.db.settings.get(SettingName.ExtensionsOn).toBoolean();
String name1 = ExtensionsOn ? File1.file.getName() : Utils.getFileNameWithoutExtension(File1.file);
String name2 = ExtensionsOn ? File2.file.getName() : Utils.getFileNameWithoutExtension(File2.file);
System.out.println("name1=" + Utils.Brackets(name1) + "name2=" + Utils.Brackets(name2));
if (Global.db.settings.get(SettingName.ComparsionDiffMergeOn).toBoolean()) {
if (name1.equalsIgnoreCase(name2))
master.DoComparePass(true);
} else
master.DoShowPass(true);
}
}
}
});
}
@Override
protected Current getCurrentObjectName() {
return Current.Version;
}
@Override
protected String getText() {
return Utils.ReadAllText(file.file);
}
@Override
protected void removeObject() {
cbFile.removeAllItems();
file = null;
}
@Override
public boolean isReady() {
return super.isReady() && file != null;
}
@Override
protected void showObject() {
lObjectName.setText(object.name);
lObjectName.setToolTipText(
object.getVersionTooltip()
);
cbFile.removeAllItems();
Vector<DBProjectFile> files = object.getFilesForComparsion();
for (DBProjectFile file : files)
cbFile.addItem(file);
}
public void selectSameFile(DBProjectFile file_in) {
file = null;
cbFile.setSelectedIndex(-1);
for (int i = 0; i < cbFile.getItemCount(); ++i) {
DBProjectFile dbProjectFile = cbFile.getItemAt(i);
if (Global.db.settings.get(SettingName.ExtensionsOn).toBoolean()) {
//если учитываем исключения, ищем полное совпадение
if (dbProjectFile.name.equals(file_in.name)) {
cbFile.setSelectedIndex(i);
return;
}
} else {
if (Utils.getNameWithoutExtension(dbProjectFile.name).equals(Utils.getNameWithoutExtension(file_in.name))) {
cbFile.setSelectedIndex(i);
return;
}
}
//если drk.x
}
}
public void CheckVersion(db_project_info version_in) {
if ((object != null) && version_in.Home.equals(object.Home)) {
RemoveObject();
}
}
@Override
protected boolean fortranWrapsOn() {
return Global.db.settings.get(SettingName.FortranWrapsOn).toBoolean();
}
}

View File

@@ -0,0 +1,118 @@
<?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.VersionsForm">
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="917" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="56af8" binding="SC2">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties>
<dividerLocation value="150"/>
<dividerSize value="3"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="963f1" binding="versionsBackground" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<minimumSize width="0" height="150"/>
</properties>
<border type="none"/>
<children>
<grid id="3dd9a" binding="versionsPanel" custom-create="true" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="3cdf1" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<minimumSize width="239" height="150"/>
</properties>
<border type="none"/>
<children>
<tabbedpane id="4762b" binding="versionsTabs">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="5fc2b" binding="variantsFormPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<tabbedpane title="Параллельные варианты" icon="icons/ParallelVariants.png"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
<grid id="377c4" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="Сравнение версий" icon="icons/Comparsion.png"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="59ecc" binding="SC9">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties>
<dividerLocation value="450"/>
<dividerSize value="3"/>
</properties>
<border type="none"/>
<children>
<grid id="c6aa" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="left"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
<grid id="ca9a1" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="right"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</splitpane>
</children>
</grid>
</children>
</tabbedpane>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
</form>

View File

@@ -0,0 +1,87 @@
package Visual_DVM_2021.UI.Main;
import Common.UI.Trees.TreeForm;
import Common.UI.UI;
import ProjectData.Project.UI.VersionsTree;
import ProjectData.Project.db_project_info;
import Visual_DVM_2021.UI.Interface.FormWithSplitters;
import Visual_DVM_2021.UI.Interface.VariantsWindow;
import Visual_DVM_2021.UI.Interface.VersionsWindow;
import javax.swing.*;
import java.awt.*;
public class VersionsForm implements FormWithSplitters, VersionsWindow {
private final db_project_info root;
private JPanel content;
//-
public JSplitPane SC2;
public JSplitPane SC9;
public VersionsComparisonForm MasterComparsionForm;
public VersionsComparisonForm SlaveComparsionForm;
private JPanel versionsPanel;
private JTabbedPane versionsTabs;
private JPanel variantsFormPanel;
private JPanel versionsBackground;
private TreeForm versionsTreeForm;
//-
private VariantsWindow variantsForm = null;
public VersionsForm(db_project_info root_in) {
LoadSplitters();
root = root_in;
MasterComparsionForm = new VersionsComparisonForm(SlaveComparsionForm = new VersionsComparisonForm(null));
SC9.setLeftComponent(MasterComparsionForm.getContent());
SC9.setRightComponent(SlaveComparsionForm.getContent());
versionsTreeForm.Show();
//-
versionsTabs.setEnabledAt(0, false);
versionsPanel.add(UI.versionsMenuBar, BorderLayout.NORTH);
}
private void createUIComponents() {
// TODO: place custom component creation code here
versionsPanel = (versionsTreeForm = new TreeForm(VersionsTree.class)).getContent();
}
@Override
public VariantsWindow getVariantsWindow() {
return variantsForm;
}
@Override
public void ShowProjectVariants() {
variantsFormPanel.add((variantsForm = new VariantsForm()).getContent());
versionsTabs.setEnabledAt(0, true);
}
@Override
public void ShowNoProjectVariants() {
UI.Clear(variantsFormPanel);
versionsTabs.setEnabledAt(0, false);
}
@Override
public void FocusDistribution() {
versionsTabs.setSelectedIndex(0);
}
@Override
public void BlockVariants() {
versionsTabs.setEnabledAt(0, false);
versionsTabs.setSelectedIndex(1);
}
@Override
public void UnblockVariants() {
versionsTabs.setEnabledAt(0, true);
}
@Override
public void RemoveVersionFromComparison(db_project_info version) {
MasterComparsionForm.CheckVersion(version);
SlaveComparsionForm.CheckVersion(version);
}
@Override
public TreeForm getVersionsForm() {
return versionsTreeForm;
}
@Override
public JPanel getContent() {
return content;
}
@Override
public void SaveSplitters() {
FormWithSplitters.super.SaveSplitters();
if (variantsForm != null) variantsForm.SaveSplitters();
}
}

View File

@@ -0,0 +1,26 @@
<?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.WelcomeForm">
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="753" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="2e242" class="javax.swing.JTextArea" binding="WelcomeText">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="6" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="150" height="50"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
<enabled value="true"/>
<font name="Times New Roman" size="25" style="1"/>
<text value="&#10;&#10;&#10;&#10;&#10; &#9;Чтобы начать работу, создайте или откройте проект"/>
</properties>
</component>
</children>
</grid>
</form>

View File

@@ -0,0 +1,18 @@
package Visual_DVM_2021.UI.Main;
import Common.UI.DragDrop.FileDrop;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021;
import javax.swing.*;
public class WelcomeForm {
public JPanel content;
private JTextArea WelcomeText;
public WelcomeForm() {
// end filesDropped
new FileDrop(System.out, WelcomeText, files -> {
if (files.length > 0) {
Pass_2021.passes.get(PassCode_2021.OpenCurrentProject).Do(files[0]);
}
});
}
}

View File

@@ -0,0 +1,11 @@
<?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" binding="panel1" default-binding="true" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<xy x="20" y="20" width="0" height="641"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</form>

View File

@@ -0,0 +1,5 @@
package Visual_DVM_2021.UI.Main;
import javax.swing.*;
public class buffer {
private JPanel panel1;
}