синхрон панелей сравнения сапфор, ++
This commit is contained in:
@@ -425,7 +425,7 @@
|
||||
<splitpane position="left"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<dividerLocation value="300"/>
|
||||
<dividerLocation value="250"/>
|
||||
<dividerSize value="3"/>
|
||||
<orientation value="0"/>
|
||||
</properties>
|
||||
@@ -446,7 +446,7 @@
|
||||
<splitpane position="right"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<dividerLocation value="300"/>
|
||||
<dividerLocation value="250"/>
|
||||
<dividerSize value="3"/>
|
||||
<orientation value="0"/>
|
||||
</properties>
|
||||
|
||||
@@ -15,6 +15,8 @@ import Visual_DVM_2021.UI.Interface.TestingWindow;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
public class TestingForm implements FormWithSplitters, TestingWindow {
|
||||
private JPanel content;
|
||||
@Override
|
||||
@@ -71,6 +73,29 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
|
||||
//--
|
||||
private final SapforVersionsComparisonForm sapforVersionMaster; //сравнение версий тестов SAPFOR.
|
||||
private final SapforVersionsComparisonForm sapforVersionSlave;
|
||||
private boolean events_on=true;
|
||||
private final PropertyChangeListener sc65Listener = new PropertyChangeListener() {
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
if (events_on) {
|
||||
events_on=false;
|
||||
SC66.setDividerLocation(SC65.getDividerLocation());
|
||||
System.out.println("Left");
|
||||
events_on=true;
|
||||
}
|
||||
}
|
||||
};
|
||||
private final PropertyChangeListener sc66Listener = new PropertyChangeListener() {
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
if (events_on) {
|
||||
events_on=false;
|
||||
SC65.setDividerLocation(SC66.getDividerLocation());
|
||||
System.out.println("Right");
|
||||
events_on=true;
|
||||
}
|
||||
}
|
||||
};
|
||||
//--
|
||||
public TestingForm() {
|
||||
content.add(UI.testingBar, BorderLayout.NORTH);
|
||||
@@ -96,6 +121,9 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
|
||||
//-
|
||||
SC65.setRightComponent(sapforVersionMaster.getContent());
|
||||
SC66.setRightComponent(sapforVersionSlave.getContent());
|
||||
//--
|
||||
SC65.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, sc65Listener);
|
||||
SC66.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, sc66Listener);
|
||||
//-
|
||||
Global.db.machines.mountUI(machinesPanel);
|
||||
Global.db.users.mountUI(usersPanel);
|
||||
|
||||
Reference in New Issue
Block a user