Fields Summary |
---|
public static final int | DEFAULT_VIEWPORT_WIDTHDefault width for viewports. |
public static final int | DEFAULT_VIEWPORT_HEIGHTDefault height for viewports |
public static final int | ZOOM_PAN_MAGNIFYAs in the SVG 1.1 specification |
public static final int | ZOOM_PAN_DISABLEAs in the SVG 1.1 specification |
public static final int | ZOOM_PAN_UNKNOWNAs in the SVG 1.1 specification |
protected int | widthViewport width |
protected int | heightViewport height |
protected com.sun.perseus.j2d.Transform | transformThe Transform applied to this node. |
protected com.sun.perseus.j2d.Transform | inverseTxfThe inverse of the Transform applied to this node. |
protected int | zoomAndPanThe zoomAndPan setting |
Methods Summary |
---|
protected com.sun.perseus.j2d.Transform | appendTransform(com.sun.perseus.j2d.Transform tx, com.sun.perseus.j2d.Transform workTx)Appends this node's transform, if it is not null.
if (transform == null) {
return tx;
}
tx = recycleTransform(tx, workTx);
tx.mMultiply(transform);
return tx;
|
public int | getHeight()
return this.height;
|
public com.sun.perseus.j2d.Transform | getInverseTransformState()
if (((canRenderState & CAN_RENDER_NON_INVERTIBLE_TXF_BIT) == 0)) {
if (inverseTxf == null) {
inverseTxf = new Transform(null);
try {
inverseTxf = (Transform) transform.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 com.sun.perseus.j2d.Transform | getTransform()
return transform;
|
public com.sun.perseus.j2d.Transform | getTransformState()
return transform;
|
public int | getWidth()
return this.width;
|
public int | getZoomAndPan()
return zoomAndPan;
|
public ModelNode | nodeHitAt(float[] pt)Returns the ModelNode , if any, hit by the
point at coordinate x/y.
// Check for a hit on children
return nodeHitAt(getLastChildNode(), pt);
|
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.
if (parentTransform != null) {
throw new IllegalArgumentException();
}
computeCanRenderTransformBit(transform);
inverseTxf = null;
recomputeTransformState(transform, getFirstChildNode());
|
public void | setSize(int newWidth, int newHeight)Sets the viewport size
if (newWidth < 0 || newHeight < 0) {
throw new IllegalArgumentException();
}
if (newWidth == width && newHeight == height) {
return;
}
modifyingNode();
this.width = newWidth;
this.height = newHeight;
recomputeTransformState(null);
computeCanRenderWidthBit(width);
computeCanRenderHeightBit(height);
modifiedNode();
|
public void | setTransform(com.sun.perseus.j2d.Transform newTransform)
if (ElementNode.equal(newTransform, this.transform)) {
return;
}
modifyingNode();
this.transform = newTransform;
recomputeTransformState(null);
modifiedNode();
|
public void | setZoomAndPan(int newZoomAndPan)
if (newZoomAndPan != ZOOM_PAN_MAGNIFY
&&
newZoomAndPan != ZOOM_PAN_DISABLE
&&
newZoomAndPan != ZOOM_PAN_UNKNOWN) {
throw new IllegalArgumentException();
}
if (newZoomAndPan == zoomAndPan) {
return;
}
modifyingNode();
this.zoomAndPan = newZoomAndPan;
modifiedNode();
|