de.fhg.igd.earth.model.graph
Class ModelGraphObject

java.lang.Object
  extended byde.fhg.igd.earth.model.graph.ProjectorObject
      extended byde.fhg.igd.earth.model.graph.ModelGraphObject
All Implemented Interfaces:
Cloneable, Serializable
Direct Known Subclasses:
Node

public abstract class ModelGraphObject
extends ProjectorObject
implements Serializable, Cloneable

This class represents a graphic object. It can be "mutable" and "traceable". Changes can only be done if mutable is true. Traceable means that the tracer is allowed to trace this object. The "trace" flag shows the trace status. Changes and subchanges can be recorded in BitSets. The allowed changes are listed as static variables. "CHANGE_.". You can store additional information into the "infoTable". Title : Earth Copyright : Copyright (c) 2001 Organisation : IGD FhG

Version:
: 1.0
Author:
: Werner Beutel
See Also:
Serialized Form

Field Summary
static int CHANGE_AddChild
          a child was added
static int CHANGE_Anything
          anything was changed
static int CHANGE_Appearance
          appearance was changed
static int CHANGE_Color
          color was changed
static int CHANGE_Create
          object was created
static int CHANGE_Delete
          object was deleted
static int CHANGE_Focus
          focus was changed
static int CHANGE_HistoryGroup
          tracer has changed something
static int CHANGE_InfoTable
          infotable was changed
static int CHANGE_Object
          internal changes
static int CHANGE_RemoveChild
          a child was removed
static int CHANGE_Shape
          shape was changed
static int CHANGE_Trace
          trace flag was changed
static int CHANGE_Update
          projector has to be updated
static int CHANGE_Visibility
          visibility was changed
protected  BitSet changes_
          changes on the current level
protected  Hashtable infoTable_
          table storing additional information
protected  boolean mutable_
          flag to allow changes
protected  String name_
          name of the graphic object
private static int numChanges_
          CHANGE_ counter (internal)
protected  BitSet subChanges_
          changes on sublevels (children)
static int SUBTYPE_BackGround
           
static int SUBTYPE_Box
           
static int SUBTYPE_BranchGroup
           
static int SUBTYPE_Cone
           
static int SUBTYPE_Cylinder
           
static int SUBTYPE_DetailGroup
           
static int SUBTYPE_DistanceDetailGroup
           
static int SUBTYPE_Group
           
static int SUBTYPE_HistoryGroup
           
static int SUBTYPE_LatchGroup
           
static int SUBTYPE_ModelGraph
           
static int SUBTYPE_Polygon
           
static int SUBTYPE_Primitive
           
static int SUBTYPE_Sphere
           
static int SUBTYPE_Text
           
static int SUBTYPE_TransformGroup
           
static int SUBTYPE_WireBoxGroup
           
protected  TimeStamp timeStamp_
          time of creation
protected  boolean trace_
          the trace status
protected  boolean traceable_
          flag to allow tracing
static int TYPE_Group
          this object can have children
static int TYPE_Leaf
          this object can't have children
 
Fields inherited from class de.fhg.igd.earth.model.graph.ProjectorObject
projectorObject_
 
Constructor Summary
ModelGraphObject()
          Constructs and initializes a default graphic object Released changes: CHANGE_OBJECT, CHANGE_CREATE
 
Method Summary
 boolean anyChanges()
          Returns true if anything was changed.
 boolean anySubChanges()
          Returns true if any child was changed.
 Object clone()
          Clones this object.
 BitSet getChanges()
          Returns the BitSet of changes.
 boolean getChanges(int index)
          Returns a special change from the BitSet.
 Hashtable getInfoTable()
          Returns a clone of the infoTable.
 Enumeration getInfoTableElements()
          Returns the elements of the infoTable as an Enumeration.
 Enumeration getInfoTableKeys()
          Returns the keys of the infoTable as an Enumeration.
 int getInfoTableSize()
          Returns the number of keys in the infoTable.
 Collection getInfoTableValues()
          Returns the values of the infoTable as a Collection.
 boolean getMutable()
          Returns the mutable flag.
 String getName()
          Returns the name of this object.
 BitSet getSubChanges()
          Returns the BitSet of subchanges.
 boolean getSubChanges(int index)
          Returns a special subchange from the BitSet.
abstract  int getSubType()
          Returns the subtype of this object
 String getSubTypeName()
          Returns the SubType of this object as a string.
 TimeStamp getTimeStamp()
          Returns the timeStamp of this object.
 boolean getTrace()
          Returns the trace status.
 boolean getTraceable()
          Returns the traceable flag.
abstract  int getType()
          Returns the type of this object
protected abstract  void publishChanges(int c)
          All changes on this level will be published to the parent.
 boolean putInfo(Object key, Object value)
          Adds an new value to the infoTable (blocked by mutable).
protected  void resetChanges()
          Resets all changes and subchanges.
protected  void setChanges(int c)
          Include a change into the changes BitSet.
 boolean setInfoTable(Hashtable infoTable)
          Overwrites the current infoTable with a new one (blocked by mutable).
protected abstract  void setMutable(boolean m)
          Sets the mutable flag.
 boolean setName(String name)
          Set the name of this object (blocked by mutable).
protected  void setSubChanges(int c)
          Include a subchange into the subchanges BitSet.
 boolean setTrace(boolean t)
          Activates the tracer (blocked by mutable).
protected  Vector VectorClone(Vector v)
          This methode duplicates a vector with all inner objects.
 
Methods inherited from class de.fhg.igd.earth.model.graph.ProjectorObject
getProjectorObject, setProjectorObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name_

protected String name_
name of the graphic object


infoTable_

protected Hashtable infoTable_
table storing additional information


changes_

protected BitSet changes_
changes on the current level


subChanges_

protected BitSet subChanges_
changes on sublevels (children)


mutable_

protected boolean mutable_
flag to allow changes


traceable_

protected boolean traceable_
flag to allow tracing


trace_

protected boolean trace_
the trace status


timeStamp_

protected TimeStamp timeStamp_
time of creation


TYPE_Leaf

public static final int TYPE_Leaf
this object can't have children

See Also:
Constant Field Values

TYPE_Group

public static final int TYPE_Group
this object can have children

See Also:
Constant Field Values

SUBTYPE_BackGround

public static final int SUBTYPE_BackGround
See Also:
Constant Field Values

SUBTYPE_Text

public static final int SUBTYPE_Text
See Also:
Constant Field Values

SUBTYPE_Primitive

public static final int SUBTYPE_Primitive
See Also:
Constant Field Values

SUBTYPE_Polygon

public static final int SUBTYPE_Polygon
See Also:
Constant Field Values

SUBTYPE_Sphere

public static final int SUBTYPE_Sphere
See Also:
Constant Field Values

SUBTYPE_Box

public static final int SUBTYPE_Box
See Also:
Constant Field Values

SUBTYPE_Cone

public static final int SUBTYPE_Cone
See Also:
Constant Field Values

SUBTYPE_Cylinder

public static final int SUBTYPE_Cylinder
See Also:
Constant Field Values

SUBTYPE_Group

public static final int SUBTYPE_Group
See Also:
Constant Field Values

SUBTYPE_TransformGroup

public static final int SUBTYPE_TransformGroup
See Also:
Constant Field Values

SUBTYPE_HistoryGroup

public static final int SUBTYPE_HistoryGroup
See Also:
Constant Field Values

SUBTYPE_BranchGroup

public static final int SUBTYPE_BranchGroup
See Also:
Constant Field Values

SUBTYPE_ModelGraph

public static final int SUBTYPE_ModelGraph
See Also:
Constant Field Values

SUBTYPE_LatchGroup

public static final int SUBTYPE_LatchGroup
See Also:
Constant Field Values

SUBTYPE_WireBoxGroup

public static final int SUBTYPE_WireBoxGroup
See Also:
Constant Field Values

SUBTYPE_DetailGroup

public static final int SUBTYPE_DetailGroup
See Also:
Constant Field Values

SUBTYPE_DistanceDetailGroup

public static final int SUBTYPE_DistanceDetailGroup
See Also:
Constant Field Values

CHANGE_Anything

public static final int CHANGE_Anything
anything was changed

See Also:
Constant Field Values

CHANGE_Update

public static final int CHANGE_Update
projector has to be updated

See Also:
Constant Field Values

CHANGE_Create

public static final int CHANGE_Create
object was created

See Also:
Constant Field Values

CHANGE_Delete

public static final int CHANGE_Delete
object was deleted

See Also:
Constant Field Values

CHANGE_Object

public static final int CHANGE_Object
internal changes

See Also:
Constant Field Values

CHANGE_AddChild

public static final int CHANGE_AddChild
a child was added

See Also:
Constant Field Values

CHANGE_RemoveChild

public static final int CHANGE_RemoveChild
a child was removed

See Also:
Constant Field Values

CHANGE_Appearance

public static final int CHANGE_Appearance
appearance was changed

See Also:
Constant Field Values

CHANGE_Color

public static final int CHANGE_Color
color was changed

See Also:
Constant Field Values

CHANGE_Visibility

public static final int CHANGE_Visibility
visibility was changed

See Also:
Constant Field Values

CHANGE_Shape

public static final int CHANGE_Shape
shape was changed

See Also:
Constant Field Values

CHANGE_InfoTable

public static final int CHANGE_InfoTable
infotable was changed

See Also:
Constant Field Values

CHANGE_Trace

public static final int CHANGE_Trace
trace flag was changed

See Also:
Constant Field Values

CHANGE_Focus

public static final int CHANGE_Focus
focus was changed

See Also:
Constant Field Values

CHANGE_HistoryGroup

public static final int CHANGE_HistoryGroup
tracer has changed something

See Also:
Constant Field Values

numChanges_

private static final int numChanges_
CHANGE_ counter (internal)

See Also:
Constant Field Values
Constructor Detail

ModelGraphObject

public ModelGraphObject()
Constructs and initializes a default graphic object Released changes: CHANGE_OBJECT, CHANGE_CREATE

Method Detail

getType

public abstract int getType()
Returns the type of this object

Returns:
type of this object

getSubType

public abstract int getSubType()
Returns the subtype of this object

Returns:
subtype of this object

setName

public boolean setName(String name)
Set the name of this object (blocked by mutable). Released changes: CHANGE_OBJECT, CHANGE_UPDATE

Parameters:
name - The new name of this object.
Returns:
true on success

getName

public String getName()
Returns the name of this object.

Returns:
Name of this object

setInfoTable

public boolean setInfoTable(Hashtable infoTable)
Overwrites the current infoTable with a new one (blocked by mutable). Released changes: CHANGE_UPDATE, CHANGE_INFOTABLE

Parameters:
infoTable - The new infoTable of this object.
Returns:
true on success

getInfoTable

public Hashtable getInfoTable()
Returns a clone of the infoTable.

Returns:
A infoTable clone

putInfo

public boolean putInfo(Object key,
                       Object value)
Adds an new value to the infoTable (blocked by mutable). Released changes: CHANGE_UPDATE, CHANGE_INFOTABLE

Parameters:
key - The new key
value - The new value
Returns:
true on success

getInfoTableSize

public int getInfoTableSize()
Returns the number of keys in the infoTable.

Returns:
number of keys

getInfoTableKeys

public Enumeration getInfoTableKeys()
Returns the keys of the infoTable as an Enumeration.

Returns:
Enumeration of infoTable keys

getInfoTableElements

public Enumeration getInfoTableElements()
Returns the elements of the infoTable as an Enumeration.

Returns:
Enumeration of infoTable elements

getInfoTableValues

public Collection getInfoTableValues()
Returns the values of the infoTable as a Collection.

Returns:
Collection of infoTable values

setChanges

protected void setChanges(int c)
Include a change into the changes BitSet. Released changes: CHANGE_ANYTHING, the new change "c"

Parameters:
c - the new change

getChanges

public BitSet getChanges()
Returns the BitSet of changes.

Returns:
a BitSet of changes

getChanges

public boolean getChanges(int index)
Returns a special change from the BitSet.

Parameters:
index - The index of the change
Returns:
change[index]

anyChanges

public boolean anyChanges()
Returns true if anything was changed.

Returns:
true if anything was changed

resetChanges

protected void resetChanges()
Resets all changes and subchanges.


publishChanges

protected abstract void publishChanges(int c)
All changes on this level will be published to the parent.

Parameters:
c - change

setSubChanges

protected void setSubChanges(int c)
Include a subchange into the subchanges BitSet. Released subchanges: CHANGE_ANYTHING, the new change "c"

Parameters:
c - the new subchange

getSubChanges

public BitSet getSubChanges()
Returns the BitSet of subchanges.

Returns:
a BitSet of subchanges

getSubChanges

public boolean getSubChanges(int index)
Returns a special subchange from the BitSet.

Parameters:
index - The index of the subchange
Returns:
subchange[index]

anySubChanges

public boolean anySubChanges()
Returns true if any child was changed.

Returns:
true if any child was changed

setTrace

public boolean setTrace(boolean t)
Activates the tracer (blocked by mutable).

Parameters:
t - true=on false=off
Returns:
true on success

getTrace

public boolean getTrace()
Returns the trace status.

Returns:
trace status

getTraceable

public boolean getTraceable()
Returns the traceable flag.

Returns:
true if this object is traceable

setMutable

protected abstract void setMutable(boolean m)
Sets the mutable flag.

Parameters:
m - new mutable flag (true=is mutable)

getMutable

public boolean getMutable()
Returns the mutable flag.

Returns:
true if this object is mutable

getTimeStamp

public TimeStamp getTimeStamp()
Returns the timeStamp of this object. The time of creation.

Returns:
timeStamp

VectorClone

protected Vector VectorClone(Vector v)
This methode duplicates a vector with all inner objects.

Parameters:
v - The vector which should be cloned
Returns:
The clone of the original vector

getSubTypeName

public String getSubTypeName()
Returns the SubType of this object as a string.

Returns:
SubType as a string

clone

public Object clone()
Clones this object.



Copyright © Fraunhofer Gesellschaft. All Rights Reserved.