- Timestamp:
- 09/18/18 12:02:44 (6 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gio/gesture/ExpediteeKBMGestureTranslator.java
r1135 r1144 406 406 // Calculate the new cursor position 407 407 Point cursorPosition = EcosystemManager.getInputManager().getCursorPosition(); 408 if (kbmEvent.getKeyDown() == Key.UP_ARROW) cursorPosition. y -= distance;409 if (kbmEvent.getKeyDown() == Key.DOWN_ARROW) cursorPosition. y += distance;410 if (kbmEvent.getKeyDown() == Key.LEFT_ARROW) cursorPosition. x -= distance;411 if (kbmEvent.getKeyDown() == Key.RIGHT_ARROW) cursorPosition. x += distance;408 if (kbmEvent.getKeyDown() == Key.UP_ARROW) cursorPosition.setY(cursorPosition.getY() - distance); 409 if (kbmEvent.getKeyDown() == Key.DOWN_ARROW) cursorPosition.setY(cursorPosition.getY() + distance); 410 if (kbmEvent.getKeyDown() == Key.LEFT_ARROW) cursorPosition.setX(cursorPosition.getX() - distance); 411 if (kbmEvent.getKeyDown() == Key.RIGHT_ARROW) cursorPosition.setX(cursorPosition.getX() + distance); 412 412 413 413 // Create the MOVE_CURSOR gesture and return it -
trunk/src/org/expeditee/gio/gesture/StandardGestureActions.java
r1136 r1144 607 607 public void exec(Gesture gesture) { 608 608 PanGestureData data = (PanGestureData) gesture.getData(); 609 Misc.pan(DisplayController.getCurrentFrame(), data.getPanDelta(). x, data.getPanDelta().y);609 Misc.pan(DisplayController.getCurrentFrame(), data.getPanDelta().getX(), data.getPanDelta().getY()); 610 610 } 611 611 }); … … 658 658 int width = cropped.getWidth(); 659 659 int height = cropped.getHeight(); 660 if(cropped.getSource().getX() + width < data.getPosition(). x) {661 cropped.getSource().setX(data.getPosition(). x- width);660 if(cropped.getSource().getX() + width < data.getPosition().getX()) { 661 cropped.getSource().setX(data.getPosition().getX() - width); 662 662 } 663 if(cropped.getSource().getY() + height < data.getPosition(). y) {664 cropped.getSource().setY(data.getPosition(). y- height);663 if(cropped.getSource().getY() + height < data.getPosition().getY()) { 664 cropped.getSource().setY(data.getPosition().getY() - height); 665 665 } 666 666 pickup(cropped); … … 1055 1055 // class returns 0 for getX 1056 1056 if (!(i instanceof Line) && !(i instanceof XRayable)) { 1057 _offX = DisplayController.getMouseX() - i.getX() + i.getOffset(). x;1058 _offY = DisplayController.getMouseY() - i.getY() + i.getOffset(). y;1057 _offX = DisplayController.getMouseX() - i.getX() + i.getOffset().getX(); 1058 _offY = DisplayController.getMouseY() - i.getY() + i.getOffset().getY(); 1059 1059 1060 1060 // make the offset item the first item in the list (so … … 1071 1071 } else if (toGrab.size() == 1) { 1072 1072 Item soleItem = toGrab.iterator().next(); 1073 _offX = DisplayController.getMouseX() - soleItem.getX() + soleItem.getOffset(). x;1074 _offY = DisplayController.getMouseY() - soleItem.getY() + soleItem.getOffset(). y;1073 _offX = DisplayController.getMouseX() - soleItem.getX() + soleItem.getOffset().getX(); 1074 _offY = DisplayController.getMouseY() - soleItem.getY() + soleItem.getOffset().getY(); 1075 1075 // Now call move so that if we are on a message in the message box 1076 1076 // It doesn't appear up the top of the screen!! … … 1230 1230 1231 1231 // check if the user hit enter and the cursor is now on another text item 1232 if (oldY < newMouse. y) {1232 if (oldY < newMouse.getY()) { 1233 1233 AxisAlignedBoxBounds rect = text.getBoundingBox(); 1234 1234 … … 1245 1245 } 1246 1246 1247 DisplayController.setCursorPosition(newMouse. x, newMouse.y, false);1247 DisplayController.setCursorPosition(newMouse.getX(), newMouse.getY(), false); 1248 1248 return text; 1249 1249 } … … 1263 1263 Item firstDot = toMove.iterator().next(); 1264 1264 1265 int deltax = (to. x- (cursor ? 0 : _offX)) - firstDot.getX();1266 int deltay = (to. y- (cursor ? 0 : _offY)) - firstDot.getY();1265 int deltax = (to.getX() - (cursor ? 0 : _offX)) - firstDot.getX(); 1266 int deltay = (to.getY() - (cursor ? 0 : _offY)) - firstDot.getY(); 1267 1267 1268 1268 // Cache the position of all items before moving any as constraints … … 1275 1275 for (Item move : toMove) { 1276 1276 Point pos = preMovePositions.get(move); 1277 move.setPosition(pos. x + deltax, pos.y+ deltay);1277 move.setPosition(pos.getX() + deltax, pos.getY() + deltay); 1278 1278 1279 1279 if (!cursor && move instanceof Text) { … … 1365 1365 public static void resetOffset() { 1366 1366 if (FreeItems.hasItemsAttachedToCursor()) { 1367 _offX = DisplayController.getMouseX() - FreeItems.getInstance().get(0).getX() + FreeItems.getInstance().get(0).getOffset(). x;1368 _offY = DisplayController.getMouseY() - FreeItems.getInstance().get(0).getY() + FreeItems.getInstance().get(0).getOffset(). y;1367 _offX = DisplayController.getMouseX() - FreeItems.getInstance().get(0).getX() + FreeItems.getInstance().get(0).getOffset().getX(); 1368 _offY = DisplayController.getMouseY() - FreeItems.getInstance().get(0).getY() + FreeItems.getInstance().get(0).getOffset().getY(); 1369 1369 } 1370 1370 } … … 2016 2016 if (zoom_active) { 2017 2017 2018 zoomFrame(DisplayController.getCurrentFrame(), scaleFactor, centreOfZoom. x, centreOfZoom.y);2018 zoomFrame(DisplayController.getCurrentFrame(), scaleFactor, centreOfZoom.getX(), centreOfZoom.getY()); 2019 2019 DisplayController.getCurrentFrame().refreshSize(); 2020 2020 Refresh(); … … 2233 2233 Point oldMousePosition = DisplayController.getMousePosition(); 2234 2234 2235 if (oldMousePosition. x == x && oldMousePosition.y== y) return;2235 if (oldMousePosition.getX() == x && oldMousePosition.getY() == y) return; 2236 2236 2237 2237 DisplayController.setCursorPosition(x, y); … … 2986 2986 2987 2987 // update the offset since the text has changed 2988 _offX = DisplayController.getMouseX() - anchored.getX() + anchored.getOffset(). x;2989 _offY = DisplayController.getMouseY() - anchored.getY() + anchored.getOffset(). y;2988 _offX = DisplayController.getMouseX() - anchored.getX() + anchored.getOffset().getX(); 2989 _offY = DisplayController.getMouseY() - anchored.getY() + anchored.getOffset().getY(); 2990 2990 } else { 2991 2991 // if shift is pressed delete the entire shape attached to the dot … … 4230 4230 if (clicked == null) { 4231 4231 // Check if the user is nearby another item... 4232 int mouseX = position. x;4233 int mouseY = position. y;4232 int mouseX = position.getX(); 4233 int mouseY = position.getY(); 4234 4234 // System.out.println(mouseX + "," + mouseY); 4235 4235 for (Item i : DisplayController.getCurrentFrame().getItems()) { … … 4303 4303 4304 4304 if (clicked instanceof Picture) { 4305 int mouseX = position. x;4306 int mouseY = position. y;4305 int mouseX = position.getX(); 4306 int mouseY = position.getY(); 4307 4307 Picture clickedOnPicture = (Picture)clicked; 4308 4308 Frame current_frame = DisplayController.getCurrentFrame(); -
trunk/src/org/expeditee/gio/javafx/JavaFXConversions.java
r1097 r1144 43 43 CycleMethod cyclic = fill.isAcyclic() ? CycleMethod.NO_CYCLE : CycleMethod.REFLECT; 44 44 return new javafx.scene.paint.LinearGradient( 45 fill.getFromPoint(). x,46 fill.getFromPoint(). y,47 fill.getToPoint(). x,48 fill.getToPoint(). y,45 fill.getFromPoint().getX(), 46 fill.getFromPoint().getY(), 47 fill.getToPoint().getX(), 48 fill.getToPoint().getY(), 49 49 false, 50 50 cyclic, -
trunk/src/org/expeditee/gio/javafx/JavaFXGraphicsManager.java
r1097 r1144 171 171 Point newStagePos = p.clone().add(delta); 172 172 173 ExpediteeApplication.theStage.setX(newStagePos. x);174 ExpediteeApplication.theStage.setY(newStagePos. y);173 ExpediteeApplication.theStage.setX(newStagePos.getX()); 174 ExpediteeApplication.theStage.setY(newStagePos.getY()); 175 175 } 176 176 … … 354 354 if (cropTopLeft != null && cropSize != null) { 355 355 croppedImage = manager.createImage(cropSize.width, cropSize.height); 356 manager.getInternalImage(croppedImage).getPixelWriter().setPixels(0, 0, cropSize.width, cropSize.height, manager.getInternalImage(image).getPixelReader(), cropTopLeft. x, cropTopLeft.y);356 manager.getInternalImage(croppedImage).getPixelWriter().setPixels(0, 0, cropSize.width, cropSize.height, manager.getInternalImage(image).getPixelReader(), cropTopLeft.getX(), cropTopLeft.getY()); 357 357 } 358 358 … … 362 362 if (size != null) g.scale(((double) size.width) / croppedImage.getWidth(), ((double) size.height) / croppedImage.getHeight()); 363 363 if (angle != 0.0) g.rotate(angle); 364 if (topLeft != null) g.translate(topLeft. x, topLeft.y);364 if (topLeft != null) g.translate(topLeft.getX(), topLeft.getY()); 365 365 g.drawImage(JavaFXMiscManager.getIfUsingJavaFXImageManager().getInternalImage(croppedImage), 0, 0); 366 366 g.restore(); … … 383 383 g.save(); 384 384 385 Point centre = new Point(topLeft. x + size.width / 2, topLeft.y+ size.height / 2);386 g.translate(-centre. x, -centre.y);385 Point centre = new Point(topLeft.getX() + size.width / 2, topLeft.getY() + size.height / 2); 386 g.translate(-centre.getX(), -centre.getY()); 387 387 if (angle != 0.0) g.rotate(angle); 388 g.translate(centre. x, centre.y);388 g.translate(centre.getX(), centre.getY()); 389 389 390 390 if (fill != null) { … … 396 396 397 397 if (cornerRadius == null) { 398 g.fillRect(topLeft. x, topLeft.y, size.width, size.height);398 g.fillRect(topLeft.getX(), topLeft.getY(), size.width, size.height); 399 399 } else { 400 g.fillRoundRect(topLeft. x, topLeft.y, size.width, size.height, cornerRadius.width, cornerRadius.height);400 g.fillRoundRect(topLeft.getX(), topLeft.getY(), size.width, size.height, cornerRadius.width, cornerRadius.height); 401 401 } 402 402 } … … 407 407 408 408 if (cornerRadius == null) { 409 g.strokeRect(topLeft. x, topLeft.y, size.width, size.height);409 g.strokeRect(topLeft.getX(), topLeft.getY(), size.width, size.height); 410 410 } else { 411 g.strokeRoundRect(topLeft. x, topLeft.y, size.width, size.height, cornerRadius.width, cornerRadius.height);411 g.strokeRoundRect(topLeft.getX(), topLeft.getY(), size.width, size.height, cornerRadius.width, cornerRadius.height); 412 412 } 413 413 } … … 433 433 434 434 if (angle != 0.0) { 435 g.translate(-centre. x, -centre.y);435 g.translate(-centre.getX(), -centre.getY()); 436 436 g.rotate(angle); 437 g.translate(centre. x, centre.y);437 g.translate(centre.getX(), centre.getY()); 438 438 } 439 439 … … 445 445 } 446 446 447 g.fillOval(centre. x - diameters.width / 2, centre.y- diameters.height / 2, diameters.width, diameters.height);447 g.fillOval(centre.getX() - diameters.width / 2, centre.getY() - diameters.height / 2, diameters.width, diameters.height); 448 448 } 449 449 … … 452 452 setStroke(g, borderStroke); 453 453 454 g.strokeOval(centre. x - diameters.width / 2, centre.y- diameters.height / 2, diameters.width, diameters.height);454 g.strokeOval(centre.getX() - diameters.width / 2, centre.getY() - diameters.height / 2, diameters.width, diameters.height); 455 455 } 456 456 … … 469 469 470 470 Point centre = points.getCentre(); 471 g.translate(-centre. x, -centre.y);471 g.translate(-centre.getX(), -centre.getY()); 472 472 if (angle != 0.0) g.rotate(angle); 473 473 if (scale != null) { … … 476 476 g.scale(xScale, yScale); 477 477 } 478 g.translate(centre. x, centre.y);479 if (offset != null) g.translate(offset. x, offset.y);478 g.translate(centre.getX(), centre.getY()); 479 if (offset != null) g.translate(offset.getX(), offset.getY()); 480 480 481 481 Point[] pointArray = points.toArray(); … … 485 485 486 486 for (int i = 0; i < nPoints; i++) { 487 xArray[i] = pointArray[i]. x+ 0.5;488 yArray[i] = pointArray[i]. y+ 0.5;487 xArray[i] = pointArray[i].getX() + 0.5; 488 yArray[i] = pointArray[i].getY() + 0.5; 489 489 } 490 490 … … 561 561 g.setFill(JavaFXConversions.toJavaFXColor(colour)); 562 562 563 g.fillText(text.getText(), position. x, position.y);563 g.fillText(text.getText(), position.getX(), position.getY()); 564 564 565 565 g.restore(); -
trunk/src/org/expeditee/gio/javafx/JavaFXInputManager.java
r1097 r1144 241 241 { 242 242 Point screenPosition = windowToScreenPosition(position); 243 _robot.mouseMove(screenPosition. x, screenPosition.y);243 _robot.mouseMove(screenPosition.getX(), screenPosition.getY()); 244 244 } 245 245 -
trunk/src/org/expeditee/gio/javafx/JavaFXTextLayoutManager.java
r1097 r1144 250 250 251 251 endIndex = startIndex + text.getText().length(); 252 text.setX(start. x);253 text.setY(start. y);252 text.setX(start.getX()); 253 text.setY(start.getY()); 254 254 255 255 if (fullJustify && endIndex < string.length()) { … … 265 265 lineDrop += lineSpacing; 266 266 } 267 start. y += lineDrop;267 start.setY(start.getY() + lineDrop); 268 268 positions.add(new Point(start)); 269 269 } -
trunk/src/org/expeditee/gio/swing/SwingConversions.java
r1097 r1144 40 40 if (point == null) return null; 41 41 42 return new java.awt.Point(point. x, point.y);42 return new java.awt.Point(point.getX(), point.getY()); 43 43 } 44 44 … … 170 170 java.awt.Color color2 = toSwingColor(fill.getToColour()); 171 171 172 return new java.awt.GradientPaint(fill.getFromPoint(). x, fill.getFromPoint().y, color1, fill.getToPoint().x, fill.getToPoint().y, color2, !fill.isAcyclic());172 return new java.awt.GradientPaint(fill.getFromPoint().getX(), fill.getFromPoint().getY(), color1, fill.getToPoint().getX(), fill.getToPoint().getY(), color2, !fill.isAcyclic()); 173 173 } 174 174 … … 274 274 for (int i = 0; i < polygonBounds.getPointCount(); i++) { 275 275 org.expeditee.core.Point p = polygonBounds.getPoint(i); 276 polygon.addPoint(p. x, p.y);276 polygon.addPoint(p.getX(), p.getY()); 277 277 } 278 278 -
trunk/src/org/expeditee/gio/swing/SwingGraphicsManager.java
r1113 r1144 47 47 // TODO: Make stack thread-safe 48 48 public class SwingGraphicsManager extends GraphicsManager { 49 49 50 50 private static SwingGraphicsManager _instance; 51 52 public static SwingGraphicsManager getInstance() 53 { 51 52 public static SwingGraphicsManager getInstance() { 54 53 if (_instance == null) { 55 54 try { … … 65 64 System.exit(1); 66 65 } 67 66 68 67 // Block until the window is ready 69 70 } 71 68 69 } 70 72 71 return _instance; 73 72 } 74 73 75 74 private JFrame _jFrame; 76 75 77 76 private GraphicsSurfaceStack<Graphics2D> _surfaceStack; 78 79 private SwingGraphicsManager() 80 { 77 78 private SwingGraphicsManager() { 81 79 _jFrame = new JFrame() { 82 80 private static final long serialVersionUID = 5179259234365906415L; … … 85 83 // when the window refreshes. 86 84 @Override 87 public void paint(Graphics g) 88 { 85 public void paint(Graphics g) { 89 86 DisplayController.requestRefresh(false); 90 87 } 91 88 }; 92 89 93 90 setWindowIcon(); 94 91 95 92 /* 96 * See Java bug ID 4016934. They say that window closed events are 97 * called oncethe JFrame is disposed.93 * See Java bug ID 4016934. They say that window closed events are called once 94 * the JFrame is disposed. 98 95 */ 99 96 _jFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); 100 97 101 98 // Expeditee handles its own repainting of AWT/Swing components 102 99 RepaintManager.setCurrentManager(ExpediteeRepaintManager.getInstance()); 103 100 104 101 // required to accept TAB key 105 102 _jFrame.setFocusTraversalKeysEnabled(false); 106 103 107 104 _jFrame.pack(); 108 105 109 106 // Moved to here to work with JFXPanel 110 107 // TODO: Is the above comment still relevant? cts16 111 108 _jFrame.getContentPane().setLayout(new AbsoluteLayout()); 112 113 // Set visible must be just after DisplayIO.Init for the message box to be the right size 109 110 // Set visible must be just after DisplayIO.Init for the message box to be the 111 // right size 114 112 // TODO: Is the above comment still relevant? cts16 115 113 _jFrame.setVisible(true); 116 114 117 115 // Create the surface stack 118 116 _surfaceStack = new GraphicsSurfaceStack<Graphics2D>() { 119 117 @Override 120 public Graphics2D getSurfaceFromImage(Image image) 121 { 118 public Graphics2D getSurfaceFromImage(Image image) { 122 119 return SwingMiscManager.getIfUsingSwingImageManager().getImageGraphics(image); 123 120 } 124 121 125 122 @Override 126 public void setSurfaceClip(Graphics2D surface, Clip clip) 127 {128 if (surface == null)return;129 123 public void setSurfaceClip(Graphics2D surface, Clip clip) { 124 if (surface == null) 125 return; 126 130 127 if (clip == null) { 131 128 surface.setClip(null); 132 129 return; 133 130 } 134 135 if (clip.isFullyClipped()) return; 136 131 132 if (clip.isFullyClipped()) 133 return; 134 137 135 surface.setClip(SwingConversions.toSwingRectangle(clip.getBounds())); 138 136 } … … 140 138 refreshRootSurface(); 141 139 } 142 143 @Override 144 protected GraphicsSurfaceStack<?> getGraphicsSurfaceStack() 145 { 140 141 @Override 142 protected GraphicsSurfaceStack<?> getGraphicsSurfaceStack() { 146 143 return _surfaceStack; 147 144 } 148 149 public Dimension getScreenSize() 150 { 145 146 public Dimension getScreenSize() { 151 147 java.awt.Dimension size = Toolkit.getDefaultToolkit().getScreenSize(); 152 148 153 149 return SwingConversions.fromSwingDimension(size); 154 150 } 155 156 public Point getWindowLocation() 157 { 151 152 public Point getWindowLocation() { 158 153 return SwingConversions.fromSwingPoint(_jFrame.getContentPane().getLocationOnScreen()); 159 154 } 160 161 public void setWindowLocation(Point p) 162 { 163 _jFrame.setLocation(p.x, p.y); 164 } 165 166 public Dimension getWindowSize() 167 { 155 156 public void setWindowLocation(Point p) { 157 _jFrame.setLocation(p.getX(), p.getY()); 158 } 159 160 public Dimension getWindowSize() { 168 161 return SwingConversions.fromSwingDimension(_jFrame.getContentPane().getSize()); 169 162 } 170 171 public void setWindowSize(Dimension d) 172 { 163 164 public void setWindowSize(Dimension d) { 173 165 _jFrame.setSize(d.width, d.height); 174 166 _jFrame.setPreferredSize(SwingConversions.toSwingDimension(d)); 175 // Issue a command to graphics so that the JFrame draws itself white.167 // Issue a command to graphics so that the JFrame draws itself white. 176 168 _jFrame.getGraphics().clearRect(0, 0, d.width, d.height); 177 169 } 178 179 public void requestFocus() 180 { 170 171 public void requestFocus() { 181 172 _jFrame.requestFocus(); 182 173 } 183 184 public void setCompositeAlpha(float alpha) 185 { 174 175 public void setCompositeAlpha(float alpha) { 186 176 _surfaceStack.getCurrentSurface().setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha)); 187 177 } 188 189 public void setAntialiasing(boolean on) 190 { 178 179 public void setAntialiasing(boolean on) { 191 180 setAntialiasing(_surfaceStack.getCurrentSurface(), on); 192 181 } 193 194 private void setAntialiasing(Graphics2D surface, boolean on) 195 {196 if (surface == null)return;197 182 183 private void setAntialiasing(Graphics2D surface, boolean on) { 184 if (surface == null) 185 return; 186 198 187 if (on) { 199 188 surface.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); … … 202 191 } 203 192 } 204 205 public void setFont(Font font) 206 { 193 194 public void setFont(Font font) { 207 195 _surfaceStack.getCurrentSurface().setFont(SwingMiscManager.getIfUsingSwingFontManager().getInternalFont(font)); 208 196 } 209 210 public void drawImage(Image image, Point topLeft, Dimension size, double angle, Point cropTopLeft, Dimension cropSize)211 {197 198 public void drawImage(Image image, Point topLeft, Dimension size, double angle, Point cropTopLeft, 199 Dimension cropSize) { 212 200 // Can't draw nothing 213 if (image == null) return; 214 201 if (image == null) 202 return; 203 215 204 // Can't draw nowhere 216 if (topLeft == null) return; 217 205 if (topLeft == null) 206 return; 207 218 208 // If the cropped area is degenerate, abort 219 if (cropSize != null && (cropSize.width <= 0 || cropSize.height <= 0)) return; 220 209 if (cropSize != null && (cropSize.width <= 0 || cropSize.height <= 0)) 210 return; 211 221 212 // If the crop area is the entire image, pretend we are not cropping 222 213 if (Point.ORIGIN.equals(cropTopLeft) && image.getSize().equals(cropSize)) { … … 224 215 cropSize = null; 225 216 } 226 217 227 218 SwingImageManager manager = SwingMiscManager.getIfUsingSwingImageManager(); 228 219 229 220 ImageObserver animator = null; 230 221 if (image.isAnimated()) { 231 222 animator = manager.getAnimator(image); 232 if (animator != null) ((SelfAnimatingImageObserver)animator).activate(); 223 if (animator != null) 224 ((SelfAnimatingImageObserver) animator).activate(); 233 225 } else { 234 226 animator = new SwingImageManager.LoadCompletedImageObserver(); 235 227 } 236 228 237 229 // Default is the entire image 238 230 Image croppedImage = image; 239 231 240 232 // If we are cropping, do this now into a temporary image 241 233 if (cropTopLeft != null && cropSize != null) { 242 234 croppedImage = manager.createImage(cropSize.width, cropSize.height); 243 manager.getInternalImage(croppedImage).getGraphics().drawImage(manager.getInternalImage(image), 0, 0, cropSize.width - 1, cropSize.height - 1, cropTopLeft.x, cropTopLeft.y, cropTopLeft.x + cropSize.width - 1, cropTopLeft.y + cropSize.height - 1, animator); 235 manager.getInternalImage(croppedImage).getGraphics().drawImage(manager.getInternalImage(image), 0, 0, 236 cropSize.width - 1, cropSize.height - 1, cropTopLeft.getX(), cropTopLeft.getY(), 237 cropTopLeft.getX() + cropSize.width - 1, cropTopLeft.getY() + cropSize.height - 1, animator); 244 238 animator = new BlockingImageObserver(); 245 239 } 246 240 247 241 // Transform the image 248 242 AffineTransform tx = new AffineTransform(); 249 if (size != null) tx.scale(((double) size.width) / croppedImage.getWidth(), ((double) size.height) / croppedImage.getHeight()); 250 if (angle != 0.0) tx.rotate(angle); 251 if (topLeft != null) tx.translate(topLeft.x, topLeft.y); 252 243 if (size != null) 244 tx.scale(((double) size.width) / croppedImage.getWidth(), 245 ((double) size.height) / croppedImage.getHeight()); 246 if (angle != 0.0) 247 tx.rotate(angle); 248 if (topLeft != null) 249 tx.translate(topLeft.getX(), topLeft.getY()); 250 253 251 // Draw the image to the current surface 254 boolean drawn = _surfaceStack.getCurrentSurface().drawImage(manager.getInternalImage(croppedImage), tx, animator); 255 252 boolean drawn = _surfaceStack.getCurrentSurface().drawImage(manager.getInternalImage(croppedImage), tx, 253 animator); 254 256 255 // If the draw didn't succeed, try again after waiting for the image to load 257 256 if (!drawn && animator instanceof BlockingImageObserver) { … … 260 259 } 261 260 } 262 263 public void drawRectangle(Point topLeft, Dimension size, double angle, Fill fill, Colour borderColour, Stroke borderStroke, Dimension cornerRadius)264 {261 262 public void drawRectangle(Point topLeft, Dimension size, double angle, Fill fill, Colour borderColour, 263 Stroke borderStroke, Dimension cornerRadius) { 265 264 Graphics2D g = (Graphics2D) _surfaceStack.getCurrentSurface().create(); 266 265 267 266 if (angle != 0.0) { 268 267 AffineTransform tx = new AffineTransform(); … … 270 269 g.transform(tx); 271 270 } 272 271 273 272 if (fill != null) { 274 273 if (fill instanceof GradientFill) { … … 277 276 g.setColor(SwingConversions.toSwingColor(fill.getColour())); 278 277 } 279 278 280 279 if (cornerRadius != null) { 281 g.fillRoundRect(topLeft. x, topLeft.y, size.width, size.height, cornerRadius.width, cornerRadius.height);280 g.fillRoundRect(topLeft.getX(), topLeft.getY(), size.width, size.height, cornerRadius.width, cornerRadius.height); 282 281 } else { 283 g.fillRect(topLeft. x, topLeft.y, size.width, size.height);284 } 285 } 286 282 g.fillRect(topLeft.getX(), topLeft.getY(), size.width, size.height); 283 } 284 } 285 287 286 if (borderColour != null && borderStroke != null) { 288 287 g.setColor(SwingConversions.toSwingColor(borderColour)); … … 290 289 291 290 if (cornerRadius != null) { 292 g.drawRoundRect(topLeft. x, topLeft.y, size.width, size.height, cornerRadius.width, cornerRadius.height);291 g.drawRoundRect(topLeft.getX(), topLeft.getY(), size.width, size.height, cornerRadius.width, cornerRadius.height); 293 292 } else { 294 g.drawRect(topLeft. x, topLeft.y, size.width, size.height);295 } 296 } 297 293 g.drawRect(topLeft.getX(), topLeft.getY(), size.width, size.height); 294 } 295 } 296 298 297 g.dispose(); 299 298 } 300 301 public void drawOval(Point centre, Dimension diameters, double angle, Fill fill, Colour borderColour, Stroke borderStroke)302 {299 300 public void drawOval(Point centre, Dimension diameters, double angle, Fill fill, Colour borderColour, 301 Stroke borderStroke) { 303 302 Graphics2D g = (Graphics2D) _surfaceStack.getCurrentSurface().create(); 304 303 305 304 if (angle != 0.0) { 306 305 AffineTransform tx = new AffineTransform(); … … 308 307 g.transform(tx); 309 308 } 310 311 Point topLeft = new Point(centre. x - diameters.width / 2, centre.y- diameters.height / 2);312 309 310 Point topLeft = new Point(centre.getX() - diameters.width / 2, centre.getY() - diameters.height / 2); 311 313 312 if (fill != null) { 314 313 if (fill instanceof GradientFill) { … … 317 316 g.setColor(SwingConversions.toSwingColor(fill.getColour())); 318 317 } 319 320 g.fillOval(topLeft. x, topLeft.y, diameters.width, diameters.height);321 } 322 318 319 g.fillOval(topLeft.getX(), topLeft.getY(), diameters.width, diameters.height); 320 } 321 323 322 if (borderColour != null && borderStroke != null) { 324 323 g.setColor(SwingConversions.toSwingColor(borderColour)); 325 324 g.setStroke(SwingConversions.toSwingStroke(borderStroke)); 326 325 327 g.drawOval(topLeft. x, topLeft.y, diameters.width, diameters.height);328 } 329 326 g.drawOval(topLeft.getX(), topLeft.getY(), diameters.width, diameters.height); 327 } 328 330 329 g.dispose(); 331 330 } 332 333 public void drawPolygon(PolygonBounds points, Point offset, Dimension scale, double angle, Fill fill, Colour borderColour, Stroke borderStroke) 334 { 335 if (points == null || points.getPointCount() < 2) return; 336 if (fill == null && (borderColour == null || borderStroke == null)) return; 337 331 332 public void drawPolygon(PolygonBounds points, Point offset, Dimension scale, double angle, Fill fill, 333 Colour borderColour, Stroke borderStroke) { 334 if (points == null || points.getPointCount() < 2) 335 return; 336 if (fill == null && (borderColour == null || borderStroke == null)) 337 return; 338 338 339 Graphics2D g = (Graphics2D) _surfaceStack.getCurrentSurface().create(); 339 340 340 341 AffineTransform tx = new AffineTransform(); 341 342 Point centre = points.getCentre(); 342 tx.translate(-centre.x, -centre.y); 343 if (angle != 0.0) tx.rotate(angle); 343 tx.translate(-centre.getX(), -centre.getY()); 344 if (angle != 0.0) 345 tx.rotate(angle); 344 346 if (scale != null) { 345 347 double xScale = ((double) scale.width) / (points.getMaxX() - points.getMinX()); … … 347 349 tx.scale(xScale, yScale); 348 350 } 349 tx.translate(centre.x, centre.y); 350 if (offset != null) tx.translate(offset.x, offset.y); 351 tx.translate(centre.getX(), centre.getY()); 352 if (offset != null) 353 tx.translate(offset.getX(), offset.getY()); 351 354 g.transform(tx); 352 355 353 356 if (fill != null) { 354 357 if (fill instanceof GradientFill) { … … 357 360 g.setColor(SwingConversions.toSwingColor(fill.getColour())); 358 361 } 359 362 360 363 g.fillPolygon(SwingConversions.toSwingPolygon(points)); 361 364 } 362 365 363 366 if (borderColour != null && borderStroke != null) { 364 367 g.setColor(SwingConversions.toSwingColor(borderColour)); … … 371 374 int[] xPoints = new int[nPoints]; 372 375 int[] yPoints = new int[nPoints]; 373 376 374 377 for (int i = 0; i < nPoints; i++) { 375 378 Point point = points.getPoint(i); 376 xPoints[i] = point. x;377 yPoints[i] = point. y;379 xPoints[i] = point.getX(); 380 yPoints[i] = point.getY(); 378 381 } 379 382 380 383 g.drawPolyline(xPoints, yPoints, nPoints); 381 384 } 382 385 } 383 386 384 387 g.dispose(); 385 388 } 386 387 @Override 388 public void drawLine(int x1, int y1, int x2, int y2, Colour colour, Stroke stroke) 389 {390 if (colour == null || stroke == null)return;391 389 390 @Override 391 public void drawLine(int x1, int y1, int x2, int y2, Colour colour, Stroke stroke) { 392 if (colour == null || stroke == null) 393 return; 394 392 395 Graphics2D g = (Graphics2D) _surfaceStack.getCurrentSurface().create(); 393 396 g.setColor(SwingConversions.toSwingColor(colour)); 394 397 g.setStroke(SwingConversions.toSwingStroke(stroke)); 395 398 396 399 g.drawLine(x1, y1, x2, y2); 397 400 398 401 g.dispose(); 399 402 } 400 403 401 404 @Override 402 public void drawString(String string, Point position, Font font, Colour colour) 403 {404 if (string == null || position == null || font == null || colour == null)return;405 405 public void drawString(String string, Point position, Font font, Colour colour) { 406 if (string == null || position == null || font == null || colour == null) 407 return; 408 406 409 Graphics2D g = (Graphics2D) _surfaceStack.getCurrentSurface().create(); 407 410 g.setColor(SwingConversions.toSwingColor(colour)); 408 411 g.setFont(SwingMiscManager.getIfUsingSwingFontManager().getInternalFont(font)); 409 410 g.drawString(string, position. x, position.y);411 412 413 g.drawString(string, position.getX(), position.getY()); 414 412 415 g.dispose(); 413 416 } 414 415 @Override 416 public void drawTextLayout(TextLayout layout, Point position, Colour colour) 417 {418 if (layout == null)return;419 417 418 @Override 419 public void drawTextLayout(TextLayout layout, Point position, Colour colour) { 420 if (layout == null) 421 return; 422 420 423 SwingTextLayoutManager layoutManager = SwingMiscManager.getIfUsingSwingTextLayoutManager(); 421 424 if (layoutManager == null) { … … 423 426 return; 424 427 } 425 428 426 429 java.awt.font.TextLayout swingLayout = layoutManager.getInternalLayout(layout); 427 430 428 431 Graphics2D g = (Graphics2D) _surfaceStack.getCurrentSurface().create(); 429 432 g.setColor(SwingConversions.toSwingColor(colour)); 430 431 swingLayout.draw(g, position. x, position.y);433 434 swingLayout.draw(g, position.getX(), position.getY()); 432 435 } 433 436 434 437 private Dimension _preFullscreenSize = null; 435 438 private boolean _fullScreenTransitionPending = false; 436 439 437 440 /** 438 441 * Whether or not we are in the middle of transitioning to/from fullscreen. 439 442 */ 440 public boolean isFullscreenTransitionPending() 441 { 443 public boolean isFullscreenTransitionPending() { 442 444 return _fullScreenTransitionPending; 443 445 } 444 446 445 447 /** 446 * Should be called when the SwingInputManager is notified that the fullscreen transition447 * has finished.448 * Should be called when the SwingInputManager is notified that the fullscreen 449 * transition has finished. 448 450 */ 449 public void finishFullscreenTransition() 450 { 451 public void finishFullscreenTransition() { 451 452 _fullScreenTransitionPending = false; 452 453 } 453 454 454 455 @Override 455 456 public boolean canGoFullscreen() { … … 459 460 @Override 460 461 public boolean isFullscreen() { 461 return GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getFullScreenWindow() == _jFrame; 462 return GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice() 463 .getFullScreenWindow() == _jFrame; 462 464 } 463 465 … … 468 470 return; 469 471 } 470 472 471 473 _preFullscreenSize = getWindowSize(); 472 474 473 475 _fullScreenTransitionPending = true; 474 476 475 477 _jFrame.dispose(); 476 478 _jFrame.setUndecorated(true); 477 479 _jFrame.pack(); 478 480 _jFrame.setVisible(true); 479 481 480 482 GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().setFullScreenWindow(_jFrame); 481 483 } … … 484 486 public void exitFullscreen() { 485 487 _fullScreenTransitionPending = true; 486 488 487 489 _jFrame.dispose(); 488 490 _jFrame.setUndecorated(false); 489 491 setWindowSize(_preFullscreenSize); 490 492 491 493 GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().setFullScreenWindow(null); 492 494 _jFrame.pack(); 493 495 _jFrame.setVisible(true); 494 495 } 496 497 @Override 498 public void setCursor(Cursor cursor) 499 {500 if (cursor == null)return;501 496 497 } 498 499 @Override 500 public void setCursor(Cursor cursor) { 501 if (cursor == null) 502 return; 503 502 504 java.awt.Cursor swingCursor; 503 505 if (cursor.getType() == Cursor.CursorType.CUSTOM) { 504 506 SwingImageManager imageManager = SwingMiscManager.getIfUsingSwingImageManager(); 505 506 if (imageManager == null) return; 507 508 swingCursor = Toolkit.getDefaultToolkit().createCustomCursor(imageManager.getInternalImage(cursor.getImage()), SwingConversions.toSwingPoint(cursor.getHotspot()), cursor.getName()); 507 508 if (imageManager == null) 509 return; 510 511 swingCursor = Toolkit.getDefaultToolkit().createCustomCursor( 512 imageManager.getInternalImage(cursor.getImage()), 513 SwingConversions.toSwingPoint(cursor.getHotspot()), cursor.getName()); 509 514 } else { 510 515 swingCursor = new java.awt.Cursor(SwingConversions.toSwingCursorType(cursor.getType())); 511 516 } 512 517 513 518 _jFrame.setCursor(swingCursor); 514 519 } … … 522 527 523 528 @Override 524 public void setWindowTitle(String title) 525 { 529 public void setWindowTitle(String title) { 526 530 _jFrame.setTitle(title); 527 531 } … … 529 533 @Override 530 534 public boolean showDialog(String title, String message) { 531 int result = JOptionPane.showConfirmDialog(_jFrame, message, title, JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); 535 int result = JOptionPane.showConfirmDialog(_jFrame, message, title, JOptionPane.OK_CANCEL_OPTION, 536 JOptionPane.WARNING_MESSAGE); 532 537 return result == JOptionPane.OK_OPTION; 533 538 } 534 539 535 540 @Override 536 public Dimension getCurrentDrawingSurfaceSize() 537 { 541 public Dimension getCurrentDrawingSurfaceSize() { 538 542 Image currentImage = _surfaceStack.getCurrentImage(); 539 543 540 544 if (currentImage != null) { 541 545 return currentImage.getSize(); … … 544 548 } 545 549 } 546 547 public void refreshRootSurface() 548 { 550 551 public void refreshRootSurface() { 549 552 Graphics2D rootSurface = (Graphics2D) _jFrame.getContentPane().getGraphics(); 550 553 setAntialiasing(rootSurface, true); … … 552 555 _surfaceStack.setRootSurface(rootSurface); 553 556 } 554 555 public JFrame getJFrame() 556 { 557 558 public JFrame getJFrame() { 557 559 return _jFrame; 558 560 } 559 560 public Container getContentPane() 561 { 561 562 public Container getContentPane() { 562 563 return _jFrame.getContentPane(); 563 564 } 564 565 public JLayeredPane getLayeredPane() 566 { 565 566 public JLayeredPane getLayeredPane() { 567 567 return _jFrame.getLayeredPane(); 568 568 } 569 570 public void setTransferHandler(TransferHandler newHandler) 571 { 569 570 public void setTransferHandler(TransferHandler newHandler) { 572 571 _jFrame.setTransferHandler(newHandler); 573 572 } 574 575 public void addWindowListener(WindowListener l) 576 { 573 574 public void addWindowListener(WindowListener l) { 577 575 _jFrame.addWindowListener(l); 578 576 } 579 580 public void addWindowStateListener(WindowStateListener l) 581 { 577 578 public void addWindowStateListener(WindowStateListener l) { 582 579 _jFrame.addWindowStateListener(l); 583 580 } 584 585 public void addKeyListener(KeyListener l) 586 { 581 582 public void addKeyListener(KeyListener l) { 587 583 _jFrame.addKeyListener(l); 588 584 } 589 590 public void addComponentListener(ComponentListener l) 591 { 585 586 public void addComponentListener(ComponentListener l) { 592 587 _jFrame.addComponentListener(l); 593 588 } 594 595 public void setGlassPane(Component glassPane) 596 { 589 590 public void setGlassPane(Component glassPane) { 597 591 _jFrame.setGlassPane(glassPane); 598 592 } 599 600 public Component getGlassPane() 601 { 593 594 public Component getGlassPane() { 602 595 return _jFrame.getGlassPane(); 603 596 } 604 605 public JMenuBar getJMenuBar() 606 { 597 598 public JMenuBar getJMenuBar() { 607 599 return _jFrame.getJMenuBar(); 608 600 } 609 610 public FontMetrics getFontMetrics(java.awt.Font font) 611 { 601 602 public FontMetrics getFontMetrics(java.awt.Font font) { 612 603 return _jFrame.getFontMetrics(font); 613 604 } 614 615 public java.awt.Font getFont() 616 { 605 606 public java.awt.Font getFont() { 617 607 return _jFrame.getFont(); 618 608 } 619 620 public Graphics2D getCurrentSurface() 621 {609 610 public Graphics2D getCurrentSurface() { 611 //System.err.println("Getting image y: " + _surfaceStack.getCurrentImage().getBounds().getMinY()); 622 612 return _surfaceStack.getCurrentSurface(); 623 613 } 624 625 @Override 626 public boolean addInteractiveWidget(Widget iw) 627 { 614 615 @Override 616 public boolean addInteractiveWidget(Widget iw) { 628 617 if (super.addInteractiveWidget(iw)) { 629 618 _jFrame.add(((SwingWidget) iw).getComponent()); 630 619 return true; 631 620 } 632 621 633 622 return false; 634 623 } 635 636 @Override 637 public boolean removeInteractiveWidget(Widget iw) 638 { 624 625 @Override 626 public boolean removeInteractiveWidget(Widget iw) { 639 627 if (super.removeInteractiveWidget(iw)) { 640 628 _jFrame.remove(((SwingWidget) iw).getComponent()); 641 629 return true; 642 630 } 643 631 644 632 return false; 645 633 } 646 647 @Override 648 protected void setWindowIcon(Image image) 649 { 634 635 @Override 636 protected void setWindowIcon(Image image) { 650 637 SwingImageManager imageManager = SwingMiscManager.getIfUsingSwingImageManager(); 651 638 652 639 if (imageManager != null) { 653 640 _jFrame.setIconImage(imageManager.getInternalImage(image)); -
trunk/src/org/expeditee/gio/swing/SwingInputManager.java
r1138 r1144 136 136 //_robot.mouseMove(screenPosition.x, screenPosition.y); 137 137 final Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); 138 _robot.MoveMouseControlled(screenPosition. x / screenSize.getWidth(), screenPosition.y/ screenSize.getHeight());139 updateCursorPosition(position. x, position.y);138 _robot.MoveMouseControlled(screenPosition.getX() / screenSize.getWidth(), screenPosition.getY() / screenSize.getHeight()); 139 updateCursorPosition(position.getX(), position.getY()); 140 140 } 141 141 -
trunk/src/org/expeditee/gio/swing/SwingTextLayoutManager.java
r1097 r1144 240 240 lineDrop += layout.getLeading(); 241 241 } 242 start. y += lineDrop;242 start.setY(start.getY() + lineDrop); 243 243 positions.add(new Point(start)); 244 244 } -
trunk/src/org/expeditee/gui/DisplayController.java
r1140 r1144 235 235 //System.err.println("setTextCursor DisplayController:: " + DisplayController.getFloatMouseX() + "," + DisplayController.getFloatMouseY()); 236 236 //System.err.println("setTextCursor Ecosystem:: " + EcosystemManager.getInputManager().getCursorPosition()); 237 Point newMouse = text.moveCursor(cursorMovement, DisplayController.getFloatMouseX(), EcosystemManager.getInputManager().getCursorPosition(). y, isShiftDown, isCtrlDown);237 Point newMouse = text.moveCursor(cursorMovement, DisplayController.getFloatMouseX(), EcosystemManager.getInputManager().getCursorPosition().getY(), isShiftDown, isCtrlDown); 238 238 //System.err.println("setTextCursor New Cursor:: " + newMouse); 239 239 240 240 if( isCtrlDown || 241 (DisplayController.getFloatMouseX() <= newMouse. x && newMouse.x<= DisplayController.getFloatMouseX() + 1) ||242 (DisplayController.getFloatMouseX() > newMouse. x&& cursorMovement == Text.RIGHT))241 (DisplayController.getFloatMouseX() <= newMouse.getX() && newMouse.getX() <= DisplayController.getFloatMouseX() + 1) || 242 (DisplayController.getFloatMouseX() > newMouse.getX() && cursorMovement == Text.RIGHT)) 243 243 { 244 244 if(cursorMovement == Text.RIGHT && !MagneticConstraints.getInstance().rightBorderHit(text)) { … … 249 249 } 250 250 } 251 newMouse. x = (int) DisplayController.getFloatMouseX();252 newMouse. y = (int) DisplayController.getFloatMouseY();251 newMouse.setX((int) DisplayController.getFloatMouseX()); 252 newMouse.setY((int) DisplayController.getFloatMouseY()); 253 253 } else if(cursorMovement == Text.UP && MagneticConstraints.getInstance().topBorderHit(text)) { 254 newMouse. x = (int) DisplayController.getFloatMouseX();255 newMouse. y = (int) DisplayController.getFloatMouseY();254 newMouse.setX((int) DisplayController.getFloatMouseX()); 255 newMouse.setY((int) DisplayController.getFloatMouseY()); 256 256 } else if(cursorMovement == Text.DOWN && MagneticConstraints.getInstance().bottomBorderHit(text)) { 257 newMouse. x = (int) DisplayController.getFloatMouseX();258 newMouse. y = (int) DisplayController.getFloatMouseY();257 newMouse.setX((int) DisplayController.getFloatMouseX()); 258 newMouse.setY((int) DisplayController.getFloatMouseY()); 259 259 } 260 260 … … 384 384 if (FreeItems.hasItemsAttachedToCursor()) { 385 385 Point mousePos = EcosystemManager.getInputManager().getCursorPosition(); 386 float deltax = x - mousePos. x;387 float deltay = y - mousePos. y;386 float deltax = x - mousePos.getX(); 387 float deltay = y - mousePos.getY(); 388 388 List<Item> toMove = FreeItems.getInstance(); 389 389 for (Item move : toMove) { … … 409 409 public static void setCursorPosition(Point pos) 410 410 { 411 setCursorPosition(pos. x, pos.y);411 setCursorPosition(pos.getX(), pos.getY()); 412 412 } 413 413 414 414 public static void setCursorPosition(Point pos, boolean forceArrow) 415 415 { 416 setCursorPosition(pos. x, pos.y, forceArrow);416 setCursorPosition(pos.getX(), pos.getY(), forceArrow); 417 417 } 418 418 … … 683 683 // we are on the right side. 684 684 if(isTwinFramesOn()) { 685 int mouseX = EcosystemManager.getInputManager().getCursorPosition(). x;685 int mouseX = EcosystemManager.getInputManager().getCursorPosition().getX(); 686 686 if(mouseX >= getTwinFramesSeparatorX() && sideHasFrame(RIGHT)) { 687 687 return RIGHT; … … 794 794 public static int getMouseX() 795 795 { 796 return getMousePosition(). x;796 return getMousePosition().getX(); 797 797 } 798 798 … … 809 809 810 810 if (isTwinFramesOn() && getRightFramePaintArea().contains(mousePos)) { 811 mousePos. x -= getRightFramePaintArea().getMinX();811 mousePos.setX(mousePos.getX() - getRightFramePaintArea().getMinX()); 812 812 } 813 813 … … 834 834 public static int getMouseY() 835 835 { 836 return getMousePosition(). y;836 return getMousePosition().getY(); 837 837 } 838 838 … … 1308 1308 1309 1309 g.popDrawingSurface(); 1310 //System.err.println("DisplayController refresh. Point.ORIGIN=" + Point.ORIGIN); 1311 //System.err.println("DisplayController refresh. Graphic=" + g); 1310 1312 g.drawImage(_refreshBuffer, Point.ORIGIN); 1311 1313 return true; -
trunk/src/org/expeditee/gui/Frame.java
r1139 r1144 1934 1934 if (isNormalTextItem(it)) itemsFound++; 1935 1935 if (itemsFound > index) { 1936 DisplayController.setCursorPosition(((Text) it).getParagraphEndPosition(). x, it.getY());1936 DisplayController.setCursorPosition(((Text) it).getParagraphEndPosition().getX(), it.getY()); 1937 1937 DisplayController.resetCursorOffset(); 1938 1938 DisplayController.requestRefresh(true); -
trunk/src/org/expeditee/gui/FrameTransition.java
r1098 r1144 244 244 Point shadowTopLeft = drawTopLeft.clone().add(0, area.getHeight()); 245 245 Dimension shadowSize = new Dimension(area.getWidth(), SHADOW_HEIGHT); 246 GradientFill shadowFill = new GradientFill(SHADOW_COLOUR, new Point(0, shadowTopLeft. y), Colour.TRANSPARENT, new Point(0, shadowTopLeft.y+ SHADOW_HEIGHT));246 GradientFill shadowFill = new GradientFill(SHADOW_COLOUR, new Point(0, shadowTopLeft.getY()), Colour.TRANSPARENT, new Point(0, shadowTopLeft.getY() + SHADOW_HEIGHT)); 247 247 248 248 EcosystemManager.getGraphicsManager().drawRectangle(drawTopLeft, area.getSize(), 0.0, new Fill(Item.DEFAULT_BACKGROUND), null, null, null); -
trunk/src/org/expeditee/gui/FrameUtils.java
r1102 r1144 1423 1423 1424 1424 for (int i = 0; i < p1.getPointCount(); i++) { 1425 int diff = Math.abs(p1.getPoint(i). x - mouseX) + Math.abs(p1.getPoint(i).y- mouseY);1425 int diff = Math.abs(p1.getPoint(i).getX() - mouseX) + Math.abs(p1.getPoint(i).getY() - mouseY); 1426 1426 int diff2 = Integer.MAX_VALUE; 1427 1427 1428 1428 if (i < p2.getPointCount()) 1429 diff2 = Math.abs(p2.getPoint(i). x - mouseX) + Math.abs(p2.getPoint(i).y- mouseY);1429 diff2 = Math.abs(p2.getPoint(i).getX() - mouseX) + Math.abs(p2.getPoint(i).getY() - mouseY); 1430 1430 1431 1431 if (diff < Math.abs(closest)) { -
trunk/src/org/expeditee/gui/PopupManager.java
r1102 r1144 324 324 if (_initialBounds == null) { 325 325 setInitialBounds(fullBounds.clone()); 326 _initialBounds.getTopLeft(). y += _initialBounds.getSize().height;326 _initialBounds.getTopLeft().setY(_initialBounds.getTopLeft().getY() + _initialBounds.getSize().height); 327 327 _initialBounds.getSize().height = 0; 328 328 } -
trunk/src/org/expeditee/gui/Vector.java
r1102 r1144 86 86 public float getX(int x) 87 87 { 88 return (x - Origin. x) / Scale;88 return (x - Origin.getY()) / Scale; 89 89 } 90 90 … … 92 92 public float getY(int y) 93 93 { 94 return (y - Origin. y) / Scale;94 return (y - Origin.getY()) / Scale; 95 95 } 96 96 -
trunk/src/org/expeditee/io/Conversion.java
r1102 r1144 475 475 476 476 if (orig == null) { 477 p. x = Integer.parseInt(xPos.trim());478 p. y = Integer.parseInt(yPos.trim());477 p.setX(Integer.parseInt(xPos.trim())); 478 p.setY(Integer.parseInt(yPos.trim())); 479 479 } else { 480 480 assert (orig instanceof Point); 481 481 Point originalPoint = (Point) orig; 482 p. x = (Integer) Convert(int.class, xPos, originalPoint.x);483 p. y = (Integer) Convert(int.class, yPos, originalPoint.y);482 p.setX((Integer) Convert(int.class, xPos, originalPoint.getX())); 483 p.setY((Integer) Convert(int.class, yPos, originalPoint.getY())); 484 484 } 485 485 return p; … … 693 693 // covert points 694 694 if (output instanceof Point) 695 return ((Point) output). x + " " + ((Point) output).y;695 return ((Point) output).getX() + " " + ((Point) output).getY(); 696 696 697 697 if (output instanceof Boolean) -
trunk/src/org/expeditee/io/ExpClipReader.java
r1102 r1144 55 55 public ExpClipReader(Point p) 56 56 { 57 this(p. x, p.y);57 this(p.getX(), p.getY()); 58 58 } 59 59 … … 186 186 ++index; 187 187 Point startend = separateValues(lines[index].substring(2)); 188 int start = startend. x;189 int end = startend. y;188 int start = startend.getX(); 189 int end = startend.getY(); 190 190 191 191 if (_linePoints.get(start) != null 192 192 && _linePoints.get(end) != null) { 193 193 _items.add(new Line(_linePoints.get(start), 194 _linePoints.get(end), idtype. x));194 _linePoints.get(end), idtype.getX())); 195 195 } else { 196 196 System.out … … 210 210 Point startend = separateValues(lines[index].substring(2)); 211 211 212 Item a = _linePoints.get(startend. x);213 Item b = _linePoints.get(startend. y);212 Item a = _linePoints.get(startend.getX()); 213 Item b = _linePoints.get(startend.getY()); 214 214 215 215 // System.out.println("adding constraint" + a + " " + b + " " + idtype.x + " " + idtype.y); 216 216 217 new Constraint(a, b, idtype. x, idtype.y);217 new Constraint(a, b, idtype.getX(), idtype.getY()); 218 218 } 219 219 } -
trunk/src/org/expeditee/io/ExpClipWriter.java
r1102 r1144 44 44 public ExpClipWriter(Point p) 45 45 { 46 this(p. x, p.y);46 this(p.getX(), p.getY()); 47 47 } 48 48 -
trunk/src/org/expeditee/io/ExpReader.java
r1102 r1144 137 137 next = _reader.readLine(); 138 138 Point startend = separateValues(next.substring(2)); 139 int start = startend. x;140 int end = startend. y;139 int start = startend.getX(); 140 int end = startend.getY(); 141 141 142 142 if (_linePoints.get(start) != null 143 143 && _linePoints.get(end) != null) { 144 144 newFrame.addItem(new Line(_linePoints.get(start), 145 _linePoints.get(end), idtype. x));145 _linePoints.get(end), idtype.getX())); 146 146 } else { 147 147 System.out … … 161 161 Point startend = separateValues(next.substring(2)); 162 162 163 Item a = _linePoints.get(startend. x);164 Item b = _linePoints.get(startend. y);165 166 new Constraint(a, b, idtype. x, idtype.y);163 Item a = _linePoints.get(startend.getX()); 164 Item b = _linePoints.get(startend.getY()); 165 166 new Constraint(a, b, idtype.getX(), idtype.getY()); 167 167 } 168 168 } -
trunk/src/org/expeditee/io/HTMLWriter.java
r1102 r1144 77 77 0.0, 78 78 pic.getStart(), 79 new Dimension(pic.getEnd(). x - pic.getStart().x, pic.getEnd().y - pic.getStart().y));79 new Dimension(pic.getEnd().getX() - pic.getStart().getX(), pic.getEnd().getY() - pic.getStart().getY())); 80 80 g.popDrawingSurface(); 81 81 image = bufferedImage; -
trunk/src/org/expeditee/io/KMSReader.java
r1102 r1144 275 275 Point startend = separateValues(s); 276 276 277 int start = startend. x;278 int end = startend. y;277 int start = startend.getX(); 278 int end = startend.getY(); 279 279 280 280 if (_linePoints.get(start) != null && _linePoints.get(end) != null) { 281 281 Line line = new Line(_linePoints.get(start), _linePoints.get(end), 282 idtype. x);282 idtype.getX()); 283 283 return line; 284 284 } … … 302 302 Point startend = separateValues(_data.get("s")); 303 303 304 Item a = _linePoints.get(startend. x);305 Item b = _linePoints.get(startend. y);306 307 new Constraint(a, b, idtype. x, idtype.y);304 Item a = _linePoints.get(startend.getX()); 305 Item b = _linePoints.get(startend.getY()); 306 307 new Constraint(a, b, idtype.getX(), idtype.getY()); 308 308 } 309 309 -
trunk/src/org/expeditee/io/PDF2Writer.java
r1102 r1144 243 243 private void drawPolygon(PdfContentByte cb, PolygonBounds poly, Colour fill, Colour line, float lineThickness) { 244 244 if(poly != null) { 245 cb.moveTo(poly.toArray()[0]. x, _height - poly.toArray()[0].y);245 cb.moveTo(poly.toArray()[0].getX(), _height - poly.toArray()[0].getY()); 246 246 for(int i = 1; i < poly.toArray().length; i++) { 247 cb.lineTo(poly.toArray()[i]. x, _height - poly.toArray()[i].y);247 cb.lineTo(poly.toArray()[i].getX(), _height - poly.toArray()[i].getY()); 248 248 } 249 249 cb.closePath();
Note:
See TracChangeset
for help on using the changeset viewer.