Fields Summary |
---|
protected static final int | FONT_STYLE_MASK |
protected static final int | FONT_WEIGHT_MASK |
protected static final int | TEXT_ANCHOR_MASK |
protected static final int | STROKE_OPACITY_MASK |
protected static final int | FILL_OPACITY_MASK |
protected static final int | FILL_RULE_MASK |
protected static final int | STROKE_LINE_CAP_MASK |
protected static final int | STROKE_LINE_JOIN_MASK |
protected static final int | VISIBILITY_MASK |
protected static final int | DISPLAY_MASK |
protected static final int | OPACITY_MASK |
protected static final int | FONT_STYLE_NORMAL_IMPL |
protected static final int | FONT_STYLE_ITALIC_IMPL |
protected static final int | FONT_STYLE_OBLIQUE_IMPL |
protected static final int | FONT_WEIGHT_100_IMPL |
protected static final int | FONT_WEIGHT_200_IMPL |
protected static final int | FONT_WEIGHT_300_IMPL |
protected static final int | FONT_WEIGHT_400_IMPL |
protected static final int | FONT_WEIGHT_500_IMPL |
protected static final int | FONT_WEIGHT_600_IMPL |
protected static final int | FONT_WEIGHT_700_IMPL |
protected static final int | FONT_WEIGHT_800_IMPL |
protected static final int | FONT_WEIGHT_900_IMPL |
protected static final int | FONT_WEIGHT_LIGHTER_IMPL |
protected static final int | FONT_WEIGHT_BOLDER_IMPL |
protected static final int | TEXT_ANCHOR_MIDDLE_IMPL |
protected static final int | TEXT_ANCHOR_START_IMPL |
protected static final int | TEXT_ANCHOR_END_IMPL |
protected static final int | CAP_BUTT_IMPL |
protected static final int | CAP_ROUND_IMPL |
protected static final int | CAP_SQUARE_IMPL |
protected static final int | JOIN_MITER_IMPL |
protected static final int | JOIN_ROUND_IMPL |
protected static final int | JOIN_BEVEL_IMPL |
protected com.sun.perseus.j2d.RGB | colorThe current color. The fill and stroke colors may be
relative to the current color |
protected com.sun.perseus.j2d.PaintServer | fillThe fill paint used to fill this node |
protected com.sun.perseus.j2d.PaintServer | strokeThe stroke paint used to stroke the outline of
this ShapeNode |
protected float | strokeWidthThe stroke width |
protected float | strokeMiterLimitThe stroke miter limit |
protected float[] | strokeDashArrayThe stroke dash array |
protected float | strokeDashOffsetThe stroke dash offset |
protected int | pack |
protected static final int | INITIAL_FONT_STYLE_IMPL |
protected static final int | INITIAL_FONT_WEIGHT_IMPL |
protected static final int | INITIAL_TEXT_ANCHOR_IMPL |
protected static final int | INITIAL_STROKE_OPACITY_IMPL |
protected static final int | INITIAL_FILL_OPACITY_IMPL |
protected static final int | INITIAL_FILL_RULE_IMPL |
protected static final int | INITIAL_STROKE_LINE_CAP_IMPL |
protected static final int | INITIAL_STROKE_LINE_JOIN_IMPL |
protected static final int | INITIAL_VISIBILITY_IMPL |
protected static final int | INITIAL_DISPLAY_IMPL |
protected static final int | INITIAL_PACK |
protected int | pack2 |
protected static final int | INITIAL_OPACITY_IMPL |
protected static final int | INITIAL_PACK2 |
protected int | markersMarkers are used to keep track of inherited properties, color relative
properties and bolder/lighter font weights.
0-20 : property inheritance
21-22 : color relative
23 : is bolder marker
24 : is lighter marker |
protected com.sun.perseus.j2d.Transform | txfCached Transform. May point to the parent transform. |
protected com.sun.perseus.j2d.Transform | inverseTxfCached inverse transform. May point to the parent inverse transform. |
Methods Summary |
---|
void | clearMarker(int marker)Clears the input marker.
markers &= ~marker;
|
protected boolean | contributeBBox()A CompositeGraphicsNode contributes to its parent bounding
box only if its display property is turned on.
return (pack & DISPLAY_MASK) != 0;
|
TraitAnim | createTraitAnimImpl(java.lang.String traitName)
if (SVGConstants.SVG_STROKE_WIDTH_ATTRIBUTE == traitName
||
SVGConstants.SVG_STROKE_MITERLIMIT_ATTRIBUTE == traitName
||
SVGConstants.SVG_STROKE_DASHOFFSET_ATTRIBUTE == traitName
||
SVGConstants.SVG_FILL_OPACITY_ATTRIBUTE == traitName
||
SVGConstants.SVG_STROKE_OPACITY_ATTRIBUTE == traitName
||
SVGConstants.SVG_OPACITY_ATTRIBUTE == traitName) {
return new FloatTraitAnim(this, traitName, TRAIT_TYPE_FLOAT);
} else if (SVGConstants.SVG_COLOR_ATTRIBUTE == traitName
||
SVGConstants.SVG_FILL_ATTRIBUTE == traitName
||
SVGConstants.SVG_STROKE_ATTRIBUTE == traitName) {
return new FloatTraitAnim(this, traitName,
TRAIT_TYPE_SVG_RGB_COLOR);
} else if (SVGConstants.SVG_STROKE_DASHARRAY_ATTRIBUTE == traitName) {
return new FloatTraitAnim(this, traitName, TRAIT_TYPE_STRING);
} else if (SVGConstants.SVG_DISPLAY_ATTRIBUTE == traitName
||
SVGConstants.SVG_FILL_RULE_ATTRIBUTE == traitName
||
SVGConstants.SVG_STROKE_LINECAP_ATTRIBUTE == traitName
||
SVGConstants.SVG_STROKE_LINEJOIN_ATTRIBUTE == traitName
||
SVGConstants.SVG_VISIBILITY_ATTRIBUTE == traitName) {
return new StringTraitAnim(this, NULL_NS, traitName);
} else {
return super.createTraitAnimImpl(traitName);
}
|
java.lang.String | fillRuleToStringTrait(int fillRule)Converts the input fill-rule value to a string trait value.
if (fillRule == CompositeGraphicsNode.FILL_RULE_MASK) {
return SVGConstants.CSS_NONZERO_VALUE;
}
return SVGConstants.CSS_EVENODD_VALUE;
|
public org.w3c.dom.svg.SVGRect | getBBox()
return null;
|
public com.sun.perseus.j2d.RGB | getColor()
return color;
|
public boolean | getDisplay()
return ((pack & DISPLAY_MASK) == DISPLAY_MASK);
|
public com.sun.perseus.j2d.PaintServer | getFill()
return fill;
|
public float | getFillOpacity()
return ((pack & FILL_OPACITY_MASK) >> 7) / 200.0f;
|
public int | getFillRule()
if ((pack & FILL_RULE_MASK) == FILL_RULE_MASK) {
return WIND_NON_ZERO;
}
return WIND_EVEN_ODD;
|
protected float | getFloatPropertyState(int propertyIndex)Returns the value of the given float-valued property.
switch (propertyIndex) {
case PROPERTY_STROKE_WIDTH:
return strokeWidth;
case PROPERTY_STROKE_MITER_LIMIT:
return strokeMiterLimit;
case PROPERTY_STROKE_DASH_OFFSET:
return strokeDashOffset;
default:
return super.getFloatPropertyState(propertyIndex);
}
|
float | getFloatTraitImpl(java.lang.String name)Supported float traits: stroke-width, stroke-miterlimit,
stroke-dashoffset, fill-opacity, stroke-opacity, opacity.
if (SVGConstants.SVG_STROKE_WIDTH_ATTRIBUTE == name) {
return getStrokeWidth();
} else if (SVGConstants.SVG_STROKE_MITERLIMIT_ATTRIBUTE == name) {
return getStrokeMiterLimit();
} else if (SVGConstants.SVG_STROKE_DASHOFFSET_ATTRIBUTE == name) {
return getStrokeDashOffset();
} else if (SVGConstants.SVG_FILL_OPACITY_ATTRIBUTE == name) {
return getFillOpacity();
} else if (SVGConstants.SVG_STROKE_OPACITY_ATTRIBUTE == name) {
return getStrokeOpacity();
} else if (SVGConstants.SVG_OPACITY_ATTRIBUTE == name) {
return getOpacity();
} else {
return super.getFloatTraitImpl(name);
}
|
com.sun.perseus.j2d.Transform | getInverseTransformState()
if (((canRenderState & CAN_RENDER_NON_INVERTIBLE_TXF_BIT) == 0)) {
if (inverseTxf == null) {
// If there is a parent, check if this node's transform is the
// same as the parent's in which cahse
if (parent != null && txf == parent.getTransformState()) {
inverseTxf = parent.getInverseTransformState();
} else {
inverseTxf = new Transform(null);
try {
inverseTxf = (Transform) txf.inverse(inverseTxf);
} catch (Exception e) {
// If we get an exception, then we have a real error
// condition, because we just checked that the
// transform was invertible.
throw new Error();
}
}
}
} else {
inverseTxf = null;
}
return inverseTxf;
|
public float | getOpacity()
return (pack2 & OPACITY_MASK) / 200.0f;
|
protected int | getPackedPropertyState(int propertyIndex)Returns the value for the given packed property.
switch (propertyIndex) {
case GraphicsNode.PROPERTY_FILL_RULE:
return pack & CompositeGraphicsNode.FILL_RULE_MASK;
case GraphicsNode.PROPERTY_STROKE_LINE_JOIN:
return pack & CompositeGraphicsNode.STROKE_LINE_JOIN_MASK;
case GraphicsNode.PROPERTY_STROKE_LINE_CAP:
return pack & CompositeGraphicsNode.STROKE_LINE_CAP_MASK;
case GraphicsNode.PROPERTY_DISPLAY:
return pack & CompositeGraphicsNode.DISPLAY_MASK;
case GraphicsNode.PROPERTY_VISIBILITY:
return pack & CompositeGraphicsNode.VISIBILITY_MASK;
case GraphicsNode.PROPERTY_FILL_OPACITY:
return pack & CompositeGraphicsNode.FILL_OPACITY_MASK;
case GraphicsNode.PROPERTY_STROKE_OPACITY:
return pack & CompositeGraphicsNode.STROKE_OPACITY_MASK;
case GraphicsNode.PROPERTY_OPACITY:
return pack2 & CompositeGraphicsNode.OPACITY_MASK;
default:
return super.getPackedPropertyState(propertyIndex);
}
|
protected java.lang.Object | getPropertyState(int propertyIndex)Returns the value of the given Object-valued property.
switch (propertyIndex) {
case PROPERTY_FILL:
return fill;
case PROPERTY_STROKE:
return stroke;
case PROPERTY_COLOR:
return color;
case PROPERTY_STROKE_DASH_ARRAY:
return strokeDashArray;
default:
return super.getPropertyState(propertyIndex);
}
|
org.w3c.dom.svg.SVGRGBColor | getRGBColorTraitImpl(java.lang.String name)Supported color traits: color, fill, stroke
if (SVGConstants.SVG_FILL_ATTRIBUTE.equals(name)) {
return toSVGRGBColor(SVGConstants.SVG_FILL_ATTRIBUTE,
getFill());
} else if (SVGConstants.SVG_STROKE_ATTRIBUTE.equals(name)) {
return toSVGRGBColor(SVGConstants.SVG_STROKE_ATTRIBUTE,
getStroke());
} else if (SVGConstants.SVG_COLOR_ATTRIBUTE.equals(name)) {
return toSVGRGBColor(SVGConstants.SVG_COLOR_ATTRIBUTE,
getColor());
} else {
return super.getRGBColorTraitImpl(name);
}
|
public org.w3c.dom.svg.SVGRect | getScreenBBox()
return null;
|
java.lang.String | getSpecifiedTraitImpl(java.lang.String name)Returns the specified trait value as String. In SVG Tiny only certain
traits can be obtained as a String value. Syntax of the returned String
matches the syntax of the corresponding attribute. This element is
exactly equivalent to {@link org.w3c.dom.svg.SVGElement#getTraitNS
getTraitNS} with namespaceURI set to null.
The method is meant to be overridden by derived classes. The
implementation pattern is that derived classes will override the method
and call their super class' implementation. If the ElementNode
implementation is called, it means that the trait is either not supported
or that it cannot be seen as a String.
if ((SVGConstants.SVG_STROKE_WIDTH_ATTRIBUTE == name
&&
isInherited(PROPERTY_STROKE_WIDTH))
||
(SVGConstants.SVG_STROKE_MITERLIMIT_ATTRIBUTE == name
&&
isInherited(PROPERTY_STROKE_MITER_LIMIT))
||
(SVGConstants.SVG_STROKE_DASHOFFSET_ATTRIBUTE == name
&&
isInherited(PROPERTY_STROKE_DASH_OFFSET))
||
(SVGConstants.SVG_FILL_RULE_ATTRIBUTE == name
&&
isInherited(PROPERTY_FILL_RULE))
||
(SVGConstants.SVG_STROKE_LINEJOIN_ATTRIBUTE == name
&&
isInherited(PROPERTY_STROKE_LINE_JOIN))
||
(SVGConstants.SVG_STROKE_LINECAP_ATTRIBUTE == name
&&
isInherited(PROPERTY_STROKE_LINE_CAP))
||
(SVGConstants.SVG_DISPLAY_ATTRIBUTE == name
&&
isInherited(PROPERTY_DISPLAY))
||
(SVGConstants.SVG_VISIBILITY_ATTRIBUTE == name
&&
isInherited(PROPERTY_VISIBILITY))
||
(SVGConstants.SVG_COLOR_ATTRIBUTE == name
&&
isInherited(PROPERTY_COLOR))
||
(SVGConstants.SVG_FILL_ATTRIBUTE == name
&&
isInherited(PROPERTY_FILL))
||
(SVGConstants.SVG_STROKE_ATTRIBUTE == name
&&
isInherited(PROPERTY_STROKE))
||
(SVGConstants.SVG_FILL_OPACITY_ATTRIBUTE == name
&&
isInherited(PROPERTY_FILL_OPACITY))
||
(SVGConstants.SVG_STROKE_OPACITY_ATTRIBUTE == name
&&
isInherited(PROPERTY_STROKE_OPACITY))
||
(SVGConstants.SVG_OPACITY_ATTRIBUTE == name
&&
isInherited(PROPERTY_OPACITY))
||
(SVGConstants.SVG_STROKE_DASHARRAY_ATTRIBUTE == name
&&
isInherited(PROPERTY_STROKE_DASH_ARRAY))) {
return SVGConstants.CSS_INHERIT_VALUE;
} else if ((SVGConstants.SVG_FILL_ATTRIBUTE == name
&&
isColorRelative(PROPERTY_FILL))
||
(SVGConstants.SVG_STROKE_ATTRIBUTE == name
&&
isColorRelative(PROPERTY_STROKE))) {
return SVGConstants.CSS_CURRENTCOLOR_VALUE;
} else if (SVGConstants.SVG_DISPLAY_ATTRIBUTE == name) {
if (getDisplay()) {
return SVGConstants.CSS_INLINE_VALUE;
} else {
return SVGConstants.CSS_NONE_VALUE;
}
} else {
return super.getSpecifiedTraitImpl(name);
}
|
public com.sun.perseus.j2d.PaintServer | getStroke()
return stroke;
|
public float[] | getStrokeDashArray()
return strokeDashArray;
|
public float | getStrokeDashOffset()
return strokeDashOffset;
|
public int | getStrokeLineCap()
switch (pack & STROKE_LINE_CAP_MASK) {
case CAP_BUTT_IMPL:
return CAP_BUTT;
case CAP_ROUND_IMPL:
return CAP_ROUND;
default:
return CAP_SQUARE;
}
|
public int | getStrokeLineJoin()
switch (pack & STROKE_LINE_JOIN_MASK) {
case JOIN_MITER_IMPL:
return JOIN_MITER;
case JOIN_ROUND_IMPL:
return JOIN_ROUND;
default:
return JOIN_BEVEL;
}
|
public float | getStrokeMiterLimit()
return strokeMiterLimit;
|
public float | getStrokeOpacity()
return ((pack & STROKE_OPACITY_MASK) >> 15) / 200.0f;
|
public float | getStrokeWidth()
return strokeWidth;
|
public java.lang.String | getTraitImpl(java.lang.String name)Supported traits: stroke-width, stroke-miterlimit, stroke-dashoffset,
fill-rule, stroke-linejoin, stroke-linecap, display, visibility,
color, fill, stroke, fill-opacity, stroke-opacity, stroke-dasharray,
opacity
if (SVGConstants.SVG_STROKE_WIDTH_ATTRIBUTE == name) {
return Float.toString(getStrokeWidth());
} else if (SVGConstants.SVG_STROKE_MITERLIMIT_ATTRIBUTE == name) {
return Float.toString
(getStrokeMiterLimit());
} else if (SVGConstants.SVG_STROKE_DASHOFFSET_ATTRIBUTE == name) {
return Float.toString
(getStrokeDashOffset());
} else if (SVGConstants.SVG_FILL_RULE_ATTRIBUTE == name) {
return fillRuleToStringTrait(pack & FILL_RULE_MASK);
} else if (SVGConstants.SVG_STROKE_LINEJOIN_ATTRIBUTE == name) {
return strokeLineJoinToStringTrait
(pack & STROKE_LINE_JOIN_MASK);
} else if (SVGConstants.SVG_STROKE_LINECAP_ATTRIBUTE == name) {
return strokeLineCapToStringTrait
(pack & STROKE_LINE_CAP_MASK);
} else if (SVGConstants.SVG_DISPLAY_ATTRIBUTE == name) {
if (getDisplay()) {
return SVGConstants.CSS_INLINE_VALUE;
} else {
return SVGConstants.CSS_NONE_VALUE;
}
} else if (SVGConstants.SVG_VISIBILITY_ATTRIBUTE == name) {
if (getVisibility()) {
return SVGConstants.CSS_VISIBLE_VALUE;
} else {
return SVGConstants.CSS_HIDDEN_VALUE;
}
} else if (SVGConstants.SVG_COLOR_ATTRIBUTE == name) {
return getColor().toString();
} else if (SVGConstants.SVG_FILL_ATTRIBUTE == name) {
return toString(getFill());
} else if (SVGConstants.SVG_STROKE_ATTRIBUTE == name) {
return toString(getStroke());
} else if (SVGConstants.SVG_FILL_OPACITY_ATTRIBUTE == name) {
return Float.toString(getFillOpacity());
} else if (SVGConstants.SVG_STROKE_OPACITY_ATTRIBUTE == name) {
return Float.toString(getStrokeOpacity());
} else if (SVGConstants.SVG_STROKE_DASHARRAY_ATTRIBUTE == name) {
return toStringTrait(getStrokeDashArray());
} else if (SVGConstants.SVG_OPACITY_ATTRIBUTE == name) {
return Float.toString(getOpacity());
} else {
return super.getTraitImpl(name);
}
|
public com.sun.perseus.j2d.Transform | getTransformState()
return txf;
|
public boolean | getVisibility()
return ((pack & VISIBILITY_MASK) == VISIBILITY_MASK);
|
public boolean | isColorRelative(int propertyIndex)Returns true if the input property is color relative. False
otherwise
return isMarkerSet(propertyIndex << 21);
|
public boolean | isColorRelativeProperty(int propertyIndex)Returns true if the input property can be color-relative.
switch (propertyIndex) {
case PROPERTY_FILL:
return true;
case PROPERTY_STROKE:
return true;
default:
return false;
}
|
protected boolean | isFloatPropertyState(int propertyIndex, float propertyValue)Checks the state of the float property value.
switch (propertyIndex) {
case GraphicsNode.PROPERTY_STROKE_WIDTH:
return strokeWidth == propertyValue;
case GraphicsNode.PROPERTY_STROKE_MITER_LIMIT:
return strokeMiterLimit == propertyValue;
case GraphicsNode.PROPERTY_STROKE_DASH_OFFSET:
return strokeDashOffset == propertyValue;
default:
return super.isFloatPropertyState(propertyIndex, propertyValue);
}
|
public final boolean | isInherited(int propertyIndex)Check if the property is inherited.
return isMarkerSet(propertyIndex);
|
final boolean | isMarkerSet(int marker)
return (markers & marker) != 0;
|
protected boolean | isPackedPropertyState(int propertyIndex, int propertyValue)Checks the state of the packed property value.
switch (propertyIndex) {
case GraphicsNode.PROPERTY_FILL_RULE:
return (propertyValue
==
(pack & CompositeGraphicsNode.FILL_RULE_MASK));
case GraphicsNode.PROPERTY_STROKE_LINE_JOIN:
return (propertyValue
==
(pack & CompositeGraphicsNode.STROKE_LINE_JOIN_MASK));
case GraphicsNode.PROPERTY_STROKE_LINE_CAP:
return (propertyValue
==
(pack & CompositeGraphicsNode.STROKE_LINE_CAP_MASK));
case GraphicsNode.PROPERTY_DISPLAY:
return (propertyValue
==
(pack & CompositeGraphicsNode.DISPLAY_MASK));
case GraphicsNode.PROPERTY_VISIBILITY:
return (propertyValue
==
(pack & CompositeGraphicsNode.VISIBILITY_MASK));
case GraphicsNode.PROPERTY_FILL_OPACITY:
return (propertyValue
==
(pack & CompositeGraphicsNode.FILL_OPACITY_MASK));
case GraphicsNode.PROPERTY_STROKE_OPACITY:
return (propertyValue
==
(pack & CompositeGraphicsNode.STROKE_OPACITY_MASK));
case GraphicsNode.PROPERTY_OPACITY:
return (propertyValue
==
(pack2 & CompositeGraphicsNode.OPACITY_MASK));
default:
return super.isPackedPropertyState(propertyIndex, propertyValue);
}
|
protected boolean | isPropertyState(int propertyIndex, java.lang.Object propertyValue)Checks the state of the Object-valued property.
switch (propertyIndex) {
case GraphicsNode.PROPERTY_FILL:
return fill == propertyValue;
case GraphicsNode.PROPERTY_STROKE:
return stroke == propertyValue;
case GraphicsNode.PROPERTY_COLOR:
return color == propertyValue;
case GraphicsNode.PROPERTY_STROKE_DASH_ARRAY:
return strokeDashArray == propertyValue;
default:
return super.isPropertyState(propertyIndex, propertyValue);
}
|
public void | onPaintServerUpdate(java.lang.String paintType, com.sun.perseus.j2d.PaintServer paintServer)
if (paintType == SVGConstants.SVG_FILL_ATTRIBUTE) {
setFill(paintServer);
} else if (paintType == SVGConstants.SVG_STROKE_ATTRIBUTE) {
setStroke(paintServer);
} else {
throw new Error();
}
|
protected void | propagateFloatPropertyState(int propertyIndex, float parentPropertyValue)Called when the computed value of the given float-valued property has
changed.
// Propagate to proxies.
if (firstProxy != null) {
ElementNodeProxy proxy = firstProxy;
while (proxy != null) {
((CompositeGraphicsNodeProxy)
proxy).proxiedFloatPropertyStateChange(
propertyIndex, parentPropertyValue);
proxy = proxy.nextProxy;
}
}
// Propagate to regular children.
ModelNode node = getFirstChildNode();
while (node != null) {
node.recomputeFloatPropertyState(propertyIndex,
parentPropertyValue);
node = node.nextSibling;
}
|
protected void | propagatePackedPropertyState(int propertyIndex, int parentPropertyValue)Called when the computed value of the given packed property has changed.
// Propagate to proxies.
if (firstProxy != null) {
ElementNodeProxy proxy = firstProxy;
while (proxy != null) {
((CompositeGraphicsNodeProxy)
proxy).proxiedPackedPropertyStateChange(
propertyIndex, parentPropertyValue);
proxy = proxy.nextProxy;
}
}
// Propagate to regular children.
ModelNode node = getFirstChildNode();
while (node != null) {
node.recomputePackedPropertyState(propertyIndex,
parentPropertyValue);
node = node.nextSibling;
}
|
protected void | propagatePropertyState(int propertyIndex, java.lang.Object parentPropertyValue)Called when the computed value of the given Object-valued property
has changed.
// Propagate to proxies.
if (firstProxy != null) {
ElementNodeProxy proxy = firstProxy;
while (proxy != null) {
((CompositeGraphicsNodeProxy) proxy).proxiedPropertyStateChange(
propertyIndex, parentPropertyValue);
proxy = proxy.nextProxy;
}
}
// Propagate to regular children.
ModelNode node = getFirstChildNode();
while (node != null) {
node.recomputePropertyState(propertyIndex, parentPropertyValue);
node = node.nextSibling;
}
|
protected void | recomputeFloatPropertyState(int propertyIndex, float parentPropertyValue)Recomputes the given float-valued property's state given the new parent
property.
// We do not need to recompute the property value if:
// - the property is _not_ inherited
// or
// - the property is inherited by the new parent property computed value
// is the same as the current value.
if (!isInherited(propertyIndex)
||
isFloatPropertyState(propertyIndex, parentPropertyValue)) {
// If the property is color relative, the propagation happens
// through the color property changes. This means that with
// currentColor, we inherit the computed value, not the specified
// currentColor indirection.
return;
}
setFloatPropertyState(propertyIndex, parentPropertyValue);
propagateFloatPropertyState(propertyIndex, parentPropertyValue);
|
void | recomputeInheritedProperties()Recomputes all inherited properties.
ModelNode p = ownerDocument;
if (parent != null) {
p = parent;
}
recomputePropertyState(PROPERTY_FILL,
p.getPropertyState(PROPERTY_FILL));
recomputePropertyState(PROPERTY_STROKE,
p.getPropertyState(PROPERTY_STROKE));
recomputePropertyState(PROPERTY_COLOR,
p.getPropertyState(PROPERTY_COLOR));
recomputePackedPropertyState(PROPERTY_FILL_RULE,
p.getPackedPropertyState(PROPERTY_FILL_RULE));
recomputeFloatPropertyState(PROPERTY_STROKE_WIDTH,
p.getFloatPropertyState(PROPERTY_STROKE_WIDTH));
recomputePackedPropertyState(PROPERTY_STROKE_LINE_JOIN,
p.getPackedPropertyState(
PROPERTY_STROKE_LINE_JOIN));
recomputePackedPropertyState(PROPERTY_STROKE_LINE_CAP,
p.getPackedPropertyState(
PROPERTY_STROKE_LINE_CAP));
recomputeFloatPropertyState(PROPERTY_STROKE_MITER_LIMIT,
p.getFloatPropertyState(
PROPERTY_STROKE_MITER_LIMIT));
recomputePropertyState(PROPERTY_STROKE_DASH_ARRAY,
p.getPropertyState(PROPERTY_STROKE_DASH_ARRAY));
recomputeFloatPropertyState(PROPERTY_STROKE_DASH_OFFSET,
p.getFloatPropertyState(
PROPERTY_STROKE_DASH_OFFSET));
recomputePackedPropertyState(PROPERTY_DISPLAY,
p.getPackedPropertyState(PROPERTY_DISPLAY));
recomputePackedPropertyState(PROPERTY_VISIBILITY,
p.getPackedPropertyState(PROPERTY_VISIBILITY));
recomputePackedPropertyState(PROPERTY_FILL_OPACITY,
p.getPackedPropertyState(PROPERTY_FILL_OPACITY));
recomputePackedPropertyState(PROPERTY_STROKE_OPACITY,
p.getPackedPropertyState(
PROPERTY_STROKE_OPACITY));
recomputePackedPropertyState(PROPERTY_OPACITY,
p.getPackedPropertyState(
PROPERTY_OPACITY));
|
protected void | recomputePackedPropertyState(int propertyIndex, int parentPropertyValue)Recomputes the given packed property's state given the new parent
property.
// We do not need to recompute the property value if:
// - the property is _not_ inherited
// or
// - the property is inherited by the new parent property computed value
// is the same as the current value.
if (!isInherited(propertyIndex)
||
isPackedPropertyState(propertyIndex, parentPropertyValue)) {
// If the property is color relative, the propagation happens
// through the color property changes. This means that with
// currentColor, we inherit the computed value, not the specified
// currentColor indirection.
return;
}
setPackedPropertyState(propertyIndex, parentPropertyValue);
propagatePackedPropertyState(propertyIndex, parentPropertyValue);
|
protected void | recomputePropertyState(int propertyIndex, java.lang.Object parentPropertyValue)Recomputes the given Object-valued property's state given the
new parent property.
// We do not need to recompute the property value if:
// - the property is _not_ inherited
// or
// - the property is inherited by the new parent property computed value
// is the same as the current value.
if (!isInherited(propertyIndex)
||
isPropertyState(propertyIndex, parentPropertyValue)) {
// If the property is color relative, the propagation happens
// through the color property changes. This means that with
// currentColor, we inherit the computed value, not the specified
// currentColor indirection.
return;
}
setPropertyState(propertyIndex, parentPropertyValue);
propagatePropertyState(propertyIndex, parentPropertyValue);
|
protected void | recomputeTransformState(com.sun.perseus.j2d.Transform parentTransform)Recomputes the transform cache, if one exists. This should recursively
call recomputeTransformState on children node or expanded content, if
any.
By default, because a ModelNode has no transform and no cached transform,
this only does a pass down.
txf = appendTransform(parentTransform, txf);
computeCanRenderTransformBit(txf);
inverseTxf = null;
// inverseTxf = computeInverseTransform(txf, parentTransform,
// inverseTxf);
recomputeTransformState(txf, getFirstChildNode());
|
public void | setColor(com.sun.perseus.j2d.RGB newColor)Setting the color property clears this property's inherited flag.
if (!isInherited(PROPERTY_COLOR) && equal(newColor, color)) {
return;
}
modifyingNode();
setComputedColor(newColor);
setInheritedQuiet(PROPERTY_COLOR, false);
propagatePropertyState(PROPERTY_COLOR, color);
modifiedNode();
|
public void | setColorRelative(int propertyIndex, boolean isColorRelative)Sets the input property as a color-relative property
if (isColorRelative && !isColorRelativeProperty(propertyIndex)) {
throw new IllegalArgumentException();
}
if (isColorRelative(propertyIndex) == isColorRelative) {
return;
}
modifyingNode();
setColorRelativeQuiet(propertyIndex,
isColorRelative);
if (isColorRelative) {
// The property is now color relative. We store the relative
// value in the on the node, i.e., the computed value.
setPropertyState(propertyIndex, color);
// Notify children that the inherited value has changed.
propagatePropertyState(propertyIndex, color);
}
modifiedNode();
|
protected void | setColorRelativeQuiet(int propertyIndex, boolean isColorRelative)Implementation. Sets the input property as a color-relative property
but does not generate modification events.
if (isColorRelative) {
setMarker(propertyIndex << 21);
} else {
clearMarker(propertyIndex << 21);
}
|
void | setComputedColor(com.sun.perseus.j2d.RGB newColor)
color = newColor;
// We need to recompute the fill and stroke colors if they are
// color-relative.
if (isColorRelative(PROPERTY_FILL)) {
setComputedFill(newColor);
propagatePropertyState(PROPERTY_FILL, fill);
}
if (isColorRelative(PROPERTY_STROKE)) {
setComputedStroke(newColor);
propagatePropertyState(PROPERTY_STROKE, stroke);
}
|
void | setComputedDisplay(boolean newDisplay)
if (newDisplay) {
pack |= DISPLAY_MASK;
} else {
pack &= ~DISPLAY_MASK;
}
computeCanRenderDisplayBit(newDisplay);
|
void | setComputedFill(com.sun.perseus.j2d.PaintServer newFill)
this.fill = newFill;
|
void | setComputedFillOpacity(float newFillOpacity)
pack &= ~FILL_OPACITY_MASK;
pack |= ((((int) (newFillOpacity * 200)) << 7) & FILL_OPACITY_MASK);
|
final void | setComputedFillRule(int newFillRule)
if (newFillRule == WIND_NON_ZERO) {
pack |= FILL_RULE_MASK;
} else {
pack &= ~FILL_RULE_MASK;
}
|
void | setComputedOpacity(float newOpacity)
pack2 &= ~OPACITY_MASK;
pack2 |= (((int) (newOpacity * 200)) & OPACITY_MASK);
|
void | setComputedStroke(com.sun.perseus.j2d.PaintServer newStroke)
this.stroke = newStroke;
|
void | setComputedStrokeDashArray(float[] newStrokeDashArray)
strokeDashArray = newStrokeDashArray;
|
void | setComputedStrokeDashOffset(float newStrokeDashOffset)
strokeDashOffset = newStrokeDashOffset;
|
void | setComputedStrokeLineCap(int newStrokeLineCap)
// Clear stroke-linecap
pack &= ~STROKE_LINE_CAP_MASK;
switch (newStrokeLineCap) {
case CAP_BUTT:
pack |= CAP_BUTT_IMPL;
break;
case CAP_ROUND:
pack |= CAP_ROUND_IMPL;
break;
default:
pack |= CAP_SQUARE_IMPL;
break;
}
|
void | setComputedStrokeLineJoin(int newStrokeLineJoin)
// Clear stroke-linejoin
pack &= ~STROKE_LINE_JOIN_MASK;
switch (newStrokeLineJoin) {
case JOIN_MITER:
pack |= JOIN_MITER_IMPL;
break;
case JOIN_ROUND:
pack |= JOIN_ROUND_IMPL;
break;
default:
pack |= JOIN_BEVEL_IMPL;
break;
}
|
void | setComputedStrokeMiterLimit(float newStrokeMiterLimit)
strokeMiterLimit = newStrokeMiterLimit;
|
void | setComputedStrokeOpacity(float newStrokeOpacity)
pack &= ~STROKE_OPACITY_MASK;
pack |= ((((int) (newStrokeOpacity * 200)) << 15)
& STROKE_OPACITY_MASK);
|
void | setComputedStrokeWidth(float newStrokeWidth)
strokeWidth = newStrokeWidth;
|
void | setComputedVisibility(boolean newVisibility)
if (newVisibility) {
pack |= VISIBILITY_MASK;
} else {
pack &= ~VISIBILITY_MASK;
}
|
public void | setDisplay(boolean newDisplay)Setting the display property clears its inherited flag.
if (!isInherited(PROPERTY_DISPLAY)
&& newDisplay == getDisplay()) {
return;
}
modifyingNode();
setInheritedQuiet(PROPERTY_DISPLAY, false);
setComputedDisplay(newDisplay);
propagatePackedPropertyState(PROPERTY_DISPLAY, pack & DISPLAY_MASK);
modifiedNode();
|
public void | setFill(com.sun.perseus.j2d.PaintServer newFill)Setting the fill property clears the inherited and color relative
states (they are set to false).
if (!isInherited(PROPERTY_FILL) && equal(newFill, fill)) {
return;
}
modifyingNode();
if (fill != null) {
fill.dispose();
}
setComputedFill(newFill);
setInheritedQuiet(PROPERTY_FILL, false);
setColorRelativeQuiet(PROPERTY_FILL, false);
propagatePropertyState(PROPERTY_FILL, fill);
modifiedNode();
|
public void | setFillOpacity(float newFillOpacity)Setting the fillOpacity property clears the inherited and color relative
states (they are set to false).
if (!isInherited(PROPERTY_FILL_OPACITY)
&&
newFillOpacity == getFillOpacity()) {
return;
}
modifyingNode();
if (newFillOpacity > 1) {
newFillOpacity = 1;
} else if (newFillOpacity < 0) {
newFillOpacity = 0;
}
setInheritedQuiet(PROPERTY_FILL_OPACITY, false);
setComputedFillOpacity(newFillOpacity);
propagatePackedPropertyState(PROPERTY_FILL_OPACITY,
pack & FILL_OPACITY_MASK);
modifiedNode();
|
public void | setFillRule(int newFillRule)Setting the fillRule property clears its inherited flag
if (!isInherited(PROPERTY_FILL_RULE)
&&
newFillRule == getFillRule()) {
return;
}
modifyingNode();
setInheritedQuiet(PROPERTY_FILL_RULE, false);
setComputedFillRule(newFillRule);
propagatePackedPropertyState(PROPERTY_FILL_RULE, pack & FILL_RULE_MASK);
modifiedNode();
|
void | setFloatArrayTrait(java.lang.String name, float[][] value)Set the trait value as float array.
if (SVGConstants.SVG_STROKE_WIDTH_ATTRIBUTE == name) {
checkPositive(name, value[0][0]);
setStrokeWidth(value[0][0]);
} else if (SVGConstants.SVG_STROKE_MITERLIMIT_ATTRIBUTE
.equals(name)) {
if (value[0][0] < 1) {
throw illegalTraitValue(name, Float.toString(value[0][0]));
}
setStrokeMiterLimit(value[0][0]);
} else if (SVGConstants.SVG_STROKE_DASHOFFSET_ATTRIBUTE
.equals(name)) {
setStrokeDashOffset(value[0][0]);
} else if (SVGConstants.SVG_COLOR_ATTRIBUTE == name) {
setColor(toRGB(name, value));
} else if (SVGConstants.SVG_FILL_ATTRIBUTE == name) {
setFill(toRGB(name, value));
} else if (SVGConstants.SVG_STROKE_ATTRIBUTE == name) {
setStroke(toRGB(name, value));
} else if (SVGConstants.SVG_FILL_OPACITY_ATTRIBUTE == name) {
setFillOpacity(value[0][0]);
} else if (SVGConstants.SVG_STROKE_OPACITY_ATTRIBUTE == name) {
setStrokeOpacity(value[0][0]);
} else if (SVGConstants.SVG_STROKE_DASHARRAY_ATTRIBUTE
.equals(name)) {
setStrokeDashArray(value[0]);
} else if (SVGConstants.SVG_OPACITY_ATTRIBUTE == name) {
setOpacity(value[0][0]);
} else {
super.setFloatArrayTrait(name, value);
}
|
public void | setFloatInherited(int propertyIndex, boolean inherit)Sets the given float-valued property's inheritance status
if (isInherited(propertyIndex) == inherit) {
return;
}
modifyingNode();
setInheritedQuiet(propertyIndex, inherit);
if (inherit) {
// The property is now inherited. We store the inherited
// value on the node, which means we keep the computed value
// on the node.
float inheritedValue =
getInheritedFloatPropertyState(propertyIndex);
setFloatPropertyState(propertyIndex, inheritedValue);
// Notify children that the inherited value has changed.
propagateFloatPropertyState(propertyIndex, inheritedValue);
}
// If the value is not inherited, it means that we are in the middle of
// specifying a value on the node. So we do not notify descendants,
// because this is done in the corresponding methods, e.g., setFill.
modifiedNode();
|
protected void | setFloatPropertyState(int propertyIndex, float propertyValue)Sets the computed value of the given float-valued property.
switch (propertyIndex) {
case PROPERTY_STROKE_WIDTH:
setComputedStrokeWidth(propertyValue);
break;
case PROPERTY_STROKE_MITER_LIMIT:
setComputedStrokeMiterLimit(propertyValue);
break;
case PROPERTY_STROKE_DASH_OFFSET:
setComputedStrokeDashOffset(propertyValue);
break;
default:
super.setFloatPropertyState(propertyIndex, propertyValue);
break;
}
|
public void | setFloatTraitImpl(java.lang.String name, float value)Set the trait value as float.
Supported float traits: stroke-width, stroke-miterlimit,
stroke-dashoffset, fill-opacity, stroke-opacity, opacity.
if (SVGConstants.SVG_STROKE_WIDTH_ATTRIBUTE == name) {
checkPositive(name, value);
setStrokeWidth(value);
} else if (SVGConstants.SVG_STROKE_MITERLIMIT_ATTRIBUTE == name) {
if (value < 1) {
throw illegalTraitValue(name, Float.toString(value));
}
setStrokeMiterLimit(value);
} else if (SVGConstants.SVG_STROKE_DASHOFFSET_ATTRIBUTE == name) {
setStrokeDashOffset(value);
} else if (SVGConstants.SVG_FILL_OPACITY_ATTRIBUTE == name) {
setFillOpacity(value);
} else if (SVGConstants.SVG_STROKE_OPACITY_ATTRIBUTE == name) {
setStrokeOpacity(value);
} else if (SVGConstants.SVG_OPACITY_ATTRIBUTE == name) {
setOpacity(value);
} else {
super.setFloatTraitImpl(name, value);
}
|
public void | setInherited(int propertyIndex, boolean inherit)Sets the given Object-valued property's inheritance status
if (isInherited(propertyIndex) == inherit) {
return;
}
modifyingNode();
setInheritedQuiet(propertyIndex, inherit);
if (inherit) {
// The property is now inherited. We store the inherited
// value on the node, which means we keep the computed value
// on the node.
Object inheritedValue = getInheritedPropertyState(propertyIndex);
setPropertyState(propertyIndex, inheritedValue);
// Notify children that the inherited value has changed.
propagatePropertyState(propertyIndex, inheritedValue);
}
// If the value is not inherited, it means that we are in the middle of
// specifying a value on the node. So we do not notify descendants,
// because this is done in the corresponding methods, e.g., setFill.
modifiedNode();
|
protected void | setInheritedQuiet(int propertyIndex, boolean inherit)Implementation. Sets the input property's inheritance status,
but does not send modification events.
if (inherit) {
setMarker(propertyIndex);
} else {
clearMarker(propertyIndex);
}
|
void | setMarker(int marker)Sets the input marker.
markers |= marker;
|
public void | setOpacity(float newOpacity)Setting the opacity property clears the inherited and color
relative states (they are set to false).
if (!isInherited(PROPERTY_OPACITY) && newOpacity == getOpacity()) {
return;
}
modifyingNode();
if (newOpacity > 1) {
newOpacity = 1;
} else if (newOpacity < 0) {
newOpacity = 0;
}
setInheritedQuiet(PROPERTY_OPACITY, false);
setComputedOpacity(newOpacity);
propagatePackedPropertyState(PROPERTY_OPACITY,
pack2 & OPACITY_MASK);
modifiedNode();
|
public void | setPackedInherited(int propertyIndex, boolean inherit)Sets the input packed property's inheritance status
if (isInherited(propertyIndex) == inherit) {
return;
}
modifyingNode();
setInheritedQuiet(propertyIndex, inherit);
if (inherit) {
// The property is now inherited. We store the inherited
// value on the node, which means we keep the computed value
// on the node.
int inheritedValue = getInheritedPackedPropertyState(propertyIndex);
setPackedPropertyState(propertyIndex, inheritedValue);
// Notify children that the inherited value has changed.
propagatePackedPropertyState(propertyIndex, inheritedValue);
}
// If the value is not inherited, it means that we are in the middle of
// specifying a value on the node. So we do not notify descendants,
// because this is done in the corresponding methods, e.g., setFill.
modifiedNode();
|
protected void | setPackedPropertyState(int propertyIndex, int propertyValue)Sets the computed value of the given packed property.
switch (propertyIndex) {
case GraphicsNode.PROPERTY_FILL_RULE:
if (propertyValue == 0) {
setComputedFillRule(WIND_EVEN_ODD);
} else {
setComputedFillRule(WIND_NON_ZERO);
}
break;
case GraphicsNode.PROPERTY_STROKE_LINE_JOIN:
switch (propertyValue) {
case CompositeGraphicsNode.JOIN_MITER_IMPL:
setComputedStrokeLineJoin(JOIN_MITER);
break;
case CompositeGraphicsNode.JOIN_ROUND_IMPL:
setComputedStrokeLineJoin(JOIN_ROUND);
break;
case CompositeGraphicsNode.JOIN_BEVEL_IMPL:
default:
setComputedStrokeLineJoin(JOIN_BEVEL);
break;
}
break;
case GraphicsNode.PROPERTY_STROKE_LINE_CAP:
switch (propertyValue) {
case CompositeGraphicsNode.CAP_BUTT_IMPL:
setComputedStrokeLineCap(CAP_BUTT);
break;
case CompositeGraphicsNode.CAP_ROUND_IMPL:
setComputedStrokeLineCap(CAP_ROUND);
break;
case CompositeGraphicsNode.CAP_SQUARE_IMPL:
default:
setComputedStrokeLineCap(CAP_SQUARE);
break;
}
break;
case GraphicsNode.PROPERTY_DISPLAY:
if (propertyValue != 0) {
setComputedDisplay(true);
} else {
setComputedDisplay(false);
}
break;
case GraphicsNode.PROPERTY_VISIBILITY:
if (propertyValue != 0) {
setComputedVisibility(true);
} else {
setComputedVisibility(false);
}
break;
case GraphicsNode.PROPERTY_FILL_OPACITY:
setComputedFillOpacity((propertyValue >> 7) / 200.0f);
break;
case GraphicsNode.PROPERTY_STROKE_OPACITY:
setComputedStrokeOpacity((propertyValue >> 15) / 200.0f);
break;
case GraphicsNode.PROPERTY_OPACITY:
setComputedOpacity(propertyValue / 200.0f);
break;
default:
super.setPackedPropertyState(propertyIndex, propertyValue);
break;
}
|
protected void | setPropertyState(int propertyIndex, java.lang.Object propertyValue)Sets the computed value of the given Object-valued property.
switch (propertyIndex) {
case PROPERTY_FILL:
setComputedFill((PaintServer) propertyValue);
break;
case PROPERTY_STROKE:
setComputedStroke((PaintServer) propertyValue);
break;
case PROPERTY_COLOR:
setComputedColor((RGB) propertyValue);
break;
case PROPERTY_STROKE_DASH_ARRAY:
setComputedStrokeDashArray((float[]) propertyValue);
break;
default:
super.setPropertyState(propertyIndex, propertyValue);
break;
}
|
void | setRGBColorTraitImpl(java.lang.String name, org.w3c.dom.svg.SVGRGBColor color)Set the trait value as {@link org.w3c.dom.svg.SVGRGBColor SVGRGBColor}.
Supported color traits: color, fill, stroke
try {
// We use .equals here because the name string may not have been
// interned.
if (SVGConstants.SVG_FILL_ATTRIBUTE.equals(name)) {
setFill((RGB) color);
} else if (SVGConstants.SVG_STROKE_ATTRIBUTE .equals(name)) {
setStroke((RGB) color);
} else if (SVGConstants.SVG_COLOR_ATTRIBUTE .equals(name)) {
setColor((RGB) color);
} else {
super.setRGBColorTraitImpl(name, color);
}
} catch (IllegalArgumentException iae) {
throw new DOMException(DOMException.INVALID_ACCESS_ERR,
iae.getMessage());
}
|
public void | setStroke(com.sun.perseus.j2d.PaintServer newStroke)Setting the stroke clears the inherited and color relative states
(i.e., they are set to false).
if (!isInherited(PROPERTY_STROKE) && equal(newStroke, stroke)) {
return;
}
modifyingNode();
if (newStroke != stroke) {
if (stroke != null) {
stroke.dispose();
}
}
setInheritedQuiet(PROPERTY_STROKE, false);
setColorRelativeQuiet(PROPERTY_STROKE, false);
setComputedStroke(newStroke);
propagatePropertyState(PROPERTY_STROKE, stroke);
modifiedNode();
|
public void | setStrokeDashArray(float[] newStrokeDashArray)Setting the strokeDashArray property clears its inherited flag.
if (!isInherited(PROPERTY_STROKE_DASH_ARRAY)
&& equal(newStrokeDashArray, strokeDashArray)) {
return;
}
modifyingNode();
setComputedStrokeDashArray(newStrokeDashArray);
setInheritedQuiet(PROPERTY_STROKE_DASH_ARRAY, false);
propagatePropertyState(PROPERTY_STROKE_DASH_ARRAY, newStrokeDashArray);
modifiedNode();
|
public void | setStrokeDashOffset(float newStrokeDashOffset)Setting the strokeDashOffset property clears its inherited flag.
if (!isInherited(PROPERTY_STROKE_DASH_OFFSET)
&& newStrokeDashOffset == strokeDashOffset) {
return;
}
modifyingNode();
setComputedStrokeDashOffset(newStrokeDashOffset);
setInheritedQuiet(PROPERTY_STROKE_DASH_OFFSET, false);
propagateFloatPropertyState(PROPERTY_STROKE_DASH_OFFSET,
strokeDashOffset);
modifiedNode();
|
public void | setStrokeLineCap(int newStrokeLineCap)Setting the strokeLineCap property clears the inherited flag
if (!isInherited(PROPERTY_STROKE_LINE_CAP)
&& newStrokeLineCap == getStrokeLineCap()) {
return;
}
modifyingNode();
setInheritedQuiet(PROPERTY_STROKE_LINE_CAP, false);
setComputedStrokeLineCap(newStrokeLineCap);
propagatePackedPropertyState(PROPERTY_STROKE_LINE_CAP,
pack & STROKE_LINE_CAP_MASK);
modifiedNode();
|
public void | setStrokeLineJoin(int newStrokeLineJoin)Setting the strokeLineJoin property clears the inherited flag
if (!isInherited(PROPERTY_STROKE_LINE_JOIN)
&& newStrokeLineJoin == getStrokeLineJoin()) {
return;
}
modifyingNode();
setInheritedQuiet(PROPERTY_STROKE_LINE_JOIN, false);
setComputedStrokeLineJoin(newStrokeLineJoin);
propagatePackedPropertyState(PROPERTY_STROKE_LINE_JOIN,
pack & STROKE_LINE_JOIN_MASK);
modifiedNode();
|
public void | setStrokeMiterLimit(float newStrokeMiterLimit)Setting the strokeMiterLimit clears its inherited flag.
if (newStrokeMiterLimit < 1) {
throw new IllegalArgumentException();
}
if (!isInherited(PROPERTY_STROKE_MITER_LIMIT)
&& newStrokeMiterLimit == strokeMiterLimit) {
return;
}
modifyingNode();
setComputedStrokeMiterLimit(newStrokeMiterLimit);
setInheritedQuiet(PROPERTY_STROKE_MITER_LIMIT, false);
propagateFloatPropertyState(PROPERTY_STROKE_MITER_LIMIT,
strokeMiterLimit);
modifiedNode();
|
public void | setStrokeOpacity(float newStrokeOpacity)Setting the strokeOpacity property clears the inherited and color
relative states (they are set to false).
if (!isInherited(PROPERTY_STROKE_OPACITY) &&
newStrokeOpacity == getStrokeOpacity()) {
return;
}
modifyingNode();
if (newStrokeOpacity > 1) {
newStrokeOpacity = 1;
} else if (newStrokeOpacity < 0) {
newStrokeOpacity = 0;
}
setInheritedQuiet(PROPERTY_STROKE_OPACITY, false);
setComputedStrokeOpacity(newStrokeOpacity);
propagatePackedPropertyState(PROPERTY_STROKE_OPACITY,
pack & STROKE_OPACITY_MASK);
modifiedNode();
|
public void | setStrokeWidth(float newStrokeWidth)Setting the strokeWidth property clears its inherited flag.
if (newStrokeWidth < 0) {
throw new IllegalArgumentException();
}
if (!isInherited(PROPERTY_STROKE_WIDTH)
&& newStrokeWidth == strokeWidth) {
return;
}
modifyingNode();
setInheritedQuiet(PROPERTY_STROKE_WIDTH, false);
setComputedStrokeWidth(newStrokeWidth);
propagateFloatPropertyState(PROPERTY_STROKE_WIDTH, newStrokeWidth);
modifiedNode();
|
public void | setTraitImpl(java.lang.String name, java.lang.String value)CompositeGraphicsNode handles the graphics node traits.
Other attributes are handled by the super class.
Supported traits: stroke-width, stroke-miterlimit, stroke-dashoffset,
fill-rule, stroke-linejoin, stroke-linecap, display, visibility,
color, fill, stroke, fill-opacity, stroke-opacity, stroke-dasharray,
opacity
if (SVGConstants.SVG_STROKE_WIDTH_ATTRIBUTE == name) {
// ======================= stroke-width ===================== //
if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
setFloatInherited(PROPERTY_STROKE_WIDTH, true);
} else {
setStrokeWidth(parsePositiveFloatTrait(name, value));
}
} else if (SVGConstants.SVG_STROKE_MITERLIMIT_ATTRIBUTE
.equals(name)) {
// ===================== stroke-miterlimit ================== //
if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
setFloatInherited(PROPERTY_STROKE_MITER_LIMIT, true);
} else {
float miter = parseFloatTrait(name, value);
if (miter < 1) {
throw illegalTraitValue(name, value);
}
setStrokeMiterLimit(miter);
}
} else if (SVGConstants.SVG_STROKE_DASHOFFSET_ATTRIBUTE
.equals(name)) {
// ===================== stroke-dashoffset ================== //
if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
setFloatInherited(PROPERTY_STROKE_DASH_OFFSET, true);
} else {
setStrokeDashOffset(parseFloatTrait(name, value));
}
} else if (SVGConstants.SVG_FILL_RULE_ATTRIBUTE == name) {
// ========================= fill-rule ====================== //
if (SVGConstants.CSS_NONZERO_VALUE.equals(value)) {
setFillRule(GraphicsProperties.WIND_NON_ZERO);
} else if (SVGConstants.CSS_EVENODD_VALUE.equals(value)) {
setFillRule(GraphicsProperties.WIND_EVEN_ODD);
} else if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
setPackedInherited(PROPERTY_FILL_RULE, true);
} else {
throw illegalTraitValue(name, value);
}
} else if (SVGConstants.SVG_STROKE_LINEJOIN_ATTRIBUTE == name) {
// ==================== stroke-linejoin ===================== //
if (SVGConstants.CSS_MITER_VALUE.equals(value)) {
setStrokeLineJoin(GraphicsProperties.JOIN_MITER);
} else if (SVGConstants.CSS_ROUND_VALUE.equals(value)) {
setStrokeLineJoin(GraphicsProperties.JOIN_ROUND);
} else if (SVGConstants.CSS_BEVEL_VALUE.equals(value)) {
setStrokeLineJoin(GraphicsProperties.JOIN_BEVEL);
} else if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
setPackedInherited(PROPERTY_STROKE_LINE_JOIN, true);
} else {
throw illegalTraitValue(name, value);
}
} else if (SVGConstants.SVG_STROKE_LINECAP_ATTRIBUTE == name) {
// ====================== stroke-linecap ==================== //
if (SVGConstants.CSS_BUTT_VALUE.equals(value)) {
setStrokeLineCap(GraphicsProperties.CAP_BUTT);
} else if (SVGConstants.CSS_ROUND_VALUE.equals(value)) {
setStrokeLineCap(GraphicsProperties.CAP_ROUND);
} else if (SVGConstants.CSS_SQUARE_VALUE.equals(value)) {
setStrokeLineCap(GraphicsProperties.CAP_SQUARE);
} else if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
setPackedInherited(PROPERTY_STROKE_LINE_CAP, true);
} else {
throw illegalTraitValue(name, value);
}
} else if (SVGConstants.SVG_DISPLAY_ATTRIBUTE == name) {
// ======================== display ========================= //
if (SVGConstants.CSS_NONE_VALUE.equals(value)) {
setDisplay(false);
} else if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
if (!isInherited(PROPERTY_DISPLAY)) {
setPackedInherited(PROPERTY_DISPLAY, true);
}
} else if (SVGConstants.CSS_BLOCK_VALUE.equals(value)
||
SVGConstants.CSS_COMPACT_VALUE.equals(value)
||
SVGConstants.CSS_INLINE_TABLE_VALUE.equals(value)
||
SVGConstants.CSS_INLINE_VALUE.equals(value)
||
SVGConstants.CSS_LIST_ITEM_VALUE.equals(value)
||
SVGConstants.CSS_MARKER_VALUE.equals(value)
||
SVGConstants.CSS_RUN_IN_VALUE.equals(value)
||
SVGConstants.CSS_TABLE_VALUE.equals(value)
||
SVGConstants.CSS_TABLE_ROW_GROUP_VALUE.equals(value)
||
SVGConstants.CSS_TABLE_HEADER_GROUP_VALUE.equals(value)
||
SVGConstants.CSS_TABLE_FOOTER_GROUP_VALUE.equals(value)
||
SVGConstants.CSS_TABLE_ROW_VALUE.equals(value)
||
SVGConstants.CSS_TABLE_COLUMN_GROUP_VALUE.equals(value)
||
SVGConstants.CSS_TABLE_COLUMN_VALUE.equals(value)
||
SVGConstants.CSS_TABLE_CELL_VALUE.equals(value)
||
SVGConstants.CSS_TABLE_CAPTION_VALUE.equals(value)) {
setDisplay(true);
} else {
throw illegalTraitValue(name, value);
}
} else if (SVGConstants.SVG_VISIBILITY_ATTRIBUTE == name) {
// ======================= visibility ======================= //
if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
setPackedInherited(PROPERTY_VISIBILITY, true);
} else if (SVGConstants.CSS_HIDDEN_VALUE.equals(value)
||
SVGConstants.CSS_COLLAPSE_VALUE.equals(value)) {
setVisibility(false);
} else if (SVGConstants.CSS_VISIBLE_VALUE.equals(value)) {
setVisibility(true);
} else {
throw illegalTraitValue(name, value);
}
} else if (SVGConstants.SVG_COLOR_ATTRIBUTE == name) {
// ========================= color ========================== //
if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
setInherited(PROPERTY_COLOR, true);
} else if (SVGConstants.CSS_NONE_VALUE.equals(value)) {
// 'none' is not a legal value for 'color'
throw illegalTraitValue(name, value);
} else {
RGB color = parseColorTrait
(SVGConstants.SVG_COLOR_ATTRIBUTE, value);
setColor(color);
}
} else if (SVGConstants.SVG_FILL_ATTRIBUTE == name) {
// ========================= fill =========================== //
if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
setInherited(PROPERTY_FILL, true);
setColorRelative(PROPERTY_FILL, false);
} else if (SVGConstants.CSS_NONE_VALUE.equals(value)) {
setFill(null);
} else if (SVGConstants.CSS_CURRENTCOLOR_VALUE.equals(value)) {
setColorRelative(PROPERTY_FILL, true);
setInherited(PROPERTY_FILL, false);
} else {
PaintServer fill = parsePaintTrait
(SVGConstants.SVG_FILL_ATTRIBUTE, this, value);
if (fill != null) {
setFill(fill);
}
}
} else if (SVGConstants.SVG_STROKE_ATTRIBUTE == name) {
// ========================= stroke ========================= //
if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
setInherited(PROPERTY_STROKE, true);
setColorRelative(PROPERTY_STROKE, false);
} else if (SVGConstants.CSS_NONE_VALUE.equals(value)) {
setStroke(null);
} else if (SVGConstants.CSS_CURRENTCOLOR_VALUE.equals(value)) {
setColorRelative(PROPERTY_STROKE, true);
setInherited(PROPERTY_STROKE, false);
} else {
PaintServer stroke = parsePaintTrait
(SVGConstants.SVG_STROKE_ATTRIBUTE, this, value);
if (stroke != null) {
setStroke(stroke);
}
}
} else if (SVGConstants.SVG_FILL_OPACITY_ATTRIBUTE == name) {
// ====================== fill-opacity ======================= //
if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
setPackedInherited(PROPERTY_FILL_OPACITY, true);
} else {
setFillOpacity(parseFloatTrait(name, value));
}
} else if (SVGConstants.SVG_STROKE_OPACITY_ATTRIBUTE
.equals(name)) {
// ================= stroke-opacity ========================= //
if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
setPackedInherited(PROPERTY_STROKE_OPACITY, true);
} else {
setStrokeOpacity(parseFloatTrait(name, value));
}
} else if (SVGConstants.SVG_STROKE_DASHARRAY_ATTRIBUTE
.equals(name)) {
// ==================== stroke-dasharray ==================== //
if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
setInherited(PROPERTY_STROKE_DASH_ARRAY, true);
} else if (SVGConstants.CSS_NONE_VALUE.equals(value)) {
setStrokeDashArray(null);
} else {
setStrokeDashArray(parsePositiveFloatArrayTrait(name, value));
}
} else if (SVGConstants.SVG_OPACITY_ATTRIBUTE
.equals(name)) {
// ================= opacity ========================= //
if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
setPackedInherited(PROPERTY_OPACITY, true);
} else {
setOpacity(parseFloatTrait(name, value));
}
} else {
super.setTraitImpl(name, value);
}
|
public void | setVisibility(boolean newVisibility)Setting the visibility clears its inherited flag.
if (!isInherited(PROPERTY_VISIBILITY)
&& newVisibility == getVisibility()) {
return;
}
modifyingNode();
setComputedVisibility(newVisibility);
setInheritedQuiet(PROPERTY_VISIBILITY, false);
propagatePackedPropertyState(PROPERTY_VISIBILITY,
pack & VISIBILITY_MASK);
modifiedNode();
|
java.lang.String | strokeLineCapToStringTrait(int strokeLineCap)
switch (strokeLineCap) {
case CompositeGraphicsNode.CAP_BUTT_IMPL:
return SVGConstants.CSS_BUTT_VALUE;
case CompositeGraphicsNode.CAP_ROUND_IMPL:
return SVGConstants.CSS_ROUND_VALUE;
case CompositeGraphicsNode.CAP_SQUARE_IMPL:
default:
return SVGConstants.CSS_SQUARE_VALUE;
}
|
java.lang.String | strokeLineJoinToStringTrait(int strokeLineJoin)
switch (strokeLineJoin) {
case CompositeGraphicsNode.JOIN_MITER_IMPL:
return SVGConstants.CSS_MITER_VALUE;
case CompositeGraphicsNode.JOIN_ROUND_IMPL:
return SVGConstants.CSS_ROUND_VALUE;
default:
return SVGConstants.CSS_BEVEL_VALUE;
}
|
boolean | supportsTrait(java.lang.String traitName)Supported traits: stroke-width, stroke-miterlimit, stroke-dashoffset,
fill-rule, stroke-linejoin, stroke-linecap, display, visibility,
color, fill, stroke, fill-opacity, stroke-opacity, stroke-dasharray,
opacity
if (SVGConstants.SVG_STROKE_WIDTH_ATTRIBUTE == traitName
||
SVGConstants.SVG_STROKE_MITERLIMIT_ATTRIBUTE == traitName
||
SVGConstants.SVG_STROKE_DASHOFFSET_ATTRIBUTE == traitName
||
SVGConstants.SVG_FILL_RULE_ATTRIBUTE == traitName
||
SVGConstants.SVG_STROKE_LINEJOIN_ATTRIBUTE == traitName
||
SVGConstants.SVG_STROKE_LINECAP_ATTRIBUTE == traitName
||
SVGConstants.SVG_DISPLAY_ATTRIBUTE == traitName
||
SVGConstants.SVG_VISIBILITY_ATTRIBUTE == traitName
||
SVGConstants.SVG_COLOR_ATTRIBUTE == traitName
||
SVGConstants.SVG_FILL_ATTRIBUTE == traitName
||
SVGConstants.SVG_STROKE_ATTRIBUTE == traitName
||
SVGConstants.SVG_FILL_OPACITY_ATTRIBUTE == traitName
||
SVGConstants.SVG_STROKE_OPACITY_ATTRIBUTE == traitName
||
SVGConstants.SVG_STROKE_DASHARRAY_ATTRIBUTE == traitName
||
SVGConstants.SVG_OPACITY_ATTRIBUTE == traitName) {
return true;
} else {
return super.supportsTrait(traitName);
}
|
java.lang.String | toStringTrait(java.lang.String name, float[][] value)
if (SVGConstants.SVG_STROKE_WIDTH_ATTRIBUTE == name
||
SVGConstants.SVG_STROKE_MITERLIMIT_ATTRIBUTE == name
||
SVGConstants.SVG_STROKE_DASHOFFSET_ATTRIBUTE == name
||
SVGConstants.SVG_FILL_OPACITY_ATTRIBUTE == name
||
SVGConstants.SVG_STROKE_OPACITY_ATTRIBUTE == name
||
SVGConstants.SVG_OPACITY_ATTRIBUTE == name) {
return Float.toString(value[0][0]);
} else if (SVGConstants.SVG_COLOR_ATTRIBUTE == name
||
SVGConstants.SVG_FILL_ATTRIBUTE == name
||
SVGConstants.SVG_STROKE_ATTRIBUTE == name) {
return toRGBString(name, value);
} else if (SVGConstants.SVG_STROKE_DASHARRAY_ATTRIBUTE == name) {
return toStringTrait(value[0]);
} else {
return super.toStringTrait(name, value);
}
|
public float[][] | validateFloatArrayTrait(java.lang.String traitName, java.lang.String value, java.lang.String reqNamespaceURI, java.lang.String reqLocalName, java.lang.String reqTraitNamespace, java.lang.String reqTraitName)Validates the float input trait value.
if (SVGConstants.SVG_STROKE_WIDTH_ATTRIBUTE == traitName) {
return new float[][] {
{parsePositiveFloatTrait(traitName, value)}
};
} else if (SVGConstants.SVG_STROKE_MITERLIMIT_ATTRIBUTE
.equals(traitName)) {
float miter = parseFloatTrait(traitName, value);
if (miter < 1) {
throw illegalTraitValue(traitName, value);
}
return new float[][] { {miter} };
} else if (SVGConstants.SVG_STROKE_DASHOFFSET_ATTRIBUTE
.equals(traitName)) {
return new float[][] { {parseFloatTrait(traitName, value)} };
} else if (SVGConstants.SVG_FILL_RULE_ATTRIBUTE == traitName
||
SVGConstants.SVG_STROKE_LINEJOIN_ATTRIBUTE == traitName
||
SVGConstants.SVG_STROKE_LINECAP_ATTRIBUTE == traitName
||
SVGConstants.SVG_DISPLAY_ATTRIBUTE == traitName
||
SVGConstants.SVG_VISIBILITY_ATTRIBUTE == traitName) {
throw unsupportedTraitType(traitName, TRAIT_TYPE_FLOAT);
} else if (SVGConstants.SVG_COLOR_ATTRIBUTE == traitName) {
RGB color = GraphicsProperties.INITIAL_COLOR;
if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
color = (RGB) getInheritedPropertyState(PROPERTY_COLOR);
} else {
color = parseColorTrait
(SVGConstants.SVG_COLOR_ATTRIBUTE, value);
}
if (color == null) {
throw illegalTraitValue(traitName, value);
}
return new float[][] {
{color.getRed(), color.getGreen(), color.getBlue()}
};
} else if (SVGConstants.SVG_FILL_ATTRIBUTE == traitName) {
RGB color = GraphicsProperties.INITIAL_FILL;
if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
color = (RGB) getInheritedPropertyState(PROPERTY_FILL);
} else if (SVGConstants.CSS_CURRENTCOLOR_VALUE.equals(value)) {
color = this.color;
} else {
color = parseColorTrait
(SVGConstants.SVG_FILL_ATTRIBUTE, value);
}
if (color == null) {
throw illegalTraitValue(traitName, value);
}
return new float[][] {
{color.getRed(), color.getGreen(), color.getBlue()}
};
} else if (SVGConstants.SVG_STROKE_ATTRIBUTE == traitName) {
RGB color = GraphicsProperties.INITIAL_STROKE;
if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
color = (RGB) getInheritedPropertyState(PROPERTY_STROKE);
} else if (SVGConstants.CSS_CURRENTCOLOR_VALUE.equals(value)) {
color = getColor();
} else {
color = parseColorTrait
(SVGConstants.SVG_STROKE_ATTRIBUTE, value);
}
if (color == null) {
throw illegalTraitValue(traitName, value);
}
return new float[][] {
{color.getRed(), color.getGreen(), color.getBlue()}
};
} else if (SVGConstants.SVG_FILL_OPACITY_ATTRIBUTE == traitName) {
float v = GraphicsNode.INITIAL_FILL_OPACITY;
if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
if (parent != null) {
v = (getInheritedPackedPropertyState(PROPERTY_FILL_OPACITY)
>> 7) / 200.0f;
}
} else {
v = parseFloatTrait(traitName, value);
if (v < 0) {
v = 0;
} else if (v > 1) {
v = 1;
}
}
return new float[][] {{v}};
} else if (SVGConstants.SVG_STROKE_OPACITY_ATTRIBUTE == traitName) {
float v = GraphicsProperties.INITIAL_STROKE_OPACITY;
if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
v = (getInheritedPackedPropertyState(PROPERTY_STROKE_OPACITY)
>> 15) / 200.0f;
} else {
v = parseFloatTrait(traitName, value);
if (v < 0) {
v = 0;
} else if (v > 1) {
v = 1;
}
}
return new float[][] {{v}};
} else if (SVGConstants.SVG_STROKE_DASHARRAY_ATTRIBUTE
.equals(traitName)) {
float[] da = parsePositiveFloatArrayTrait(traitName, value);
if (da == null) {
throw illegalTraitValue(traitName, value);
} else {
return new float[][] {da};
}
} else if (SVGConstants.SVG_OPACITY_ATTRIBUTE == traitName) {
float v = GraphicsProperties.INITIAL_OPACITY;
if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
v = getInheritedPackedPropertyState(PROPERTY_OPACITY) /
200.0f;
} else {
v = parseFloatTrait(traitName, value);
if (v < 0) {
v = 0;
} else if (v > 1) {
v = 1;
}
}
return new float[][] {{v}};
} else {
return super.validateFloatArrayTrait(traitName,
value,
reqNamespaceURI,
reqLocalName,
reqTraitNamespace,
reqTraitName);
}
|
java.lang.String | validateTraitNS(java.lang.String namespaceURI, java.lang.String traitName, java.lang.String value, java.lang.String reqNamespaceURI, java.lang.String reqLocalName, java.lang.String reqTraitNamespace, java.lang.String reqTraitName)Validates the input trait value.
if (namespaceURI != null && namespaceURI != NULL_NS) {
return super.validateTraitNS(namespaceURI,
traitName,
value,
reqNamespaceURI,
reqLocalName,
reqTraitNamespace,
reqTraitName);
}
if (SVGConstants.SVG_STROKE_WIDTH_ATTRIBUTE == traitName
||
SVGConstants.SVG_STROKE_MITERLIMIT_ATTRIBUTE == traitName
||
SVGConstants.SVG_STROKE_DASHOFFSET_ATTRIBUTE == traitName
||
SVGConstants.SVG_COLOR_ATTRIBUTE == traitName
||
SVGConstants.SVG_FILL_ATTRIBUTE == traitName
||
SVGConstants.SVG_STROKE_ATTRIBUTE == traitName
||
SVGConstants.SVG_FILL_OPACITY_ATTRIBUTE == traitName
||
SVGConstants.SVG_STROKE_OPACITY_ATTRIBUTE == traitName
||
SVGConstants.SVG_STROKE_DASHARRAY_ATTRIBUTE
.equals(traitName)
||
SVGConstants.SVG_OPACITY_ATTRIBUTE == traitName) {
throw unsupportedTraitType(traitName, TRAIT_TYPE_FLOAT);
} else if (SVGConstants.SVG_FILL_RULE_ATTRIBUTE == traitName) {
if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
return fillRuleToStringTrait
(getInheritedPackedPropertyState(PROPERTY_FILL_RULE));
}
if (!SVGConstants.CSS_NONZERO_VALUE.equals(value)
&&
!SVGConstants.CSS_EVENODD_VALUE.equals(value)) {
throw illegalTraitValue(traitName, value);
}
return value;
} else if (SVGConstants.SVG_STROKE_LINEJOIN_ATTRIBUTE == traitName) {
if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
return strokeLineJoinToStringTrait(
getInheritedPackedPropertyState(
PROPERTY_STROKE_LINE_JOIN));
}
if (!SVGConstants.CSS_MITER_VALUE.equals(value)
&&
!SVGConstants.CSS_ROUND_VALUE.equals(value)
&&
!SVGConstants.CSS_BEVEL_VALUE.equals(value)) {
throw illegalTraitValue(traitName, value);
}
return value;
} else if (SVGConstants.SVG_STROKE_LINECAP_ATTRIBUTE == traitName) {
if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
return strokeLineCapToStringTrait(
getInheritedPackedPropertyState(
PROPERTY_STROKE_LINE_CAP));
}
if (!SVGConstants.CSS_BUTT_VALUE.equals(value)
&&
!SVGConstants.CSS_ROUND_VALUE.equals(value)
&&
!SVGConstants.CSS_SQUARE_VALUE.equals(value)) {
throw illegalTraitValue(traitName, value);
}
return value;
} else if (SVGConstants.SVG_DISPLAY_ATTRIBUTE == traitName) {
if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
if (getInheritedPackedPropertyState(PROPERTY_DISPLAY) != 0) {
return SVGConstants.CSS_INLINE_VALUE;
}
return SVGConstants.CSS_NONE_VALUE;
}
if (!SVGConstants.CSS_INLINE_VALUE.equals(value)
&&
!SVGConstants.CSS_NONE_VALUE.equals(value)) {
throw illegalTraitValue(traitName, value);
}
return value;
} else if (SVGConstants.SVG_VISIBILITY_ATTRIBUTE == traitName) {
if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
if (getInheritedPackedPropertyState(PROPERTY_VISIBILITY) != 0) {
return SVGConstants.CSS_VISIBLE_VALUE;
} else {
return SVGConstants.CSS_HIDDEN_VALUE;
}
}
if (!SVGConstants.CSS_VISIBLE_VALUE.equals(value)
&&
!SVGConstants.CSS_HIDDEN_VALUE.equals(value)) {
throw illegalTraitValue(traitName, value);
}
return value;
}
return super.validateTraitNS(namespaceURI,
traitName,
value,
reqNamespaceURI,
reqLocalName,
reqTraitNamespace,
reqTraitName);
|