Methods Summary |
---|
com.sun.perseus.j2d.Box | addBBox(com.sun.perseus.j2d.Box bbox, com.sun.perseus.j2d.Transform t)
ModelNode c = getFirstExpandedChild();
while (c != null) {
if (c.canRenderState == 0) {
bbox = c.addBBox(bbox, c.appendTransform(t, null));
}
c = c.nextSibling;
}
return bbox;
|
public org.w3c.dom.svg.SVGRect | getBBox()
return addBBox(null, null);
|
protected float | getFloatPropertyState(int propertyIndex)Returns the value for the given float property.
switch (propertyIndex) {
case TextNode.PROPERTY_FONT_SIZE:
return fontSize;
default:
return super.getFloatPropertyState(propertyIndex);
}
|
public java.lang.String[] | getFontFamily()
return fontFamily;
|
public float | getFontSize()
return fontSize;
|
public int | getFontStyle()
switch (pack & StructureNode.FONT_STYLE_MASK) {
case StructureNode.FONT_STYLE_NORMAL_IMPL:
return FONT_STYLE_NORMAL;
case StructureNode.FONT_STYLE_ITALIC_IMPL:
return FONT_STYLE_ITALIC;
default:
return FONT_STYLE_OBLIQUE;
}
|
public int | getFontWeight()
switch (pack & StructureNode.FONT_WEIGHT_MASK) {
case StructureNode.FONT_WEIGHT_100_IMPL:
return FONT_WEIGHT_100;
case StructureNode.FONT_WEIGHT_200_IMPL:
return FONT_WEIGHT_200;
case StructureNode.FONT_WEIGHT_300_IMPL:
return FONT_WEIGHT_300;
case StructureNode.FONT_WEIGHT_400_IMPL:
return FONT_WEIGHT_400;
case StructureNode.FONT_WEIGHT_500_IMPL:
return FONT_WEIGHT_500;
case StructureNode.FONT_WEIGHT_600_IMPL:
return FONT_WEIGHT_600;
case StructureNode.FONT_WEIGHT_700_IMPL:
return FONT_WEIGHT_700;
case StructureNode.FONT_WEIGHT_800_IMPL:
return FONT_WEIGHT_800;
case StructureNode.FONT_WEIGHT_900_IMPL:
return FONT_WEIGHT_900;
case StructureNode.FONT_WEIGHT_LIGHTER_IMPL:
return TextNode.FONT_WEIGHT_LIGHTER;
default:
return TextNode.FONT_WEIGHT_BOLDER;
}
|
protected int | getPackedPropertyState(int propertyIndex)Returns the value for the given packed property.
switch (propertyIndex) {
case TextNode.PROPERTY_FONT_STYLE:
return pack & StructureNode.FONT_STYLE_MASK;
case TextNode.PROPERTY_FONT_WEIGHT:
return pack & StructureNode.FONT_WEIGHT_MASK;
case TextNode.PROPERTY_TEXT_ANCHOR:
return pack & StructureNode.TEXT_ANCHOR_MASK;
default:
return super.getPackedPropertyState(propertyIndex);
}
|
protected java.lang.Object | getPropertyState(int propertyIndex)Returns the value for the given property.
switch (propertyIndex) {
case TextNode.PROPERTY_FONT_FAMILY:
return fontFamily;
default:
return super.getPropertyState(propertyIndex);
}
|
public int | getTextAnchor()
switch (pack & StructureNode.TEXT_ANCHOR_MASK) {
case StructureNode.TEXT_ANCHOR_START_IMPL:
return TEXT_ANCHOR_START;
case StructureNode.TEXT_ANCHOR_MIDDLE_IMPL:
return TEXT_ANCHOR_MIDDLE;
default:
return TEXT_ANCHOR_END;
}
|
protected boolean | isFloatPropertyState(int propertyIndex, float propertyValue)Checks the state of the float property value.
switch (propertyIndex) {
case TextNode.PROPERTY_FONT_SIZE:
return fontSize == propertyValue;
default:
return super.isFloatPropertyState(propertyIndex, propertyValue);
}
|
protected boolean | isPackedPropertyState(int propertyIndex, int propertyValue)Checks the state of the property value.
switch (propertyIndex) {
case TextNode.PROPERTY_FONT_STYLE:
return (propertyValue
==
(pack & StructureNode.FONT_STYLE_MASK));
case TextNode.PROPERTY_FONT_WEIGHT:
return (propertyValue
==
(pack & StructureNode.FONT_WEIGHT_MASK));
case TextNode.PROPERTY_TEXT_ANCHOR:
return (propertyValue
==
(pack & StructureNode.TEXT_ANCHOR_MASK));
default:
return super.isPackedPropertyState(propertyIndex, propertyValue);
}
|
protected boolean | isPropertyState(int propertyIndex, java.lang.Object propertyValue)Checks the state of the property value.
switch (propertyIndex) {
case TextNode.PROPERTY_FONT_FAMILY:
return fontFamily == propertyValue;
default:
return super.isPropertyState(propertyIndex, propertyValue);
}
|
public void | paint(com.sun.perseus.j2d.RenderGraphics rg)By default, an ElementNodeProxy does not paint anything.
if (canRenderState != 0) {
return;
}
paint(getFirstExpandedChild(), rg);
|
void | recomputeInheritedProperties()Recomputes all inherited properties.
super.recomputeInheritedProperties();
ModelNode p = ownerDocument;
if (parent != null) {
p = parent;
}
recomputePropertyState(
TextNode.PROPERTY_FONT_FAMILY,
p.getPropertyState(TextNode.PROPERTY_FONT_FAMILY));
recomputeFloatPropertyState(
TextNode.PROPERTY_FONT_SIZE,
p.getFloatPropertyState(TextNode.PROPERTY_FONT_SIZE));
recomputePackedPropertyState(
TextNode.PROPERTY_FONT_STYLE,
p.getPackedPropertyState(TextNode.PROPERTY_FONT_STYLE));
recomputePackedPropertyState(
TextNode.PROPERTY_FONT_WEIGHT,
p.getPackedPropertyState(TextNode.PROPERTY_FONT_WEIGHT));
recomputePackedPropertyState(
TextNode.PROPERTY_TEXT_ANCHOR,
p.getPackedPropertyState(TextNode.PROPERTY_TEXT_ANCHOR));
|
protected void | recomputePackedPropertyState(int propertyIndex, int parentPropertyValue)Recomputes the given packed property's state given the new parent
property.
if (propertyIndex != StructureNode.PROPERTY_FONT_WEIGHT) {
super.recomputePackedPropertyState(propertyIndex,
parentPropertyValue);
} else {
// We do not need to recompute the fontWeight value if:
// - the fontWeight is _not_ inherited & not relative (i.e. lighter
// or bolder)
// or
// - the property is inherited but the new parent property computed
// value is the same as the current value & the bolder and lighter
// markes are in the same state
if ((!((StructureNode) proxied).isInherited(propertyIndex)
&&
!((StructureNode) proxied).isMarkerSet(
StructureNode.FONT_WEIGHT_BOLDER_MARKER)
&&
!((StructureNode) proxied).isMarkerSet(
StructureNode.FONT_WEIGHT_LIGHTER_MARKER))
||
isPackedPropertyState(propertyIndex, parentPropertyValue)) {
return;
}
setPackedPropertyState(propertyIndex, parentPropertyValue);
propagatePackedPropertyState(propertyIndex, parentPropertyValue);
}
|
protected void | setFloatPropertyState(int propertyIndex, float propertyValue)Sets the computed value for the given float property.
switch (propertyIndex) {
case TextNode.PROPERTY_FONT_SIZE:
setFontSize(propertyValue);
break;
default:
super.setFloatPropertyState(propertyIndex, propertyValue);
}
|
public void | setFontFamily(java.lang.String[] newFontFamily)
this.fontFamily = newFontFamily;
|
public void | setFontSize(float newFontSize)
this.fontSize = newFontSize;
|
public void | setFontStyle(int newFontStyle)
pack &= ~StructureNode.FONT_STYLE_MASK;
switch (newFontStyle) {
case FONT_STYLE_NORMAL:
pack |= StructureNode.FONT_STYLE_NORMAL_IMPL;
break;
case FONT_STYLE_ITALIC:
pack |= StructureNode.FONT_STYLE_ITALIC_IMPL;
break;
default:
pack |= StructureNode.FONT_STYLE_OBLIQUE_IMPL;
break;
}
|
public void | setFontWeight(int newFontWeight)
pack &= ~StructureNode.FONT_WEIGHT_MASK;
switch (newFontWeight) {
case FONT_WEIGHT_100:
pack |= StructureNode.FONT_WEIGHT_100_IMPL;
break;
case FONT_WEIGHT_200:
pack |= StructureNode.FONT_WEIGHT_200_IMPL;
break;
case FONT_WEIGHT_300:
pack |= StructureNode.FONT_WEIGHT_300_IMPL;
break;
case FONT_WEIGHT_400:
pack |= StructureNode.FONT_WEIGHT_400_IMPL;
break;
case FONT_WEIGHT_500:
pack |= StructureNode.FONT_WEIGHT_500_IMPL;
break;
case FONT_WEIGHT_600:
pack |= StructureNode.FONT_WEIGHT_600_IMPL;
break;
case FONT_WEIGHT_700:
pack |= StructureNode.FONT_WEIGHT_700_IMPL;
break;
case FONT_WEIGHT_800:
pack |= StructureNode.FONT_WEIGHT_800_IMPL;
break;
case FONT_WEIGHT_900:
pack |= StructureNode.FONT_WEIGHT_900_IMPL;
break;
case StructureNode.FONT_WEIGHT_LIGHTER:
pack |= StructureNode.FONT_WEIGHT_LIGHTER_IMPL;
break;
default:
pack |= StructureNode.FONT_WEIGHT_BOLDER_IMPL;
break;
}
|
protected void | setPackedPropertyState(int propertyIndex, int propertyValue)Sets the computed value for the given packed property.
switch (propertyIndex) {
case StructureNode.PROPERTY_FONT_STYLE:
switch (propertyValue) {
case StructureNode.FONT_STYLE_NORMAL_IMPL:
setFontStyle(FONT_STYLE_NORMAL);
break;
case StructureNode.FONT_STYLE_ITALIC_IMPL:
setFontStyle(FONT_STYLE_ITALIC);
break;
case StructureNode.FONT_STYLE_OBLIQUE_IMPL:
default:
setFontStyle(FONT_STYLE_OBLIQUE);
break;
}
break;
case StructureNode.PROPERTY_FONT_WEIGHT:
switch (propertyValue) {
case StructureNode.FONT_WEIGHT_100_IMPL:
setFontWeight(FONT_WEIGHT_100);
break;
case StructureNode.FONT_WEIGHT_200_IMPL:
setFontWeight(FONT_WEIGHT_200);
break;
case StructureNode.FONT_WEIGHT_300_IMPL:
setFontWeight(FONT_WEIGHT_300);
break;
case StructureNode.FONT_WEIGHT_400_IMPL:
setFontWeight(FONT_WEIGHT_400);
break;
case StructureNode.FONT_WEIGHT_500_IMPL:
setFontWeight(FONT_WEIGHT_500);
break;
case StructureNode.FONT_WEIGHT_600_IMPL:
setFontWeight(FONT_WEIGHT_600);
break;
case StructureNode.FONT_WEIGHT_700_IMPL:
setFontWeight(FONT_WEIGHT_700);
break;
case StructureNode.FONT_WEIGHT_800_IMPL:
setFontWeight(FONT_WEIGHT_800);
break;
case StructureNode.FONT_WEIGHT_900_IMPL:
setFontWeight(FONT_WEIGHT_900);
break;
}
break;
case StructureNode.PROPERTY_TEXT_ANCHOR:
switch (propertyValue) {
case StructureNode.TEXT_ANCHOR_START_IMPL:
setTextAnchor(TEXT_ANCHOR_START);
break;
case StructureNode.TEXT_ANCHOR_MIDDLE_IMPL:
setTextAnchor(TEXT_ANCHOR_MIDDLE);
break;
case StructureNode.TEXT_ANCHOR_END_IMPL:
default:
setTextAnchor(TEXT_ANCHOR_END);
break;
}
break;
default:
super.setPackedPropertyState(propertyIndex, propertyValue);
}
|
protected void | setPropertyState(int propertyIndex, java.lang.Object propertyValue)Sets the computed value for the given property.
switch (propertyIndex) {
case TextNode.PROPERTY_FONT_FAMILY:
setFontFamily((String[]) propertyValue);
break;
default:
super.setPropertyState(propertyIndex, propertyValue);
}
|
public void | setTextAnchor(int newTextAnchor)Sets the value of the computed text anchor property.
pack &= ~StructureNode.TEXT_ANCHOR_MASK;
switch (newTextAnchor) {
case TEXT_ANCHOR_START:
pack |= StructureNode.TEXT_ANCHOR_START_IMPL;
break;
case TEXT_ANCHOR_MIDDLE:
pack |= StructureNode.TEXT_ANCHOR_MIDDLE_IMPL;
break;
default:
pack |= StructureNode.TEXT_ANCHOR_END_IMPL;
break;
}
|