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 Details

    • pathwayModel

      protected PathwayModel pathwayModel
    • elementId

      private java.lang.String elementId
    • noFire

      int noFire
    • listeners

      private java.util.Set<PathwayObjectListener> listeners
  • Constructor Details

    • PathwayObject

      public PathwayObject()
      Instantiates a pathway element. Parent pathway model and elementId are set through PathwayModel add pathway element methods. elementId.
  • Method Details

    • getObjectType

      public abstract ObjectType getObjectType()
      Returns the object type of the pathway object.
      Returns:
      objectType the object type.
    • getPathwayModel

      public PathwayModel 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.IllegalStateException
      Sets 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 by PathwayModel.addPathwayObject(org.pathvisio.libgpml.model.PathwayObject).
      Parameters:
      pathwayModel - the parent pathway model.
      Throws:
      java.lang.IllegalArgumentException
      java.lang.IllegalStateException
    • setPathwayModel

      protected void setPathwayModel​(PathwayModel pathwayModel)
      Sets the pathway model of this pathway element to the given pathway model. NB: This method is not used directly. It is called by setPathwayModelTo(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 by terminate().
    • 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

      public java.util.Set<PathwayObjectListener> getListeners()
      Returns the listeners for this pathway object.
      Returns:
      listeners for this pathway object.
    • addListener

      public void addListener​(PathwayObjectListener v)
      Adds pathway object listener.
      Parameters:
      v - the pathway object listener to add.
    • removeListener

      public void removeListener​(PathwayObjectListener v)
      Removes pathway object listener.
      Parameters:
      v - the pathway object listener to remove.
    • fireObjectModifiedEvent

      public void fireObjectModifiedEvent​(PathwayObjectEvent e)
      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

      public java.util.Set<StaticProperty> 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

      public java.lang.Object getStaticProperty​(StaticProperty key)
      Returns static property value for given key.
      Parameters:
      key - the key.
      Returns:
      the static property value.
    • setStaticProperty

      public 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. elementRef
      Parameters:
      key - the key.
      value - the static property value.