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

Ajout d'un matrice: nom, valeurs

parent 8f950f9d
No related branches found
No related tags found
No related merge requests found
Source diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -185,7 +185,8 @@ public class TGCDependencyMatrix extends TGCScalableWithInternalComponent implem
public boolean editOnDoubleClick(JFrame frame) {
String oldValue = value;
JDialogDependencyMatrix jddm = new JDialogDependencyMatrix(frame, tdp.getMainGUI(), "Dependency Matrix", columnDiag, rowDiag,
JDialogDependencyMatrix jddm = new JDialogDependencyMatrix(frame, tdp.getMainGUI(), "Dependency Matrix", value,
columnDiag, rowDiag,
columns, rows, dependencies);
GraphicLib.centerOnParent(jddm, 800, 500);
jddm.setVisible( true );
......@@ -194,11 +195,16 @@ public class TGCDependencyMatrix extends TGCScalableWithInternalComponent implem
TraceManager.addDev("Has been saved");
if (jddm.hasMatrix()) {
TraceManager.addDev("Has matrix!");
String valTmp = jddm.getName().trim();
if ((valTmp != null) && (valTmp.length() > 0)) {
value = valTmp;
}
rowDiag = jddm.getRowDiag();
columnDiag = jddm.getColumnDiag();
rows = jddm.getRows();
columns = jddm.getColumns();
dependencies = jddm.getDependencies();
tdp.repaint();
}
}
......
......@@ -73,11 +73,13 @@ public class JDialogDependencyMatrix extends JDialogBase implements ActionListen
private MainGUI mgui;
private JTabbedPane mainPane;
private JTextField name;
private JComboBox<String> rowPanelBox, rowDiagBox, colPanelBox, colDiagBox;
private JList<String> rowClassList, colClassList;
private DefaultListModel<String> rowClassListModel, colClassListModel;
private JButton generateMatrix;
private String value;
private String rowDiag;
private String columnDiag;
private String rows;
......@@ -93,12 +95,13 @@ public class JDialogDependencyMatrix extends JDialogBase implements ActionListen
protected DependencyTableModel dtm;
/* Creates new form */
public JDialogDependencyMatrix(JFrame f, MainGUI _mgui, String title, String _columnDiag, String _rowDiag,
public JDialogDependencyMatrix(JFrame f, MainGUI _mgui, String title, String _value, String _columnDiag, String _rowDiag,
String _columns, String _rows, ArrayList<BytePoint> _dependencies) {
super(f, title, true);
mgui = _mgui;
value = _value;
rowDiag = _rowDiag;
columnDiag = _columnDiag;
rows = _rows;
......@@ -124,6 +127,18 @@ public class JDialogDependencyMatrix extends JDialogBase implements ActionListen
mainPane = new JTabbedPane();
c.add(BorderLayout.CENTER, mainPane);
// Name panel
JPanel namePanel = new JPanel();
namePanel.add(new JLabel("Name:"));
name = new JTextField("", 30);
if (value != null) {
name.setText(value);
}
name.setEditable(true);
namePanel.add(name);
c.add(BorderLayout.NORTH, namePanel);
// Tab to generate Matrix
GridBagLayout gsp = new GridBagLayout();
......@@ -533,6 +548,13 @@ public class JDialogDependencyMatrix extends JDialogBase implements ActionListen
return matrix != null;
}
public String getName() {
if (name == null) {
return "";
}
return name.getText();
}
public String getRowDiag() {
return rowDiag;
}
......
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