org.apache.batik.bridge
public abstract class CSSUtilities extends Object implements CSSConstants, ErrorConstants, XMLConstants
Field Summary | |
---|---|
static Composite | TRANSPARENT |
Constructor Summary | |
---|---|
protected | CSSUtilities()
No instance of this class is required. |
Method Summary | |
---|---|
static void | computeStyleAndURIs(Element refElement, Element localRefElement, String uri)
Partially computes the style in the 'def' tree and set it in the 'use'
tree.
|
static float[] | convertClip(Element e)
Returns an array of floating offsets representing the 'clip'
property or null if 'auto'. |
static ClipRable | convertClipPath(Element clippedElement, GraphicsNode clippedNode, BridgeContext ctx)
Returns a Clip referenced by the specified element and
which applies on the specified graphics node.
|
static int | convertClipRule(Element e)
Returns the 'clip-rule' for the specified element.
|
static MultipleGradientPaint.ColorSpaceEnum | convertColorInterpolation(Element e)
Returns the color space for the specified element. |
static boolean | convertColorInterpolationFilters(Element e)
Returns the color space for the specified filter element. |
static RenderingHints | convertColorRendering(Element e, RenderingHints hints)
Fills the rendering hints for the specified element or do
nothing if none has been specified. |
static Cursor | convertCursor(Element e, BridgeContext ctx)
Returns the Cursor corresponding to the input element's
cursor property
|
static boolean | convertDisplay(Element e)
Returns true if the specified element has to be displayed, false
otherwise. |
static Rectangle2D | convertEnableBackground(Element e)
Returns the subregion of user space where access to the
background image is allowed to happen.
|
static int | convertFillRule(Element e)
Returns the 'fill-rule' for the specified element.
|
static Filter | convertFilter(Element filteredElement, GraphicsNode filteredNode, BridgeContext ctx)
Returns a Filter referenced by the specified element
and which applies on the specified graphics node.
|
static Color | convertFloodColor(Element e, BridgeContext ctx)
Converts the color defined on the specified <feFlood>
element to a Color.
|
static RenderingHints | convertImageRendering(Element e, RenderingHints hints)
Fills the rendering hints for the specified image element or do
nothing if none has been specified. |
static Color | convertLightingColor(Element e, BridgeContext ctx)
Converts the color defined on the specified lighting filter element
to a Color.
|
static Mask | convertMask(Element maskedElement, GraphicsNode maskedNode, BridgeContext ctx)
Returns a Mask referenced by the specified element and
which applies on the specified graphics node.
|
static Composite | convertOpacity(Element e)
Returns a composite object that represents the 'opacity' of the
specified element.
|
static boolean | convertOverflow(Element e)
Returns true if the 'overflow' property indicates that an
additional clip is required, false otherwise. |
static int | convertPointerEvents(Element e)
Returns the type that describes how this graphics node reacts to events.
|
static RenderingHints | convertShapeRendering(Element e, RenderingHints hints)
Fills the rendering hints for the specified shape element or do
nothing none has been specified. |
static Color | convertStopColor(Element e, float opacity, BridgeContext ctx)
Converts the color defined on the specified <stop> element
to a Color.
|
static RenderingHints | convertTextRendering(Element e, RenderingHints hints)
Fills the rendering hints for the specified text element or do
nothing if none has been specified. |
static boolean | convertVisibility(Element e)
Returns true if the specified element is visible, false
otherwise. |
static Value | getComputedStyle(Element e, int property)
Returns the computed style of the given property. |
static CSSEngine | getCSSEngine(Element e)
Returns CSSEngine associated to the specified element. |
static boolean | isAutoCursor(Element e)
Checks if the cursor property on the input element is set to auto |
protected static int | rule(CSSValue v)
Returns the winding rule represented by the specified CSSValue.
|
Note: This method must be called only when 'use' has been added to the DOM tree.
Parameters: refElement the referenced element localRefElement the referenced element in the current document
Parameters: e the element with the 'clip' property
Parameters: clippedElement the element that references the clip clippedNode the graphics node associated to the element to clip ctx the bridge context
Parameters: e the element interested in its a 'clip-rule'
Returns: GeneralPath.WIND_NON_ZERO | GeneralPath.WIND_EVEN_ODD
Parameters: e the element
Parameters: e the element
Returns: true if the color space is linear, false otherwise (sRGB).
Here is how the mapping between SVG rendering hints and the Java2D rendering hints is done:
Parameters: e the element hints a RenderingHints to fill, or null.
Parameters: e the element
Parameters: e the element
Parameters: e the container element
Parameters: e the element interested in its a 'fill-rule'
Returns: GeneralPath.WIND_NON_ZERO | GeneralPath.WIND_EVEN_ODD
Parameters: filteredElement the element that references the filter filteredNode the graphics node associated to the element to filter. ctx the bridge context
Parameters: e the feFlood element ctx the bridge context
Here is how the mapping between SVG rendering hints and the Java2D rendering hints is done:
Parameters: e the element hints a RenderingHints to fill, or null.
Parameters: e the lighting filter element ctx the bridge context
Parameters: maskedElement the element that references the mask maskedNode the graphics node associated to the element to mask ctx the bridge context
Parameters: e the element
Parameters: e the element with the 'overflow' property
Returns: GraphicsNode.VISIBLE_PAINTED | GraphicsNode.VISIBLE_FILL | GraphicsNode.VISIBLE_STROKE | GraphicsNode.VISIBLE | GraphicsNode.PAINTED | GraphicsNode.FILL | GraphicsNode.STROKE | GraphicsNode.ALL | GraphicsNode.NONE
Here is how the mapping between SVG rendering hints and the Java2D rendering hints is done:
Parameters: e the element hints a RenderingHints to fill, or null.
Parameters: e the stop element opacity the paint opacity ctx the bridge context to use
Here is how the mapping between SVG rendering hints and the Java2D rendering hints is done:
Note that for text both KEY_TEXT_ANTIALIASING and KEY_ANTIALIASING are set as there is no guarantee that a Java2D text rendering primitive will be used to draw text (eg. SVG Font...).
Parameters: e the element hints a RenderingHints to fill, or null.
Parameters: e the element
Parameters: e the element
Parameters: v the value that represents the rule
Returns: GeneralPath.WIND_NON_ZERO | GeneralPath.WIND_EVEN_ODD