Ignore:
Timestamp:
07/18/08 14:28:41 (16 years ago)
Author:
ra33
Message:

Added anchorRight and anchorBottom properties to items...
Fixed bugs with @i item display...
Can now inject properties into enclosed items at the same time

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/gui/FrameGraphics.java

    r139 r147  
    3434
    3535        // 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);
    3737
    3838        // modes
     
    126126                if (DisplayIO.getCurrentFrame() != null) {
    127127                        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                }
    133134        }
    134135
     
    358359
    359360                        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()) {
    360363                        if (clip == null) {
    361364                                freeItemsToPaint = FreeItems.getInstance();
     
    371374                                }
    372375                        }
    373 
    374                         if (isActualFrame /* && toPaint == DisplayIO.getCurrentFrame() */)
     376                        // }
     377
     378                        if (isActualFrame && toPaint == DisplayIO.getCurrentFrame())
    375379                                PaintPictures(bg, freeItemsToPaint, fillOnlyItems,
    376380                                                paintedFillsAndLines);
     
    392396                                                Line line = (Line) i;
    393397
    394                                                 if (toPaint != DisplayIO.getCurrentFrame()) {
     398                                                if (toPaint == DisplayIO.getCurrentFrame()) {
     399                                                        // If exactly one end of the line is floating...
     400                                                       
     401                                                       
     402                                                       
    395403                                                        if (line.getEndItem().isFloating()
    396404                                                                        ^ 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);
    405415                                                        }
    406416                                                } 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//                                                      }
    419428                                                }
    420429                                        }
     
    428437                        }
    429438
    430                         if (isActualFrame /* && toPaint == DisplayIO.getCurrentFrame() */)
     439                        if (isActualFrame && toPaint == DisplayIO.getCurrentFrame())
    431440                                PaintNonLinesNonPicture(bg, freeItemsToPaint);
    432441
    433442                        // Repaint popups / drags...
    434                         if (isActualFrame) 
     443                        if (isActualFrame)
    435444                                PopupManager.paintLayeredPane(bg, clip);
    436445
     
    438447                }
    439448
    440                
    441                
    442449                return toPaint.getBuffer();
    443450        }
     
    477484                                d.setX(d.getX() + DisplayIO.getMiddle());
    478485                }
    479 
     486                if (nl != null) {
     487                        nl.invalidateAll();
     488                        FrameGraphics.requestRefresh(true);
     489                }
    480490                return nl;
    481491        }
     
    600610                                int cmp = aArea.compareTo(bArea);
    601611                                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());
    604615                                }
    605616                                return cmp * -1;
     
    664675                        // For polygons need to make sure all other endpoints are
    665676                        // unHighlighted
    666                         if(i.hasPermission(Permission.full))
     677                        if (i.hasPermission(Permission.full))
    667678                                changeHighlightMode(i, Item.HighlightMode.Normal,
    668679                                                Item.HighlightMode.None);
     
    716727
    717728        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
    719731                if (_DisplayGraphics == null)
    720732                        return null;
     
    783795        public static void refresh(boolean useInvalidation) {
    784796
    785                 if (_DisplayGraphics == null || _MaxSize.width <= 0 || _MaxSize.height <= 0)
     797                if (_DisplayGraphics == null || _MaxSize.width <= 0
     798                                || _MaxSize.height <= 0)
    786799                        return;
    787800
     
    793806
    794807                                        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));
    797812                                        }
    798813                                        damagedAreas.clear();
    799                                        
     814
    800815                                } else if (MessageBay.isDirty()) {
    801816                                        // Paint dirty message bay
Note: See TracChangeset for help on using the changeset viewer.