Ignore:
Timestamp:
05/08/08 14:30:09 (16 years ago)
Author:
ra33
Message:
 
File:
1 edited

Legend:

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

    r18 r21  
    5959         * The title to display in the Title bar.
    6060         */
    61         public static final String TITLE = "Exp06May2008A";
     61        public static final String TITLE = "Exp08May2008B";
    6262
    6363        private DisplayIO() {
     
    8888                cursorType = Item.TEXT_CURSOR;
    8989
    90                 //Do some stuff to adjust the cursor size based on the font size
     90                // Do some stuff to adjust the cursor size based on the font size
    9191                final int MEDIUM_CURSOR_CUTOFF = 31;
    9292                final int LARGE_CURSOR_CUTOFF = 62;
     
    112112                }
    113113
    114                 /*System.out.println("hs: " + hotspotPos + " start: " + start + " font: "
    115                                 + size + " cursor: " + (cursorSize - start));*/
     114                /*
     115                 * System.out.println("hs: " + hotspotPos + " start: " + start + " font: " +
     116                 * size + " cursor: " + (cursorSize - start));
     117                 */
    116118
    117119                int[] pixels = new int[cursorSize * cursorSize];
     
    174176
    175177        public static void setCursorPosition(int x, int y, boolean forceArrow) {
    176                 if (Frame.itemAttachedToCursor()) {
    177                         List<Item> toMove = Frame.FreeItems;
    178 
    179                         int deltax = x - FrameMouseActions.MouseX;
    180                         int deltay = y - FrameMouseActions.MouseY;
    181 
    182                         for (Item move : toMove) {
    183                                 move.setPosition(move.getX() + deltax, move.getY() + deltay);
    184                         }
    185 
    186                         // FrameGraphics.Repaint();
    187 
    188                         // if (!item.getArea().contains(x, y))
    189                         // item.setPosition(x, y);
    190                 }
     178                int deltax = x - FrameMouseActions.MouseX;
     179                int deltay = y - FrameMouseActions.MouseY;
    191180
    192181                if (_TwinFrames) {
     
    195184                }
    196185
    197                 // cheat
    198                 FrameMouseActions.setForceArrow(forceArrow);
    199 
    200186                // ensures the cursor doesn't fall behind while waiting for robot
    201187                FrameMouseActions.MouseX = x;
    202188                FrameMouseActions.MouseY = y;
    203189
    204                 _Robot.mouseMove((int)_Browser.getContentPane().getLocationOnScreen().getX() + x, (int)_Browser.getContentPane().getLocationOnScreen().getY() + y);
     190                if (Frame.itemAttachedToCursor()) {
     191                        List<Item> toMove = Frame.FreeItems;
     192                        for (Item move : toMove) {
     193                                move.setPosition(move.getX() + deltax, move.getY() + deltay);
     194                        }
     195                }
     196
     197                // cheat
     198                FrameMouseActions.setForceArrow(forceArrow);
     199                _Robot.mouseMove((int) _Browser.getContentPane().getLocationOnScreen()
     200                                .getX()
     201                                + x, (int) _Browser.getContentPane().getLocationOnScreen()
     202                                .getY()
     203                                + y);
    205204        }
    206205
     
    330329                                FrameIO.ResumeCache();
    331330                        }
    332                        
     331
    333332                        // If the frames are the same then the items for the
    334333                        // frame that is just about to hide will still be in view
    335334                        // so only notify items that they are hidden if the
    336335                        // frames differ.
    337                         if (_CurrentFrames[getCurrentSide()] != null &&
    338                                 _CurrentFrames[0] != _CurrentFrames[1]) {
     336                        if (_CurrentFrames[getCurrentSide()] != null
     337                                        && _CurrentFrames[0] != _CurrentFrames[1]) {
    339338                                for (Item i : _CurrentFrames[getCurrentSide()].getItems()) {
    340                                         i.onParentFameHidden(); 
     339                                        i.onParentFameHidden();
    341340                                }
    342341                        }
    343342                        _CurrentFrames[getCurrentSide()] = frame;
    344                        
    345                         // BROOK 
     343
     344                        // BROOK
    346345                        for (Item i : _CurrentFrames[getCurrentSide()].getItems()) {
    347346                                i.onParentFameShown();
    348347                        }
    349348                } else {
    350                         // Notifying items on the frame being hidden that they 
     349                        // Notifying items on the frame being hidden that they
    351350                        // are about to be hidden.
    352351                        // ie. Widgets use this method to remove themselves from
    353                         //the JPanel
     352                        // the JPanel
    354353                        if (_CurrentFrames[getCurrentSide()] != null) {
    355354                                for (Item i : _CurrentFrames[getCurrentSide()].getItems()) {
    356                                         i.onParentFameHidden(); 
     355                                        i.onParentFameHidden();
    357356                                }
    358357                        }
    359                        
     358
    360359                        _CurrentFrames[getCurrentSide()] = frame;
    361360                        frame.setMaxSize(FrameGraphics.getMaxFrameSize());
    362                
     361
    363362                        // Notify items on the frame being displayed that they are in view
    364                         //ie. widgets use this method to add themselves to the content pane
     363                        // ie. widgets use this method to add themselves to the content pane
    365364                        for (Item i : _CurrentFrames[getCurrentSide()].getItems()) {
    366365                                i.onParentFameShown();
     
    369368
    370369                FrameGraphics.Repaint();
    371                 UpdateTitle();
    372370        }
    373371
     
    539537                        if (i.getLink() != null
    540538                                        && i.getAbsoluteLink().toLowerCase().equals(oldFrame)) {
    541                                 i.showHighlight(true, BACK_HIGHLIGHT_COLOR);
    542                                 //check if its an @f item and if so update the buffer
     539                                i.setSelectedMode(Item.SelectedMode.Normal,
     540                                                BACK_HIGHLIGHT_COLOR);
     541                                // check if its an @f item and if so update the buffer
    543542                                if (i instanceof Picture) {
    544                                         Picture p = (Picture)i;
     543                                        Picture p = (Picture) i;
    545544                                        p.refresh();
    546545                                }
Note: See TracChangeset for help on using the changeset viewer.