public class BasicStyle extends java.lang.Object implements Style, SLDImporter.StrokeFillStyle, AlphaSetting
Modifier and Type | Field and Description |
---|---|
static java.awt.Color |
DEFAULT_FILL_COLOR |
static java.awt.BasicStroke |
DEFAULT_FILL_STROKE |
static java.awt.Color |
DEFAULT_LINE_COLOR |
static java.lang.String |
RGB_ATTRIBUTE_NAME |
Constructor and Description |
---|
BasicStyle() |
BasicStyle(java.awt.Color fillColor) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Uses Object.clone() method which performs a shallow copy of this object,
creating a new instance of the same class and copying attribute values
of this object to the clone.
|
int |
getAlpha() |
java.awt.Color |
getFeatureColor(Feature f)
- Giuseppe Aruta 11-June - 2012 - added code from SkyJUMP to enable color chooser plugIn -
- Original comments from SkyJUMP developers -
Looks for an Attriubte field that contains the RGB color code and returns
it or null if the RGB hex string is empty or ill-formed.
|
java.awt.Color |
getFillColor() |
java.awt.Paint |
getFillPattern() |
java.awt.Color |
getLineColor() |
java.lang.String |
getLinePattern() |
java.awt.BasicStroke |
getLineStroke() |
int |
getLineWidth() |
boolean |
getRenderingVertices() |
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 |
setFractionalLineWidth(float lineWidth) |
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) |
void |
setRenderingVertices(boolean renderingVertices) |
static float[] |
toArray(java.lang.String linePattern,
float lineWidth) |
public static final java.lang.String RGB_ATTRIBUTE_NAME
public static final java.awt.Color DEFAULT_FILL_COLOR
public static final java.awt.Color DEFAULT_LINE_COLOR
public static final java.awt.BasicStroke DEFAULT_FILL_STROKE
public BasicStyle(java.awt.Color fillColor)
public BasicStyle()
public boolean isRenderingFillPattern()
public BasicStyle setRenderingFillPattern(boolean renderingFillPattern)
public java.awt.Paint getFillPattern()
public BasicStyle setFillPattern(java.awt.Paint fillPattern)
public java.lang.String getLinePattern()
public boolean getRenderingVertices()
public void setRenderingVertices(boolean renderingVertices)
public BasicStyle setLinePattern(java.lang.String linePattern)
setLinePattern
in interface SLDImporter.StrokeStyle
linePattern
- e.g. "5,2,3,2"public void initialize(Layer layer)
Style
initialize
in interface Style
public void setEnabled(boolean enabled)
setEnabled
in interface Style
public boolean isEnabled()
public void paint(Feature f, java.awt.Graphics2D g, Viewport viewport) throws java.lang.Exception
public java.lang.Object clone()
public boolean isRenderingFill()
public boolean isRenderingLine()
public boolean isRenderingLinePattern()
public void setRenderingFill(boolean renderingFill)
public void setRenderingLine(boolean renderingLine)
public BasicStyle setRenderingLinePattern(boolean renderingLinePattern)
setRenderingLinePattern
in interface SLDImporter.StrokeStyle
public void setFillColor(java.awt.Color fillColor)
setFillColor
in interface SLDImporter.FillStyle
public void setLineColor(java.awt.Color lineColor)
setLineColor
in interface SLDImporter.StrokeStyle
public void setLineWidth(int lineWidth)
setLineWidth
in interface SLDImporter.StrokeStyle
public void setFractionalLineWidth(float lineWidth)
public static float[] toArray(java.lang.String linePattern, float lineWidth)
public int getAlpha()
getAlpha
in interface AlphaSetting
public java.awt.Color getFillColor()
public java.awt.Color getLineColor()
public int getLineWidth()
public void setAlpha(int alpha)
setAlpha
in interface AlphaSetting
setAlpha
in interface SLDImporter.FillStyle
setAlpha
in interface SLDImporter.StrokeStyle
alpha
- 0-255 (255 is opaque)public java.awt.BasicStroke getLineStroke()
public java.awt.Color getFeatureColor(Feature f)
f
- the Feature
containing the RGB
Attribute to be parsed.Color
represented by the R_B_G hex value with
the current Alpha value inserted.
Warning: returns null in many "normal" cases.