Point p = new Point(1,2); Point p2 = p.clone(); Point p3 = p; p2.x = 5; p3.y = 7;
/** * Returns a clone of this coordinates. * * @return A clone of this coordinates. */ @Override public GridCoordinates2D clone() { return (GridCoordinates2D) super.clone(); }
/** * Returns a clone of this coordinates. * * @return A clone of this coordinates. */ @Override public GridCoordinates2D clone() { return (GridCoordinates2D) super.clone(); }
@Override public void setCurrentPosition(final Point point) { oldPosition = position; position = (Point) point.clone(); }
@Override public Object clone () { return super.clone(); //To change body of generated methods, choose Tools | Templates. } }
@Override public Point getOldPosition() { return (Point) oldPosition.clone(); }
public Rectangle(Point p) { origin = p.clone(); }
@Override public Point getCurrentPosition() { return (Point) position.clone(); }
//Circle class public Circle(Point p) { this.p = p.clone(); }
public Point getMouseOffset() { return (Point)mouseOffset.clone(); }
/** * Constructor. * @param pEvent event to get {@link #mComponent}and {@link #mPosition} from. */ public ShowPopup(final MouseEvent pEvent) { mComponent = pEvent.getComponent(); mPosition = (Point)pEvent.getPoint().clone(); // just to be on the safe side if somebody changes this value }
protected Point getTranslatedPoint(Point point) { Point p = (Point) point.clone(); SwingUtilities.convertPointFromScreen(p, component); return p; }
public Point getCurrentMouse(boolean relativeToScreen) { Point p = (Point)currentMouse.clone(); if(relativeToScreen) { SwingUtilities.convertPointToScreen(p, dragSource); } return p; }
public void setTarget(Point pt) { touch(); this.target = (Point)pt.clone(); }
public void setTarget(Point pt) { touch(); this.target = (Point)pt.clone(); }
public void setTarget(Point pt) { touch(); this.target = (Point)pt.clone(); }
/** * Creates and returns a copy of this object. * * <p>Mutable second-class Objects are required to provide a public * clone method in order to allow for copying PersistenceCapable * objects. In contrast to Object.clone(), this method must not throw a * CloneNotSupportedException. * @return A clone of the object */ public Object clone() { Object obj = super.clone(); ((Point)obj).unsetOwner(); return obj; }
public void mouseDraggedFromToggleButton() { Point mousePositionRelativeToScreen = MouseInfo.getPointerInfo().getLocation(); Rectangle timeListBounds = timeList.getBounds(); timeListBounds.setLocation(timeList.getLocationOnScreen()); if (timeListBounds.contains(mousePositionRelativeToScreen)) { SwingUtilities.convertPointFromScreen(mousePositionRelativeToScreen, timeList); Point mousePositionRelativeToComponent = (Point) mousePositionRelativeToScreen.clone(); int index = timeList.locationToIndex(mousePositionRelativeToComponent); if ((index != -1) && (index != timeList.getSelectedIndex())) { timeList.setSelectedIndex(index); } } }