Class PolylineItem

All Implemented Interfaces:
IFeedbackProvider, IDrawable, EventListener
Direct Known Subclasses:
ConnectorItem

public class PolylineItem extends PathBasedItem
An open, stroked-only polyline defined in world coordinates.

Unlike PolygonItem, the path is not closed back to its first point, and the fill color is forced to null so only the connecting segments are drawn. The geometry is stored as a world-coordinate Path2D; selection/reshape modifies vertices of that path.

  • Constructor Details

    • PolylineItem

      public PolylineItem(Layer layer, Point2D.Double[] points)
      Create a world polyline item
      Parameters:
      layer - the z layer this item is on.
      points - the points of the polyline
    • PolylineItem

      public PolylineItem(Layer layer, Point2D.Double[] points, Object... keyVals)
      Create a world polyline item
      Parameters:
      layer - the z layer this item is on.
      points - the points of the polyline
      keyVals - optional key value pairs for styling the item. See AItem(Layer, Object...) for more details.
  • Method Details

    • drawItem

      public void drawItem(Graphics2D g2, IContainer container)
      Custom drawer for the item.
      Overrides:
      drawItem in class PathBasedItem
      Parameters:
      g2 - the graphics context.
      container - the graphical container being rendered.
    • reshape

      protected void reshape()
      Reshape the polygon based on the modification. Not much we can do to a polygon except move the selected point. Keep in mind that if control or shift was pressed, the polygon will scale rather than coming here.
      Overrides:
      reshape in class PathBasedItem