- Timestamp:
- 09/18/18 12:00:17 (6 years ago)
- Location:
- trunk/src/org/expeditee/items
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/items/Circle.java
r1102 r1143 159 159 double radius = getRadius(); 160 160 161 double distance = Math.sqrt(Math.pow(Math.abs(_center.getX() - p. x), 2)162 + Math.pow(Math.abs(_center.getY() - p. y), 2));161 double distance = Math.sqrt(Math.pow(Math.abs(_center.getX() - p.getX()), 2) 162 + Math.pow(Math.abs(_center.getY() - p.getY()), 2)); 163 163 164 164 return Math.abs(distance - radius) < getGravity() * 2; -
trunk/src/org/expeditee/items/Item.java
r1102 r1143 2149 2149 2150 2150 public void setPosition(Point position) { 2151 setPosition(position. x, position.y);2151 setPosition(position.getX(), position.getY()); 2152 2152 } 2153 2153 … … 2881 2881 invalidateCommonTraitForAll(ItemAppearence.PreMoved); 2882 2882 2883 _x = (float) (origin. x + ratio * (_x - origin.x));2884 _y = (float) (origin. y + ratio * (_y - origin.y));2883 _x = (float) (origin.getX() + ratio * (_x - origin.getX())); 2884 _y = (float) (origin.getY() + ratio * (_y - origin.getY())); 2885 2885 invalidateBounds(); 2886 2886 for (Line line : getLines()) -
trunk/src/org/expeditee/items/ItemUtils.java
r1102 r1143 971 971 private static void scaleItem(Vector v, Item item) { 972 972 Float scale = v.Scale; 973 int originX = v.Origin. x;974 int originY = v.Origin. y;973 int originX = v.Origin.getX(); 974 int originY = v.Origin.getY(); 975 975 Colour defaultForeground = v.Foreground; 976 976 Colour defaultBackground = v.Background; -
trunk/src/org/expeditee/items/Line.java
r1102 r1143 227 227 * else 228 228 */{ 229 _startOffset. x = 0;230 _startOffset. y = 0;229 _startOffset.setX(0); 230 _startOffset.setY(0); 231 231 } 232 232 … … 245 245 * end.getX(); _endOffset.y = _end.getY() - end.getY(); } else 246 246 */{ 247 _endOffset. x = 0;248 _endOffset. y = 0;247 _endOffset.setX(0); 248 _endOffset.setY(0); 249 249 } 250 250 … … 377 377 // Add all the x and y's to the array 378 378 for (int j = 0; j < pointPath.size(); j++) { 379 path.addPoint(pointPath.get(j). x, pointPath.get(j).y);379 path.addPoint(pointPath.get(j).getX(), pointPath.get(j).getY()); 380 380 } 381 381 } … … 447 447 int x0, x1, y0, y1; 448 448 449 x1 = withArrow.getX() + startOffset. x;450 y1 = withArrow.getY() + startOffset. y;451 x0 = getOppositeEnd(withArrow).getX() + endOffset. x;452 y0 = getOppositeEnd(withArrow).getY() + endOffset. y;449 x1 = withArrow.getX() + startOffset.getX(); 450 y1 = withArrow.getY() + startOffset.getY(); 451 x0 = getOppositeEnd(withArrow).getX() + endOffset.getX(); 452 y0 = getOppositeEnd(withArrow).getY() + endOffset.getY(); 453 453 454 454 float arrowLength = withArrow.getArrowheadLength(); … … 499 499 arrowhead = arrowhead.clone(); 500 500 double rad = calcAngle((float) x0, (float) y0, (float) x1, (float) y1); 501 arrowhead.translate((x0 + length) - arrowhead.toArray()[0]. x, y0 - arrowhead.toArray()[0].y);501 arrowhead.translate((x0 + length) - arrowhead.toArray()[0].getX(), y0 - arrowhead.toArray()[0].getY()); 502 502 arrowhead.rotate(rad, x0, y0); 503 503 … … 609 609 public Item getEndPointToDisconnect(Point p) 610 610 { 611 return getEndPointToDisconnect(p. x, p.y);611 return getEndPointToDisconnect(p.getX(), p.getY()); 612 612 } 613 613 -
trunk/src/org/expeditee/items/Picture.java
r1102 r1143 207 207 String size = getImageSize(); 208 208 209 if (_end. x != 0 || _end.y!= 0)209 if (_end.getX() != 0 || _end.getY() != 0) 210 210 return; 211 211 … … 280 280 public void setStartCrop(Point p) 281 281 { 282 if (p != null) setStartCrop(p. x, p.y);282 if (p != null) setStartCrop(p.getX(), p.getY()); 283 283 } 284 284 … … 291 291 public void setEndCrop(Point p) 292 292 { 293 if (p != null) setEndCrop(p. x, p.y);293 if (p != null) setEndCrop(p.getX(), p.getY()); 294 294 } 295 295 … … 304 304 Point topLeft = getTopLeftCrop(); 305 305 Point bottomRight = getBottomRightCrop(); 306 int startX = getX() + topLeft. x- _highlightThickness;307 int startY = getY() + topLeft. y- _highlightThickness;306 int startX = getX() + topLeft.getX() - _highlightThickness; 307 int startY = getY() + topLeft.getY() - _highlightThickness; 308 308 int border = 2 * _highlightThickness; 309 309 // TODO: Why invalidate specific area just before invalidateAll? cts16 310 310 invalidate(new AxisAlignedBoxBounds(startX, startY, 311 bottomRight. x - topLeft.x + 2 * border, bottomRight.y - topLeft.y+ 2 * border));311 bottomRight.getX() - topLeft.getX() + 2 * border, bottomRight.getY() - topLeft.getY() + 2 * border)); 312 312 invalidateAll(); 313 313 } else { … … 317 317 318 318 public Point getTopLeftCrop() { 319 return new Point(Math.min(_cropStart. x, _cropEnd.x), Math.min(320 _cropStart. y, _cropEnd.y));319 return new Point(Math.min(_cropStart.getX(), _cropEnd.getX()), Math.min( 320 _cropStart.getY(), _cropEnd.getY())); 321 321 } 322 322 323 323 public Point getBottomRightCrop() 324 324 { 325 return new Point(Math.max(_cropStart. x, _cropEnd.x), Math.max(_cropStart.y, _cropEnd.y));325 return new Point(Math.max(_cropStart.getX(), _cropEnd.getX()), Math.max(_cropStart.getY(), _cropEnd.getY())); 326 326 } 327 327 … … 341 341 if (!isBeingCropped()) return true; 342 342 343 int cropWidth = Math.abs(_cropEnd. x - _cropStart.x);344 int cropHeight = Math.abs(_cropEnd. y - _cropStart.y);343 int cropWidth = Math.abs(_cropEnd.getX() - _cropStart.getX()); 344 int cropHeight = Math.abs(_cropEnd.getY() - _cropStart.getY()); 345 345 346 346 return cropWidth < MINIMUM_WIDTH || cropHeight < MINIMUM_WIDTH; … … 371 371 int height = getHeight(); 372 372 373 centre. x = base_x + width / 2;374 centre. y = base_y + height / 2;373 centre.setX(base_x + width / 2); 374 centre.setY(base_y + height / 2); 375 375 376 376 int xdiff = -MARGIN_RIGHT; // -getLeftMargin(); … … 391 391 Point bottomRight = getBottomRightCrop(); 392 392 393 centre. x = base_x + (bottomRight.x - topLeft.x) / 2;394 centre. y = base_y + (bottomRight.y - topLeft.y) / 2;395 396 AxisAlignedBoxBounds clip = new AxisAlignedBoxBounds(topLeft. x+ base_x,397 topLeft. y + base_y, bottomRight.x - topLeft.x,398 bottomRight. y - topLeft.y);393 centre.setX(base_x + (bottomRight.getX() - topLeft.getX()) / 2); 394 centre.setY(base_y + (bottomRight.getY() - topLeft.getY()) / 2); 395 396 AxisAlignedBoxBounds clip = new AxisAlignedBoxBounds(topLeft.getX() + base_x, 397 topLeft.getY() + base_y, bottomRight.getX() - topLeft.getX(), 398 bottomRight.getY() - topLeft.getY()); 399 399 // _poly.addPoint((int) clip.getMinX() - 1, (int) clip.getMinY() - 1); 400 400 // _poly.addPoint((int) clip.getMinX() - 1, (int) clip.getMaxY()); … … 425 425 @Override 426 426 public void setWidth(Integer width) { 427 _scale = width * 1F / (_end. x - _start.x);427 _scale = width * 1F / (_end.getX() - _start.getX()); 428 428 } 429 429 … … 487 487 int offY = (tmp.getHeight() - getHeight()) / 2; 488 488 489 int cropStartX = _start. x;490 int cropEndX = _end. x;489 int cropStartX = _start.getX(); 490 int cropEndX = _end.getX(); 491 491 if(cropEndX > iw) { 492 492 cropEndX = iw; … … 503 503 } 504 504 505 int cropStartY = _start. y;506 int cropEndY = _end. y;505 int cropStartY = _start.getY(); 506 int cropEndY = _end.getY(); 507 507 if(cropEndY > ih) { 508 508 cropEndY = ih; … … 569 569 int base_y = (_anchorTop != null) ? _anchorTop : _source.getY(); 570 570 571 Clip clip = new Clip(new AxisAlignedBoxBounds( base_x + topLeft. x,572 base_y + topLeft. y,573 bottomRight. x - topLeft.x,574 bottomRight. y - topLeft.y));571 Clip clip = new Clip(new AxisAlignedBoxBounds( base_x + topLeft.getX(), 572 base_y + topLeft.getY(), 573 bottomRight.getX() - topLeft.getX(), 574 bottomRight.getY() - topLeft.getY())); 575 575 EnforcedClipKey key = g.pushClip(clip); 576 576 paintImageTiling(); … … 625 625 Point topLeft = getTopLeftCrop(); 626 626 Point bottomRight = getBottomRightCrop(); 627 int startX = Math.round(topLeft. x / _scale) + _start.x;628 int startY = Math.round(topLeft. y / _scale) + _start.y;629 int endX = Math.round(bottomRight. x / _scale + _start.x);630 int endY = Math.round(bottomRight. y / _scale + _start.y);627 int startX = Math.round(topLeft.getX() / _scale) + _start.getX(); 628 int startY = Math.round(topLeft.getY() / _scale) + _start.getY(); 629 int endX = Math.round(bottomRight.getX() / _scale + _start.getX()); 630 int endY = Math.round(bottomRight.getY() / _scale + _start.getY()); 631 631 int width = _image.getWidth(); 632 632 int height = _image.getHeight(); … … 649 649 int base_x = (_anchorLeft!=null) ? _anchorLeft : _source.getX(); 650 650 int base_y = (_anchorTop!=null) ? _anchorTop : _source.getY(); 651 p._source.setPosition(topLeft. x + base_x, topLeft.y+ base_y);651 p._source.setPosition(topLeft.getX() + base_x, topLeft.getY() + base_y); 652 652 } else { 653 653 p._start = new Point(_start); … … 678 678 int ih = _image.getHeight(); 679 679 if(iw > 0 || ih > 0) { 680 while(_start. x>= iw) {681 _start. x -= iw;682 _end. x -= iw;680 while(_start.getX() >= iw) { 681 _start.setX(_start.getX() - iw); 682 _end.setX(_end.getX() - iw); 683 683 } 684 while(_start. y>= ih) {685 _start. y -= ih;686 _end. y -= ih;684 while(_start.getY() >= ih) { 685 _start.setY(_start.getY() - ih); 686 _end.setY(_end.getY() - ih); 687 687 } 688 while(_start. x< 0) {689 _start. x += iw;690 _end. x += iw;688 while(_start.getX() < 0) { 689 _start.setX(_start.getX() + iw); 690 _end.setX(_end.getX() + iw); 691 691 } 692 while(_start. y< 0) {693 _start. y += ih;694 _end. y += ih;692 while(_start.getY() < 0) { 693 _start.setY(_start.getY() + ih); 694 _end.setY(_end.getY() + ih); 695 695 } 696 696 } … … 749 749 } 750 750 751 return Image.createImageAsCroppedCopy(_image, _start. x, _start.y, getUnscaledWidth(), getUnscaledHeight());751 return Image.createImageAsCroppedCopy(_image, _start.getX(), _start.getY(), getUnscaledWidth(), getUnscaledHeight()); 752 752 } 753 753 754 754 public int getUnscaledWidth() { 755 return _end. x - _start.x;755 return _end.getX() - _start.getX(); 756 756 } 757 757 758 758 public int getUnscaledHeight() { 759 return _end. y - _start.y;759 return _end.getY() - _start.getY(); 760 760 } 761 761 … … 764 764 */ 765 765 public boolean isCropped() { 766 return (_end. x != 0 && _end.x != _image.getWidth()) || (_end.y != 0 && _end.y != _image.getHeight()) || _start.y != 0 || _start.x!= 0;766 return (_end.getX() != 0 && _end.getX() != _image.getWidth()) || (_end.getY() != 0 && _end.getY() != _image.getHeight()) || _start.getY() != 0 || _start.getX() != 0; 767 767 } 768 768 … … 888 888 // If the image is cropped add the position for the start and finish of 889 889 // the crop to the soure text 890 if (_start. x > 0 || _start.y > 0 || _end.x!= _image.getWidth()891 || _end. y!= _image.getHeight()) {892 newText.append(" ").append(_start. x).append(" ").append(_start.y);893 newText.append(" ").append(_end. x).append(" ").append(_end.y);890 if (_start.getX() > 0 || _start.getY() > 0 || _end.getX() != _image.getWidth() 891 || _end.getY() != _image.getHeight()) { 892 newText.append(" ").append(_start.getX()).append(" ").append(_start.getY()); 893 newText.append(" ").append(_end.getX()).append(" ").append(_end.getY()); 894 894 } 895 895 -
trunk/src/org/expeditee/items/Text.java
r1125 r1143 727 727 public void setSelectionStart(Point p) 728 728 { 729 setSelectionStart(p. x, p.y);729 setSelectionStart(p.getX(), p.getY()); 730 730 } 731 731 … … 746 746 public void setSelectionEnd(Point p) 747 747 { 748 setSelectionEnd(p. x, p.y);748 setSelectionEnd(p.getX(), p.getY()); 749 749 } 750 750 … … 1158 1158 } 1159 1159 1160 if (setSelection) setSelectionEnd(resultPos. x, resultPos.y);1160 if (setSelection) setSelectionEnd(resultPos.getX(), resultPos.getY()); 1161 1161 1162 1162 return resultPos; … … 1178 1178 1179 1179 TextLayout layout = _textLayouts.get(line); 1180 mouseX += getOffset(). x;1180 mouseX += getOffset().getX(); 1181 1181 mouseX -= getJustOffset(layout); 1182 1182 … … 1195 1195 */ 1196 1196 public int getLinePosition(float mouseY) { 1197 mouseY += getOffset(). y;1197 mouseY += getOffset().getY(); 1198 1198 1199 1199 float y = getY(); … … 1545 1545 @Override 1546 1546 public boolean contains(Point mousePosition) { 1547 return contains(mousePosition. x, mousePosition.y, getGravity() * NEARBY_GRAVITY);1547 return contains(mousePosition.getX(), mousePosition.getY(), getGravity() * NEARBY_GRAVITY); 1548 1548 } 1549 1549 … … 1555 1555 public boolean contains(int mouseX, int mouseY, int gravity) 1556 1556 { 1557 mouseX += getOffset(). x;1558 mouseY += getOffset(). y;1557 mouseX += getOffset().getX(); 1558 mouseY += getOffset().getY(); 1559 1559 1560 1560 float textY = getY(); … … 1869 1869 // return; 1870 1870 } 1871 1871 1872 1872 // check if its a vector item and paint all the vector stuff too if this 1873 1873 // item is a free item … … 2051 2051 newPoint.set(insertText("\b", mouseX, mouseY, 1)); 2052 2052 if (_text.length() > 0 && _text.charAt(0) == ' ') 2053 newPoint.set(insertText("\b", newPoint. x, newPoint.y, 1));2053 newPoint.set(insertText("\b", newPoint.getX(), newPoint.getY(), 1)); 2054 2054 } else { 2055 2055 newPoint.set(insertText("@", mouseX, mouseY, 0)); … … 2061 2061 if (!isLineEnd() && _text.charAt(0) == '@') { 2062 2062 newPoint.set(insertText("\b", mouseX, mouseY, 1)); 2063 newPoint.set(insertText(DEFAULT_BULLET_STRING, newPoint. x, newPoint.y, 0));2063 newPoint.set(insertText(DEFAULT_BULLET_STRING, newPoint.getX(), newPoint.getY(), 0)); 2064 2064 } else { 2065 2065 newPoint.set(insertText("\b", mouseX, mouseY, 1)); … … 2068 2068 FrameUtils.setLastEdited(this); 2069 2069 rebuild(true); 2070 DisplayController.setCursorPosition(newPoint. x, newPoint.y, false);2070 DisplayController.setCursorPosition(newPoint.getX(), newPoint.getY(), false); 2071 2071 } 2072 2072 … … 2838 2838 2839 2839 Point newMouse = t.insertChar(start, DisplayController.getMouseX(), DisplayController.getMouseY()); 2840 DisplayController.setCursorPosition(newMouse. x, newMouse.y, false);2840 DisplayController.setCursorPosition(newMouse.getX(), newMouse.getY(), false); 2841 2841 2842 2842 return t; -
trunk/src/org/expeditee/items/widgets/HeavyDutyInteractiveWidget.java
r1102 r1143 273 273 // Render shaded window over widget 274 274 g.setColor(SwingConversions.toSwingColor(backgroundColor)); 275 g.fillRect(getX(), getY(), getWidth(), getHeight()); 276 275 final int x = getX(); 276 final int y = getY(); 277 final int width = getWidth(); 278 final int height = getHeight(); 279 g.fillRect(x, y, width, height); 280 277 281 // Center the bar 278 int barX = getX()+ BAR_HOROZONTIAL_MARGIN;279 int barY = getY() + (getHeight()>> 1) - (BAR_HEIGHT >> 1);280 281 int barWidth = getWidth()- (BAR_HOROZONTIAL_MARGIN * 2);282 int barX = x + BAR_HOROZONTIAL_MARGIN; 283 int barY = y + (height >> 1) - (BAR_HEIGHT >> 1); 284 285 int barWidth = width - (BAR_HOROZONTIAL_MARGIN * 2); 282 286 if (barWidth <= 0) barWidth = 10; 283 287 -
trunk/src/org/expeditee/items/widgets/SwingWidget.java
r1098 r1143 4 4 import java.awt.Container; 5 5 import java.awt.Graphics2D; 6 import java.awt.Point; 6 7 7 8 import javax.swing.JComponent; … … 109 110 Graphics2D g = SwingMiscManager.getIfUsingSwingGraphicsManager().getCurrentSurface(); 110 111 111 int x = getX(); 112 int y = getY(); 112 final Point location = _swingComponent.getLocation(); 113 int x = location.x; 114 int y = location.y; 113 115 114 116 g.translate(x, y); -
trunk/src/org/expeditee/items/widgets/Widget.java
r1098 r1143 900 900 901 901 _settingPositionFlag = true; 902 902 903 903 invalidateLink(); 904 904 -
trunk/src/org/expeditee/items/widgets/charts/AbstractChart.java
r1102 r1143 175 175 Point origin = getOrigin(); 176 176 return new MouseEvent((Component) e.getSource(), e.getID(), e 177 .getWhen(), e.getModifiers(), origin. x+ e.getX(),178 origin. y+ e.getY(), e.getXOnScreen(),177 .getWhen(), e.getModifiers(), origin.getX() + e.getX(), 178 origin.getY() + e.getY(), e.getXOnScreen(), 179 179 e.getYOnScreen(), e.getClickCount(), false, e 180 180 .getButton());
Note:
See TracChangeset
for help on using the changeset viewer.