de.huberlin.informatik.pnk.kernel
Class Extendable

java.lang.Object
  |
  +--java.util.Observable
        |
        +--de.huberlin.informatik.pnk.kernel.base.NetObservable
              |
              +--de.huberlin.informatik.pnk.kernel.Extendable
Direct Known Subclasses:
Extension, Graph, Member

public abstract class Extendable
extends NetObservable

The root class for all extendable classes of the package de.huberlin.informatik.pnk.kernel . Extendable are the classes of the member class hierarchy, Graph and Net.
Extendable provides the infrastructure to administer extensions and solves the problem of instantiation of the right extensions for all classes of the Extendable class hierarchy. This is possible, since the instantiation procedure is fully independent of the actual extensions and the actual class.


Constructor Summary
protected Extendable(Graph graph)
          Constructor specifying the graph (net).
protected Extendable(Specification specification)
          Constructor specifying the specification. (used by class Graph).
 
Method Summary
 Enumeration getApplicationKeys()
          Insert the method's description here.
 Node getDynamicExtension(String applicationKey, String instanceKey, String extensionName)
          Get Pnml-Node of the dynamic extension specified by applicationKey, instanceKey and extensionName.
 Enumeration getDynExtensionKeys(String applicationKey, String instanceKey)
          Returns a list (Enumeration) consisting of dynamic extension names specified by applicationKey, instanceKey.
 Extension getExtension(String extId)
          Gives the extension of this extendable identified by extId.
 Hashtable getExtIdToObject()
          Gives the table of all extensions of this extendable.
 Graph getGraph()
          Gives the graph of this extendable.
 Node getGraphicsInfo()
          Returns the Pnml graphic node.
 String getId()
          Returns the ID of this net object.
 Enumeration getInstanceKeys(String applicationKey)
          Get an instance key list (enumeration) of an application specified by applicationKey.
 Net getNet()
          Gives the net of this extendable.
protected  Observer getObserver()
          Gets the observer of this extendable, that is the observer of the graph.
 Point getOffset(int pageId)
          Get Offset of this net object on a page specified by pageId.
 Vector getPages()
          Returns a page vector for this net object. (multiple graphical represetaions of this object on several pages)
 Point getPosition(int pageId)
          Get absolute position of this net object on page 'pageId', e.g. the position of a transition.
 Specification getSpecification()
          Gets the specification of this extendable.
 boolean hasApplicationInfo()
          Insert the method's description here.
 boolean hasGraphicsInfo()
          Returns true, if a Pnml grphic node was specified for this extendable.
 void setDynamicExtension(String applicationKey, String instanceKey, String extensionName, Node theNode)
          Set Pnml-Node 'theNode' for the dynamic extension specified by applicationKey, instanceKey and extensionName.
 void setExtension(Object initiator, String extId, String newValue)
          Sets the extension of this extendable identified by extId to newValue.
protected  void setExtIdToObject(Hashtable extIdToObject)
          Sets all extensions of this extendable.
protected  void setGraph(Graph graph)
          Sets the graph of this extendable to graph.
 void setId(String id)
          Sets the id of this extendable to id.
 void setOffset(Point thePoint, int pageId)
          Set Offset of this net object on a page specified by pageId to 'thePoint'.
 void setPosition(Point thePoint, int pageId)
          Set absolute position of this extendable on page 'pageId', e.g. the position of a transition.
protected  void setSpecification(Specification specification)
          Sets the pecification of this extendable to specification.
 void updateExtension(Object initiator, String extId, String newValue)
          Sends the new value of extension identified by extId to the observer of this extendable.
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Extendable

protected Extendable(Graph graph)
Constructor specifying the graph (net).
Initializes a new extendable object with each of its extensions set to its default state.
During runtime the class of the extendable object is retrieved. Then the class hierarchy up to Extendable is followed successively. For each class on the way up the extension identifiers and associated extension class names mapped to it are retrieved from specification. For each extension class name an object of the class is instantiated. The extension identifier and object are stored in the extIdToObject table.

Extendable

protected Extendable(Specification specification)
Constructor specifying the specification. (used by class Graph).
Method Detail

getApplicationKeys

public Enumeration getApplicationKeys()
Insert the method's description here. Creation date: (04.07.00 10:04:17)

getDynamicExtension

public Node getDynamicExtension(String applicationKey,
                                String instanceKey,
                                String extensionName)
Get Pnml-Node of the dynamic extension specified by applicationKey, instanceKey and extensionName.

getDynExtensionKeys

public Enumeration getDynExtensionKeys(String applicationKey,
                                       String instanceKey)
Returns a list (Enumeration) consisting of dynamic extension names specified by applicationKey, instanceKey.

getExtension

public Extension getExtension(String extId)
Gives the extension of this extendable identified by extId.

getExtIdToObject

public Hashtable getExtIdToObject()
Gives the table of all extensions of this extendable.

getGraph

public Graph getGraph()
Gives the graph of this extendable.

getGraphicsInfo

public Node getGraphicsInfo()
Returns the Pnml graphic node. -> dynamic extension applicationKey = instanceKey = extensionName = "graphics"

getId

public String getId()
Returns the ID of this net object.

getInstanceKeys

public Enumeration getInstanceKeys(String applicationKey)
Get an instance key list (enumeration) of an application specified by applicationKey.

getNet

public Net getNet()
Gives the net of this extendable.
Overrides:
getNet in class NetObservable
Throws:
ClassCastException - if the graph of this extendable is not a net.

getObserver

protected Observer getObserver()
Gets the observer of this extendable, that is the observer of the graph.

getOffset

public Point getOffset(int pageId)
Get Offset of this net object on a page specified by pageId. (This is mainly used for relative positioning, e.g. for the graphical representation of extensions.)

getPages

public Vector getPages()
Returns a page vector for this net object. (multiple graphical represetaions of this object on several pages)

getPosition

public Point getPosition(int pageId)
Get absolute position of this net object on page 'pageId', e.g. the position of a transition.

getSpecification

public Specification getSpecification()
Gets the specification of this extendable.

hasApplicationInfo

public boolean hasApplicationInfo()
Insert the method's description here. Creation date: (04.07.00 10:04:17)

hasGraphicsInfo

public boolean hasGraphicsInfo()
Returns true, if a Pnml grphic node was specified for this extendable.

setDynamicExtension

public void setDynamicExtension(String applicationKey,
                                String instanceKey,
                                String extensionName,
                                Node theNode)
Set Pnml-Node 'theNode' for the dynamic extension specified by applicationKey, instanceKey and extensionName.

setExtension

public void setExtension(Object initiator,
                         String extId,
                         String newValue)
Sets the extension of this extendable identified by extId to newValue.

setExtIdToObject

protected void setExtIdToObject(Hashtable extIdToObject)
Sets all extensions of this extendable. The extensions are given by extIdToObject.

setGraph

protected void setGraph(Graph graph)
Sets the graph of this extendable to graph.

setId

public void setId(String id)
Sets the id of this extendable to id.

setOffset

public void setOffset(Point thePoint,
                      int pageId)
Set Offset of this net object on a page specified by pageId to 'thePoint'. (This is mainly used for relative positioning, e.g. for the graphical representation of extensions.)

setPosition

public void setPosition(Point thePoint,
                        int pageId)
Set absolute position of this extendable on page 'pageId', e.g. the position of a transition.

setSpecification

protected void setSpecification(Specification specification)
Sets the pecification of this extendable to specification.

updateExtension

public void updateExtension(Object initiator,
                            String extId,
                            String newValue)
Sends the new value of extension identified by extId to the observer of this extendable.