Class MeasurementStyle

java.lang.Object
org.openjump.core.ui.plugin.tools.MeasurementStyle
All Implemented Interfaces:
Style, Cloneable

public class MeasurementStyle extends Object implements Style
A special Style for usage in the AdvancedMeasureTool. This Style paints the area and distance in the center of the Geometry's Envelope. At every vertex the actual distance will be painted.
Author:
Matthias Scholz <ms@jammerhund.de>
  • Constructor Details

    • MeasurementStyle

      public MeasurementStyle()
  • Method Details

    • paint

      public void paint(Feature f, Graphics2D g, Viewport viewport) throws Exception
      Specified by:
      paint in interface Style
      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
    • 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.
    • clone

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

      public String getAreaAttribute()
      Returns:
      the areaAttribute
    • setAreaAttribute

      public void setAreaAttribute(String areaAttribute)
      Parameters:
      areaAttribute - the areaAttribute to set
    • getLengthAttribute

      public String getLengthAttribute()
      Returns:
      the lengthAttribute
    • setLengthAttribute

      public void setLengthAttribute(String lengthAttribute)
      Parameters:
      lengthAttribute - the lengthAttribute to set
    • getSummaryFont

      public Font getSummaryFont()
      Returns:
      the font
    • setSummaryFont

      public void setSummaryFont(Font font)
      Parameters:
      font - the font to set
    • getSummaryColor

      public Color getSummaryColor()
      Returns:
      the summaryColor
    • setSummaryColor

      public void setSummaryColor(Color summaryColor)
      Parameters:
      summaryColor - the summaryColor to set
    • isPaintSummaryLength

      public boolean isPaintSummaryLength()
      Returns:
      the paintSummary
    • setPaintSummaryLength

      public void setPaintSummaryLength(boolean paintSummary)
      Parameters:
      paintSummary - the paintSummary to set
    • isPaintSummaryArea

      public boolean isPaintSummaryArea()
      Returns:
      the paintSummaryArea
    • setPaintSummaryArea

      public void setPaintSummaryArea(boolean paintSummaryArea)
      Parameters:
      paintSummaryArea - the paintSummaryArea to set
    • getVertexFont

      public Font getVertexFont()
      Returns:
      the vertexFont
    • setVertexFont

      public void setVertexFont(Font vertexFont)
      Parameters:
      vertexFont - the vertexFont to set
    • getVertexFontColor

      public Color getVertexFontColor()
      Returns:
      the vertexFontColor
    • setVertexFontColor

      public void setVertexFontColor(Color vertexFontColor)
      Parameters:
      vertexFontColor - the vertexFontColor to set
    • isVertexPaintDistance

      public boolean isVertexPaintDistance()
      Returns:
      the vertexPaintDistance
    • setVertexPaintDistance

      public void setVertexPaintDistance(boolean vertexPaintDistance)
      Parameters:
      vertexPaintDistance - the vertexPaintDistance to set
    • isVertexPaint

      public boolean isVertexPaint()
      Returns:
      the vertexPaint
    • setVertexPaint

      public void setVertexPaint(boolean vertexPaint)
      Parameters:
      vertexPaint - the vertexPaint to set
    • getVertexFirstColor

      public Color getVertexFirstColor()
      Returns:
      the vertexFirstColor
    • setVertexFirstColor

      public void setVertexFirstColor(Color vertexFirstColor)
      Parameters:
      vertexFirstColor - the vertexFirstColor to set
    • getVertexFirstForm

      public String getVertexFirstForm()
      Returns:
      the vertexFirstForm
    • setVertexFirstForm

      public void setVertexFirstForm(String vertexFirstForm)
      Parameters:
      vertexFirstForm - the vertexFirstForm to set
    • getVertexFirstSize

      public int getVertexFirstSize()
      Returns:
      the vertexFirstSize
    • setVertexFirstSize

      public void setVertexFirstSize(int vertexFirstSize)
      Parameters:
      vertexFirstSize - the vertexFirstSize to set
    • getVertexFollowingColor

      public Color getVertexFollowingColor()
      Returns:
      the vertexFollowingColor
    • setVertexFollowingColor

      public void setVertexFollowingColor(Color vertexFollowingColor)
      Parameters:
      vertexFollowingColor - the vertexFollowingColor to set
    • getVertexFollowingForm

      public String getVertexFollowingForm()
      Returns:
      the vertexFollowingForm
    • setVertexFollowingForm

      public void setVertexFollowingForm(String vertexFollowingForm)
      Parameters:
      vertexFollowingForm - the vertexFollowingForm to set
    • getVertexFollowingSize

      public int getVertexFollowingSize()
      Returns:
      the vertexFollowingSize
    • setVertexFollowingSize

      public void setVertexFollowingSize(int vertexFollowingSize)
      Parameters:
      vertexFollowingSize - the vertexFollowingSize to set
    • isVertexPaintDistanceRelative

      public boolean isVertexPaintDistanceRelative()
      Returns:
      the vertexPaintDistanceRelative
    • setVertexPaintDistanceRelative

      public void setVertexPaintDistanceRelative(boolean vertexPaintDistanceRelative)
      Parameters:
      vertexPaintDistanceRelative - the vertexPaintDistanceRelative to set