|
@@ -177,15 +177,21 @@ public class PortEditorPanel extends JPanel
|
|
|
tfTriggerInterval = new JTextField();
|
|
|
tfTriggerInterval.setBounds(160, 100, 130, 20);
|
|
|
editPanel.add(tfTriggerInterval);
|
|
|
- tfTriggerInterval.setColumns(10);
|
|
|
- tfTriggerInterval.addFocusListener(this);
|
|
|
- tfTriggerInterval.addActionListener(this);
|
|
|
- tfTriggerInterval.addMouseListener(this);
|
|
|
+ //tfTriggerInterval.setColumns(10);
|
|
|
+ //tfTriggerInterval.addFocusListener(this);
|
|
|
+ //tfTriggerInterval.addActionListener(this);
|
|
|
+ //tfTriggerInterval.addMouseListener(this);
|
|
|
tfTriggerInterval.setToolTipText(toolTipTrigger);
|
|
|
+ tfTriggerInterval.setEnabled(false);
|
|
|
|
|
|
- JLabel lblTriggerIntervalUnit = new JLabel("ms");
|
|
|
- lblTriggerIntervalUnit.setBounds(3000, 100, 50, 20);
|
|
|
- editPanel.add(lblTriggerIntervalUnit);
|
|
|
+ JButton btnEditTriggerInterval = new JButton("Edit Distribution");
|
|
|
+ btnEditTriggerInterval.setBounds(300, 100, 150, 20);
|
|
|
+ btnEditTriggerInterval.addActionListener(l->openEditDistribution());
|
|
|
+ editPanel.add(btnEditTriggerInterval);
|
|
|
+
|
|
|
+ //JLabel lblTriggerIntervalUnit = new JLabel("ms");
|
|
|
+ //lblTriggerIntervalUnit.setBounds(300, 100, 50, 20);
|
|
|
+ //editPanel.add(lblTriggerIntervalUnit);
|
|
|
|
|
|
|
|
|
String toolTipResponse = "<html>Time in milliseconds which this port needs to calculate<br>"
|
|
@@ -271,7 +277,21 @@ public class PortEditorPanel extends JPanel
|
|
|
updateLabel(toEdit.getPorts().get(list.getSelectedIndex()));
|
|
|
}
|
|
|
|
|
|
- //Listens to the list
|
|
|
+ private void openEditDistribution() {
|
|
|
+ if(list.getSelectedIndex() < 0 || list.getSelectedIndex() >= toEdit.getPorts().size())return;
|
|
|
+ /**
|
|
|
+ * Port, which is being edited at the moment
|
|
|
+ */
|
|
|
+ Port toChange = toEdit.getPorts().get(list.getSelectedIndex());
|
|
|
+
|
|
|
+ PortDistributionConfigurationPopUp popUp = new PortDistributionConfigurationPopUp(toChange);
|
|
|
+ popUp.setEnabled(true);
|
|
|
+ popUp.setVisible(true);
|
|
|
+ popUp.setLocationRelativeTo(this);
|
|
|
+ popUp.setFocusable(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ //Listens to the list
|
|
|
@SuppressWarnings("unchecked")
|
|
|
public void valueChanged(ListSelectionEvent e) {
|
|
|
if(!(e.getSource() instanceof JList<?>)||!(((JList<?>)e.getSource()).getSelectedValue() instanceof Port))return;
|
|
@@ -291,7 +311,7 @@ public class PortEditorPanel extends JPanel
|
|
|
tfLastTrigger.setBackground(Color.WHITE);
|
|
|
tfResponseTime.setText(""+port.getResponseTime());
|
|
|
tfResponseTime.setBackground(Color.WHITE);
|
|
|
- tfTriggerInterval.setText(""+port.getTriggerInterval());
|
|
|
+ tfTriggerInterval.setText(""+port.getTriggerInterval()+" ms");
|
|
|
tfTriggerInterval.setBackground(Color.WHITE);
|
|
|
tfJitter.setText(""+port.getJitter());
|
|
|
tfJitter.setBackground(Color.WHITE);
|
|
@@ -375,6 +395,7 @@ public class PortEditorPanel extends JPanel
|
|
|
toChange.setStatus((short) cmbStatus.getSelectedIndex());
|
|
|
|
|
|
//Edit trigger Interval
|
|
|
+ /**
|
|
|
if(tfTriggerInterval.getText()!=""+toChange.getTriggerInterval()){
|
|
|
try {
|
|
|
//TODO: Advanced Triggers
|
|
@@ -391,6 +412,7 @@ public class PortEditorPanel extends JPanel
|
|
|
}else{
|
|
|
tfTriggerInterval.setBackground(Color.WHITE);
|
|
|
}
|
|
|
+ */
|
|
|
|
|
|
//Edit Response time
|
|
|
if(tfResponseTime.getText()!=""+toChange.getResponseTime()){
|