Skip to content
Snippets Groups Projects
Commit 5e6387c8 authored by Ludovic Apvrille's avatar Ludovic Apvrille
Browse files

Update on psi chart panel

parent 1631b6cb
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
/**Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille /**Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille
ludovic.apvrille AT enst.fr ludovic.apvrille AT enst.fr
This software is a computer program whose purpose is to allow the This software is a computer program whose purpose is to allow the
edition of TURTLE analysis, design and deployment diagrams, to edition of TURTLE analysis, design and deployment diagrams, to
allow the generation of RT-LOTOS or Java code from this diagram, allow the generation of RT-LOTOS or Java code from this diagram,
and at last to allow the analysis of formal validation traces and at last to allow the analysis of formal validation traces
obtained from external tools, e.g. RTL from LAAS-CNRS and CADP obtained from external tools, e.g. RTL from LAAS-CNRS and CADP
from INRIA Rhone-Alpes. from INRIA Rhone-Alpes.
This software is governed by the CeCILL license under French law and This software is governed by the CeCILL license under French law and
abiding by the rules of distribution of free software. You can use, abiding by the rules of distribution of free software. You can use,
modify and/ or redistribute the software under the terms of the CeCILL modify and/ or redistribute the software under the terms of the CeCILL
license as circulated by CEA, CNRS and INRIA at the following URL license as circulated by CEA, CNRS and INRIA at the following URL
"http://www.cecill.info". "http://www.cecill.info".
As a counterpart to the access to the source code and rights to copy, As a counterpart to the access to the source code and rights to copy,
modify and redistribute granted by the license, users are provided only modify and redistribute granted by the license, users are provided only
with a limited warranty and the software's author, the holder of the with a limited warranty and the software's author, the holder of the
economic rights, and the successive licensors have only limited economic rights, and the successive licensors have only limited
liability. liability.
In this respect, the user's attention is drawn to the risks associated In this respect, the user's attention is drawn to the risks associated
with loading, using, modifying and/or developing or reproducing the with loading, using, modifying and/or developing or reproducing the
software by the user in light of its specific status of free software, software by the user in light of its specific status of free software,
that may mean that it is complicated to manipulate, and that also that may mean that it is complicated to manipulate, and that also
therefore means that it is reserved for developers and experienced therefore means that it is reserved for developers and experienced
professionals having in-depth computer knowledge. Users are therefore professionals having in-depth computer knowledge. Users are therefore
encouraged to load and test the software's suitability as regards their encouraged to load and test the software's suitability as regards their
requirements in conditions enabling the security of their systems and/or requirements in conditions enabling the security of their systems and/or
data to be ensured and, more generally, to use and operate it in the data to be ensured and, more generally, to use and operate it in the
same conditions as regards security. same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
/** /**
* Class JDialogManageListOfString * Class JDialogManageListOfString
* Dialog for managing two lists of String * Dialog for managing two lists of String
* Creation: 28/03/2014 * Creation: 28/03/2014
* @version 1.0 28/03/2014 * @version 1.0 28/03/2014
* @author Ludovic APVRILLE * @author Ludovic APVRILLE
* @see * @see
*/ */
package ui.window; package ui.window;
...@@ -56,13 +56,13 @@ import ui.*; ...@@ -56,13 +56,13 @@ import ui.*;
public class JDialogManageListOfString extends javax.swing.JDialog implements ActionListener, ListSelectionListener { public class JDialogManageListOfString extends javax.swing.JDialog implements ActionListener, ListSelectionListener {
private static boolean overideSyntaxChecking = false; private static boolean overideSyntaxChecking = false;
private Vector<String> ignored, selected; private Vector<String> ignored, selected;
//subpanels //subpanels
private JPanel panel1, panel2, panel3, panel6; private JPanel panel1, panel2, panel3, panel6;
private JList listIgnored; private JList listIgnored;
...@@ -71,29 +71,29 @@ public class JDialogManageListOfString extends javax.swing.JDialog implements Ac ...@@ -71,29 +71,29 @@ public class JDialogManageListOfString extends javax.swing.JDialog implements Ac
private JButton addOneSelected; private JButton addOneSelected;
private JButton addOneIgnored; private JButton addOneIgnored;
private JButton allIgnored; private JButton allIgnored;
// Main Panel // Main Panel
private JButton closeButton; private JButton closeButton;
private JButton cancelButton; private JButton cancelButton;
private boolean hasBeenCancelled = false; private boolean hasBeenCancelled = false;
/** Creates new form */ /** Creates new form */
public JDialogManageListOfString(Frame f, Vector<String> _ignored, Vector<String> _selected, String title) { public JDialogManageListOfString(Frame f, Vector<String> _ignored, Vector<String> _selected, String title) {
super(f, title, true); super(f, title, true);
ignored = _ignored; ignored = _ignored;
selected = _selected; selected = _selected;
initComponents(); initComponents();
myInitComponents(); myInitComponents();
pack(); pack();
} }
private void myInitComponents() { private void myInitComponents() {
setButtons(); setButtons();
} }
private void initComponents() { private void initComponents() {
Container c = getContentPane(); Container c = getContentPane();
GridBagLayout gridbag1 = new GridBagLayout(); GridBagLayout gridbag1 = new GridBagLayout();
...@@ -101,7 +101,7 @@ public class JDialogManageListOfString extends javax.swing.JDialog implements Ac ...@@ -101,7 +101,7 @@ public class JDialogManageListOfString extends javax.swing.JDialog implements Ac
setFont(new Font("Helvetica", Font.PLAIN, 14)); setFont(new Font("Helvetica", Font.PLAIN, 14));
c.setLayout(new BorderLayout()); c.setLayout(new BorderLayout());
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
// ignored list // ignored list
panel1 = new JPanel(); panel1 = new JPanel();
panel1.setLayout(new BorderLayout()); panel1.setLayout(new BorderLayout());
...@@ -114,7 +114,7 @@ public class JDialogManageListOfString extends javax.swing.JDialog implements Ac ...@@ -114,7 +114,7 @@ public class JDialogManageListOfString extends javax.swing.JDialog implements Ac
panel1.add(scrollPane1, BorderLayout.CENTER); panel1.add(scrollPane1, BorderLayout.CENTER);
panel1.setPreferredSize(new Dimension(200, 250)); panel1.setPreferredSize(new Dimension(200, 250));
c.add(panel1, BorderLayout.WEST); c.add(panel1, BorderLayout.WEST);
// validated list // validated list
panel2 = new JPanel(); panel2 = new JPanel();
panel2.setLayout(new BorderLayout()); panel2.setLayout(new BorderLayout());
...@@ -127,69 +127,69 @@ public class JDialogManageListOfString extends javax.swing.JDialog implements Ac ...@@ -127,69 +127,69 @@ public class JDialogManageListOfString extends javax.swing.JDialog implements Ac
panel2.add(scrollPane2, BorderLayout.CENTER); panel2.add(scrollPane2, BorderLayout.CENTER);
panel2.setPreferredSize(new Dimension(200, 250)); panel2.setPreferredSize(new Dimension(200, 250));
c.add(panel2, BorderLayout.EAST); c.add(panel2, BorderLayout.EAST);
// central buttons // central buttons
panel3 = new JPanel(); panel3 = new JPanel();
panel3.setLayout(gridbag1); panel3.setLayout(gridbag1);
c1.weighty = 1.0; c1.weighty = 1.0;
c1.weightx = 1.0; c1.weightx = 1.0;
c1.gridwidth = GridBagConstraints.REMAINDER; //end row c1.gridwidth = GridBagConstraints.REMAINDER; //end row
c1.fill = GridBagConstraints.HORIZONTAL; c1.fill = GridBagConstraints.HORIZONTAL;
c1.gridheight = 1; c1.gridheight = 1;
allSelected = new JButton(IconManager.imgic50); allSelected = new JButton(IconManager.imgic50);
allSelected.setPreferredSize(new Dimension(50, 25)); allSelected.setPreferredSize(new Dimension(50, 25));
allSelected.addActionListener(this); allSelected.addActionListener(this);
allSelected.setActionCommand("allSelected"); allSelected.setActionCommand("allSelected");
panel3.add(allSelected, c1); panel3.add(allSelected, c1);
addOneSelected = new JButton(IconManager.imgic48); addOneSelected = new JButton(IconManager.imgic48);
addOneSelected.setPreferredSize(new Dimension(50, 25)); addOneSelected.setPreferredSize(new Dimension(50, 25));
addOneSelected.addActionListener(this); addOneSelected.addActionListener(this);
addOneSelected.setActionCommand("addOneSelected"); addOneSelected.setActionCommand("addOneSelected");
panel3.add(addOneSelected, c1); panel3.add(addOneSelected, c1);
panel3.add(new JLabel(" "), c1); panel3.add(new JLabel(" "), c1);
addOneIgnored = new JButton(IconManager.imgic46); addOneIgnored = new JButton(IconManager.imgic46);
addOneIgnored.addActionListener(this); addOneIgnored.addActionListener(this);
addOneIgnored.setPreferredSize(new Dimension(50, 25)); addOneIgnored.setPreferredSize(new Dimension(50, 25));
addOneIgnored.setActionCommand("addOneIgnored"); addOneIgnored.setActionCommand("addOneIgnored");
panel3.add(addOneIgnored, c1); panel3.add(addOneIgnored, c1);
allIgnored = new JButton(IconManager.imgic44); allIgnored = new JButton(IconManager.imgic44);
allIgnored.addActionListener(this); allIgnored.addActionListener(this);
allIgnored.setPreferredSize(new Dimension(50, 25)); allIgnored.setPreferredSize(new Dimension(50, 25));
allIgnored.setActionCommand("allIgnored"); allIgnored.setActionCommand("allIgnored");
panel3.add(allIgnored, c1); panel3.add(allIgnored, c1);
c.add(panel3, BorderLayout.CENTER); c.add(panel3, BorderLayout.CENTER);
// main panel; // main panel;
panel6 = new JPanel(); panel6 = new JPanel();
panel6.setLayout(new FlowLayout()); panel6.setLayout(new FlowLayout());
closeButton = new JButton("OK", IconManager.imgic37); closeButton = new JButton("OK", IconManager.imgic37);
//closeButton.setPreferredSize(new Dimension(600, 50)); //closeButton.setPreferredSize(new Dimension(600, 50));
closeButton.addActionListener(this); closeButton.addActionListener(this);
closeButton.setPreferredSize(new Dimension(200, 30)); closeButton.setPreferredSize(new Dimension(200, 30));
cancelButton = new JButton("Cancel", IconManager.imgic27); cancelButton = new JButton("Cancel", IconManager.imgic27);
cancelButton.addActionListener(this); cancelButton.addActionListener(this);
cancelButton.setPreferredSize(new Dimension(200, 30)); cancelButton.setPreferredSize(new Dimension(200, 30));
panel6.add(cancelButton); panel6.add(cancelButton);
panel6.add(closeButton); panel6.add(closeButton);
c.add(panel6, BorderLayout.SOUTH); c.add(panel6, BorderLayout.SOUTH);
} }
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
String command = evt.getActionCommand(); String command = evt.getActionCommand();
// Compare the action command to the known actions. // Compare the action command to the known actions.
if (evt.getSource() == closeButton) { if (evt.getSource() == closeButton) {
closeDialog(); closeDialog();
...@@ -205,8 +205,8 @@ public class JDialogManageListOfString extends javax.swing.JDialog implements Ac ...@@ -205,8 +205,8 @@ public class JDialogManageListOfString extends javax.swing.JDialog implements Ac
allIgnored(); allIgnored();
} }
} }
private void addOneIgnored() { private void addOneIgnored() {
int [] list = listSelected.getSelectedIndices(); int [] list = listSelected.getSelectedIndices();
Vector v = new Vector(); Vector v = new Vector();
...@@ -216,30 +216,30 @@ public class JDialogManageListOfString extends javax.swing.JDialog implements Ac ...@@ -216,30 +216,30 @@ public class JDialogManageListOfString extends javax.swing.JDialog implements Ac
ignored.addElement((String)o); ignored.addElement((String)o);
v.addElement(o); v.addElement(o);
} }
selected.removeAll(v); selected.removeAll(v);
listIgnored.setListData(ignored); listIgnored.setListData(ignored);
listSelected.setListData(selected); listSelected.setListData(selected);
setButtons(); setButtons();
} }
private void addOneSelected() { private void addOneSelected() {
int [] list = listIgnored.getSelectedIndices(); int [] list = listIgnored.getSelectedIndices();
Vector v = new Vector(); Vector v = new Vector();
Object o; Object o;
for (int i=0; i<list.length; i++){ for (int i=0; i<list.length; i++){
o = ignored o = ignored
.elementAt(list[i]); .elementAt(list[i]);
selected.addElement((String)o); selected.addElement((String)o);
v.addElement(o); v.addElement(o);
} }
ignored.removeAll(v); ignored.removeAll(v);
listIgnored.setListData(ignored); listIgnored.setListData(ignored);
listSelected.setListData(selected); listSelected.setListData(selected);
setButtons(); setButtons();
} }
private void allSelected() { private void allSelected() {
selected.addAll(ignored); selected.addAll(ignored);
ignored.removeAllElements(); ignored.removeAllElements();
...@@ -247,7 +247,7 @@ public class JDialogManageListOfString extends javax.swing.JDialog implements Ac ...@@ -247,7 +247,7 @@ public class JDialogManageListOfString extends javax.swing.JDialog implements Ac
listSelected.setListData(selected); listSelected.setListData(selected);
setButtons(); setButtons();
} }
private void allIgnored() { private void allIgnored() {
ignored.addAll(selected); ignored.addAll(selected);
selected.removeAllElements(); selected.removeAllElements();
...@@ -255,67 +255,67 @@ public class JDialogManageListOfString extends javax.swing.JDialog implements Ac ...@@ -255,67 +255,67 @@ public class JDialogManageListOfString extends javax.swing.JDialog implements Ac
listSelected.setListData(selected); listSelected.setListData(selected);
setButtons(); setButtons();
} }
public void closeDialog() { public void closeDialog() {
dispose(); dispose();
} }
public void cancelDialog() { public void cancelDialog() {
hasBeenCancelled = true; hasBeenCancelled = true;
dispose(); dispose();
} }
public boolean hasBeenCancelled() { public boolean hasBeenCancelled() {
return hasBeenCancelled; return hasBeenCancelled;
} }
private void setButtons() { private void setButtons() {
int i1 = listIgnored.getSelectedIndex(); int i1 = listIgnored.getSelectedIndex();
int i2 = listSelected.getSelectedIndex(); int i2 = listSelected.getSelectedIndex();
//closeButton.setEnabled(true); //closeButton.setEnabled(true);
if (i1 == -1) { if (i1 == -1) {
addOneSelected.setEnabled(false); addOneSelected.setEnabled(false);
} else { } else {
addOneSelected.setEnabled(true); addOneSelected.setEnabled(true);
//listValidated.clearSelection(); //listValidated.clearSelection();
} }
if (i2 == -1) { if (i2 == -1) {
addOneIgnored.setEnabled(false); addOneIgnored.setEnabled(false);
} else { } else {
addOneIgnored.setEnabled(true); addOneIgnored.setEnabled(true);
//listIgnored.clearSelection(); //listIgnored.clearSelection();
} }
if (ignored.size() ==0) { if (ignored.size() ==0) {
allSelected.setEnabled(false); allSelected.setEnabled(false);
} else { } else {
allSelected.setEnabled(true); allSelected.setEnabled(true);
} }
if (selected.size() ==0) { if (selected.size() ==0) {
allIgnored.setEnabled(false); allIgnored.setEnabled(false);
} else { } else {
allIgnored.setEnabled(true); allIgnored.setEnabled(true);
} }
} }
public void valueChanged(ListSelectionEvent e) { public void valueChanged(ListSelectionEvent e) {
setButtons(); setButtons();
} }
public Vector<String> getSelected() { public Vector<String> getSelected() {
return selected; return selected;
} }
public Vector<String> getIgnored() { public Vector<String> getIgnored() {
return ignored; return ignored;
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment