|
@@ -106,7 +106,7 @@ public class GUI<E> implements CategoryListener {
|
|
private JTable tableHolonElement = new JTable();
|
|
private JTable tableHolonElement = new JTable();
|
|
private PropertyTable tableModelHolonElement = new PropertyTable();
|
|
private PropertyTable tableModelHolonElement = new PropertyTable();
|
|
private final JPanel scrollElements = new JPanel();
|
|
private final JPanel scrollElements = new JPanel();
|
|
- JScrollPane tableHolonElementScrollPane = new JScrollPane();
|
|
|
|
|
|
+ private JScrollPane tableHolonElementScrollPane = new JScrollPane();
|
|
|
|
|
|
// In this section are all the properties that correspond to the clicked
|
|
// In this section are all the properties that correspond to the clicked
|
|
// HolonObject, such as connections, name, Type, etc.
|
|
// HolonObject, such as connections, name, Type, etc.
|
|
@@ -435,8 +435,12 @@ public class GUI<E> implements CategoryListener {
|
|
try {
|
|
try {
|
|
Object temp;
|
|
Object temp;
|
|
if (getActualCps() != null) {
|
|
if (getActualCps() != null) {
|
|
- temp = tableModelProperties.getValueAt(0, 1);
|
|
|
|
- getActualCps().setName(temp.toString());
|
|
|
|
|
|
+ if (getActualCps() instanceof HolonObject) {
|
|
|
|
+ temp = tableModelProperties.getValueAt(0, 1);
|
|
|
|
+ getActualCps().setName(temp.toString());
|
|
|
|
+ } else if (getActualCps() instanceof HolonTransformer) {
|
|
|
|
+ // get Info of the Properties for Transformer
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
temp = tableModelProperties.getValueAt(2, 1);
|
|
temp = tableModelProperties.getValueAt(2, 1);
|
|
Float ftemp = Float.parseFloat(temp.toString());
|
|
Float ftemp = Float.parseFloat(temp.toString());
|
|
@@ -691,6 +695,9 @@ public class GUI<E> implements CategoryListener {
|
|
refreshTableHolonElement();
|
|
refreshTableHolonElement();
|
|
Object[] tempEnergy = { "Total Energy", ((HolonObject) temp).getCurrentEnergy() };
|
|
Object[] tempEnergy = { "Total Energy", ((HolonObject) temp).getCurrentEnergy() };
|
|
tableModelProperties.addRow(tempEnergy);
|
|
tableModelProperties.addRow(tempEnergy);
|
|
|
|
+ } else if (temp instanceof HolonTransformer) {
|
|
|
|
+ Object[] tempRatioPerc = { "Ratio Type", true };
|
|
|
|
+ tableModelProperties.addRow(tempRatioPerc);
|
|
}
|
|
}
|
|
tableModelProperties.setCellEditable(0, 1, true);
|
|
tableModelProperties.setCellEditable(0, 1, true);
|
|
tableModelProperties.setCellEditable(2, 1, false);
|
|
tableModelProperties.setCellEditable(2, 1, false);
|
|
@@ -714,13 +721,11 @@ public class GUI<E> implements CategoryListener {
|
|
Object[] tempConnection = { "",
|
|
Object[] tempConnection = { "",
|
|
temp2.getA().getName() + " with ID: " + temp2.getA().getID() };
|
|
temp2.getA().getName() + " with ID: " + temp2.getA().getID() };
|
|
tableModelProperties.addRow(tempConnection);
|
|
tableModelProperties.addRow(tempConnection);
|
|
-
|
|
|
|
} else {
|
|
} else {
|
|
Object[] tempConnection = { "",
|
|
Object[] tempConnection = { "",
|
|
temp2.getB().getName() + " with ID: " + temp2.getB().getID() };
|
|
temp2.getB().getName() + " with ID: " + temp2.getB().getID() };
|
|
tableModelProperties.addRow(tempConnection);
|
|
tableModelProperties.addRow(tempConnection);
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -783,7 +788,7 @@ public class GUI<E> implements CategoryListener {
|
|
frmCyberPhysical.getContentPane().add(splitPane);
|
|
frmCyberPhysical.getContentPane().add(splitPane);
|
|
|
|
|
|
mntmNew.addActionListener(new ActionListener() {
|
|
mntmNew.addActionListener(new ActionListener() {
|
|
-
|
|
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public void actionPerformed(ActionEvent arg0) {
|
|
public void actionPerformed(ActionEvent arg0) {
|
|
model.getEdgesOnCanvas().removeAll(model.getEdgesOnCanvas());
|
|
model.getEdgesOnCanvas().removeAll(model.getEdgesOnCanvas());
|
|
@@ -797,7 +802,7 @@ public class GUI<E> implements CategoryListener {
|
|
canvas.repaint();
|
|
canvas.repaint();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+
|
|
mntmOpen.addActionListener(new java.awt.event.ActionListener() {
|
|
mntmOpen.addActionListener(new java.awt.event.ActionListener() {
|
|
@Override
|
|
@Override
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
@@ -1038,6 +1043,8 @@ public class GUI<E> implements CategoryListener {
|
|
tableModelProperties.removeRow(2);
|
|
tableModelProperties.removeRow(2);
|
|
Object[] tempEnergy = { "Total Energy", ((HolonObject) tempCps).getCurrentEnergy() };
|
|
Object[] tempEnergy = { "Total Energy", ((HolonObject) tempCps).getCurrentEnergy() };
|
|
tableModelProperties.insertRow(2, tempEnergy);
|
|
tableModelProperties.insertRow(2, tempEnergy);
|
|
|
|
+ } else if (tempCps instanceof HolonTransformer) {
|
|
|
|
+ // Refresh Transformer Info
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|