Changeset 1172 for trunk/src/org/expeditee/gui/FrameGraphics.java
- Timestamp:
- 09/28/18 10:16:45 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/FrameGraphics.java
r1102 r1172 33 33 import org.expeditee.core.bounds.PolygonBounds; 34 34 import org.expeditee.gio.EcosystemManager; 35 import org.expeditee.gio.input.KBMInputEvent.Key; 35 36 import org.expeditee.gio.input.StandardInputEventListeners; 36 import org.expeditee.gio.input.KBMInputEvent.Key;37 37 import org.expeditee.items.Circle; 38 38 import org.expeditee.items.Dot; 39 39 import org.expeditee.items.Item; 40 import org.expeditee.items.Item.HighlightMode; 40 41 import org.expeditee.items.Line; 41 42 import org.expeditee.items.UserAppliedPermission; 42 43 import org.expeditee.items.XRayable; 43 import org.expeditee.items.Item.HighlightMode;44 44 import org.expeditee.items.widgets.Widget; 45 45 import org.expeditee.items.widgets.WidgetEdge; … … 73 73 public static Image getFrameImage(Frame toPaint, Clip clip, Dimension size, boolean isActualFrame, boolean createVolatile) 74 74 { 75 if (toPaint == null) return null; 75 if (toPaint == null) { 76 return null; 77 } 76 78 77 79 // the buffer is not valid, so it must be recreated … … 120 122 // Nicer looking lines, but may be too jerky while 121 123 // rubber-banding on older machines 122 if (UserSettings.AntiAlias.get()) EcosystemManager.getGraphicsManager().setAntialiasing(true); 124 if (UserSettings.AntiAlias.get()) { 125 EcosystemManager.getGraphicsManager().setAntialiasing(true); 126 } 123 127 124 128 // If we are doing @f etc... then have a clear background if its the default background color … … 130 134 } else { 131 135 backgroundColor = toPaint.getBackgroundColor(); 132 if (backgroundColor == null) backgroundColor = Item.TRANSPARENT; 136 if (backgroundColor == null) { 137 backgroundColor = Item.TRANSPARENT; 138 } 133 139 } 134 140 … … 204 210 // the box that is supposed to be underneath 205 211 Widget iw = widgetItor.previous(); 206 if (clip == null || clip.isNotClipped() || clip.getBounds().intersects(iw.get Bounds())) {212 if (clip == null || clip.isNotClipped() || clip.getBounds().intersects(iw.getClip().getBounds())) { 207 213 iw.paint(); 208 214 PaintItem(iw.getItems().get(4)); … … 285 291 } 286 292 287 if (isActualFrame) PaintLines(lines); 293 if (isActualFrame) { 294 PaintLines(lines); 295 } 288 296 } else { 289 if (isActualFrame) PaintLines(freeItemsToPaint); 297 if (isActualFrame) { 298 PaintLines(freeItemsToPaint); 299 } 290 300 } 291 301 … … 310 320 if(!FreeItems.hasItemsAttachedToCursor()) { 311 321 Item current = FrameUtils.getCurrentItem(); 312 if(current != null) current.paintTooltip(); 313 if (_lastToolTippedItem != null) _lastToolTippedItem.clearTooltips(); 322 if(current != null) { 323 current.paintTooltip(); 324 } 325 if (_lastToolTippedItem != null) { 326 _lastToolTippedItem.clearTooltips(); 327 } 314 328 _lastToolTippedItem = current; 315 329 } … … 347 361 // When painting a line all connected lines are painted too 348 362 done.addAll(l.getAllConnected()); 349 if (l.getStartItem().getEnclosedArea() == 0) PaintItem(i); 363 if (l.getStartItem().getEnclosedArea() == 0) { 364 PaintItem(i); 365 } 350 366 } 351 367 } … … 368 384 // Also ignore invisible items.. 369 385 // TODO possibly ignore invisible items before coming to this method? 370 if (done.contains(i)) continue; 386 if (done.contains(i)) { 387 continue; 388 } 371 389 372 390 if (i instanceof XRayable) { … … 375 393 } else if (i.hasEnclosures()) { 376 394 for (Item enclosure : i.getEnclosures()) { 377 if (!toFill.contains(enclosure)) toFill.add(enclosure); 395 if (!toFill.contains(enclosure)) { 396 toFill.add(enclosure); 397 } 378 398 } 379 399 done.addAll(i.getConnected()); … … 397 417 // Sort the items to fill 398 418 Collections.sort(toFill, new Comparator<Item>() { 419 @Override 399 420 public int compare(Item a, Item b) { 400 421 Double aArea = a.getEnclosedArea(); … … 405 426 PolygonBounds pA = a.getEnclosedShape(); 406 427 PolygonBounds pB = b.getEnclosedShape(); 407 if (pA == null || pB == null) return 0; 428 if (pA == null || pB == null) { 429 return 0; 430 } 408 431 return new Integer(pA.getMinX()).compareTo(pB.getMinX()); 409 432 } … … 419 442 i.paintFill(); 420 443 List<Line> lines = i.getLines(); 421 if (lines.size() > 0) PaintItem(lines.get(0)); 444 if (lines.size() > 0) { 445 PaintItem(lines.get(0)); 446 } 422 447 } 423 448 } … … 427 452 static void PaintItem(Item i) 428 453 { 429 if (i == null) return; 454 if (i == null) { 455 return; 456 } 430 457 431 458 // do not paint annotation items in audience mode … … 456 483 if (toDisconnect != null && !(i instanceof WidgetEdge)) { 457 484 Item.HighlightMode newMode = toDisconnect.getHighlightMode(); 458 if (FreeItems.hasItemsAttachedToCursor()) 485 if (FreeItems.hasItemsAttachedToCursor()) { 459 486 newMode = Item.HighlightMode.Normal; 487 } 460 488 // unhighlight all the other dots 461 489 for (Item conn : toDisconnect.getAllConnected()) { … … 551 579 public static void changeHighlightMode(Item item, Item.HighlightMode newMode, Item.HighlightMode connectedNewMode) 552 580 { 553 if (item == null) return; 581 if (item == null) { 582 return; 583 } 554 584 555 585 if (item.hasVector()) { … … 600 630 */ 601 631 public static void addFrameRenderPass(FrameRenderPass pass) { 602 if (pass == null) 632 if (pass == null) { 603 633 throw new NullPointerException("pass"); 604 605 if (!_frameRenderPasses.contains(pass)) 634 } 635 636 if (!_frameRenderPasses.contains(pass)) { 606 637 _frameRenderPasses.add(pass); 638 } 607 639 } 608 640
Note:
See TracChangeset
for help on using the changeset viewer.