org.openjump.core.ui.plugin.tools
Class MeasurementStyle

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

public class MeasurementStyle
extends java.lang.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

Constructor Summary
MeasurementStyle()
           
 
Method Summary
 java.lang.Object clone()
           
 java.lang.String getAreaAttribute()
           
 java.lang.String getLengthAttribute()
           
 java.awt.Color getSummaryColor()
           
 java.awt.Font getSummaryFont()
           
 java.awt.Color getVertexFirstColor()
           
 java.lang.String getVertexFirstForm()
           
 int getVertexFirstSize()
           
 java.awt.Color getVertexFollowingColor()
           
 java.lang.String getVertexFollowingForm()
           
 int getVertexFollowingSize()
           
 java.awt.Font getVertexFont()
           
 java.awt.Color getVertexFontColor()
           
 void initialize(Layer layer)
          Called before #paint is applied to each Feature.
 boolean isEnabled()
           
 boolean isPaintSummaryArea()
           
 boolean isPaintSummaryLength()
           
 boolean isVertexPaint()
           
 boolean isVertexPaintDistance()
           
 void paint(Feature f, java.awt.Graphics2D g, Viewport viewport)
           
 void setAreaAttribute(java.lang.String areaAttribute)
           
 void setEnabled(boolean enabled)
           
 void setLengthAttribute(java.lang.String lengthAttribute)
           
 void setPaintSummaryArea(boolean paintSummaryArea)
           
 void setPaintSummaryLength(boolean paintSummary)
           
 void setSummaryColor(java.awt.Color summaryColor)
           
 void setSummaryFont(java.awt.Font font)
           
 void setVertexFirstColor(java.awt.Color vertexFirstColor)
           
 void setVertexFirstForm(java.lang.String vertexFirstForm)
           
 void setVertexFirstSize(int vertexFirstSize)
           
 void setVertexFollowingColor(java.awt.Color vertexFollowingColor)
           
 void setVertexFollowingForm(java.lang.String vertexFollowingForm)
           
 void setVertexFollowingSize(int vertexFollowingSize)
           
 void setVertexFont(java.awt.Font vertexFont)
           
 void setVertexFontColor(java.awt.Color vertexFontColor)
           
 void setVertexPaint(boolean vertexPaint)
           
 void setVertexPaintDistance(boolean vertexPaintDistance)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MeasurementStyle

public MeasurementStyle()
Method Detail

paint

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

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 java.lang.Object clone()
Specified by:
clone in interface Style
Overrides:
clone in class java.lang.Object

getAreaAttribute

public java.lang.String getAreaAttribute()
Returns:
the areaAttribute

setAreaAttribute

public void setAreaAttribute(java.lang.String areaAttribute)
Parameters:
areaAttribute - the areaAttribute to set

getLengthAttribute

public java.lang.String getLengthAttribute()
Returns:
the lengthAttribute

setLengthAttribute

public void setLengthAttribute(java.lang.String lengthAttribute)
Parameters:
lengthAttribute - the lengthAttribute to set

getSummaryFont

public java.awt.Font getSummaryFont()
Returns:
the font

setSummaryFont

public void setSummaryFont(java.awt.Font font)
Parameters:
font - the font to set

getSummaryColor

public java.awt.Color getSummaryColor()
Returns:
the summaryColor

setSummaryColor

public void setSummaryColor(java.awt.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 java.awt.Font getVertexFont()
Returns:
the vertexFont

setVertexFont

public void setVertexFont(java.awt.Font vertexFont)
Parameters:
vertexFont - the vertexFont to set

getVertexFontColor

public java.awt.Color getVertexFontColor()
Returns:
the vertexFontColor

setVertexFontColor

public void setVertexFontColor(java.awt.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 java.awt.Color getVertexFirstColor()
Returns:
the vertexFirstColor

setVertexFirstColor

public void setVertexFirstColor(java.awt.Color vertexFirstColor)
Parameters:
vertexFirstColor - the vertexFirstColor to set

getVertexFirstForm

public java.lang.String getVertexFirstForm()
Returns:
the vertexFirstForm

setVertexFirstForm

public void setVertexFirstForm(java.lang.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 java.awt.Color getVertexFollowingColor()
Returns:
the vertexFollowingColor

setVertexFollowingColor

public void setVertexFollowingColor(java.awt.Color vertexFollowingColor)
Parameters:
vertexFollowingColor - the vertexFollowingColor to set

getVertexFollowingForm

public java.lang.String getVertexFollowingForm()
Returns:
the vertexFollowingForm

setVertexFollowingForm

public void setVertexFollowingForm(java.lang.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