00001
00002
00003
00004
00005
00006
00007 package DisplayGUI;
00008 import java.awt.Polygon;
00009
00014 public class ModuleCell {
00015
00016
00017 private int MUR,modulePosition,sctComponent,row;
00018 private String serialNo;
00019 private int moduleGroup;
00020 private Double data;
00021 private java.awt.Color color;
00022 private SNInfo snInfo;
00023
00024 private Polygon[] polygons = new Polygon[ConfigurationInterface.VIEW_CATEGORIES];
00025
00026
00028 public ModuleCell(String serialNo, int sctComponent, int row, int modulePosition,int MUR, int moduleGroup) {
00029 this.serialNo=serialNo;
00030 this.modulePosition=modulePosition;
00031 this.MUR=MUR;
00032 this.sctComponent=sctComponent;
00033 this.row=row;
00034 this.moduleGroup=moduleGroup;
00035 data=null;
00036 color = java.awt.Color.white;
00037
00038 }
00039
00040 public void addPolygon(int index, int[] xPoints, int[] yPoints, int nPoints) {
00041 if(index<0 || index>ConfigurationInterface.VIEW_CATEGORIES-1) {
00042 System.err.println("SctGUI::ModuleCell invalid polygon index");
00043 return;
00044 }
00045 polygons[index] = new Polygon(xPoints,yPoints,nPoints);
00046 }
00047
00048 public Polygon getPolygon(int index) {
00049 return polygons[index];
00050 }
00051
00052 public SNInfo getSNInfo() {
00053 return snInfo;
00054 }
00055 public void addSNInfo(SNInfo snInfo) {
00056 this.snInfo=snInfo;
00057 }
00058
00059
00060
00061
00062
00063 public void setData(Double value, java.awt.Color color) {
00064 this.data=value;
00065 this.color=color;
00066 }
00067 public Double getData() {
00068 return data;
00069 }
00070 public java.awt.Color getColor() {
00071 return color;
00072 }
00073
00074 public String getSerialNo() {
00075 return serialNo;
00076 }
00077 public int getMUR() {
00078 return MUR;
00079 }
00080 public int getModulePosition() {
00081 return modulePosition;
00082 }
00083 public String getEndCapPosition() {
00084
00085
00086 if(modulePosition<13) return "O"+Integer.toString(modulePosition+1);
00087 else if(modulePosition>=13 && modulePosition<23) return "M"+Integer.toString(modulePosition-12);
00088 else return "I"+Integer.toString(modulePosition-22);
00089 }
00090 public void setModuleGroup(int group) {
00091 moduleGroup=group;
00092 }
00093 public int getModuleGroup() {
00094 return moduleGroup;
00095 }
00096 public boolean isSelected() {
00097 return (moduleGroup>=0);
00098 }
00099 public int getSctComponent() {
00100 return sctComponent;
00101 }
00102 public int getRow() {
00103
00104 return row;
00105 }
00106 public String getQuadrant() {
00107 switch(row) {
00108 case 0:
00109 return "TR";
00110 case 1:
00111 return "BR";
00112 case 2:
00113 return "BL";
00114 case 3:
00115 default:
00116 return "TL";
00117 }
00118 }
00119 public int getPosition() {
00120 return modulePosition;
00121 }
00122 }