Class DataNode.State

All Implemented Interfaces:
java.lang.Cloneable, Drawable, GraphLink.LinkableTo, Groupable, Referenceable, Referenceable.Annotatable, Referenceable.Citable, Referenceable.Evidenceable, Xrefable
Enclosing class:
DataNode

public class DataNode.State
extends ShapedElement
implements Xrefable
This class stores all information relevant to a State pathway element.
Author:
finterly
  • Field Details

    • textLabel

      private java.lang.String textLabel
    • type

      private StateType type
    • relX

      private double relX
    • relY

      private double relY
    • xref

      private org.bridgedb.Xref xref
  • Constructor Details

    • State

      private State​(java.lang.String textLabel, StateType type, double relX, double relY, org.bridgedb.Xref xref)
      Instantiates a State pathway element given all possible parameters.
      Parameters:
      textLabel - the text label of the state.
      type - the type of the state, e.g. protein modification.
      relX - the relative x coordinates on the parent object, where 0,0 is at the center of the object and 1,1 at the bottom-right corner of the object.
      relY - the relative y coordinates on the parent object, where 0,0 is at the center of the object and 1,1 at the bottom-right corner of the object.
      xref - the state xref.
    • State

      private State​(java.lang.String textLabel, StateType type, double relX, double relY)
      Instantiates a State pathway element given all possible parameters except xref.
  • Method Details

    • getObjectType

      public ObjectType getObjectType()
      Returns the object type of this pathway element.
      Specified by:
      getObjectType in interface Drawable
      Specified by:
      getObjectType in interface GraphLink.LinkableTo
      Specified by:
      getObjectType in class PathwayObject
      Returns:
      the object type.
    • getDataNode

      public DataNode getDataNode()
      Returns the parent data node, outer class, to which the state belongs.

      NB:

      1. Returns the parent data node even if this state has been removed from the data node states list.
      2. In GPML2013a, elementRef was used to refer to the elementId of parent data node, thus linking state to parent data node.
      Returns:
      dataNode the parent data node of the state.
    • getTextLabel

      public java.lang.String getTextLabel()
      Returns the text of of this state.
      Specified by:
      getTextLabel in class ShapedElement
      Returns:
      textLabel the text of of this state.
    • setTextLabel

      public void setTextLabel​(java.lang.String v)
      Sets the text of of this shaped pathway element.
      Specified by:
      setTextLabel in class ShapedElement
      Parameters:
      v - the text to set for this shaped pathway element.
    • getType

      public StateType getType()
      Returns the type of this state.
      Returns:
      type the type of this state, e.g. complex.
    • setType

      public void setType​(StateType v)
      Sets the type of this state.
      Parameters:
      v - the type of this state, e.g. complex.
    • getRelX

      public double getRelX()
      Returns the relative x coordinate. When the given state is linked to a data node, relX and relY are the relative coordinates on the data node, where 0,0 is at the center of the data node and 1,1 at the bottom right corner of the data node.
      Returns:
      relX the relative x coordinate.
    • setRelX

      public void setRelX​(double v)
      Sets the relative x coordinate. When the given state is linked to a data node, relX and relY are the relative coordinates on the data node, where 0,0 is at the center of the data node and 1,1 at the bottom right corner of the data node.
      Parameters:
      v - the relative x coordinate.
      Throws:
      java.lang.IllegalArgumentException - if relX is not between -1.0 and 1.0. t
    • getRelY

      public double getRelY()
      Returns the relative y coordinate. When the given state is linked to a data node, relX and relY are the relative coordinates on the data node, where 0,0 is at the center of the data node and 1,1 at the bottom right corner of the data node.
      Returns:
      relY the relative y coordinate.
    • setRelY

      public void setRelY​(double v)
      Sets the relative y coordinate. When the given state is linked to a data node, relX and relY are the relative coordinates on the data node, where 0,0 is at the center of the data node and 1,1 at the bottom right corner of the data node.
      Parameters:
      v - the relative y coordinate.
    • getXref

      public org.bridgedb.Xref getXref()
      Returns the Xref for this state.
      Specified by:
      getXref in interface Xrefable
      Returns:
      xref the xref of this state.
    • setXref

      public void setXref​(org.bridgedb.Xref v)
      Sets the Xref for this state.
      Specified by:
      setXref in interface Xrefable
      Parameters:
      v - the xref of this state.
    • updateCoordinates

      private void updateCoordinates()
      Updates coordinates.
    • coordinatesChanged

      public void coordinatesChanged()
    • getZOrder

      public int getZOrder()
      Returns the z-order of this pathway element. NB: State z-order is always z-order of parent data node +1. This is because z-order is not written out to the gpml file.
      Specified by:
      getZOrder in interface Drawable
      Overrides:
      getZOrder in class ShapedElement
      Returns:
      zOrder the order of this pathway element.
    • setZOrder

      public void setZOrder​(int v)
      Do nothing. State z-order is always z-order of parent data node +1. This is because z-order is not written out to the gpml file.
      Specified by:
      setZOrder in interface Drawable
      Overrides:
      setZOrder in class ShapedElement
      Parameters:
      v - the input
    • getGroupRef

      public Group getGroupRef()
      Returns the parent group of the dataNode of this state. NB: A state should always belong to the same group as its parent data node.
      Specified by:
      getGroupRef in interface Groupable
      Overrides:
      getGroupRef in class ShapedElement
      Returns:
      the parent group of this state and its parent dataNode.
    • setGroupRefTo

      public void setGroupRefTo​(Group v)
      Do not allow groupRef to be set for this state. A state will always belong to the same group as its parent data node.
      Specified by:
      setGroupRefTo in interface Groupable
      Overrides:
      setGroupRefTo in class ShapedElement
      Parameters:
      v - the group.
    • setPathwayModelTo

      protected void setPathwayModelTo​(PathwayModel pathwayModel) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
      Sets the pathway model for this pathway element. NB: This method is not used directly. It is called by PathwayModel.addPathwayObject(org.pathvisio.libgpml.model.PathwayObject).
      Overrides:
      setPathwayModelTo in class PathwayObject
      Parameters:
      pathwayModel - the parent pathway model.
      Throws:
      java.lang.IllegalArgumentException
      java.lang.IllegalStateException
    • terminate

      protected void terminate()
      Terminates this state and removes all links and references.
      Overrides:
      terminate in class ShapedElement
    • copyValuesFrom

      public void copyValuesFrom​(DataNode.State src)
      Copies values from the given source pathway element.
      Parameters:
      src - the source pathway element.
    • copy

      public CopyElement copy()
      Copies this pathway element. NB: this method is never actually used.
      Specified by:
      copy in class PathwayElement
      Returns:
      the copyElement for the new pathway element and this source pathway element.
    • getStaticPropertyKeys

      public java.util.Set<StaticProperty> getStaticPropertyKeys()
      Returns all static properties for this pathway object.
      Overrides:
      getStaticPropertyKeys in class ShapedElement
      Returns:
      result the set of static property for this pathway object.
    • getStaticProperty

      public java.lang.Object getStaticProperty​(StaticProperty key)
      Returns static property value for given key.
      Overrides:
      getStaticProperty in class ShapedElement
      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. graphRef
      Overrides:
      setStaticProperty in class ShapedElement
      Parameters:
      key - the key.
      value - the static property value.