Changeset 108 for trunk/src/org/expeditee/items/Dot.java
- Timestamp:
- 06/27/08 16:44:21 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/items/Dot.java
r97 r108 26 26 27 27 private static final int _MINIMUM_DOT_SIZE = 6; 28 29 // the polygon surrounding this point, used for 'gravity'30 private Polygon _poly = null;31 28 32 29 private int _pointType = Item.POINTTYPE_SQUARE; … … 92 89 public void paint(Graphics2D g) { 93 90 if (isHighlighted() /* && !Frame.FreeItems.contains(this) */) { 94 g.setColor(getHighlightColor()); 91 Color backgroundColor = g.getBackground(); 92 Color highlightColor = getHighlightColor(); 93 if (highlightColor.equals(backgroundColor)){ 94 highlightColor = ALTERNATE_HIGHLIGHT; 95 } 96 g.setColor(highlightColor); 97 g.setStroke(HIGHLIGHT_STROKE); 98 //g.setStroke() 95 99 // Draw the highlighting rectangle surrounding the dot 96 100 // this is drawn even if its part of a rectangle … … 150 154 */ 151 155 protected void updatePolygon() { 152 int thick = (int) Math.ceil(getThickness());156 int thick = Math.round(getThickness()); 153 157 // Sets a minimum size for the dot 154 158 thick = Math.max(thick, _MINIMUM_DOT_SIZE); … … 165 169 166 170 @Override 167 public Polygon getPolygon() {168 if (_poly == null)169 updatePolygon();170 171 Polygon external = new Polygon(_poly.xpoints, _poly.ypoints,172 _poly.npoints);173 174 return external;175 }176 177 @Override178 171 public Item copy() { 179 172 Dot copy = new Dot(getX(), getY(), getID()); … … 205 198 // if the item being merged with is another Dot 206 199 if (merger instanceof Dot) { 200 if(merger.hasEnclosures() || hasEnclosures()) 201 return merger; 202 207 203 Item dot = (Item) merger; 208 204 merger.setPosition(this.getPosition());
Note:
See TracChangeset
for help on using the changeset viewer.