net.sourceforge.jeuclid.elements
Interface DisplayableNode

All Known Subinterfaces:
JEuclidElement
All Known Implementing Classes:
AbstractContainer, AbstractElementWithDelegates, AbstractInvisibleJEuclidElement, AbstractJEuclidElement, AbstractMathElementWithChildren, AbstractRoot, AbstractRowLike, AbstractScriptElement, AbstractSubSuper, AbstractTokenWithStandardLayout, AbstractTokenWithTextLayout, AbstractUnderOver, Annotation, DocumentElement, Maction, Maligngroup, Malignmark, MathImpl, Menclose, Menclose.AbstractRowLikeNotation, Menclose.Downdiagonalstrike, Menclose.Longdiv, Menclose.Updiagonalstrike, Merror, Mfenced, Mfrac, Mglyph, Mi, Mlabeledtr, Mmultiscripts, Mn, Mo, Mover, Mpadded, Mphantom, Mprescripts, Mroot, Mrow, Ms, Mspace, Msqrt, Mstyle, Msub, Msubsup, Msup, Mtable, Mtd, Mtext, Mtr, Munder, Munderover, None, Semantics

public interface DisplayableNode

Any node that can be displayed on screen. This is the start of a generic interface that should support all types of Nodes.

Version:
$Revision: 310 $
Author:
Max Berger

Method Summary
 float getAscentHeight(Graphics2D g)
          Returns the current height of the upper part of this component from the baseline.
 float getDescentHeight(Graphics2D g)
          Returns the current height of the lower part of this component from the baseline.
 float getHeight(Graphics2D g)
          Return the current height of this element.
 float getPaintedPosX()
          Returns the last X position this node was painted on.
 float getPaintedPosY()
          Returns the last Y position this node was painted on.
 float getWidth(Graphics2D g)
          Returns the current width of this element.
 float getXCenter(Graphics2D g)
          Returns the center X coordinate of the content.
 void paint(Graphics2D g, float posX, float posY)
          Paints this element.
 

Method Detail

paint

void paint(Graphics2D g,
           float posX,
           float posY)
Paints this element.

Parameters:
g - The graphics context to use for painting
posX - The first left position for painting
posY - The position of the baseline

getAscentHeight

float getAscentHeight(Graphics2D g)
Returns the current height of the upper part of this component from the baseline.

Parameters:
g - Graphics2D context to use.
Returns:
Height of the upper part

getDescentHeight

float getDescentHeight(Graphics2D g)
Returns the current height of the lower part of this component from the baseline.

Parameters:
g - Graphics2D context to use.
Returns:
Height of the lower part.

getHeight

float getHeight(Graphics2D g)
Return the current height of this element.

Parameters:
g - Graphics2D context to use.
Returns:
Height of this element

getWidth

float getWidth(Graphics2D g)
Returns the current width of this element.

Parameters:
g - Graphics2D context to use.
Returns:
Width of this element.

getXCenter

float getXCenter(Graphics2D g)
Returns the center X coordinate of the content. In most cases, this will be width/2. In some cases, an element may have extra space on one side, therefore moving the content.

Parameters:
g - X-offset of the horizontal center of the actual content.
Returns:
Graphics2D context to use.

getPaintedPosX

float getPaintedPosX()
Returns the last X position this node was painted on. May return -1 if the node was not painted recently.

Returns:
the x position.

getPaintedPosY

float getPaintedPosY()
Returns the last Y position this node was painted on. May return -1 if the node was not painted recently.

Returns:
the y position.


Copyright © 2002-2008 The JEuclid project. All Rights Reserved.