Class PolylineDecoration

All Implemented Interfaces:
IFigure, RotatableDecoration

public class PolylineDecoration extends Polyline implements RotatableDecoration
A decorative Figure intended to be placed on a Polyline. It has the default shape of right-pointing triangle.
  • Field Details

    • TRIANGLE_TIP

      public static final PointList TRIANGLE_TIP
      A triangle template
  • Constructor Details

    • PolylineDecoration

      public PolylineDecoration()
      Constructs a PolylineDecoration. Defaults the PolylineDecoration to fill its region with black.
      Since:
      2.0
  • Method Details

    • getPoints

      public PointList getPoints()
      Description copied from class: AbstractPointListShape
      Returns the points in this figure by reference. If the returned list is modified, this figure must be informed by calling AbstractPointListShape.setPoints(PointList). Failure to do so will result in layout and paint problems.
      Overrides:
      getPoints in class AbstractPointListShape
      Returns:
      this Polyline's points
      See Also:
    • setLocation

      public void setLocation(Point p)
      Description copied from interface: IFigure
      Sets the location of this IFigure.
      Specified by:
      setLocation in interface IFigure
      Specified by:
      setLocation in interface RotatableDecoration
      Overrides:
      setLocation in class Figure
      Parameters:
      p - The new location
      See Also:
    • setTemplate

      public void setTemplate(PointList pl)
      Sets the PolylineDecoration's point template. This template is an outline of the PolylineDecoration's region. (The default value is TRIANGLE_TIP which is a triangle whose tip is pointing to the right).
      Parameters:
      pl - the template
      Since:
      2.0
    • setScale

      public void setScale(double x, double y)
      Sets the amount of scaling to be done along X and Y axes on the PolylineDecoration's template.
      Parameters:
      x - the x scale
      y - the y scale
      Since:
      2.0
    • setReferencePoint

      public void setReferencePoint(Point ref)
      Description copied from interface: RotatableDecoration
      Sets the reference point used to determine the rotation angle.
      Specified by:
      setReferencePoint in interface RotatableDecoration
      Parameters:
      ref - The reference point
      See Also:
    • setRotation

      public void setRotation(double angle)
      Sets the angle by which rotation is to be done on the PolylineDecoration.
      Parameters:
      angle - the angle of rotation
      Since:
      2.0