|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--drawables.DrawableObject
Object class for objects with a drawable primitive.
| Field Summary | |
protected static int |
NODEFSCALE
Value for no default scale. |
| Constructor Summary | |
DrawableObject(long id,
DrawableObjectType type,
java.lang.String name,
java.lang.String info,
DrawableObjects container)
Constructor of an object. |
|
| Method Summary | |
void |
addDrawable(Drawable addPrim)
Adds a primitive to the object. |
void |
draw(java.awt.Graphics g)
Draws the primitives of the object. |
void |
draw(java.awt.Graphics g,
int scale)
Draws the primitives of the object. |
void |
draw(java.awt.Graphics g,
java.awt.Rectangle r)
Draws the primitives of the object. |
void |
draw(java.awt.Graphics g,
java.awt.Rectangle r,
int scale)
Draws the primitives of the object. |
boolean |
equals(java.lang.Object obj)
Compares to objects using their identifier. |
int |
getDataValue(int index)
Returns a data value depending on the actual mode. |
int |
getDefaultScale()
Returns the default scale of the object. |
Drawable |
getDrawable(int index)
Returns the a corresponding primitive. |
long |
getId()
Returns the identifier. |
java.lang.String |
getInfo()
Returns the string with the attributes. |
java.awt.Rectangle |
getMBR()
Computes the minimum bounding rectangle. |
java.lang.String |
getName()
Returns the name of the object. |
int |
getNumberOfDrawables()
Returns the number of drawable primitives. |
DrawableObjectType |
getObjectType()
Returns the type of the object. |
int |
getPresValue()
Returns the value which influeces the presentation depending on the actual mode. |
int |
hashCode()
Returns the hashcode (=id). |
boolean |
isSelected()
Returns whether the object is selected or not. |
boolean |
isVisible(int scale)
Test whether one of the corresponding primitives is visible. |
void |
setDefaultScale(int scale)
Sets the default scale. |
void |
setId(long id)
Sets the id. |
void |
setName(java.lang.String name)
Sets the name of the object. |
void |
setSelection(boolean on)
Selects or deselect the object and its primitives. |
void |
write(java.io.DataOutputStream out)
Writes the object without its primitives. |
void |
write(EntryWriter out)
Writes the object without its primitives. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final int NODEFSCALE
| Constructor Detail |
public DrawableObject(long id,
DrawableObjectType type,
java.lang.String name,
java.lang.String info,
DrawableObjects container)
id - the identifiertype - the type of the objectname - the name of the objectinfo - attributes of the objectcontainer - container storing the object (the constructor does not put the object into the container)| Method Detail |
public void addDrawable(Drawable addPrim)
addPrim - the primitivepublic void draw(java.awt.Graphics g)
g - graphic context
public void draw(java.awt.Graphics g,
int scale)
g - graphic contextscale - actual scale
public void draw(java.awt.Graphics g,
java.awt.Rectangle r)
g - graphic contextr - clipping rectangle
public void draw(java.awt.Graphics g,
java.awt.Rectangle r,
int scale)
g - graphic contextr - clipping rectanglescale - actual scalepublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - object to be compared
public int getDataValue(int index)
throws java.lang.NumberFormatException
index - the index of the data value
java.lang.NumberFormatExceptionpublic int getDefaultScale()
public Drawable getDrawable(int index)
index - of the primitive
public long getId()
public java.lang.String getInfo()
public java.awt.Rectangle getMBR()
public java.lang.String getName()
public int getNumberOfDrawables()
public DrawableObjectType getObjectType()
public int getPresValue()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean isSelected()
public boolean isVisible(int scale)
scale - scale (-1 => return true)
public void setDefaultScale(int scale)
scale - new default scalepublic void setId(long id)
id - new idpublic void setName(java.lang.String name)
name - new namepublic void setSelection(boolean on)
on - selected?public void write(java.io.DataOutputStream out)
out - the data output streampublic void write(EntryWriter out)
out - entry writer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||