Beispiel #1
0
 /** 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());
   }
 }
Beispiel #2
0
 /** Removes all points from the underlying line. */
 public void removeAllPoints() {
   lineShape.removePoints(0, lineShape.getPointCount());
   lineChanged();
 }
Beispiel #3
0
 /**
  * Returns the number of points in the line.
  *
  * @return number of points in the line
  */
 public int getPointCount() {
   return lineShape.getPointCount();
 }