Class DefaultFigureStyle
- java.lang.Object
-
- com.bc.ceres.binding.PropertyContainer
-
- com.bc.ceres.swing.figure.support.DefaultFigureStyle
-
- All Implemented Interfaces:
PropertyChangeEmitter
,PropertySet
,FigureStyle
public class DefaultFigureStyle extends PropertyContainer implements FigureStyle
-
-
Field Summary
Fields Modifier and Type Field Description static PropertyDescriptor
FILL_COLOR
static PropertyDescriptor
FILL_OPACITY
static PropertyDescriptor
STROKE_COLOR
static PropertyDescriptor
STROKE_OPACITY
static PropertyDescriptor
STROKE_WIDTH
static PropertyDescriptor
SYMBOL_IMAGE
static PropertyDescriptor
SYMBOL_NAME
static PropertyDescriptor
SYMBOL_REF_X
static PropertyDescriptor
SYMBOL_REF_Y
-
Constructor Summary
Constructors Constructor Description DefaultFigureStyle()
DefaultFigureStyle(FigureStyle parentStyle)
DefaultFigureStyle(String name)
DefaultFigureStyle(String name, FigureStyle parentStyle)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FigureStyle
createFromCss(String css)
static FigureStyle
createLineStyle(Paint strokePaint)
static FigureStyle
createLineStyle(Paint strokePaint, Stroke stroke)
static FigureStyle
createPointStyle(Symbol symbol)
static FigureStyle
createPointStyle(Symbol symbol, Paint fillPaint, Paint strokePaint, Stroke stroke)
static FigureStyle
createPointStyle(Symbol symbol, Paint strokePaint, Stroke stroke)
static DefaultFigureStyle
createPolygonStyle(Paint fillPaint)
static DefaultFigureStyle
createPolygonStyle(Paint fillPaint, Paint strokePaint)
static DefaultFigureStyle
createPolygonStyle(Paint fillPaint, Paint strokePaint, Stroke stroke)
boolean
equals(Object obj)
void
fromCssString(String css)
Color
getFillColor()
double
getFillOpacity()
Paint
getFillPaint()
Gets the effective fill paint used for drawing the interior of a polygonal shape.String
getName()
Stroke
getStroke()
Gets the effective stroke style used for drawing the exterior of a lineal or polygonal shape.Stroke
getStroke(double scale)
Gets the effective stroke style used for drawing the exterior of a lineal or polygonal shape.Color
getStrokeColor()
double
getStrokeOpacity()
Paint
getStrokePaint()
Gets the effective stroke paint used for drawing the exterior of a lineal or polygonal shape.double
getStrokeWidth()
Symbol
getSymbol()
Gets the effective point symbol used for drawing of points figures.String
getSymbolImagePath()
String
getSymbolName()
double
getSymbolRefX()
double
getSymbolRefY()
<T> T
getValue(String name)
Gets the value of the named property.void
setFillColor(Color fillColor)
void
setFillOpacity(double opacity)
void
setStrokeColor(Color strokeColor)
void
setStrokeOpacity(double opacity)
void
setStrokeWidth(double width)
void
setSymbolImagePath(String symbolName)
void
setSymbolName(String symbolName)
void
setSymbolRefX(double refX)
void
setSymbolRefY(double refY)
void
setValue(String name, Object value)
Sets the value of the named property.String
toCssString()
-
Methods inherited from class com.bc.ceres.binding.PropertyContainer
addProperties, addProperty, addPropertyChangeListener, addPropertyChangeListener, createForFields, createMapBacked, createMapBacked, createMapBacked, createMapBacked, createObjectBacked, createObjectBacked, createObjectBacked, createValueBacked, createValueBacked, getDescriptor, getProperties, getProperty, isPropertyDefined, removeProperties, removeProperty, removePropertyChangeListener, removePropertyChangeListener, setDefaultValues
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.bc.ceres.binding.PropertyChangeEmitter
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
-
Methods inherited from interface com.bc.ceres.binding.PropertySet
addProperties, addProperty, getDescriptor, getProperties, getProperty, isPropertyDefined, removeProperties, removeProperty, setDefaultValues
-
-
-
-
Field Detail
-
FILL_COLOR
public static final PropertyDescriptor FILL_COLOR
-
FILL_OPACITY
public static final PropertyDescriptor FILL_OPACITY
-
STROKE_COLOR
public static final PropertyDescriptor STROKE_COLOR
-
STROKE_OPACITY
public static final PropertyDescriptor STROKE_OPACITY
-
STROKE_WIDTH
public static final PropertyDescriptor STROKE_WIDTH
-
SYMBOL_NAME
public static final PropertyDescriptor SYMBOL_NAME
-
SYMBOL_IMAGE
public static final PropertyDescriptor SYMBOL_IMAGE
-
SYMBOL_REF_X
public static final PropertyDescriptor SYMBOL_REF_X
-
SYMBOL_REF_Y
public static final PropertyDescriptor SYMBOL_REF_Y
-
-
Constructor Detail
-
DefaultFigureStyle
public DefaultFigureStyle()
-
DefaultFigureStyle
public DefaultFigureStyle(String name)
-
DefaultFigureStyle
public DefaultFigureStyle(FigureStyle parentStyle)
-
DefaultFigureStyle
public DefaultFigureStyle(String name, FigureStyle parentStyle)
-
-
Method Detail
-
createFromCss
public static FigureStyle createFromCss(String css)
-
createPointStyle
public static FigureStyle createPointStyle(Symbol symbol)
-
createPointStyle
public static FigureStyle createPointStyle(Symbol symbol, Paint strokePaint, Stroke stroke)
-
createPointStyle
public static FigureStyle createPointStyle(Symbol symbol, Paint fillPaint, Paint strokePaint, Stroke stroke)
-
createLineStyle
public static FigureStyle createLineStyle(Paint strokePaint)
-
createLineStyle
public static FigureStyle createLineStyle(Paint strokePaint, Stroke stroke)
-
createPolygonStyle
public static DefaultFigureStyle createPolygonStyle(Paint fillPaint)
-
createPolygonStyle
public static DefaultFigureStyle createPolygonStyle(Paint fillPaint, Paint strokePaint)
-
createPolygonStyle
public static DefaultFigureStyle createPolygonStyle(Paint fillPaint, Paint strokePaint, Stroke stroke)
-
getName
public String getName()
- Specified by:
getName
in interfaceFigureStyle
-
getValue
public <T> T getValue(String name)
Description copied from interface:PropertySet
Gets the value of the named property.- Specified by:
getValue
in interfacePropertySet
- Overrides:
getValue
in classPropertyContainer
- Parameters:
name
- The property name.- Returns:
- The property value or
null
if a property with the given name does not exist.
-
setValue
public void setValue(String name, Object value) throws IllegalArgumentException
Description copied from interface:PropertySet
Sets the value of the named property.- Specified by:
setValue
in interfacePropertySet
- Overrides:
setValue
in classPropertyContainer
- Parameters:
name
- The property name.value
- The new property value.- Throws:
IllegalArgumentException
- If the value is illegal. The cause will always be aValidationException
.
-
getSymbol
public Symbol getSymbol()
Description copied from interface:FigureStyle
Gets the effective point symbol used for drawing of points figures.- Specified by:
getSymbol
in interfaceFigureStyle
- Returns:
- The effective point symbol used for drawing.
-
getSymbolName
public String getSymbolName()
- Specified by:
getSymbolName
in interfaceFigureStyle
-
setSymbolName
public void setSymbolName(String symbolName)
-
getSymbolImagePath
public String getSymbolImagePath()
- Specified by:
getSymbolImagePath
in interfaceFigureStyle
-
setSymbolImagePath
public void setSymbolImagePath(String symbolName)
-
getSymbolRefX
public double getSymbolRefX()
- Specified by:
getSymbolRefX
in interfaceFigureStyle
-
setSymbolRefX
public void setSymbolRefX(double refX)
-
getSymbolRefY
public double getSymbolRefY()
- Specified by:
getSymbolRefY
in interfaceFigureStyle
-
setSymbolRefY
public void setSymbolRefY(double refY)
-
getStroke
public Stroke getStroke()
Description copied from interface:FigureStyle
Gets the effective stroke style used for drawing the exterior of a lineal or polygonal shape. The effective paint may result from a number of different style properties.- Specified by:
getStroke
in interfaceFigureStyle
- Returns:
- The effective stroke style used for drawing.
-
getStroke
public Stroke getStroke(double scale)
Description copied from interface:FigureStyle
Gets the effective stroke style used for drawing the exterior of a lineal or polygonal shape. The effective paint may result from a number of different style properties.- Specified by:
getStroke
in interfaceFigureStyle
- Parameters:
scale
- The current model-to-view scaling.- Returns:
- The effective stroke style used for drawing.
-
getStrokePaint
public Paint getStrokePaint()
Gets the effective stroke paint used for drawing the exterior of a lineal or polygonal shape. The effective paint may result from a number of different style properties.- Specified by:
getStrokePaint
in interfaceFigureStyle
- Returns:
- The effective stroke paint used for drawing.
-
getStrokeColor
public Color getStrokeColor()
- Specified by:
getStrokeColor
in interfaceFigureStyle
-
setStrokeColor
public void setStrokeColor(Color strokeColor)
-
getStrokeOpacity
public double getStrokeOpacity()
- Specified by:
getStrokeOpacity
in interfaceFigureStyle
-
setStrokeOpacity
public void setStrokeOpacity(double opacity)
-
getStrokeWidth
public double getStrokeWidth()
- Specified by:
getStrokeWidth
in interfaceFigureStyle
-
setStrokeWidth
public void setStrokeWidth(double width)
-
getFillPaint
public Paint getFillPaint()
Gets the effective fill paint used for drawing the interior of a polygonal shape. The effective paint may result from a number of different style properties.- Specified by:
getFillPaint
in interfaceFigureStyle
- Returns:
- The effective fill paint used for drawing.
-
getFillColor
public Color getFillColor()
- Specified by:
getFillColor
in interfaceFigureStyle
-
setFillColor
public void setFillColor(Color fillColor)
-
getFillOpacity
public double getFillOpacity()
- Specified by:
getFillOpacity
in interfaceFigureStyle
-
setFillOpacity
public void setFillOpacity(double opacity)
-
toCssString
public String toCssString()
- Specified by:
toCssString
in interfaceFigureStyle
-
fromCssString
public void fromCssString(String css)
- Specified by:
fromCssString
in interfaceFigureStyle
-
-