Package snap.gfx
Class Border
java.lang.Object
snap.props.PropObject
snap.gfx.Border
- All Implemented Interfaces:
Cloneable
,PropChange.DoChange
,XMLArchiver.Archivable
- Direct Known Subclasses:
Borders.BevelBorder
,Borders.EtchBorder
,Borders.LineBorder
A class to represent a painted stroke.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
Fields inherited from class snap.props.PropObject
_pcs, EMPTY_OBJECT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Border
Returns a simple black border.protected Border
clone()
Standard clone implementation - only used internally (by copyFor methods).Returns a border with given insets.copyForColor
(Color aColor) Copies border for given color.copyForInsets
(Insets theIns) Copies border for given insets.copyForStroke
(Stroke aStroke) Copies border for given stroke.copyForStrokeWidth
(double aWidth) Copies border for given stroke width.protected Insets
Creates the insets.static Borders.LineBorder
createLineBorder
(Color aColor, double aWidth) Creates a line border for given color and width.static Borders.BevelBorder
Creates a beveled border.static Border
Returns a simple empty border.boolean
Standard equals implementation.fromXML
(XMLArchiver anArchiver, XMLElement anElement) XML Unarchival.getColor()
Returns the basic color of the border.Returns the insets.getName()
Returns the name for border.getPropValue
(String aPropName) Returns a value for a key.Returns the stroke of the border (maybe not be entirely accurate for fancy strokes).double
getWidth()
Returns the basic width of the border.protected void
Override to support props for this class.boolean
Returns whether the border paints above view.static Border
Creates a border from given string.void
Paint border.void
setPropValue
(String aPropName, Object aValue) Sets a value for a key.toXML
(XMLArchiver anArchiver) XML Archival.Methods inherited from class snap.props.PropObject
addDeepChangeListener, addPropChangeListener, addPropChangeListener, firePropChange, firePropChange, firePropChange, getPropDefault, getPropForName, getPropParent, getPropSet, getPropsForArchival, getPropsForArchivalExtra, getPropsString, isPropDefault, processPropChange, removeDeepChangeListener, removePropChangeListener, removePropChangeListener, setPropsString, setPropValues, toString, toStringProps
-
Field Details
-
Stroke_Prop
- See Also:
-
Color_Prop
- See Also:
-
Insets_Prop
- See Also:
-
PaintAbove_Prop
- See Also:
-
-
Constructor Details
-
Border
public Border()
-
-
Method Details
-
getInsets
Returns the insets. -
createInsets
Creates the insets. -
getColor
Returns the basic color of the border. -
getWidth
public double getWidth()Returns the basic width of the border. -
getStroke
Returns the stroke of the border (maybe not be entirely accurate for fancy strokes). -
getName
Returns the name for border. -
isPaintAbove
public boolean isPaintAbove()Returns whether the border paints above view. -
paint
Paint border. -
copyForColor
Copies border for given color. -
copyForStroke
Copies border for given stroke. -
copyForStrokeWidth
Copies border for given stroke width. -
copyForInsets
Copies border for given insets. -
copyFor
Returns a border with given insets. -
initProps
Override to support props for this class.- Overrides:
initProps
in classPropObject
-
getPropValue
Returns a value for a key.- Overrides:
getPropValue
in classPropObject
-
setPropValue
Sets a value for a key.- Overrides:
setPropValue
in classPropObject
-
clone
Standard clone implementation - only used internally (by copyFor methods).- Overrides:
clone
in classPropObject
-
equals
Standard equals implementation. -
toXML
XML Archival.- Specified by:
toXML
in interfaceXMLArchiver.Archivable
-
fromXML
XML Unarchival.- Specified by:
fromXML
in interfaceXMLArchiver.Archivable
-
blackBorder
Returns a simple black border. -
emptyBorder
Returns a simple empty border. -
createLineBorder
Creates a line border for given color and width. -
createLoweredBevelBorder
Creates a beveled border. -
of
Creates a border from given string.
-