Math2mat
|
00001 00015 package m2m.frontend.dynamicview.model; 00016 00017 import org.eclipse.draw2d.geometry.Rectangle; 00018 00019 public class GraphicOperation extends Node 00020 { 00024 private PointConnection outputPointConnection; 00028 private String operatorName; 00032 private boolean selectAll; 00033 00034 00038 public GraphicOperation () 00039 { 00040 super(); 00041 outputPointConnection = null; 00042 operatorName = "Unknown"; 00043 selectAll = false; 00044 } 00045 00046 00051 public PointConnection getOutputPointConnection() 00052 { 00053 return outputPointConnection; 00054 } 00055 00056 00061 public void setOutputPointConnexion(PointConnection pc) 00062 { 00063 outputPointConnection = pc; 00064 pc.setOutputResult(this); 00065 } 00066 00067 00072 public void setOperatorName(String operatorName) 00073 { 00074 this.operatorName = operatorName; 00075 } 00076 00077 00082 public String getOperatorName() 00083 { 00084 return operatorName; 00085 } 00086 00087 00092 public void setSelectAll(boolean val) 00093 { 00094 this.selectAll = val; 00095 } 00096 00097 00102 public boolean getSelectAll() 00103 { 00104 return selectAll; 00105 } 00106 00107 00112 public boolean CanSetLayout(Rectangle layoutTest) 00113 { 00114 /* Check if the new layout is inside its parent */ 00115 if(!isInParent(layoutTest)) 00116 return false; 00117 00118 /* Check if the new layout is under connection points */ 00119 for(Node node : getParent().getChildrenArray()) 00120 { 00121 if(node != this && node != outputPointConnection) 00122 if(nodeUnderNode(layoutTest, node.getLayout())) 00123 return false; 00124 } 00125 return true; 00126 } 00127 }