Changeset 147 for trunk/src/org/expeditee/gui/FrameGraphics.java
- Timestamp:
- 07/18/08 14:28:41 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/FrameGraphics.java
r139 r147 34 34 35 35 // the maximum size that can be used to paint on 36 private static Dimension _MaxSize = new Dimension(1000, 1000);36 private static Dimension _MaxSize = new Dimension(1000, 1000); 37 37 38 38 // modes … … 126 126 if (DisplayIO.getCurrentFrame() != null) { 127 127 DisplayIO.getCurrentFrame().setBuffer(null); 128 DisplayIO.getCurrentFrame().setMaxSize(max); 129 } 130 131 if (newMaxHeight > 0) 132 MessageBay.updateSize(); 128 DisplayIO.getCurrentFrame().refreshSize(_MaxSize); 129 } 130 131 if (newMaxHeight > 0) { 132 MessageBay.updateSize(); 133 } 133 134 } 134 135 … … 358 359 359 360 List<Item> freeItemsToPaint = new LinkedList<Item>(); 361 // Dont paint the free items for the other frame in twin frames mode 362 // if (toPaint == DisplayIO.getCurrentFrame()) { 360 363 if (clip == null) { 361 364 freeItemsToPaint = FreeItems.getInstance(); … … 371 374 } 372 375 } 373 374 if (isActualFrame /* && toPaint == DisplayIO.getCurrentFrame() */) 376 // } 377 378 if (isActualFrame && toPaint == DisplayIO.getCurrentFrame()) 375 379 PaintPictures(bg, freeItemsToPaint, fillOnlyItems, 376 380 paintedFillsAndLines); … … 392 396 Line line = (Line) i; 393 397 394 if (toPaint != DisplayIO.getCurrentFrame()) { 398 if (toPaint == DisplayIO.getCurrentFrame()) { 399 // If exactly one end of the line is floating... 400 401 402 395 403 if (line.getEndItem().isFloating() 396 404 ^ line.getStartItem().isFloating()) { 397 lines.add(TransposeLine(line, 398 line.getEndItem(), toPaint, 399 FrameMouseActions.getY(), -DisplayIO 400 .getMiddle())); 401 lines.add(TransposeLine(line, line 402 .getStartItem(), toPaint, 403 FrameMouseActions.getY(), -DisplayIO 404 .getMiddle())); 405 // Line l = TransposeLine(line, line.getEndItem(), 406 // toPaint, 0, 0); 407 // if (l == null) 408 // l = TransposeLine(line, 409 // line.getStartItem(), toPaint, 0, 0); 410 // if (l == null) 411 // l = line; 412 // lines.add(l); 413 } else{ 414 //lines.add(line); 405 415 } 406 416 } else { 407 if (line.getEndItem().isFloating() 408 ^ line.getStartItem().isFloating()) { 409 Line l = TransposeLine(line, line.getEndItem(), 410 toPaint, 0, 0); 411 if (l == null) 412 l = TransposeLine(line, 413 line.getStartItem(), toPaint, 0, 0); 414 if (l == null) 415 l = line; 416 lines.add(l); 417 } else 418 lines.add(line); 417 // if (line.getEndItem().isFloating() 418 // ^ line.getStartItem().isFloating()) { 419 // lines.add(TransposeLine(line, 420 // line.getEndItem(), toPaint, 421 // FrameMouseActions.getY(), -DisplayIO 422 // .getMiddle())); 423 // lines.add(TransposeLine(line, line 424 // .getStartItem(), toPaint, 425 // FrameMouseActions.getY(), -DisplayIO 426 // .getMiddle())); 427 // } 419 428 } 420 429 } … … 428 437 } 429 438 430 if (isActualFrame /* && toPaint == DisplayIO.getCurrentFrame() */)439 if (isActualFrame && toPaint == DisplayIO.getCurrentFrame()) 431 440 PaintNonLinesNonPicture(bg, freeItemsToPaint); 432 441 433 442 // Repaint popups / drags... 434 if (isActualFrame) 443 if (isActualFrame) 435 444 PopupManager.paintLayeredPane(bg, clip); 436 445 … … 438 447 } 439 448 440 441 442 449 return toPaint.getBuffer(); 443 450 } … … 477 484 d.setX(d.getX() + DisplayIO.getMiddle()); 478 485 } 479 486 if (nl != null) { 487 nl.invalidateAll(); 488 FrameGraphics.requestRefresh(true); 489 } 480 490 return nl; 481 491 } … … 600 610 int cmp = aArea.compareTo(bArea); 601 611 if (cmp == 0) { 602 //System.out.println(a.getEnclosureID() + " " + b.getID()); 603 return new Integer(a.getEnclosureID()).compareTo(b.getEnclosureID()); 612 // System.out.println(a.getEnclosureID() + " " + b.getID()); 613 return new Integer(a.getEnclosureID()).compareTo(b 614 .getEnclosureID()); 604 615 } 605 616 return cmp * -1; … … 664 675 // For polygons need to make sure all other endpoints are 665 676 // unHighlighted 666 if (i.hasPermission(Permission.full))677 if (i.hasPermission(Permission.full)) 667 678 changeHighlightMode(i, Item.HighlightMode.Normal, 668 679 Item.HighlightMode.None); … … 716 727 717 728 public static Graphics createGraphics() { 718 //Error messages on start up will call this message before _DisplayGraphics has been initialised 729 // Error messages on start up will call this message before 730 // _DisplayGraphics has been initialised 719 731 if (_DisplayGraphics == null) 720 732 return null; … … 783 795 public static void refresh(boolean useInvalidation) { 784 796 785 if (_DisplayGraphics == null || _MaxSize.width <= 0 || _MaxSize.height <= 0) 797 if (_DisplayGraphics == null || _MaxSize.width <= 0 798 || _MaxSize.height <= 0) 786 799 return; 787 800 … … 793 806 794 807 for (Rectangle r : damagedAreas) { 795 if (clip == null) clip = new Area(r); 796 else clip.add(new Area(r)); 808 if (clip == null) 809 clip = new Area(r); 810 else 811 clip.add(new Area(r)); 797 812 } 798 813 damagedAreas.clear(); 799 814 800 815 } else if (MessageBay.isDirty()) { 801 816 // Paint dirty message bay
Note:
See TracChangeset
for help on using the changeset viewer.