/** * Clones this Step. * * @return a cloned step */ public Object clone() { PositionStep step = (PositionStep) super.clone(); if (step != null) step.points[0] = step.p = step.new Position(p.getX(), p.getY()); step.textLayouts = new HashMap<TrackerPanel, TextLayout>(); step.layoutBounds = new HashMap<TrackerPanel, Rectangle>(); return step; }
/** * Constructs a PositionStep with specified image coordinates. * * @param track the PointMass track * @param n the frame number * @param x the x coordinate * @param y the y coordinate */ public PositionStep(PointMass track, int n, double x, double y) { super(track, n); p = new Position(x, y); p.setTrackEditTrigger(true); points = new TPoint[] {p}; screenPoints = new Point[getLength()]; }
/** * Gets TextLayout screen position. * * @param trackerPanel the tracker panel * @return the screen position point */ protected Point getLayoutPosition(TrackerPanel trackerPanel) { Point pt = p.getScreenPosition(trackerPanel); pt.setLocation(pt.x - 4 - textLayoutFont.getSize(), pt.y - 6); return pt; }