com.vividsolutions.jump.workbench.ui.renderer.style
Class BasicStyle

java.lang.Object
  extended by com.vividsolutions.jump.workbench.ui.renderer.style.BasicStyle
All Implemented Interfaces:
Style, java.lang.Cloneable

public class BasicStyle
extends java.lang.Object
implements Style


Constructor Summary
BasicStyle()
           
BasicStyle(java.awt.Color fillColor)
           
 
Method Summary
 java.lang.Object clone()
           
 int getAlpha()
           
 java.awt.Color getFillColor()
           
 java.awt.Paint getFillPattern()
           
 java.awt.Color getLineColor()
           
 java.lang.String getLinePattern()
           
 java.awt.BasicStroke getLineStroke()
           
 int getLineWidth()
           
 void initialize(Layer layer)
          Called before #paint is applied to each Feature.
 boolean isEnabled()
           
 boolean isRenderingFill()
           
 boolean isRenderingFillPattern()
           
 boolean isRenderingLine()
           
 boolean isRenderingLinePattern()
           
 void paint(Feature f, java.awt.Graphics2D g, Viewport viewport)
           
 void setAlpha(int alpha)
           
 void setEnabled(boolean enabled)
           
 void setFillColor(java.awt.Color fillColor)
           
 BasicStyle setFillPattern(java.awt.Paint fillPattern)
          Remember to call #setRenderingFillPattern(true).
 void setLineColor(java.awt.Color lineColor)
           
 BasicStyle setLinePattern(java.lang.String linePattern)
          The actual dash pattern used internally will be the given dash pattern multiplied by the line length.
 void setLineWidth(int lineWidth)
           
 void setRenderingFill(boolean renderingFill)
           
 BasicStyle setRenderingFillPattern(boolean renderingFillPattern)
           
 void setRenderingLine(boolean renderingLine)
           
 BasicStyle setRenderingLinePattern(boolean renderingLinePattern)
           
static float[] toArray(java.lang.String linePattern, float lineWidth)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicStyle

public BasicStyle(java.awt.Color fillColor)

BasicStyle

public BasicStyle()
Method Detail

isRenderingFillPattern

public boolean isRenderingFillPattern()

setRenderingFillPattern

public BasicStyle setRenderingFillPattern(boolean renderingFillPattern)

getFillPattern

public java.awt.Paint getFillPattern()

setFillPattern

public BasicStyle setFillPattern(java.awt.Paint fillPattern)
Remember to call #setRenderingFillPattern(true).


getLinePattern

public java.lang.String getLinePattern()

setLinePattern

public BasicStyle setLinePattern(java.lang.String linePattern)
The actual dash pattern used internally will be the given dash pattern multiplied by the line length. Remember to call #setRenderingLinePattern(true).

Parameters:
linePattern - e.g. "5,2,3,2"

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

paint

public void paint(Feature f,
                  java.awt.Graphics2D g,
                  Viewport viewport)
           throws java.awt.geom.NoninvertibleTransformException
Specified by:
paint in interface Style
Throws:
java.awt.geom.NoninvertibleTransformException

clone

public java.lang.Object clone()
Specified by:
clone in interface Style
Overrides:
clone in class java.lang.Object

isRenderingFill

public boolean isRenderingFill()

isRenderingLine

public boolean isRenderingLine()

isRenderingLinePattern

public boolean isRenderingLinePattern()

setRenderingFill

public void setRenderingFill(boolean renderingFill)

setRenderingLine

public void setRenderingLine(boolean renderingLine)

setRenderingLinePattern

public BasicStyle setRenderingLinePattern(boolean renderingLinePattern)

setFillColor

public void setFillColor(java.awt.Color fillColor)

setLineColor

public void setLineColor(java.awt.Color lineColor)

setLineWidth

public void setLineWidth(int lineWidth)

toArray

public static float[] toArray(java.lang.String linePattern,
                              float lineWidth)

getAlpha

public int getAlpha()
Returns:
0-255 (255 is opaque)

getFillColor

public java.awt.Color getFillColor()

getLineColor

public java.awt.Color getLineColor()

getLineWidth

public int getLineWidth()

setAlpha

public void setAlpha(int alpha)
Parameters:
alpha - 0-255 (255 is opaque)

getLineStroke

public java.awt.BasicStroke getLineStroke()