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 PropertyDescriptorFILL_COLORstatic PropertyDescriptorFILL_OPACITYstatic PropertyDescriptorSTROKE_COLORstatic PropertyDescriptorSTROKE_OPACITYstatic PropertyDescriptorSTROKE_WIDTHstatic PropertyDescriptorSYMBOL_IMAGEstatic PropertyDescriptorSYMBOL_NAMEstatic PropertyDescriptorSYMBOL_REF_Xstatic PropertyDescriptorSYMBOL_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 FigureStylecreateFromCss(String css)static FigureStylecreateLineStyle(Paint strokePaint)static FigureStylecreateLineStyle(Paint strokePaint, Stroke stroke)static FigureStylecreatePointStyle(Symbol symbol)static FigureStylecreatePointStyle(Symbol symbol, Paint fillPaint, Paint strokePaint, Stroke stroke)static FigureStylecreatePointStyle(Symbol symbol, Paint strokePaint, Stroke stroke)static DefaultFigureStylecreatePolygonStyle(Paint fillPaint)static DefaultFigureStylecreatePolygonStyle(Paint fillPaint, Paint strokePaint)static DefaultFigureStylecreatePolygonStyle(Paint fillPaint, Paint strokePaint, Stroke stroke)booleanequals(Object obj)voidfromCssString(String css)ColorgetFillColor()doublegetFillOpacity()PaintgetFillPaint()Gets the effective fill paint used for drawing the interior of a polygonal shape.StringgetName()StrokegetStroke()Gets the effective stroke style used for drawing the exterior of a lineal or polygonal shape.StrokegetStroke(double scale)Gets the effective stroke style used for drawing the exterior of a lineal or polygonal shape.ColorgetStrokeColor()doublegetStrokeOpacity()PaintgetStrokePaint()Gets the effective stroke paint used for drawing the exterior of a lineal or polygonal shape.doublegetStrokeWidth()SymbolgetSymbol()Gets the effective point symbol used for drawing of points figures.StringgetSymbolImagePath()StringgetSymbolName()doublegetSymbolRefX()doublegetSymbolRefY()<T> TgetValue(String name)Gets the value of the named property.voidsetFillColor(Color fillColor)voidsetFillOpacity(double opacity)voidsetStrokeColor(Color strokeColor)voidsetStrokeOpacity(double opacity)voidsetStrokeWidth(double width)voidsetSymbolImagePath(String symbolName)voidsetSymbolName(String symbolName)voidsetSymbolRefX(double refX)voidsetSymbolRefY(double refY)voidsetValue(String name, Object value)Sets the value of the named property.StringtoCssString()-
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:
getNamein interfaceFigureStyle
-
getValue
public <T> T getValue(String name)
Description copied from interface:PropertySetGets the value of the named property.- Specified by:
getValuein interfacePropertySet- Overrides:
getValuein classPropertyContainer- Parameters:
name- The property name.- Returns:
- The property value or
nullif a property with the given name does not exist.
-
setValue
public void setValue(String name, Object value) throws IllegalArgumentException
Description copied from interface:PropertySetSets the value of the named property.- Specified by:
setValuein interfacePropertySet- Overrides:
setValuein 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:FigureStyleGets the effective point symbol used for drawing of points figures.- Specified by:
getSymbolin interfaceFigureStyle- Returns:
- The effective point symbol used for drawing.
-
getSymbolName
public String getSymbolName()
- Specified by:
getSymbolNamein interfaceFigureStyle
-
setSymbolName
public void setSymbolName(String symbolName)
-
getSymbolImagePath
public String getSymbolImagePath()
- Specified by:
getSymbolImagePathin interfaceFigureStyle
-
setSymbolImagePath
public void setSymbolImagePath(String symbolName)
-
getSymbolRefX
public double getSymbolRefX()
- Specified by:
getSymbolRefXin interfaceFigureStyle
-
setSymbolRefX
public void setSymbolRefX(double refX)
-
getSymbolRefY
public double getSymbolRefY()
- Specified by:
getSymbolRefYin interfaceFigureStyle
-
setSymbolRefY
public void setSymbolRefY(double refY)
-
getStroke
public Stroke getStroke()
Description copied from interface:FigureStyleGets 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:
getStrokein interfaceFigureStyle- Returns:
- The effective stroke style used for drawing.
-
getStroke
public Stroke getStroke(double scale)
Description copied from interface:FigureStyleGets 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:
getStrokein 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:
getStrokePaintin interfaceFigureStyle- Returns:
- The effective stroke paint used for drawing.
-
getStrokeColor
public Color getStrokeColor()
- Specified by:
getStrokeColorin interfaceFigureStyle
-
setStrokeColor
public void setStrokeColor(Color strokeColor)
-
getStrokeOpacity
public double getStrokeOpacity()
- Specified by:
getStrokeOpacityin interfaceFigureStyle
-
setStrokeOpacity
public void setStrokeOpacity(double opacity)
-
getStrokeWidth
public double getStrokeWidth()
- Specified by:
getStrokeWidthin 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:
getFillPaintin interfaceFigureStyle- Returns:
- The effective fill paint used for drawing.
-
getFillColor
public Color getFillColor()
- Specified by:
getFillColorin interfaceFigureStyle
-
setFillColor
public void setFillColor(Color fillColor)
-
getFillOpacity
public double getFillOpacity()
- Specified by:
getFillOpacityin interfaceFigureStyle
-
setFillOpacity
public void setFillOpacity(double opacity)
-
toCssString
public String toCssString()
- Specified by:
toCssStringin interfaceFigureStyle
-
fromCssString
public void fromCssString(String css)
- Specified by:
fromCssStringin interfaceFigureStyle
-
-