|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--org.omegahat.Graphics.Primitives.GraphicalObject
|
+--org.omegahat.Graphics.Primitives.RGO
|
+--org.omegahat.Graphics.Primitives.GraphicalContainer
Graphical objects that can contain other graphical objects.
This class adds to the rectangular graphical object several concepts to help in the construction of general objects:
Scale properties specify the
co-ordinate scales for native units for this object.
| Field Summary | |
protected RegionAllocator |
allocator
|
protected java.util.List |
children
|
protected int |
origin
|
protected SimpleGraphicalContainerInt |
parent
|
protected ScaleInt |
scaleX
|
protected ScaleInt |
scaleY
|
| Fields inherited from class org.omegahat.Graphics.Primitives.RGO |
region |
| Fields inherited from class org.omegahat.Graphics.Primitives.GraphicalObject |
ACTIVE, fontSize, lastDevice, lastHeightCM, lastRegion, lastWidthCM, parents, status, VISIBLE |
| Fields inherited from interface org.omegahat.Environment.DataStructures.MathOperable |
DIVIDE, MINUS, MULTIPLY, PLUS |
| Constructor Summary | |
GraphicalContainer()
|
|
GraphicalContainer(double x,
double y,
double width,
double height,
int unit)
|
|
GraphicalContainer(GraphicalContainer el)
|
|
GraphicalContainer(GraphicalContainer el,
boolean deep)
|
|
GraphicalContainer(ScaleInt xscale,
ScaleInt yscale)
|
|
GraphicalContainer(UDouble x,
UDouble y,
UDouble width,
UDouble height)
|
|
| Method Summary | |
boolean |
add(java.lang.Object go)
Add an entry to the list of children. |
void |
addGraphicalObject(GraphicalComponentInt go)
Simplest version of the addition of a graphical component to a container, using the default region and layer. |
void |
addGraphicalObject(GraphicalComponentInt go,
boolean withAllocators)
|
void |
addGraphicalObject(GraphicalComponentInt go,
boolean withAllocators,
int layer)
|
void |
addGraphicalObject(GraphicalComponentInt go,
int inRegion)
Add the specified graphical component to this container with in the given region. |
void |
addGraphicalObject(GraphicalComponentInt go,
int regionId,
int layer)
Add the specified graphical component to this container in the region identified by region and draw it in the given
layer. |
void |
addGraphicalObject(GraphicalComponentInt go,
java.lang.Object regionId)
|
void |
addGraphicalObject(GraphicalComponentInt go,
java.lang.Object regionId,
int layer)
|
void |
addGraphicalObject(GraphicalComponentInt go,
java.lang.String regionId)
Add the specified graphical component to this container with in the given region identified by name. |
void |
addGraphicalObject(GraphicalComponentInt go,
java.lang.String regionId,
int layer)
Add the graphical componen to the specified region within this container, drawing it in the given layer. |
void |
addGraphicalObject(java.lang.Object go)
|
java.lang.Object |
addValue(java.lang.Object rhs,
boolean inPlace)
|
java.lang.Object |
copy()
Create a shallow copy of this object. |
java.lang.Object |
copy(boolean deep)
Create a copy of this object, controlling whether its contents are shared with the copy or also copied. |
Region |
draw(RectRegion rr,
ScaleInt sx,
ScaleInt sy,
int parentOrigin,
double widthCM,
double heightCM,
int fontSize,
OutputDevice od,
GraphicalContainerInt parentId)
This iterates over its children, having them draw themselves relative to this container's dimensions and using the primitives in the OutputDevice. |
void |
drawChildren(RectRegion rr,
double widthCM,
double heightCM,
OutputDevice od)
|
java.lang.Object |
get(int which)
Get the ith child. |
GraphicalComponentInt |
getChild(int which)
|
int |
getChildCount()
Get the number of children currently contained in this node. |
java.util.List |
getChildren()
Return the entire collection of children. |
OutputDevice |
getDevice()
|
int |
getOrigin()
Accessor for the origin field. |
RegionAllocator |
getRegionAllocator()
Get the current region allocator used by this container. |
ScaleInt |
getXScale()
Retrieve the ScaleInt
of the horizontal/X dimension. |
ScaleInt |
getYScale()
Retrieve the ScaleInt
of the vertical/Y dimension. |
SimpleGraphicalContainerInt |
parent()
Retrieve the parent of this component, if it has one. |
SimpleGraphicalContainerInt |
parent(SimpleGraphicalContainerInt o)
Set the parent of this container. |
java.lang.Object |
remove(int which)
Remove the ith child from the list of children. |
void |
removeGraphicalObject(GraphicalComponentInt go)
|
void |
removeGraphicalObject(GraphicalComponentInt go,
int layer)
|
void |
setOrigin(int o)
Accessor for setting the origin field. |
void |
setRegionAllocator(RegionAllocator ra)
Set the object that will control the creation of the different regions within the container to house sub-groups of components. |
void |
setXScale(ScaleInt s)
Set the ScaleInt
of the horizontal/X dimension. |
void |
setYScale(ScaleInt s)
Set the ScaleInt
of the vertical/Y dimension. |
java.lang.Object |
subset(List indeces,
boolean keepStructure)
Method providing subsetting overloading for the GraphicalContainerInt |
java.lang.Object |
subset(java.lang.Object index,
boolean keepStructure)
|
Tree |
transform(GraphicalContainerInt c,
NodeMap mapper)
Apply the methods of the specified map recursively to the specified container and its elements. |
Tree |
transform(NodeMap mapper)
Apply the methods of the specified map recursively to this container and its elements. |
| Methods inherited from class org.omegahat.Graphics.Primitives.RGO |
center, centre, createRegionDescription, createRegionDescription, getRegion, height, height, setHJust, setRegion, setVJust, width, width, x, x, y, y |
| Methods inherited from class org.omegahat.Graphics.Primitives.GraphicalObject |
cacheSize, getFontSize, getFontSize, getParameters, getParents, getStatus, isActive, isVisible, lastHeightCM, lastRegion, lastWidthCM, parents, setActive, setParameters, setParents, setVisible |
| 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 |
getParameters, getRegion, isActive, isVisible, parents, setActive, setParameters, setRegion, setVisible |
| Field Detail |
protected java.util.List children
protected SimpleGraphicalContainerInt parent
protected RegionAllocator allocator
protected ScaleInt scaleX
protected ScaleInt scaleY
protected int origin
| Constructor Detail |
public GraphicalContainer()
public GraphicalContainer(double x,
double y,
double width,
double height,
int unit)
public GraphicalContainer(UDouble x,
UDouble y,
UDouble width,
UDouble height)
public GraphicalContainer(ScaleInt xscale,
ScaleInt yscale)
public GraphicalContainer(GraphicalContainer el)
public GraphicalContainer(GraphicalContainer el,
boolean deep)
| Method Detail |
public void addGraphicalObject(GraphicalComponentInt go)
GraphicalContainerIntaddGraphicalObject in interface GraphicalContainerIntpublic void addGraphicalObject(java.lang.Object go)
public boolean add(java.lang.Object go)
Treeadd in interface Tree
public void addGraphicalObject(GraphicalComponentInt go,
int inRegion)
GraphicalContainerIntregionAllocator().get(inRegion).addGraphicalObject(go)addGraphicalObject in interface GraphicalContainerInt
public void addGraphicalObject(GraphicalComponentInt go,
java.lang.String regionId)
GraphicalContainerIntregionAllocator().get(inRegion).addGraphicalObject(go)addGraphicalObject in interface GraphicalContainerInt
public void addGraphicalObject(GraphicalComponentInt go,
java.lang.String regionId,
int layer)
GraphicalContainerIntaddGraphicalObject in interface GraphicalContainerInt
public void addGraphicalObject(GraphicalComponentInt go,
int regionId,
int layer)
GraphicalContainerIntregion and draw it in the given
layer.addGraphicalObject in interface GraphicalContainerInt
public void addGraphicalObject(GraphicalComponentInt go,
java.lang.Object regionId)
throws java.lang.Exception
addGraphicalObject in interface GraphicalContainerInt
public void addGraphicalObject(GraphicalComponentInt go,
java.lang.Object regionId,
int layer)
throws java.lang.Exception
addGraphicalObject in interface GraphicalContainerInt
public void addGraphicalObject(GraphicalComponentInt go,
boolean withAllocators)
addGraphicalObject in interface GraphicalContainerInt
public void addGraphicalObject(GraphicalComponentInt go,
boolean withAllocators,
int layer)
addGraphicalObject in interface GraphicalContainerIntpublic SimpleGraphicalContainerInt parent()
GraphicalComponentIntparent in interface GraphicalComponentIntparent in class GraphicalObjectpublic SimpleGraphicalContainerInt parent(SimpleGraphicalContainerInt o)
SimpleGraphicalContainerIntparent in interface GraphicalComponentIntparent in class GraphicalObjectpublic ScaleInt getXScale()
ScaledComponentIntScaleInt
of the horizontal/X dimension.getXScale in interface ScaledComponentIntpublic ScaleInt getYScale()
ScaledComponentIntScaleInt
of the vertical/Y dimension.getYScale in interface ScaledComponentIntpublic void setXScale(ScaleInt s)
ScaledComponentIntScaleInt
of the horizontal/X dimension.setXScale in interface ScaledComponentIntpublic void setYScale(ScaleInt s)
ScaledComponentIntScaleInt
of the vertical/Y dimension.setYScale in interface ScaledComponentIntpublic void setOrigin(int o)
origin field.setOrigin in interface GraphicalContainerIntpublic int getOrigin()
origin field.getOrigin in interface GraphicalContainerIntpublic void setRegionAllocator(RegionAllocator ra)
GraphicalContainerIntsetRegionAllocator in interface GraphicalContainerIntpublic RegionAllocator getRegionAllocator()
GraphicalContainerIntgetRegionAllocator in interface GraphicalContainerIntpublic GraphicalComponentInt getChild(int which)
getChild in interface GraphicalContainerIntpublic java.lang.Object get(int which)
Treeget in interface Treepublic int getChildCount()
TreegetChildCount in interface Treepublic java.util.List getChildren()
TreegetChildren in interface Treepublic void removeGraphicalObject(GraphicalComponentInt go)
removeGraphicalObject in interface GraphicalContainerInt
public void removeGraphicalObject(GraphicalComponentInt go,
int layer)
removeGraphicalObject in interface GraphicalContainerIntpublic java.lang.Object remove(int which)
Treeremove in interface Tree
public Region draw(RectRegion rr,
ScaleInt sx,
ScaleInt sy,
int parentOrigin,
double widthCM,
double heightCM,
int fontSize,
OutputDevice od,
GraphicalContainerInt parentId)
throws DrawChildException
OutputDevice.draw in interface GraphicalComponentIntdraw in class GraphicalObjectrr - is the region given to this graphical component by this
graphical component's parent
in Normalized Device Coordinates (NDC)- e.g. pixels/dimension.sx - native x coordinate scale for the parentsy - native y coordinate scale for the parentwidthCM - absolue size of the parent's width in centimetres.heigthCM - absolue size of the parent's height in centimetres.fontsize - font size used by the parent in pointsod - output device, eg window, page, providing primitives,
graphics parameters,
etc, and onto which elements are drawn.
public void drawChildren(RectRegion rr,
double widthCM,
double heightCM,
OutputDevice od)
throws DrawChildException
public java.lang.Object addValue(java.lang.Object rhs,
boolean inPlace)
addValue in interface Addablepublic java.lang.Object copy(boolean deep)
copy in interface Copyableorg.omegahat.Environment.DataStructures.CopyabledeepCopy - controls whether the
contents of the object are also recursively copied or shared by
reference with the new object.public java.lang.Object copy()
copy in interface Copyable
public java.lang.Object subset(List indeces,
boolean keepStructure)
GraphicalContainerInt
public java.lang.Object subset(java.lang.Object index,
boolean keepStructure)
subset in interface Subsettablepublic OutputDevice getDevice()
public Tree transform(NodeMap mapper)
transform(org.omegahat.Graphics.Primitives.GraphicalContainerInt, NodeMap)
public Tree transform(GraphicalContainerInt c,
NodeMap mapper)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||