Changeset 188 for trunk/src/org/expeditee/items/WidgetEdge.java
- Timestamp:
- 08/05/08 12:42:33 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/items/WidgetEdge.java
r186 r188 6 6 /** 7 7 * Widget edges define the boundries of an interactive widget. 8 * 8 9 * @author Brook Novak 9 10 */ 10 11 public class WidgetEdge extends Line { 11 12 12 13 private InteractiveWidget _widgetSource; 13 14 WidgetEdge(WidgetCorner start, WidgetCorner end, int id, InteractiveWidget widgetSource) { 14 15 WidgetEdge(WidgetCorner start, WidgetCorner end, int id, 16 InteractiveWidget widgetSource) { 15 17 super(start, end, id); 16 super.setThickness(2.0f); 17 super.setColor(Color.black); 18 19 if (widgetSource == null) throw new NullPointerException("widgetSource"); 18 if (widgetSource == null) 19 throw new NullPointerException("widgetSource"); 20 20 _widgetSource = widgetSource; 21 21 } … … 24 24 return _widgetSource; 25 25 } 26 26 27 27 @Override 28 28 public Item forceMerge(Item merger, int mouseX, int mouseY) { … … 30 30 } 31 31 32 //@Override33 //public void setThickness(float thick) {34 //// Ignore35 //}36 32 // @Override 33 // public void setThickness(float thick) { 34 // // Ignore 35 // } 36 37 37 @Override 38 public void toggleArrow() { 38 public void toggleArrow() { 39 39 // Ignore 40 40 } 41 41 42 42 @Override 43 43 public void toggleDashed(int amount) { 44 44 // Ignore 45 45 } 46 46 47 47 @Override 48 48 public void toggleArrowHeadRatio(int amount) { 49 49 // Ignore 50 50 } 51 51 52 52 @Override 53 53 public void toggleArrowHeadLength(int amount) { … … 55 55 } 56 56 57 //@OVERRIDE58 //PUBLIC VOID SETCOLOR(COLOR C) {59 //// IGNORE60 //}61 57 // @OVERRIDE 58 // PUBLIC VOID SETCOLOR(COLOR C) { 59 // // IGNORE 60 // } 61 62 62 @Override 63 63 public void setAnnotation(boolean val) { … … 105 105 public void setSize(float size) { 106 106 } 107 107 108 108 @Override 109 109 public boolean contains(int x, int y) { 110 return super.contains(x, y) && ! getEnclosedShape().contains(x,y);110 return super.contains(x, y) && !getEnclosedShape().contains(x, y); 111 111 } 112 112 113 113 @Override 114 114 public Polygon getEnclosedShape() { 115 115 return getStartItem().getEnclosedShape(); 116 116 } 117 117 118 118 @Override 119 119 public String getLink() { 120 120 return _widgetSource.getSource().getLink(); 121 121 } 122 122 123 123 @Override 124 124 public void setLink(String link) { 125 125 _widgetSource.getSource().setLink(link); 126 } 127 126 } 127 128 128 @Override 129 129 protected boolean dontPaint() { 130 // TODO Auto-generated method stub 131 return getThickness() == 0; 130 return getThickness() <= 0; 131 } 132 133 @Override 134 public void setThickness(float newThickness, boolean setConnected) { 135 if (_widgetSource != null) { 136 float minThickness = _widgetSource.getMinimumBorderThickness(); 137 if(newThickness < minThickness) 138 newThickness = minThickness; 139 super.setThickness(newThickness, setConnected); 140 _widgetSource.getSource().setThickness(newThickness, false); 141 } 142 } 143 144 @Override 145 public void setColor(Color color) { 146 if (_widgetSource != null) { 147 super.setColor(color); 148 _widgetSource.getSource().setColor(color); 149 } 132 150 } 133 151 }
Note:
See TracChangeset
for help on using the changeset viewer.