Changeset 278 for trunk/src/org/expeditee/items/Dot.java
- Timestamp:
- 08/25/08 15:19:25 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/items/Dot.java
r188 r278 11 11 import org.expeditee.gui.DisplayIO; 12 12 import org.expeditee.gui.Frame; 13 import org.expeditee.gui.FrameGraphics; 13 14 import org.expeditee.gui.FrameKeyboardActions; 14 15 … … 62 63 } 63 64 64 /**65 * Sets the 'thickness' of this Dot, that is, how many pixels this Dot66 * should be.67 *68 * @param thick69 * The number of pixels to use when displaying this Dot The Dot70 * is displayed as a thick x thick square.71 */72 @Override73 public void setThickness(float thick) {74 super.setThickness(thick);75 76 updatePolygon();77 }78 79 65 @Override 80 66 public void setColor(Color c) { … … 84 70 for (Line line : getLines()) 85 71 line.setColor(c); 72 } 73 74 @Override 75 public void setAnchorBottom(Float anchor) { 76 if(!isLineEnd()){ 77 super.setAnchorBottom(anchor); 78 return; 79 } 80 invalidateFill(); 81 invalidateCommonTrait(ItemAppearence.PreMoved); 82 int oldY = getY(); 83 if (anchor != null) { 84 float deltaY = FrameGraphics.getMaxFrameSize().height - anchor 85 - getBoundsHeight() - oldY; 86 //Check for a more efficient way to do this!! 87 //Invalidate all the items 88 for (Item i : this.getAllConnected()) { 89 i.invalidateAll(); 90 } 91 //Move the items 92 for (Item i : this.getAllConnected()) { 93 if (i.isLineEnd()){ 94 i.setAnchorBottom(null); 95 i.setXY(i.getX(), i.getY() + deltaY); 96 i.updatePolygon(); 97 i.invalidateAll(); 98 } 99 } 100 //Invalidate them again!! 101 for (Item i : this.getAllConnected()) { 102 i.invalidateAll(); 103 } 104 } 105 this._anchorBottom = anchor; 106 invalidateCommonTrait(ItemAppearence.PostMoved); 107 invalidateFill(); 108 } 109 110 @Override 111 public void setAnchorRight(Float anchor) { 112 if(!isLineEnd()){ 113 super.setAnchorRight(anchor); 114 return; 115 } 116 invalidateFill(); 117 invalidateCommonTrait(ItemAppearence.PreMoved); 118 int oldX = getX(); 119 if (anchor != null) { 120 float deltaX = FrameGraphics.getMaxFrameSize().width - anchor 121 - getBoundsWidth() - oldX; 122 //Check for a more efficient way to do this!! 123 //Invalidate all the items 124 for (Item i : this.getAllConnected()) { 125 i.invalidateAll(); 126 } 127 //Move the items 128 for (Item i : this.getAllConnected()) { 129 if (i.isLineEnd()){ 130 i.setAnchorRight(null); 131 i.setXY(i.getX() + deltaX, i.getY()); 132 i.updatePolygon(); 133 i.invalidateAll(); 134 } 135 } 136 //Invalidate them again!! 137 for (Item i : this.getAllConnected()) { 138 i.invalidateAll(); 139 } 140 } 141 this._anchorRight = anchor; 142 invalidateCommonTrait(ItemAppearence.PostMoved); 143 invalidateFill(); 86 144 } 87 145
Note:
See TracChangeset
for help on using the changeset viewer.