Package repast.simphony.gis.styleEditor
Class StylePreviewFactory
java.lang.Object
repast.simphony.gis.styleEditor.StylePreviewFactory
Factory for creating style preview labels that are used in GUI elements to
show how style agents will appear. Currently the the factory supports
creation of two size: regular and small. Regular sized previews show how
the styles will actually appear in the display with respect to size, while
the small version is just a scaled down version that can easily fit in GUI
elements like buttons or table cells.
- Author:
- Eric Tatara, Nick Collier
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Color
static final double
static final double
static final Color
static final String
static final double
static final double
static final double
static final Color
static final double
static final double
static final Color
static final double
static final Color
static final double
static final double
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Icon
createIcon
(org.geotools.styling.Rule rule) Create an Icon instance from a Rule.static Icon
createIcon
(org.geotools.styling.Style style) Create an Icon instance from a Style.static PreviewLabel
createPreviewLabel
(org.geotools.styling.Rule rule) Creates an instance of a PreviewLabel using the Rule properties.static Icon
createSmallIcon
(org.geotools.styling.Rule rule) Create an small Icon instance from a Rule.static <T> T
evaluateExpression
(org.opengis.filter.expression.Expression expr, T defaultValue, Class<T> type) Returns either the evaluated expression if the expression is a Literal, or the default value for other types of expression, such as property expressions (which are the property name to be evaluated at run time).static org.geotools.styling.Style
getDefaultStyle
(GeometryUtil.GeometryType geomType) Provide a default style for the style editors.
-
Field Details
-
DEFAULT_POINT_MARK
- See Also:
-
DEFAULT_POINT_SIZE
public static final double DEFAULT_POINT_SIZE- See Also:
-
DEFAULT_POINT_ROTATION
public static final double DEFAULT_POINT_ROTATION- See Also:
-
DEFAULT_POINT_FILL
-
DEFAULT_POINT_OPACITY
public static final double DEFAULT_POINT_OPACITY- See Also:
-
DEFAULT_POINT_STROKE_WIDTH
public static final double DEFAULT_POINT_STROKE_WIDTH- See Also:
-
DEFAULT_POINT_STROKE_COLOR
-
DEFAULT_POINT_STROKE_OPACITY
public static final double DEFAULT_POINT_STROKE_OPACITY- See Also:
-
DEFAULT_LINE_STROKE_WIDTH
public static final double DEFAULT_LINE_STROKE_WIDTH- See Also:
-
DEFAULT_LINE_STROKE_COLOR
-
DEFAULT_LINE_STROKE_OPACITY
public static final double DEFAULT_LINE_STROKE_OPACITY- See Also:
-
DEFAULT_POLY_FILL
-
DEFAULT_POLY_OPACITY
public static final double DEFAULT_POLY_OPACITY- See Also:
-
DEFAULT_POLY_STROKE_WIDTH
public static final double DEFAULT_POLY_STROKE_WIDTH- See Also:
-
DEFAULT_POLY_STROKE_COLOR
-
DEFAULT_POLY_STROKE_OPACITY
public static final double DEFAULT_POLY_STROKE_OPACITY- See Also:
-
-
Constructor Details
-
StylePreviewFactory
public StylePreviewFactory()
-
-
Method Details
-
createPreviewLabel
Creates an instance of a PreviewLabel using the Rule properties.- Parameters:
rule
- the Rule used to create the PreviewLabel- Returns:
- the new PrviewLabel
-
createIcon
Create an Icon instance from a Style. Useful for creating JLabel Icons for GUI components.- Parameters:
style
- the Style used to create the Icon- Returns:
- the Icon
-
createIcon
Create an Icon instance from a Rule. Useful for creating JLabel Icons for GUI components.- Parameters:
rule
- the Rule used to create the Icon- Returns:
- the Icon
-
createSmallIcon
Create an small Icon instance from a Rule. Useful for creating JLabel Icons for GUI components that require small icons.- Parameters:
rule
- the Rule used to create the Icon- Returns:
- the Icon
-
getDefaultStyle
Provide a default style for the style editors.- Parameters:
geomType
- the geometry type for the selected agent class.- Returns:
- the default style for the geometry type.
-
evaluateExpression
public static <T> T evaluateExpression(org.opengis.filter.expression.Expression expr, T defaultValue, Class<T> type) Returns either the evaluated expression if the expression is a Literal, or the default value for other types of expression, such as property expressions (which are the property name to be evaluated at run time).- Parameters:
expr
- the Expression to evaluatedefaultValue
- the default value to use when the expression is not a Literaltype
- the class of the Expression literal- Returns:
- the evaluated expression
-