From 27c3a59629518b8491f4ac3fab2d9108d9356719 Mon Sep 17 00:00:00 2001 From: Lee <irina.lee@etu.upmc.fr> Date: Fri, 3 Aug 2018 12:57:24 +0200 Subject: [PATCH] update cluster / module for swallowed components (eln*) --- src/main/java/ui/eln/ELNCluster.java | 47 +++++++++++++++++++--------- src/main/java/ui/eln/ELNModule.java | 29 +++++++++-------- 2 files changed, 46 insertions(+), 30 deletions(-) diff --git a/src/main/java/ui/eln/ELNCluster.java b/src/main/java/ui/eln/ELNCluster.java index 89294a7423..2d318d82f5 100644 --- a/src/main/java/ui/eln/ELNCluster.java +++ b/src/main/java/ui/eln/ELNCluster.java @@ -40,7 +40,6 @@ package ui.eln; import myutil.GraphicLib; import ui.*; -import ui.syscams.*; import ui.util.IconManager; import java.awt.*; import java.util.*; @@ -200,9 +199,11 @@ public class ELNCluster extends TGCScalableWithInternalComponent implements Swal public boolean acceptSwallowedTGComponent(TGComponent tgc) { if (tgc instanceof ELNModule) { return true; - } else if (tgc instanceof SysCAMSPortDE) { + } else if (tgc instanceof ELNClusterTerminal) { return true; - } else if (tgc instanceof SysCAMSPortTDF) { + } else if (tgc instanceof ELNClusterPortDE) { + return true; + } else if (tgc instanceof ELNClusterPortTDF) { return true; } return false; @@ -234,10 +235,13 @@ public class ELNCluster extends TGCScalableWithInternalComponent implements Swal if (tgc instanceof ELNModule) { tgc.resizeWithFather(); } - if (tgc instanceof SysCAMSPortDE) { + if (tgc instanceof ELNClusterTerminal) { + tgc.resizeWithFather(); + } + if (tgc instanceof ELNClusterPortDE) { tgc.resizeWithFather(); } - if (tgc instanceof SysCAMSPortTDF) { + if (tgc instanceof ELNClusterPortTDF) { tgc.resizeWithFather(); } addInternalComponent(tgc, 0); @@ -273,10 +277,13 @@ public class ELNCluster extends TGCScalableWithInternalComponent implements Swal if (tgcomponent[i] instanceof ELNModule) { tgcomponent[i].resizeWithFather(); } - if (tgcomponent[i] instanceof SysCAMSPortDE) { + if (tgcomponent[i] instanceof ELNClusterTerminal) { + tgcomponent[i].resizeWithFather(); + } + if (tgcomponent[i] instanceof ELNClusterPortDE) { tgcomponent[i].resizeWithFather(); } - if (tgcomponent[i] instanceof SysCAMSPortTDF) { + if (tgcomponent[i] instanceof ELNClusterPortTDF) { tgcomponent[i].resizeWithFather(); } } @@ -296,21 +303,31 @@ public class ELNCluster extends TGCScalableWithInternalComponent implements Swal return list; } - public java.util.List<SysCAMSPortDE> getAllPortDE() { - java.util.List<SysCAMSPortDE> list = new ArrayList<SysCAMSPortDE>(); + public java.util.List<ELNClusterTerminal> getAllClusterTerminal() { + java.util.List<ELNClusterTerminal> list = new ArrayList<ELNClusterTerminal>(); + for(int i=0; i<nbInternalTGComponent; i++) { + if (tgcomponent[i] instanceof ELNClusterTerminal) { + list.add((ELNClusterTerminal)(tgcomponent[i])); + } + } + return list; + } + + public java.util.List<ELNClusterPortDE> getAllClusterPortDE() { + java.util.List<ELNClusterPortDE> list = new ArrayList<ELNClusterPortDE>(); for(int i=0; i<nbInternalTGComponent; i++) { - if (tgcomponent[i] instanceof SysCAMSPortDE) { - list.add((SysCAMSPortDE)(tgcomponent[i])); + if (tgcomponent[i] instanceof ELNClusterPortDE) { + list.add((ELNClusterPortDE)(tgcomponent[i])); } } return list; } - public java.util.List<SysCAMSPortTDF> getAllPortTDF() { - java.util.List<SysCAMSPortTDF> list = new ArrayList<SysCAMSPortTDF>(); + public java.util.List<ELNClusterPortTDF> getAllClusterPortTDF() { + java.util.List<ELNClusterPortTDF> list = new ArrayList<ELNClusterPortTDF>(); for(int i=0; i<nbInternalTGComponent; i++) { - if (tgcomponent[i] instanceof SysCAMSPortTDF) { - list.add((SysCAMSPortTDF)(tgcomponent[i])); + if (tgcomponent[i] instanceof ELNClusterPortTDF) { + list.add((ELNClusterPortTDF)(tgcomponent[i])); } } return list; diff --git a/src/main/java/ui/eln/ELNModule.java b/src/main/java/ui/eln/ELNModule.java index bc592b2333..2c69fd80c9 100644 --- a/src/main/java/ui/eln/ELNModule.java +++ b/src/main/java/ui/eln/ELNModule.java @@ -42,7 +42,6 @@ import myutil.GraphicLib; import ui.*; import ui.eln.sca_eln.*; import ui.eln.sca_eln_sca_tdf.*; -import ui.syscams.*; import ui.util.IconManager; import ui.window.*; import java.awt.*; @@ -250,10 +249,10 @@ public class ELNModule extends TGCScalableWithInternalComponent implements Swall if (tgc instanceof ELNModuleTerminal) { return true; } - if (tgc instanceof SysCAMSPortDE) { + if (tgc instanceof ELNModulePortDE) { return true; } - if (tgc instanceof SysCAMSPortTDF) { + if (tgc instanceof ELNModulePortTDF) { return true; } return false; @@ -365,14 +364,14 @@ public class ELNModule extends TGCScalableWithInternalComponent implements Swall addInternalComponent(tgc, 0); return true; } - if (tgc instanceof SysCAMSPortDE) { + if (tgc instanceof ELNModulePortDE) { tgc.setFather(this); tgc.setDrawingZone(true); tgc.resizeWithFather(); addInternalComponent(tgc, 0); return true; } - if (tgc instanceof SysCAMSPortTDF) { + if (tgc instanceof ELNModulePortTDF) { tgc.setFather(this); tgc.setDrawingZone(true); tgc.resizeWithFather(); @@ -434,10 +433,10 @@ public class ELNModule extends TGCScalableWithInternalComponent implements Swall if (tgcomponent[i] instanceof ELNModuleTerminal) { tgcomponent[i].resizeWithFather(); } - if (tgcomponent[i] instanceof SysCAMSPortDE) { + if (tgcomponent[i] instanceof ELNModulePortDE) { tgcomponent[i].resizeWithFather(); } - if (tgcomponent[i] instanceof SysCAMSPortTDF) { + if (tgcomponent[i] instanceof ELNModulePortTDF) { tgcomponent[i].resizeWithFather(); } } @@ -620,21 +619,21 @@ public class ELNModule extends TGCScalableWithInternalComponent implements Swall return list; } - public java.util.List<SysCAMSPortDE> getAllPortDE() { - java.util.List<SysCAMSPortDE> list = new ArrayList<SysCAMSPortDE>(); + public java.util.List<ELNModulePortDE> getAllModulePortDE() { + java.util.List<ELNModulePortDE> list = new ArrayList<ELNModulePortDE>(); for(int i=0; i<nbInternalTGComponent; i++) { - if (tgcomponent[i] instanceof SysCAMSPortDE) { - list.add((SysCAMSPortDE)(tgcomponent[i])); + if (tgcomponent[i] instanceof ELNModulePortDE) { + list.add((ELNModulePortDE)(tgcomponent[i])); } } return list; } - public java.util.List<SysCAMSPortTDF> getAllPortTDF() { - java.util.List<SysCAMSPortTDF> list = new ArrayList<SysCAMSPortTDF>(); + public java.util.List<ELNModulePortTDF> getAllModulePortTDF() { + java.util.List<ELNModulePortTDF> list = new ArrayList<ELNModulePortTDF>(); for(int i=0; i<nbInternalTGComponent; i++) { - if (tgcomponent[i] instanceof SysCAMSPortTDF) { - list.add((SysCAMSPortTDF)(tgcomponent[i])); + if (tgcomponent[i] instanceof ELNModulePortTDF) { + list.add((ELNModulePortTDF)(tgcomponent[i])); } } return list; -- GitLab