Package org.pathvisio.libgpml.model
Class DataNode.State
java.lang.Object
org.pathvisio.libgpml.model.PathwayObject
org.pathvisio.libgpml.model.PathwayElement
org.pathvisio.libgpml.model.ShapedElement
org.pathvisio.libgpml.model.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
-
Nested Class Summary
Nested classes/interfaces inherited from class org.pathvisio.libgpml.model.PathwayElement
PathwayElement.AnnotationRef, PathwayElement.CitationRef, PathwayElement.Comment, PathwayElement.EvidenceRef, PathwayElement.InfoRef
Nested classes/interfaces inherited from interface org.pathvisio.libgpml.model.Referenceable
Referenceable.Annotatable, Referenceable.Citable, Referenceable.Evidenceable
-
Field Summary
Fields Modifier and Type Field Description private double
relX
private double
relY
private java.lang.String
textLabel
private StateType
type
private org.bridgedb.Xref
xref
Fields inherited from class org.pathvisio.libgpml.model.PathwayObject
noFire, pathwayModel
-
Constructor Summary
Constructors Modifier Constructor Description private
State(java.lang.String textLabel, StateType type, double relX, double relY)
Instantiates a State pathway element given all possible parameters except xref.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. -
Method Summary
Modifier and Type Method Description void
coordinatesChanged()
Updates coordinates, called byPathwayModel.childModified(org.pathvisio.libgpml.model.PathwayObjectEvent)
CopyElement
copy()
Copies this pathway element.void
copyValuesFrom(DataNode.State src)
Copies values from the given source pathway element.DataNode
getDataNode()
Returns the parent data node, outer class, to which the state belongs.Group
getGroupRef()
Returns the parent group of the dataNode of this state.ObjectType
getObjectType()
Returns the object type of this pathway element.double
getRelX()
Returns the relative x coordinate.double
getRelY()
Returns the relative y coordinate.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.java.lang.String
getTextLabel()
Returns the text of of this state.StateType
getType()
Returns the type of this state.org.bridgedb.Xref
getXref()
Returns the Xref for this state.int
getZOrder()
Returns the z-order of this pathway element.void
setGroupRefTo(Group v)
Do not allow groupRef to be set for this state.protected void
setPathwayModelTo(PathwayModel pathwayModel)
Sets the pathway model for this pathway element.void
setRelX(double v)
Sets the relative x coordinate.void
setRelY(double v)
Sets the relative y coordinate.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.void
setTextLabel(java.lang.String v)
Sets the text of of this shaped pathway element.void
setType(StateType v)
Sets the type of this state.void
setXref(org.bridgedb.Xref v)
Sets the Xref for this state.void
setZOrder(int v)
Do nothing.protected void
terminate()
Terminates this state and removes all links and references.private void
updateCoordinates()
Updates coordinates.Methods inherited from class org.pathvisio.libgpml.model.ShapedElement
copyValuesFrom, getBorderColor, getBorderStyle, getBorderWidth, getBounds, getCenterX, getCenterY, getFillColor, getFontDecoration, getFontName, getFontSize, getFontStrikethru, getFontStyle, getFontWeight, getHAlign, getHeight, getLeft, getLinkableFroms, getRotatedBounds, getRotation, getShapeType, getTextColor, getTop, getVAlign, getWidth, hasGroupRef, setBorderColor, setBorderStyle, setBorderWidth, setCenterX, setCenterY, setFillColor, setFontDecoration, setFontName, setFontSize, setFontStrikethru, setFontStyle, setFontWeight, setHAlign, setHeight, setLeft, setRotation, setShapeType, setTextColor, setTop, setVAlign, setWidth, toAbsoluteCoordinate, toRelativeCoordinate, unsetAllLinkableFroms, unsetGroupRef
Methods inherited from class org.pathvisio.libgpml.model.PathwayElement
addAnnotation, addAnnotation, addAnnotation, addCitation, addCitation, addCitation, addComment, addComment, addEvidence, addEvidence, addEvidence, copyReferencesFrom, copyValuesFrom, findComment, getAnnotationRefs, getCitationRefs, getComments, getDynamicProperties, getDynamicProperty, getDynamicPropertyKeys, getEvidenceRefs, getPropertyEx, getPropertyKeys, hasAnnotationRef, hasCitationRef, hasEvidenceRef, removeAnnotationRef, removeAnnotationRefs, removeCitationRef, removeCitationRefs, removeComment, removeEvidenceRef, removeEvidenceRefs, setComments, setDynamicProperty, setPropertyEx
Methods inherited from class org.pathvisio.libgpml.model.PathwayObject
addListener, dontFireEvents, fireObjectModifiedEvent, getElementId, getListeners, getPathwayModel, hasPathwayModel, removeListener, setElementId, setGeneratedElementId, setPathwayModel, unsetPathwayModel
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.pathvisio.libgpml.model.Drawable
getPathwayModel
Methods inherited from interface org.pathvisio.libgpml.model.GraphLink.LinkableTo
getElementId
-
Field Details
-
textLabel
private java.lang.String textLabel -
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
Instantiates a State pathway element given all possible parameters except xref.
-
-
Method Details
-
getObjectType
Returns the object type of this pathway element.- Specified by:
getObjectType
in interfaceDrawable
- Specified by:
getObjectType
in interfaceGraphLink.LinkableTo
- Specified by:
getObjectType
in classPathwayObject
- Returns:
- the object type.
-
getDataNode
Returns the parent data node, outer class, to which the state belongs.NB:
- Returns the parent data node even if this state has been removed from the data node states list.
- 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 classShapedElement
- 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 classShapedElement
- Parameters:
v
- the text to set for this shaped pathway element.
-
getType
Returns the type of this state.- Returns:
- type the type of this state, e.g. complex.
-
setType
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. -
setXref
public void setXref(org.bridgedb.Xref v)Sets the Xref for this state. -
updateCoordinates
private void updateCoordinates()Updates coordinates. -
coordinatesChanged
public void coordinatesChanged()Updates coordinates, called byPathwayModel.childModified(org.pathvisio.libgpml.model.PathwayObjectEvent)
-
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 interfaceDrawable
- Overrides:
getZOrder
in classShapedElement
- 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 interfaceDrawable
- Overrides:
setZOrder
in classShapedElement
- Parameters:
v
- the input
-
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 interfaceGroupable
- Overrides:
getGroupRef
in classShapedElement
- Returns:
- the parent group of this state and its parent dataNode.
-
setGroupRefTo
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 interfaceGroupable
- Overrides:
setGroupRefTo
in classShapedElement
- Parameters:
v
- the group.
-
setPathwayModelTo
protected void setPathwayModelTo(PathwayModel pathwayModel) throws java.lang.IllegalArgumentException, java.lang.IllegalStateExceptionSets the pathway model for this pathway element. NB: This method is not used directly. It is called byPathwayModel.addPathwayObject(org.pathvisio.libgpml.model.PathwayObject)
.- Overrides:
setPathwayModelTo
in classPathwayObject
- 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 classShapedElement
-
copyValuesFrom
Copies values from the given source pathway element.- Parameters:
src
- the source pathway element.
-
copy
Copies this pathway element. NB: this method is never actually used.- Specified by:
copy
in classPathwayElement
- Returns:
- the copyElement for the new pathway element and this source pathway element.
-
getStaticPropertyKeys
Returns all static properties for this pathway object.- Overrides:
getStaticPropertyKeys
in classShapedElement
- Returns:
- result the set of static property for this pathway object.
-
getStaticProperty
Returns static property value for given key.- Overrides:
getStaticProperty
in classShapedElement
- 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. graphRef- Overrides:
setStaticProperty
in classShapedElement
- Parameters:
key
- the key.value
- the static property value.
-