Methods Summary |
---|
protected boolean | contributeBBox()A CompositeGraphicsNodeProxy contributes to its parent
bounding box only if its display property is turned on.
return (pack & CompositeGraphicsNode.DISPLAY_MASK) != 0;
|
public org.w3c.dom.svg.SVGRect | getBBox()
return null;
|
public com.sun.perseus.j2d.RGB | getColor()
return this.color;
|
public boolean | getDisplay()
return ((pack & CompositeGraphicsNode.DISPLAY_MASK)
== CompositeGraphicsNode.DISPLAY_MASK);
|
public com.sun.perseus.j2d.PaintServer | getFill()
return fill;
|
public float | getFillOpacity()
return ((pack & CompositeGraphicsNode.FILL_OPACITY_MASK) >> 7) / 200.0f;
|
public int | getFillRule()
if ((pack & CompositeGraphicsNode.FILL_RULE_MASK)
==
CompositeGraphicsNode.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 GraphicsNode.PROPERTY_STROKE_WIDTH:
return strokeWidth;
case GraphicsNode.PROPERTY_STROKE_MITER_LIMIT:
return strokeMiterLimit;
case GraphicsNode.PROPERTY_STROKE_DASH_OFFSET:
return strokeDashOffset;
default:
return super.getFloatPropertyState(propertyIndex);
}
|
public 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 & CompositeGraphicsNode.OPACITY_MASK) / 200.0f;
|
protected int | getPackedPropertyState(int propertyIndex)Returns the value of 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 GraphicsNode.PROPERTY_FILL:
return fill;
case GraphicsNode.PROPERTY_STROKE:
return stroke;
case GraphicsNode.PROPERTY_COLOR:
return color;
case GraphicsNode.PROPERTY_STROKE_DASH_ARRAY:
return getStrokeDashArray();
default:
return super.getPropertyState(propertyIndex);
}
|
public com.sun.perseus.j2d.PaintServer | getStroke()
return stroke;
|
public float[] | getStrokeDashArray()
return strokeDashArray;
|
public float | getStrokeDashOffset()
return strokeDashOffset;
|
public int | getStrokeLineCap()
switch (pack & CompositeGraphicsNode.STROKE_LINE_CAP_MASK) {
case CompositeGraphicsNode.CAP_BUTT_IMPL:
return CAP_BUTT;
case CompositeGraphicsNode.CAP_ROUND_IMPL:
return CAP_ROUND;
default:
return CAP_SQUARE;
}
|
public int | getStrokeLineJoin()
switch (pack & CompositeGraphicsNode.STROKE_LINE_JOIN_MASK) {
case CompositeGraphicsNode.JOIN_MITER_IMPL:
return JOIN_MITER;
case CompositeGraphicsNode.JOIN_ROUND_IMPL:
return JOIN_ROUND;
default:
return JOIN_BEVEL;
}
|
public float | getStrokeMiterLimit()
return strokeMiterLimit;
|
public float | getStrokeOpacity()
return ((pack & CompositeGraphicsNode.STROKE_OPACITY_MASK) >> 15)
/ 200.0f;
|
public float | getStrokeWidth()
return strokeWidth;
|
public com.sun.perseus.j2d.Transform | getTransformState()
return txf;
|
public boolean | getVisibility()
return ((pack & CompositeGraphicsNode.VISIBILITY_MASK)
== CompositeGraphicsNode.VISIBILITY_MASK);
|
protected boolean | isFloatPropertyState(int propertyIndex, float propertyValue)Checks the state of the float type 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);
}
|
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.DISPLAY_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 type property value.
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)This method is used to implement the PaintTarget interface which is used
to compute the rendering area. However, the paint server updates are
handled by the proxied node, so this should _never_ be called.
// Do nothing.
|
protected void | propagateFloatPropertyState(int propertyIndex, float parentPropertyValue)Called when the computed value of the given float-valued property
has changed.
// Propagate to expanded children.
ModelNode node = firstExpandedChild;
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 expanded children.
ModelNode node = firstExpandedChild;
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 expanded children.
ModelNode node = firstExpandedChild;
while (node != null) {
node.recomputePropertyState(propertyIndex, parentPropertyValue);
node = node.nextSibling;
}
|
protected final void | proxiedFloatPropertyStateChange(int propertyIndex, float proxiedComputedValue)Called by the proxied node when the given float-valued property's
computed value has changed.
if (!((CompositeGraphicsNode) proxied).isInherited(propertyIndex)) {
// The property is specified on the proxied node, update the
// state with that specified value.
setFloatPropertyState(propertyIndex, proxiedComputedValue);
} else {
// The property is unspecified on the proxied node. Inherit from
// the proxy's parent (and not the proxied's parent).
setFloatPropertyState(
propertyIndex,
getInheritedFloatPropertyState(propertyIndex));
}
// Do not propagate changes to the proxy children: propagation happens
// through the proxied's tree, so children will be notified if needed.
|
protected final void | proxiedPackedPropertyStateChange(int propertyIndex, int proxiedComputedValue)Called by the proxied node when the given packed property's computed
value has changed.
if (!((CompositeGraphicsNode) proxied).isInherited(propertyIndex)) {
// The property is specified on the proxied node, update the
// state with that specified value.
setPackedPropertyState(propertyIndex, proxiedComputedValue);
} else {
// The property is unspecified on the proxied node. Inherit from
// the proxy's parent (and not the proxied's parent).
setPackedPropertyState(propertyIndex,
getInheritedPackedPropertyState(propertyIndex));
}
// Do not propagate changes to the proxy children: propagation happens
// through the proxied's tree, so children will be notified if needed.
|
protected void | proxiedPropertyStateChange(int propertyIndex, java.lang.Object proxiedComputedValue)Called by the proxied node when the given Object-valued property's
computed value has changed.
if (!((CompositeGraphicsNode) proxied).isInherited(propertyIndex)) {
// The property is specified on the proxied node, update the
// state with that specified value.
setPropertyState(propertyIndex, proxiedComputedValue);
} else {
// The property is unspecified on the proxied node. Inherit from
// the proxy's parent (and not the proxied's parent).
setPropertyState(propertyIndex,
getInheritedPropertyState(propertyIndex));
}
// Do not propagate changes to the proxy children: propagation happens
// through the proxied's tree, so children will be notified if needed.
|
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 (!((CompositeGraphicsNode) proxied).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(
GraphicsNode.PROPERTY_FILL,
p.getPropertyState(GraphicsNode.PROPERTY_FILL));
recomputePropertyState(
GraphicsNode.PROPERTY_STROKE,
p.getPropertyState(GraphicsNode.PROPERTY_STROKE));
recomputePropertyState(
GraphicsNode.PROPERTY_COLOR,
p.getPropertyState(GraphicsNode.PROPERTY_COLOR));
recomputePackedPropertyState(
GraphicsNode.PROPERTY_FILL_RULE,
p.getPackedPropertyState(GraphicsNode.PROPERTY_FILL_RULE));
recomputeFloatPropertyState(
GraphicsNode.PROPERTY_STROKE_WIDTH,
p.getFloatPropertyState(GraphicsNode.PROPERTY_STROKE_WIDTH));
recomputePackedPropertyState(
GraphicsNode.PROPERTY_STROKE_LINE_JOIN,
p.getPackedPropertyState(
GraphicsNode.PROPERTY_STROKE_LINE_JOIN));
recomputePackedPropertyState(
GraphicsNode.PROPERTY_STROKE_LINE_CAP,
p.getPackedPropertyState(
GraphicsNode.PROPERTY_STROKE_LINE_CAP));
recomputeFloatPropertyState(
GraphicsNode.PROPERTY_STROKE_MITER_LIMIT,
p.getFloatPropertyState(
GraphicsNode.PROPERTY_STROKE_MITER_LIMIT));
recomputePropertyState(
GraphicsNode.PROPERTY_STROKE_DASH_ARRAY,
p.getPropertyState(GraphicsNode.PROPERTY_STROKE_DASH_ARRAY));
recomputeFloatPropertyState(
GraphicsNode.PROPERTY_STROKE_DASH_OFFSET,
p.getFloatPropertyState(
GraphicsNode.PROPERTY_STROKE_DASH_OFFSET));
recomputePackedPropertyState(
GraphicsNode.PROPERTY_DISPLAY,
p.getPackedPropertyState(GraphicsNode.PROPERTY_DISPLAY));
recomputePackedPropertyState(
GraphicsNode.PROPERTY_VISIBILITY,
p.getPackedPropertyState(GraphicsNode.PROPERTY_VISIBILITY));
recomputePackedPropertyState(
GraphicsNode.PROPERTY_FILL_OPACITY,
p.getPackedPropertyState(GraphicsNode.PROPERTY_FILL_OPACITY));
recomputePackedPropertyState(
GraphicsNode.PROPERTY_STROKE_OPACITY,
p.getPackedPropertyState(GraphicsNode.PROPERTY_STROKE_OPACITY));
recomputePackedPropertyState(
GraphicsNode.PROPERTY_OPACITY,
p.getPackedPropertyState(GraphicsNode.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 (!((CompositeGraphicsNode) proxied).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 (!((CompositeGraphicsNode) proxied).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 = proxied.appendTransform(parentTransform, txf);
computeCanRenderTransformBit(txf);
inverseTxf = null;
// inverseTxf = computeInverseTransform(txf, parentTransform,
// inverseTxf);
recomputeTransformState(txf, firstExpandedChild);
|
public void | setColor(com.sun.perseus.j2d.RGB newColor)
color = newColor;
|
public void | setDisplay(boolean newDisplay)
if (newDisplay) {
pack |= CompositeGraphicsNode.DISPLAY_MASK;
} else {
pack &= ~CompositeGraphicsNode.DISPLAY_MASK;
}
computeCanRenderDisplayBit(newDisplay);
|
public void | setFill(com.sun.perseus.j2d.PaintServer newFill)
this.fill = newFill;
|
public void | setFillOpacity(float newFillOpacity)
pack &= ~CompositeGraphicsNode.FILL_OPACITY_MASK;
pack |= ((((int) (newFillOpacity * 200)) << 7)
& CompositeGraphicsNode.FILL_OPACITY_MASK);
|
public final void | setFillRule(int newFillRule)
if (newFillRule == WIND_NON_ZERO) {
pack |= CompositeGraphicsNode.FILL_RULE_MASK;
} else {
pack &= ~CompositeGraphicsNode.FILL_RULE_MASK;
}
|
protected void | setFloatPropertyState(int propertyIndex, float propertyValue)Sets the computed value of the given float-valued property.
switch (propertyIndex) {
case GraphicsNode.PROPERTY_STROKE_WIDTH:
setStrokeWidth(propertyValue);
break;
case GraphicsNode.PROPERTY_STROKE_MITER_LIMIT:
setStrokeMiterLimit(propertyValue);
break;
case GraphicsNode.PROPERTY_STROKE_DASH_OFFSET:
setStrokeDashOffset(propertyValue);
break;
default:
super.setFloatPropertyState(propertyIndex, propertyValue);
break;
}
|
public void | setOpacity(float newOpacity)
pack2 &= ~CompositeGraphicsNode.OPACITY_MASK;
pack2 |= (((int) (newOpacity * 200))
& CompositeGraphicsNode.OPACITY_MASK);
|
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) {
setFillRule(WIND_EVEN_ODD);
} else {
setFillRule(WIND_NON_ZERO);
}
break;
case GraphicsNode.PROPERTY_STROKE_LINE_JOIN:
switch (propertyValue) {
case CompositeGraphicsNode.JOIN_MITER_IMPL:
setStrokeLineJoin(JOIN_MITER);
break;
case CompositeGraphicsNode.JOIN_ROUND_IMPL:
setStrokeLineJoin(JOIN_ROUND);
break;
case CompositeGraphicsNode.JOIN_BEVEL_IMPL:
default:
setStrokeLineJoin(JOIN_BEVEL);
break;
}
break;
case GraphicsNode.PROPERTY_STROKE_LINE_CAP:
switch (propertyValue) {
case CompositeGraphicsNode.CAP_BUTT_IMPL:
setStrokeLineCap(CAP_BUTT);
break;
case CompositeGraphicsNode.CAP_ROUND_IMPL:
setStrokeLineCap(CAP_ROUND);
break;
case CompositeGraphicsNode.CAP_SQUARE_IMPL:
default:
setStrokeLineCap(CAP_SQUARE);
break;
}
break;
case GraphicsNode.PROPERTY_DISPLAY:
if (propertyValue != 0) {
setDisplay(true);
} else {
setDisplay(false);
}
break;
case GraphicsNode.PROPERTY_VISIBILITY:
if (propertyValue != 0) {
setVisibility(true);
} else {
setVisibility(false);
}
break;
case GraphicsNode.PROPERTY_FILL_OPACITY:
setFillOpacity((propertyValue >> 7) / 200.0f);
break;
case GraphicsNode.PROPERTY_STROKE_OPACITY:
setStrokeOpacity((propertyValue >> 15) / 200.0f);
break;
case GraphicsNode.PROPERTY_OPACITY:
setOpacity(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 GraphicsNode.PROPERTY_FILL:
setFill((PaintServer) propertyValue);
break;
case GraphicsNode.PROPERTY_STROKE:
setStroke((PaintServer) propertyValue);
break;
case GraphicsNode.PROPERTY_COLOR:
setColor((RGB) propertyValue);
break;
case GraphicsNode.PROPERTY_STROKE_DASH_ARRAY:
setStrokeDashArray((float[]) propertyValue);
break;
default:
super.setPropertyState(propertyIndex, propertyValue);
break;
}
|
public void | setStroke(com.sun.perseus.j2d.PaintServer newStroke)
this.stroke = newStroke;
|
public void | setStrokeDashArray(float[] newStrokeDashArray)
strokeDashArray = newStrokeDashArray;
|
public void | setStrokeDashOffset(float newStrokeDashOffset)
strokeDashOffset = newStrokeDashOffset;
|
public void | setStrokeLineCap(int newStrokeLineCap)
// Clear stroke-linecap
pack &= ~CompositeGraphicsNode.STROKE_LINE_CAP_MASK;
switch (newStrokeLineCap) {
case CAP_BUTT:
pack |= CompositeGraphicsNode.CAP_BUTT_IMPL;
break;
case CAP_ROUND:
pack |= CompositeGraphicsNode.CAP_ROUND_IMPL;
break;
default:
pack |= CompositeGraphicsNode.CAP_SQUARE_IMPL;
break;
}
|
public void | setStrokeLineJoin(int newStrokeLineJoin)
// Clear stroke-linejoin
pack &= ~CompositeGraphicsNode.STROKE_LINE_JOIN_MASK;
switch (newStrokeLineJoin) {
case JOIN_MITER:
pack |= CompositeGraphicsNode.JOIN_MITER_IMPL;
break;
case JOIN_ROUND:
pack |= CompositeGraphicsNode.JOIN_ROUND_IMPL;
break;
default:
pack |= CompositeGraphicsNode.JOIN_BEVEL_IMPL;
break;
}
|
public void | setStrokeMiterLimit(float newStrokeMiterLimit)
strokeMiterLimit = newStrokeMiterLimit;
|
public void | setStrokeOpacity(float newStrokeOpacity)
pack &= ~CompositeGraphicsNode.STROKE_OPACITY_MASK;
pack |= ((((int) (newStrokeOpacity * 200)) << 15)
& CompositeGraphicsNode.STROKE_OPACITY_MASK);
|
public void | setStrokeWidth(float newStrokeWidth)
strokeWidth = newStrokeWidth;
|
public void | setVisibility(boolean newVisibility)
if (newVisibility) {
pack |= CompositeGraphicsNode.VISIBILITY_MASK;
} else {
pack &= ~CompositeGraphicsNode.VISIBILITY_MASK;
}
|