|
@@ -26,6 +26,7 @@ import javax.swing.JPanel;
|
|
import javax.swing.JPopupMenu;
|
|
import javax.swing.JPopupMenu;
|
|
import javax.swing.JToolTip;
|
|
import javax.swing.JToolTip;
|
|
|
|
|
|
|
|
+import api.CpsAPI;
|
|
import classes.CpsEdge;
|
|
import classes.CpsEdge;
|
|
import classes.CpsNode;
|
|
import classes.CpsNode;
|
|
import classes.AbstractCpsObject;
|
|
import classes.AbstractCpsObject;
|
|
@@ -120,18 +121,22 @@ public class MyCanvas extends JPanel implements MouseListener, MouseMotionListen
|
|
itemCollapse.addActionListener(new ActionListener() {
|
|
itemCollapse.addActionListener(new ActionListener() {
|
|
@Override
|
|
@Override
|
|
public void actionPerformed(ActionEvent e) {
|
|
public void actionPerformed(ActionEvent e) {
|
|
-
|
|
|
|
|
|
+
|
|
repaint();
|
|
repaint();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+
|
|
itemTrack.addActionListener(new ActionListener() {
|
|
itemTrack.addActionListener(new ActionListener() {
|
|
@Override
|
|
@Override
|
|
public void actionPerformed(ActionEvent e) {
|
|
public void actionPerformed(ActionEvent e) {
|
|
-
|
|
|
|
|
|
+ for (AbstractCpsObject o : model.getSelectedCpsObjects()) {
|
|
|
|
+ if (o instanceof HolonObject) {
|
|
|
|
+ control.addTrackingObj((HolonObject) o);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+
|
|
itemDelete.addActionListener(new ActionListener() {
|
|
itemDelete.addActionListener(new ActionListener() {
|
|
@Override
|
|
@Override
|
|
public void actionPerformed(ActionEvent e) {
|
|
public void actionPerformed(ActionEvent e) {
|
|
@@ -192,11 +197,12 @@ public class MyCanvas extends JPanel implements MouseListener, MouseMotionListen
|
|
// Test SubNet Coloring
|
|
// Test SubNet Coloring
|
|
int i = 0;
|
|
int i = 0;
|
|
for (SubNet s : controller.getSimManager().getSubNets()) {
|
|
for (SubNet s : controller.getSimManager().getSubNets()) {
|
|
-
|
|
|
|
- if(model.getSubNetColors().size()-1 < i){
|
|
|
|
- controller.addSubNetColor(new Color((int) (Math.random() * 255), (int) (Math.random() * 255), (int) (Math.random() * 255)));
|
|
|
|
|
|
+
|
|
|
|
+ if (model.getSubNetColors().size() - 1 < i) {
|
|
|
|
+ controller.addSubNetColor(new Color((int) (Math.random() * 255), (int) (Math.random() * 255),
|
|
|
|
+ (int) (Math.random() * 255)));
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
for (HolonObject cps : s.getObjects()) {
|
|
for (HolonObject cps : s.getObjects()) {
|
|
cps.setBorderColor(model.getSubNetColors().get(i));
|
|
cps.setBorderColor(model.getSubNetColors().get(i));
|
|
}
|
|
}
|