|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--drawables.DrawableObjects
Container class for drawable objects.
| Field Summary | |
protected DupHashtable |
hashtable
Hashtable for ID search. |
protected Drawable[] |
lastInLayer
The Last object in a layer. |
protected Drawable[] |
layer
The layers. |
protected long |
maxId
Highest id of an object |
protected int |
mode
Presentation mode |
protected int |
numOfLayers
Number of layers. |
protected int |
numOfModes
Number of presentation modes |
protected DrawableObject |
searchObject
Prepared search object used for hashtable search. |
protected DrawableObject |
selectedObject
Selected object. |
static int |
STDMODE
Standard presentation mode |
protected Drawable |
visibleDrawable
Actual drawable used by "getNextVisibleIntersectingObject". |
| Constructor Summary | |
DrawableObjects(int numOfLayers)
Constructor. |
|
| Method Summary | |
void |
addDrawable(Drawable prim)
Add a drawable into the container. |
void |
deselect()
Deselects the selected object. |
void |
drawAllObjects(java.awt.Graphics g,
java.awt.Rectangle r,
int scale)
Zeichnet alle Drawable-Objekte im angegebenen Graphic Context, vorausgesetzt der aktuelle Maßstab wird vom Drawable-Objekt überschritten und es liegt im übergebenen Rechteck. |
void |
drawAllObjectsOfLayer(int l,
java.awt.Graphics g,
java.awt.Rectangle r,
int scale)
Zeichnet alle Drawable-Objekte im angegebenen Graphic Context, vorausgesetzt der aktuelle Maßstab wird vom Drawable-Objekt überschritten und es liegt im übergebenen Rechteck. |
java.util.Enumeration |
elements()
Returns enumeration of all drawable objects. |
Drawable |
findNearestDrawable(int x,
int y)
Finds the nearest derawable to a given position. |
java.awt.Rectangle |
getDataspace()
Returns the data space of all objects. |
int |
getMode()
Returns the presentation mode. |
Drawable |
getNextDrawable(Drawable prevPrim)
Returns the next drawable primitive. |
long |
getNextFreeId()
Returns the next free identifier. |
DrawableObject |
getNextVisibleIntersectingObject(int px,
int py,
int scale,
boolean selectable)
Gibt das nächste benannte, sichtbare und ggf. selektierbare Drawable-Objekt zurück, welches sich an der angegebenen Position befindet und den Maßstab einhält. |
int |
getNumberOfModes()
Returns the number of presentation modes. |
int |
getNumberOfObjects()
Returns the number of all objects. |
DrawableObject |
getObjectById(long id)
Gibt das Drawable-Objekt zurück, welches die übergebende ID besitzt. |
DrawableObject |
getSelectedObject()
Returns the selected object. |
DrawableObject |
getVisibleObjectById(long id,
int scale)
Gibt das Drawable-Objekt zurück, welches die übergebende ID besitzt und sichtbar ist. |
DrawableObject |
newDrawableObject(long id,
DrawableObjectType type,
java.lang.String name,
java.lang.String info)
Public "conctructor" of a drawable object; it will also be inserted into the container. |
DrawableObject |
newDrawableObject(long id,
java.lang.String typeName,
java.lang.String name,
java.lang.String info)
Public "conctructor" of a drawable object; it will also be inserted into the container. |
DrawableObject |
newDrawableObject(long id,
java.lang.String typeName,
java.lang.String name,
java.lang.String info,
int defScale)
Public "conctructor" of a drawable object; it will also be inserted into the container. |
DrawableObject |
readDrawableObject(java.io.DataInputStream r,
int version)
Reads a drawable object from the data input stream. |
DrawableObject |
readDrawableObject(EntryInput r,
int version)
Reads a drawable object from the entry input. |
void |
readDrawableObject(EntryInput r,
java.lang.String objType)
Liest das Drawable-Objekt vom Entry-Input ein. |
void |
remove(DrawableObject obj)
Löscht das Drawable-Objekt aus dem Container und löst die Beziehung zum Grafik-Primitiv auf. |
void |
removeAll()
Removes all objects from the container. |
void |
removeAllObjectsOfLayer(int l)
Removes all objects of a given layer from the container. |
void |
select(DrawableObject obj)
Deselektiert das bislang selektierte Drawable-Objekt und selektiert das übergebene Objekt. |
void |
setMode(int mode)
Sets the presentation mode. |
void |
setNumberOfModes(int num)
Sets the number of presentation modes. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected int numOfLayers
protected Drawable[] layer
protected Drawable[] lastInLayer
protected DupHashtable hashtable
public static final int STDMODE
protected int mode
protected int numOfModes
protected long maxId
protected DrawableObject selectedObject
protected Drawable visibleDrawable
protected DrawableObject searchObject
| Constructor Detail |
public DrawableObjects(int numOfLayers)
numOfLayers - number of layers| Method Detail |
public void addDrawable(Drawable prim)
prim - the drawablepublic void deselect()
public void drawAllObjects(java.awt.Graphics g,
java.awt.Rectangle r,
int scale)
g - aktueller Graphic Contextr - Clipping-Rechteckscale - aktueller Maßstab
public void drawAllObjectsOfLayer(int l,
java.awt.Graphics g,
java.awt.Rectangle r,
int scale)
l - Layerg - aktueller Graphic Contextr - Clipping-Rechteckscale - aktueller Maßstabpublic java.util.Enumeration elements()
public Drawable findNearestDrawable(int x,
int y)
x - x-coordinate of the positiony - y-coordinate of the position
public java.awt.Rectangle getDataspace()
public int getMode()
public Drawable getNextDrawable(Drawable prevPrim)
prevPrim - previous drawable; null => look for first drawable
public long getNextFreeId()
public DrawableObject getNextVisibleIntersectingObject(int px,
int py,
int scale,
boolean selectable)
px - x-Koordinate der gesuchten Position (in Basis-Koordinaten)py - y-Koordinate der gesuchten Position (in Basis-Koordinaten)selectable - muß das Objekt selektierbar sein?
public int getNumberOfModes()
public int getNumberOfObjects()
public DrawableObject getObjectById(long id)
id - gesuchte ID
public DrawableObject getSelectedObject()
public DrawableObject getVisibleObjectById(long id,
int scale)
id - gesuchte IDscale - Maßstab
public DrawableObject newDrawableObject(long id,
DrawableObjectType type,
java.lang.String name,
java.lang.String info)
id - id of the objectname - the name of the objectinfo - attributes
public DrawableObject newDrawableObject(long id,
java.lang.String typeName,
java.lang.String name,
java.lang.String info)
id - id of the objecttypeName - the name of the object typename - the name of the objectinfo - attributes
public DrawableObject newDrawableObject(long id,
java.lang.String typeName,
java.lang.String name,
java.lang.String info,
int defScale)
id - id of the objecttypeName - the name of the object typename - the name of the objectinfo - attributesdefScale - the default scale
public DrawableObject readDrawableObject(java.io.DataInputStream r,
int version)
throws java.io.IOException
r - data input streamversion - the file version
java.io.IOException
public DrawableObject readDrawableObject(EntryInput r,
int version)
r - entry input
public void readDrawableObject(EntryInput r,
java.lang.String objType)
r - Entry-InputobjType - vom Entry-Input eingelesener Drawable-Typpublic void remove(DrawableObject obj)
obj - zu löschendes Drawable-Objektpublic void removeAll()
public void removeAllObjectsOfLayer(int l)
l - the layerpublic void select(DrawableObject obj)
obj - zu löschendes Drawable-Objektpublic void setMode(int mode)
mode - the presentation modepublic void setNumberOfModes(int num)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||