Package org.pathvisio.libgpml.model
Class PathwayObject
java.lang.Object
org.pathvisio.libgpml.model.PathwayObject
- Direct Known Subclasses:
Annotation
,Citation
,Evidence
,LineElement.GenericPoint
,PathwayElement
public abstract class PathwayObject
extends java.lang.Object
Abstract class of pathway elements which are part of a pathway and have an
elementId.
Children: DataNode, State, Interaction, GraphicalLine, Label, Shape, Group,
Anchor, Point, Annotation, Citation, and Evidence.
- Author:
- finterly
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
elementId
private java.util.Set<PathwayObjectListener>
listeners
(package private) int
noFire
protected PathwayModel
pathwayModel
-
Constructor Summary
Constructors Constructor Description PathwayObject()
Instantiates a pathway element. -
Method Summary
Modifier and Type Method Description void
addListener(PathwayObjectListener v)
Adds pathway object listener.void
dontFireEvents(int times)
Sets noFire to the given integer.void
fireObjectModifiedEvent(PathwayObjectEvent e)
Fires object modified event.java.lang.String
getElementId()
Returns the elementId of the pathway element.java.util.Set<PathwayObjectListener>
getListeners()
Returns the listeners for this pathway object.abstract ObjectType
getObjectType()
Returns the object type of the pathway object.PathwayModel
getPathwayModel()
Returns the pathway model for this pathway element.java.lang.Object
getPropertyEx(java.lang.Object key)
Returns static property of given key.java.util.Set<java.lang.Object>
getPropertyKeys()
Returns keys of available static properties and dynamic properties as an object list.java.lang.Object
getStaticProperty(StaticProperty key)
Returns static property value for given key.java.util.Set<StaticProperty>
getStaticPropertyKeys()
Returns all static properties for this pathway object.boolean
hasPathwayModel()
Checks whether this pathway element belongs to a pathway model.void
removeListener(PathwayObjectListener v)
Removes pathway object listener.protected void
setElementId(java.lang.String v)
Sets the elementId of the pathway element.protected java.lang.String
setGeneratedElementId()
Sets the elementId to generated elementId from pathwayModel.protected void
setPathwayModel(PathwayModel pathwayModel)
Sets the pathway model of this pathway element to the given pathway model.protected void
setPathwayModelTo(PathwayModel pathwayModel)
Sets the pathway model for this pathway element.void
setPropertyEx(java.lang.Object key, java.lang.Object value)
Sets properties.void
setStaticProperty(StaticProperty key, java.lang.Object value)
This works so that o.setNotes(x) is the equivalent of o.setProperty("Notes", x); Value may be null in some cases, e.g.protected void
terminate()
Terminates this pathway element.protected void
unsetPathwayModel()
Unsets the pathway model, if any, from this pathway element.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
pathwayModel
-
elementId
private java.lang.String elementId -
noFire
int noFire -
listeners
-
-
Constructor Details
-
PathwayObject
public PathwayObject()Instantiates a pathway element. Parent pathway model and elementId are set throughPathwayModel
add pathway element methods. elementId.
-
-
Method Details
-
getObjectType
Returns the object type of the pathway object.- Returns:
- objectType the object type.
-
getPathwayModel
Returns the pathway model for this pathway element.- Returns:
- pathwayModel the parent pathway model.
-
hasPathwayModel
public boolean hasPathwayModel()Checks whether this pathway element belongs to a pathway model.- Returns:
- true if and only if the pathwayNodel of this pathway element is effective.
-
setPathwayModelTo
protected void setPathwayModelTo(PathwayModel pathwayModel) throws java.lang.IllegalArgumentException, java.lang.IllegalStateExceptionSets the pathway model for this pathway element. NB: Only set when a pathway model adds this pathway element. NB: This method is not used directly. It is called byPathwayModel.addPathwayObject(org.pathvisio.libgpml.model.PathwayObject)
.- Parameters:
pathwayModel
- the parent pathway model.- Throws:
java.lang.IllegalArgumentException
java.lang.IllegalStateException
-
setPathwayModel
Sets the pathway model of this pathway element to the given pathway model. NB: This method is not used directly. It is called bysetPathwayModelTo(org.pathvisio.libgpml.model.PathwayModel)
.- Parameters:
pathwayModel
- the new pathway model for this pathway element.
-
unsetPathwayModel
protected void unsetPathwayModel()Unsets the pathway model, if any, from this pathway element. The pathway element no longer belongs to a pathway model. NB: This method is not used directly. It is called byterminate()
. -
getElementId
public java.lang.String getElementId()Returns the elementId of the pathway element.- Returns:
- elementId the unique pathway element identifier.
-
setElementId
protected void setElementId(java.lang.String v)Sets the elementId of the pathway element. NB: This method is not used directly.- Parameters:
v
- the unique pathway element identifier.
-
setGeneratedElementId
protected java.lang.String setGeneratedElementId()Sets the elementId to generated elementId from pathwayModel. NB: This method does not automatically add this elementId to the pathway model.- Returns:
- elementId the generated elementId.
-
terminate
protected void terminate()Terminates this pathway element. The pathway model, if any, is unset from this pathway element. The elementId of this pathway element is changed. -
dontFireEvents
public void dontFireEvents(int times)Sets noFire to the given integer.- Parameters:
times
- the times integer value.
-
getListeners
Returns the listeners for this pathway object.- Returns:
- listeners for this pathway object.
-
addListener
Adds pathway object listener.- Parameters:
v
- the pathway object listener to add.
-
removeListener
Removes pathway object listener.- Parameters:
v
- the pathway object listener to remove.
-
fireObjectModifiedEvent
Fires object modified event.- Parameters:
e
- the pathway object event.
-
getPropertyKeys
public java.util.Set<java.lang.Object> getPropertyKeys()Returns keys of available static properties and dynamic properties as an object list.- Returns:
- keys the keys of available properties.
-
getStaticPropertyKeys
Returns all static properties for this pathway object.- Returns:
- result the set of static property for this pathway object.
-
getPropertyEx
public java.lang.Object getPropertyEx(java.lang.Object key)Returns static property of given key.- Parameters:
key
- the key.- Returns:
- the static key property of given key.
-
setPropertyEx
public void setPropertyEx(java.lang.Object key, java.lang.Object value)Sets properties. Old notes: Will be replaced with setProperty in the future. TODO- Parameters:
key
- the key for the property to set.value
- the value for the property to set.
-
getStaticProperty
Returns static property value for given key.- Parameters:
key
- the key.- Returns:
- the static property value.
-
setStaticProperty
This works so that o.setNotes(x) is the equivalent of o.setProperty("Notes", x); Value may be null in some cases, e.g. elementRef- Parameters:
key
- the key.value
- the static property value.
-