Class TextBasedVertexStyle

java.lang.Object
org.openjump.core.ui.style.decoration.TextBasedVertexStyle
All Implemented Interfaces:
ChoosableStyle, Style, Cloneable
Direct Known Subclasses:
VertexZValueStyle

public abstract class TextBasedVertexStyle extends Object implements ChoosableStyle
  • Field Details

    • enabled

      protected boolean enabled
    • name

      protected String name
    • icon

      protected Icon icon
  • Constructor Details

    • TextBasedVertexStyle

      public TextBasedVertexStyle()
    • TextBasedVertexStyle

      public TextBasedVertexStyle(String name, Icon icon)
  • Method Details

    • clone

      public Object clone()
      Specified by:
      clone in interface Style
      Overrides:
      clone in class Object
    • paintGeometry

      protected void paintGeometry(org.locationtech.jts.geom.Geometry geometry, Graphics2D graphics, Viewport viewport) throws Exception
      Throws:
      Exception
    • paintLineString

      protected void paintLineString(org.locationtech.jts.geom.LineString lineString, Viewport viewport, Graphics2D graphics) throws Exception
      Parameters:
      lineString - has 2 or more points
      viewport - the viewport to paint the lineString to
      graphics - the graphic context
      Throws:
      Exception - if an Exception occurs during painting
    • paint

      protected abstract void paint(Point2D p0, org.locationtech.jts.geom.LineString line, int index, Viewport viewport, Graphics2D graphics) throws Exception
      Throws:
      Exception
    • paintPoint

      protected abstract void paintPoint(org.locationtech.jts.geom.Point point, Viewport viewport, Graphics2D graphics) throws Exception
      Throws:
      Exception
    • initialize

      public void initialize(Layer layer)
      Description copied from interface: Style
      Called before #paint is applied to each Feature.
      Specified by:
      initialize in interface Style
      Parameters:
      layer - the layer on which to apply this style
    • paint

      public void paint(Feature f, Graphics2D g, Viewport viewport) throws Exception
      Specified by:
      paint in interface Style
      Throws:
      Exception
    • setEnabled

      public void setEnabled(boolean enabled)
      Specified by:
      setEnabled in interface Style
    • isEnabled

      public boolean isEnabled()
      Specified by:
      isEnabled in interface Style
      Returns:
      false if #paint should not be called e.g. because vertices are not shown. Don't need to check whether the layer is visible.
    • getName

      public String getName()
      Description copied from interface: ChoosableStyle
      For display.
      Specified by:
      getName in interface ChoosableStyle
      Returns:
      the name of this Style
    • getIcon

      public Icon getIcon()
      Description copied from interface: ChoosableStyle
      For display. 20 x 20 pixels.
      Specified by:
      getIcon in interface ChoosableStyle
      Returns:
      an Icon representing this Style