Methods Summary |
---|
com.sun.perseus.j2d.Box | addNodeBBox(com.sun.perseus.j2d.Box bbox, com.sun.perseus.j2d.Transform t)
float x1 = this.x1;
float x2 = this.x2;
float y1 = this.y1;
float y2 = this.y2;
if (t != null) {
x1 = t.getComponent(0) * this.x1
+ t.getComponent(2) * this.y1
+ t.getComponent(4);
y1 = t.getComponent(1) * this.x1
+ t.getComponent(3) * this.y1
+ t.getComponent(5);
x2 = t.getComponent(0) * this.x2
+ t.getComponent(2) * this.y2
+ t.getComponent(4);
y2 = t.getComponent(1) * this.x2
+ t.getComponent(3) * this.y2
+ t.getComponent(5);
}
if (x1 > x2) {
float x = x2;
x2 = x1;
x1 = x;
}
if (y1 > y2) {
float y = y2;
y2 = y1;
y1 = y;
}
return addBBox(bbox, x1, y1, x2 - x1, y2 - y1);
|
public boolean | contains(float x, float y, int fillRule)
return false;
|
TraitAnim | createTraitAnimImpl(java.lang.String traitName)
if (SVGConstants.SVG_X1_ATTRIBUTE == traitName
||
SVGConstants.SVG_Y1_ATTRIBUTE == traitName
||
SVGConstants.SVG_X2_ATTRIBUTE == traitName
||
SVGConstants.SVG_Y2_ATTRIBUTE == traitName) {
return new FloatTraitAnim(this, traitName, TRAIT_TYPE_FLOAT);
} else {
return super.createTraitAnimImpl(traitName);
}
|
public void | drawShape(com.sun.perseus.j2d.RenderGraphics rg)
rg.drawLine(x1, y1, x2, y2);
|
public void | fillShape(com.sun.perseus.j2d.RenderGraphics rg)
|
float | getFloatTraitImpl(java.lang.String name)Supported traits: x1, x2, y1, y2
if (SVGConstants.SVG_X1_ATTRIBUTE == name) {
return x1;
} else if (SVGConstants.SVG_X2_ATTRIBUTE == name) {
return x2;
} else if (SVGConstants.SVG_Y1_ATTRIBUTE == name) {
return y1;
} else if (SVGConstants.SVG_Y2_ATTRIBUTE == name) {
return y2;
} else {
return super.getFloatTraitImpl(name);
}
|
public java.lang.String | getLocalName()
return SVGConstants.SVG_LINE_TAG;
|
java.lang.Object | getStrokedPath(com.sun.perseus.j2d.GraphicsProperties gp)Returns the stroked shape, using the given stroke properties.
return PathSupport.getStrokedLine(x1,
y1,
x2,
y2,
gp);
|
public java.lang.String | getTraitImpl(java.lang.String name)Supported traits: x1, x2, y1, y2
if (SVGConstants.SVG_X1_ATTRIBUTE == name) {
return Float.toString(x1);
} else if (SVGConstants.SVG_X2_ATTRIBUTE == name) {
return Float.toString(x2);
} else if (SVGConstants.SVG_Y1_ATTRIBUTE == name) {
return Float.toString(y1);
} else if (SVGConstants.SVG_Y2_ATTRIBUTE == name) {
return Float.toString(y2);
} else {
return super.getTraitImpl(name);
}
|
public float | getX1()
return x1;
|
public float | getX2()
return x2;
|
public float | getY1()
return y1;
|
public float | getY2()
return y2;
|
public ElementNode | newInstance(DocumentNode doc)Used by DocumentNode to create a new instance from
a prototype Line .
return new Line(doc);
|
void | setFloatArrayTrait(java.lang.String name, float[][] value)Set the trait value as float.
if (SVGConstants.SVG_X1_ATTRIBUTE == name) {
setX1(value[0][0]);
} else if (SVGConstants.SVG_Y1_ATTRIBUTE == name) {
setY1(value[0][0]);
} else if (SVGConstants.SVG_X2_ATTRIBUTE == name) {
checkPositive(name, value[0][0]);
setX2(value[0][0]);
} else if (SVGConstants.SVG_Y2_ATTRIBUTE == name) {
checkPositive(name, value[0][0]);
setY2(value[0][0]);
} else {
super.setFloatArrayTrait(name, value);
}
|
public void | setFloatTraitImpl(java.lang.String name, float value)Supported traits: x1, x2, y1, y2
if (SVGConstants.SVG_X1_ATTRIBUTE == name) {
setX1(value);
} else if (SVGConstants.SVG_X2_ATTRIBUTE == name) {
setX2(value);
} else if (SVGConstants.SVG_Y1_ATTRIBUTE == name) {
setY1(value);
} else if (SVGConstants.SVG_Y2_ATTRIBUTE == name) {
setY2(value);
} else {
super.setFloatTraitImpl(name, value);
}
|
public void | setTraitImpl(java.lang.String name, java.lang.String value)Supported traits: x1, x2, y1, y2
if (SVGConstants.SVG_X1_ATTRIBUTE == name) {
setX1(parseFloatTrait(name, value));
} else if (SVGConstants.SVG_X2_ATTRIBUTE == name) {
setX2(parseFloatTrait(name, value));
} else if (SVGConstants.SVG_Y1_ATTRIBUTE == name) {
setY1(parseFloatTrait(name, value));
} else if (SVGConstants.SVG_Y2_ATTRIBUTE == name) {
setY2(parseFloatTrait(name, value));
} else {
super.setTraitImpl(name, value);
}
|
public void | setX1(float newX1)
if (newX1 == x1) {
return;
}
modifyingNode();
renderingDirty();
x1 = newX1;
modifiedNode();
|
public void | setX2(float newX2)
if (newX2 == x2) {
return;
}
modifyingNode();
renderingDirty();
x2 = newX2;
modifiedNode();
|
public void | setY1(float newY1)
if (newY1 == y1) {
return;
}
modifyingNode();
renderingDirty();
y1 = newY1;
modifiedNode();
|
public void | setY2(float newY2)
if (newY2 == y2) {
return;
}
modifyingNode();
renderingDirty();
y2 = newY2;
modifiedNode();
|
boolean | supportsTrait(java.lang.String traitName)Supported traits: x1, x2, y1, y2
if (SVGConstants.SVG_X1_ATTRIBUTE.equals(traitName)
||
SVGConstants.SVG_X2_ATTRIBUTE.equals(traitName)
||
SVGConstants.SVG_Y1_ATTRIBUTE.equals(traitName)
||
SVGConstants.SVG_Y2_ATTRIBUTE.equals(traitName)) {
return true;
} else {
return super.supportsTrait(traitName);
}
|
java.lang.String | toStringTrait(java.lang.String name, float[][] value)
if (SVGConstants.SVG_X1_ATTRIBUTE == name
||
SVGConstants.SVG_X2_ATTRIBUTE == name
||
SVGConstants.SVG_Y1_ATTRIBUTE == name
||
SVGConstants.SVG_Y2_ATTRIBUTE == name) {
return Float.toString(value[0][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 input trait value.
if (SVGConstants.SVG_X1_ATTRIBUTE == traitName
||
SVGConstants.SVG_X2_ATTRIBUTE == traitName
||
SVGConstants.SVG_Y1_ATTRIBUTE == traitName
||
SVGConstants.SVG_Y2_ATTRIBUTE == traitName) {
return new float[][] {{parseFloatTrait(traitName, value)}};
} else {
return super.validateFloatArrayTrait(traitName,
value,
reqNamespaceURI,
reqLocalName,
reqTraitNamespace,
reqTraitName);
}
|