Changeset 21 for trunk/src/org/expeditee/gui/DisplayIO.java
- Timestamp:
- 05/08/08 14:30:09 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/DisplayIO.java
r18 r21 59 59 * The title to display in the Title bar. 60 60 */ 61 public static final String TITLE = "Exp0 6May2008A";61 public static final String TITLE = "Exp08May2008B"; 62 62 63 63 private DisplayIO() { … … 88 88 cursorType = Item.TEXT_CURSOR; 89 89 90 // Do some stuff to adjust the cursor size based on the font size90 // Do some stuff to adjust the cursor size based on the font size 91 91 final int MEDIUM_CURSOR_CUTOFF = 31; 92 92 final int LARGE_CURSOR_CUTOFF = 62; … … 112 112 } 113 113 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 */ 116 118 117 119 int[] pixels = new int[cursorSize * cursorSize]; … … 174 176 175 177 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; 191 180 192 181 if (_TwinFrames) { … … 195 184 } 196 185 197 // cheat198 FrameMouseActions.setForceArrow(forceArrow);199 200 186 // ensures the cursor doesn't fall behind while waiting for robot 201 187 FrameMouseActions.MouseX = x; 202 188 FrameMouseActions.MouseY = y; 203 189 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); 205 204 } 206 205 … … 330 329 FrameIO.ResumeCache(); 331 330 } 332 331 333 332 // If the frames are the same then the items for the 334 333 // frame that is just about to hide will still be in view 335 334 // so only notify items that they are hidden if the 336 335 // frames differ. 337 if (_CurrentFrames[getCurrentSide()] != null &&338 _CurrentFrames[0] != _CurrentFrames[1]) {336 if (_CurrentFrames[getCurrentSide()] != null 337 && _CurrentFrames[0] != _CurrentFrames[1]) { 339 338 for (Item i : _CurrentFrames[getCurrentSide()].getItems()) { 340 i.onParentFameHidden(); 339 i.onParentFameHidden(); 341 340 } 342 341 } 343 342 _CurrentFrames[getCurrentSide()] = frame; 344 345 // BROOK 343 344 // BROOK 346 345 for (Item i : _CurrentFrames[getCurrentSide()].getItems()) { 347 346 i.onParentFameShown(); 348 347 } 349 348 } else { 350 // Notifying items on the frame being hidden that they 349 // Notifying items on the frame being hidden that they 351 350 // are about to be hidden. 352 351 // ie. Widgets use this method to remove themselves from 353 // the JPanel352 // the JPanel 354 353 if (_CurrentFrames[getCurrentSide()] != null) { 355 354 for (Item i : _CurrentFrames[getCurrentSide()].getItems()) { 356 i.onParentFameHidden(); 355 i.onParentFameHidden(); 357 356 } 358 357 } 359 358 360 359 _CurrentFrames[getCurrentSide()] = frame; 361 360 frame.setMaxSize(FrameGraphics.getMaxFrameSize()); 362 361 363 362 // Notify items on the frame being displayed that they are in view 364 // ie. widgets use this method to add themselves to the content pane363 // ie. widgets use this method to add themselves to the content pane 365 364 for (Item i : _CurrentFrames[getCurrentSide()].getItems()) { 366 365 i.onParentFameShown(); … … 369 368 370 369 FrameGraphics.Repaint(); 371 UpdateTitle();372 370 } 373 371 … … 539 537 if (i.getLink() != null 540 538 && 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 543 542 if (i instanceof Picture) { 544 Picture p = (Picture) i;543 Picture p = (Picture) i; 545 544 p.refresh(); 546 545 }
Note:
See TracChangeset
for help on using the changeset viewer.