|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.batik.bridge.PaintServer
A collection of utility methods to deliver java.awt.Paint, java.awt.Stroke objects that could be used to paint a shape. This class also provides additional methods the deliver SVG Paint using the ShapePainter interface.
Fields inherited from interface org.apache.batik.bridge.ErrorConstants |
ERR_ATTRIBUTE_MISSING, ERR_ATTRIBUTE_VALUE_MALFORMED, ERR_CSS_LENGTH_NEGATIVE, ERR_CSS_URI_BAD_TARGET, ERR_LENGTH_NEGATIVE, ERR_URI_BAD_TARGET, ERR_URI_IMAGE_INVALID, ERR_URI_IO, ERR_URI_MALFORMED, ERR_URI_REFERENCE_A_DOCUMENT, ERR_URI_UNSECURE, ERR_XLINK_HREF_CIRCULAR_DEPENDENCIES, MSG_BROKEN_LINK_TITLE |
Constructor Summary | |
protected |
PaintServer()
No instance of this class is required. |
Method Summary | |
static java.awt.Color |
convertColor(Value c,
float opacity)
Converts the given Value and opacity to a Color object. |
static ShapePainter |
convertFillAndStroke(Element e,
ShapeNode node,
BridgeContext ctx)
Returns a ShapePainter defined on the specified element and for the specified shape node, and using the specified bridge context. |
static java.awt.Paint |
convertFillPaint(Element filledElement,
GraphicsNode filledNode,
BridgeContext ctx)
Converts for the specified element, its fill paint properties to a Paint object. |
static java.awt.Color |
convertICCColor(Element e,
ICCColor c,
float opacity,
BridgeContext ctx)
Returns a Color object that corresponds to the input Paint's ICC color value or null if the related color profile could not be used or loaded for any reason. |
static Marker |
convertMarker(Element e,
Value v,
BridgeContext ctx)
Returns a Marker defined on the specified element by the specified value, and for the specified shape node. |
static ShapePainter |
convertMarkers(Element e,
ShapeNode node,
BridgeContext ctx)
Returns a ShapePainter defined on the specified element and for the specified shape node. |
static float |
convertOpacity(Value v)
Returns the opacity represented by the specified CSSValue. |
protected static java.awt.Paint |
convertPaint(Element paintedElement,
GraphicsNode paintedNode,
Value paintDef,
float opacity,
BridgeContext ctx)
Converts a Paint definition to a concrete java.awt.Paint instance according to the specified parameters. |
static java.awt.Color |
convertRGBICCColor(Element paintedElement,
Value colorDef,
ICCColor iccColor,
float opacity,
BridgeContext ctx)
Returns a Color object that corresponds to the input Paint's ICC color value or an RGB color if the related color profile could not be used or loaded for any reason. |
static java.awt.Stroke |
convertStroke(Element e)
Converts a Stroke object defined on the specified element. |
static float[] |
convertStrokeDasharray(Value v)
Converts the 'stroke-dasharray' property to a list of float number in user units. |
static int |
convertStrokeLinecap(Value v)
Converts the 'linecap' property to the appropriate BasicStroke constant. |
static int |
convertStrokeLinejoin(Value v)
Converts the 'linejoin' property to the appropriate BasicStroke constant. |
static float |
convertStrokeMiterlimit(Value v)
Converts the 'miterlimit' property to the appropriate float number. |
static java.awt.Paint |
convertStrokePaint(Element strokedElement,
GraphicsNode strokedNode,
BridgeContext ctx)
Converts for the specified element, its stroke paint properties to a Paint object. |
static java.awt.Paint |
convertURIPaint(Element paintedElement,
GraphicsNode paintedNode,
Value paintDef,
float opacity,
BridgeContext ctx)
Converts a Paint specified as a URI. |
static int |
resolveColorComponent(Value v)
Returns the value of one color component (0 <= result <= 255). |
static java.awt.Paint |
silentConvertURIPaint(Element paintedElement,
GraphicsNode paintedNode,
ListValue paintDef,
float opacity,
BridgeContext ctx)
Converts a Paint specified by URI without sending any error. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected PaintServer()
Method Detail |
public static ShapePainter convertMarkers(Element e, ShapeNode node, BridgeContext ctx)
e
- the element with the marker CSS propertiesnode
- the shape nodectx
- the bridge contextpublic static Marker convertMarker(Element e, Value v, BridgeContext ctx)
e
- the painted elementv
- the CSS value describing the marker to constructctx
- the bridge contextpublic static ShapePainter convertFillAndStroke(Element e, ShapeNode node, BridgeContext ctx)
e
- the element interested in a shape painternode
- the shape nodectx
- the bridge contextpublic static java.awt.Paint convertStrokePaint(Element strokedElement, GraphicsNode strokedNode, BridgeContext ctx)
strokedElement
- the element interested in a PaintstrokedNode
- the graphics node to strokectx
- the bridge contextpublic static java.awt.Paint convertFillPaint(Element filledElement, GraphicsNode filledNode, BridgeContext ctx)
filledElement
- the element interested in a PaintfilledNode
- the graphics node to fillctx
- the bridge contextprotected static java.awt.Paint convertPaint(Element paintedElement, GraphicsNode paintedNode, Value paintDef, float opacity, BridgeContext ctx)
paintedElement
- the element interested in a Paintdecl
- the CSS declaration of the painted elementpaintedNode
- the graphics node to paint (objectBoundingBox)paintDef
- the paint definitionopacity
- the opacity to consider for the Paintctx
- the bridge contextpublic static java.awt.Paint silentConvertURIPaint(Element paintedElement, GraphicsNode paintedNode, ListValue paintDef, float opacity, BridgeContext ctx)
paintedElement
- the element interested in a PaintpaintedNode
- the graphics node to paint (objectBoundingBox)paintDef
- the paint definitionopacity
- the opacity to consider for the Paintctx
- the bridge contextpublic static java.awt.Paint convertURIPaint(Element paintedElement, GraphicsNode paintedNode, Value paintDef, float opacity, BridgeContext ctx)
paintedElement
- the element interested in a PaintpaintedNode
- the graphics node to paint (objectBoundingBox)paintDef
- the paint definitionopacity
- the opacity to consider for the Paintctx
- the bridge contextpublic static java.awt.Color convertRGBICCColor(Element paintedElement, Value colorDef, ICCColor iccColor, float opacity, BridgeContext ctx)
paintedElement
- the element using the colorcolorDef
- the color definitioniccColor
- the ICC color definitionopacity
- the opacityctx
- the bridge context to usepublic static java.awt.Color convertICCColor(Element e, ICCColor c, float opacity, BridgeContext ctx)
paintedElement
- the element using the colorc
- the ICC color definitionopacity
- the opacityctx
- the bridge context to usepublic static java.awt.Color convertColor(Value c, float opacity)
c
- The CSS color to convert.o
- The opacity value (0 <= o <= 1).public static java.awt.Stroke convertStroke(Element e)
e
- the element on which the stroke is specifiedpublic static float[] convertStrokeDasharray(Value v)
v
- the CSS value describing the dasharray propertyuctx
- the unit processor context used to resolve unitspublic static float convertStrokeMiterlimit(Value v)
v
- the CSS value describing the miterlimit propertypublic static int convertStrokeLinecap(Value v)
v
- the CSS value describing the linecap propertypublic static int convertStrokeLinejoin(Value v)
v
- the CSS value describing the linejoin propertypublic static int resolveColorComponent(Value v)
v
- the value that defines the color componentpublic static float convertOpacity(Value v)
v
- the value that represents the opacity
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |