|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.omegahat.Graphics.Primitives.GraphicalObject
The class from which all graphical objects must inherit. It carries the concepts of associated graphics parameters and a region within the parent object.
The abstract draw method must be implemented by any actual graphical object.
| Field Summary | |
static int |
ACTIVE
Constant used in setting and querying the status flag to indicate whether
the component is active or not, and can have events generated for it. |
protected int |
fontSize
|
protected OutputDevice |
lastDevice
The device instance cached from the previous draw() call. |
protected double |
lastHeightCM
Actual height of this component in centimeters cached from last regular draw. |
protected RectRegion |
lastRegion
Cached version of the RectRegion
in NDC - Normalized Device Coordinates -
from the last regular draw, used when drawing an individual child. |
protected double |
lastWidthCM
Actual width of this component in centimeters cached from last regular draw. |
protected java.util.Vector |
parents
|
protected int |
status
Value used to indicate whether the component is active, visible, etc. |
static int |
VISIBLE
Constant used in setting and querying the status flag to indicate whether
the component is visible or not, and so whether it is to be drawn. |
| Constructor Summary | |
GraphicalObject()
|
|
| Method Summary | |
protected RectRegion |
cacheSize(RectRegion rr,
ScaleInt sx,
ScaleInt sy,
int parentOrigin,
double widthCM,
double heightCM,
int fontSizeRect,
OutputDevice od,
GraphicalContainerInt parentId)
Compute the current NDC region this object occupies and its absolute dimensions in centimeters and store these in the cached fields. |
abstract Region |
draw(RectRegion rr,
ScaleInt sx,
ScaleInt sy,
int origin,
double widthCM,
double heightCM,
int fontSize,
OutputDevice od,
GraphicalContainerInt parentId)
draw the object in the rectangular region rr, using scales sx and sy. |
int |
getFontSize()
|
int |
getFontSize(int s)
|
GraphicsParameters |
getParameters()
the graphics parameters object associated with this object. |
java.util.Vector |
getParents()
Accessor for parents field |
int |
getStatus()
|
boolean |
isActive()
Determines whether the object can have events generated "about" it. |
boolean |
isVisible()
Determines whether the object is drawn as part of the hierarchy. |
double |
lastHeightCM()
|
RectRegion |
lastRegion()
|
double |
lastWidthCM()
|
SimpleGraphicalContainerInt |
parent()
Retrieve the (default) parent of this component. |
SimpleGraphicalContainerInt |
parent(SimpleGraphicalContainerInt p)
Register the parent container as one of the parents of this object. |
java.util.List |
parents()
Return a list of all the containers of which this component is a member/entry. |
boolean |
setActive(boolean val)
Sets whether the object can have events generated "about" it. |
void |
setParameters(GraphicsParameters p)
|
java.util.Vector |
setParents(java.util.Vector value)
Accessor for setting parents field |
boolean |
setVisible(boolean val)
Sets whether the object is drawn as part of the hierarchy. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.omegahat.Graphics.Primitives.GraphicalComponentInt |
getRegion, setRegion |
| Field Detail |
public static final int VISIBLE
status flag to indicate whether
the component is visible or not, and so whether it is to be drawn.public static final int ACTIVE
status flag to indicate whether
the component is active or not, and can have events generated for it.protected int fontSize
protected java.util.Vector parents
protected int status
ACTIVE, VISIBLEprotected RectRegion lastRegion
RectRegion
in NDC - Normalized Device Coordinates -
from the last regular draw, used when drawing an individual child.protected double lastWidthCM
GraphicalComponentInt.htmlprotected double lastHeightCM
GraphicalComponentInt.htmlprotected OutputDevice lastDevice
| Constructor Detail |
public GraphicalObject()
| Method Detail |
public abstract Region draw(RectRegion rr,
ScaleInt sx,
ScaleInt sy,
int origin,
double widthCM,
double heightCM,
int fontSize,
OutputDevice od,
GraphicalContainerInt parentId)
draw in interface GraphicalComponentIntorg.omegahat.Graphics.Primitives.GraphicalComponentIntrr - the parents RectRegion in normalized device coordinates (NDC).sx - the parent's horizontal scale for transforming between arbitrary units.sy - the parent's vertical scale for transforming between arbitrary units.origin - the parent's origin position.public GraphicsParameters getParameters()
getParameters in interface GraphicalComponentIntpublic void setParameters(GraphicsParameters p)
setParameters in interface GraphicalComponentIntpublic SimpleGraphicalContainerInt parent()
parent in interface GraphicalComponentIntpublic SimpleGraphicalContainerInt parent(SimpleGraphicalContainerInt p)
parent in interface GraphicalComponentIntpublic java.util.List parents()
parents in interface GraphicalComponentIntpublic java.util.Vector getParents()
parents fieldpublic java.util.Vector setParents(java.util.Vector value)
parents fieldpublic int getFontSize()
public int getFontSize(int s)
public RectRegion lastRegion()
public double lastWidthCM()
public double lastHeightCM()
public boolean isActive()
isActive in interface GraphicalComponentIntpublic boolean setActive(boolean val)
setActive in interface GraphicalComponentIntpublic boolean isVisible()
isVisible in interface GraphicalComponentIntpublic boolean setVisible(boolean val)
setVisible in interface GraphicalComponentIntpublic int getStatus()
protected RectRegion cacheSize(RectRegion rr,
ScaleInt sx,
ScaleInt sy,
int parentOrigin,
double widthCM,
double heightCM,
int fontSizeRect,
OutputDevice od,
GraphicalContainerInt parentId)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||