/** Recalculates the bounds when a change to the underlying line occurs. */ public void updateBoundsFromLine() { if (lineShape.getPointCount() == 0) { resetBounds(); } else { final Rectangle2D b = getLineBoundsWithStroke(); super.setBounds(b.getX(), b.getY(), b.getWidth(), b.getHeight()); } }
/** Removes all points from the underlying line. */ public void removeAllPoints() { lineShape.removePoints(0, lineShape.getPointCount()); lineChanged(); }
/** * Returns the number of points in the line. * * @return number of points in the line */ public int getPointCount() { return lineShape.getPointCount(); }