Changeset 143 for trunk/src/org/expeditee/items/Dot.java
- Timestamp:
- 07/15/08 12:55:33 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/items/Dot.java
r121 r143 27 27 private static final int _MINIMUM_DOT_SIZE = 6; 28 28 29 private static final int MINIMUM_DOT_SIZE = 2; 30 29 31 private int _pointType = Item.POINTTYPE_SQUARE; 30 32 31 33 private boolean _filled = true; 32 34 33 35 public Dot(int id) { 34 36 super(); … … 74 76 updatePolygon(); 75 77 } 76 78 77 79 @Override 78 80 public void setColor(Color c) { … … 90 92 g.setColor(highlightColor); 91 93 g.setStroke(HIGHLIGHT_STROKE); 92 // g.setStroke()94 // g.setStroke() 93 95 // Draw the highlighting rectangle surrounding the dot 94 96 // this is drawn even if its part of a rectangle … … 103 105 g.fillOval(rect.x, rect.y, rect.width, rect.height); 104 106 } 105 // System.out.println(_mode.toString());107 // System.out.println(_mode.toString()); 106 108 } 107 109 … … 113 115 114 116 int thick = (int) getThickness(); 115 if (thick < 2)116 thick = 2;117 if (thick < MINIMUM_DOT_SIZE) 118 thick = MINIMUM_DOT_SIZE; 117 119 118 120 int width = thick / 2; … … 192 194 // if the item being merged with is another Dot 193 195 if (merger instanceof Dot) { 194 if (merger.hasEnclosures() || hasEnclosures())196 if (merger.hasEnclosures() || hasEnclosures()) 195 197 return merger; 196 198 197 199 Item dot = (Item) merger; 198 200 merger.setPosition(this.getPosition()); … … 262 264 return "P " + getID(); 263 265 } 264 266 265 267 @Override 266 268 public void delete() { … … 270 272 l.delete(); 271 273 } 272 274 273 275 @Override 274 276 public void anchor() { 275 277 Frame current = getParentOrCurrentFrame(); 276 // This is to make lines anchored across frames be on one frame277 for (Line l: getLines()) {278 // This is to make lines anchored across frames be on one frame 279 for (Line l : getLines()) { 278 280 Frame parent = l.getOppositeEnd(this).getParent(); 279 281 if (parent != null && parent != current) { 280 282 this.setParent(parent); 281 if (DisplayIO.getCurrentSide() == 0)283 if (DisplayIO.getCurrentSide() == 0) 282 284 this.setX(this.getX() - DisplayIO.getMiddle()); 283 285 else … … 286 288 break; 287 289 } 288 290 289 291 super.anchor(); 290 291 // TODO is the code below needed... what for?292 293 // TODO is the code below needed... what for? 292 294 for (Line line : getLines()) { 293 295 if (line.getID() < 0 && !current.getItems().contains(line)) { … … 295 297 line.setHighlightColor(); 296 298 // Mike: Why was this line here? 297 // anchor(line);298 } 299 } 300 } 301 299 // anchor(line); 300 } 301 } 302 } 303 302 304 @Override 303 305 public void addLine(Line line) { … … 307 309 line.setLinePattern(getLinePattern()); 308 310 } 309 311 310 312 @Override 311 313 public void lineColorChanged(Color c) { … … 314 316 } 315 317 } 318 319 @Override 320 public boolean dontSave() { 321 if (getThickness() <= 1 && (getLines().size() == 0) 322 && getConstraints().size() == 0) { 323 return true; 324 } 325 return super.dontSave(); 326 } 316 327 }
Note:
See TracChangeset
for help on using the changeset viewer.