FileDocCategorySizeDatePackage
GlyphProxy.javaAPI DocphoneME MR2 API (J2ME)5888Wed May 02 18:00:36 BST 2007com.sun.perseus.model

GlyphProxy

public final class GlyphProxy extends Object
A GlyphNodeProxy delegates its rendering to a proxied Glyph object.
version
$Id: GlyphProxy.java,v 1.10 2006/06/29 10:47:31 ln156897 Exp $

Fields Summary
protected float
x
The origin of the glyph on the x axis.
protected float
rotate
The glyph's rotation
protected Glyph
proxied
The proxied glyph.
protected GlyphProxy
nextSibling
The next GlyphProxy sibling.
protected GlyphProxy
prevSibling
The previous GlyphProxy sibling.
Constructors Summary
public GlyphProxy(Glyph proxied)

param
proxied Glyph node to proxy. Should not be null.

        this.proxied = proxied;
    
Methods Summary
com.sun.perseus.j2d.BoxaddNodeBBox(com.sun.perseus.j2d.Box bbox, com.sun.perseus.j2d.Transform t)

param
bbox the bounding box to which this node's bounding box should be appended. That bounding box is in the target coordinate space. It may be null, in which case this node should create a new one.
param
t the transform from the node coordinate system to the coordinate system into which the bounds should be computed.
return
the bounding box of this node, in the target coordinate space,

        return proxied.addNodeBBox(bbox, t);
    
protected com.sun.perseus.j2d.TileaddRenderingTile(com.sun.perseus.j2d.Tile tile, com.sun.perseus.j2d.TextRenderingProperties trp, com.sun.perseus.j2d.Transform t)
Adds this glyph's bounds to the input tile. If the input tile.

param
tile the Tile instance whose bounds should be set.
param
trp the TextRenderingProperties describing the nodes rendering characteristics.
param
t the Transform to the requested tile space, from this node's user space.
return
the expanded tile.

        return proxied.addRenderingTile(tile, trp, t);
    
protected voidapplyInverseTransform(com.sun.perseus.j2d.Transform tx)
Apply this node inverse additional transform.

param
tx the Transform to add node transform to. This is guaranteed to be not null.

        proxied.applyInverseTransform(tx);

        // Rotate the glyph
        tx.mRotate(-rotate);

        // Add this node's x/y translation.
        tx.mTranslate(-x, 0);
    
protected voidapplyTransform(com.sun.perseus.j2d.Transform tx)
Apply this node's x/y translation.

param
tx the Transform to add node transform to. This is guaranteed to be not null.

        // Add this node's x/y translation.
        tx.mTranslate(x, 0);

        // Rotate the glyph
        tx.mRotate(rotate);

        proxied.applyTransform(tx);
    
public floatgetRotate()

return
this node's rotation

        return rotate;
    
public floatgetX()

return
this node's origin on the x-axis

        return x;
    
protected booleanisHit(float[] pt, com.sun.perseus.j2d.TextRenderingProperties trp)

param
pt the x/y coordinate. Should never be null and be of size two. If not, the behavior is unspecified. The point should be in user space.
param
trp the TextRenderingProperties containing the properties applicable to the hit detection operation. This is used because the same node may be referenced multiple times by different proxies.
return
true if this node is hit by the input point. The input point is in viewport space. This is invoked in the hit detection process after the node's properties have been applied and the display value has been checked (i.e., the node is actually rendered).
see
#nodeHitAt

        return proxied.isHit(pt, trp);
    
public voidsetRotate(float newRotate)

param
newRotate the new glyph rotation

        this.rotate = newRotate;
    
public voidsetX(float newX)

param
newX the new origin on the x-axis

        this.x = newX;
    
public java.lang.StringtoString()

return
a string description of this ElementNodeProxy

        return "GlyphProxy[x=" + x + " rotate=" + rotate
            + " proxied=" + proxied + "][" + super.toString() + "]";