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.InfoRefNested 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 doublerelXprivate doublerelYprivate java.lang.StringtextLabelprivate StateTypetypeprivate org.bridgedb.XrefxrefFields inherited from class org.pathvisio.libgpml.model.PathwayObject
noFire, pathwayModel -
Constructor Summary
Constructors Modifier Constructor Description privateState(java.lang.String textLabel, StateType type, double relX, double relY)Instantiates a State pathway element given all possible parameters except xref.privateState(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 voidcoordinatesChanged()Updates coordinates, called byPathwayModel.childModified(org.pathvisio.libgpml.model.PathwayObjectEvent)CopyElementcopy()Copies this pathway element.voidcopyValuesFrom(DataNode.State src)Copies values from the given source pathway element.DataNodegetDataNode()Returns the parent data node, outer class, to which the state belongs.GroupgetGroupRef()Returns the parent group of the dataNode of this state.ObjectTypegetObjectType()Returns the object type of this pathway element.doublegetRelX()Returns the relative x coordinate.doublegetRelY()Returns the relative y coordinate.java.lang.ObjectgetStaticProperty(StaticProperty key)Returns static property value for given key.java.util.Set<StaticProperty>getStaticPropertyKeys()Returns all static properties for this pathway object.java.lang.StringgetTextLabel()Returns the text of of this state.StateTypegetType()Returns the type of this state.org.bridgedb.XrefgetXref()Returns the Xref for this state.intgetZOrder()Returns the z-order of this pathway element.voidsetGroupRefTo(Group v)Do not allow groupRef to be set for this state.protected voidsetPathwayModelTo(PathwayModel pathwayModel)Sets the pathway model for this pathway element.voidsetRelX(double v)Sets the relative x coordinate.voidsetRelY(double v)Sets the relative y coordinate.voidsetStaticProperty(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.voidsetTextLabel(java.lang.String v)Sets the text of of this shaped pathway element.voidsetType(StateType v)Sets the type of this state.voidsetXref(org.bridgedb.Xref v)Sets the Xref for this state.voidsetZOrder(int v)Do nothing.protected voidterminate()Terminates this state and removes all links and references.private voidupdateCoordinates()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, unsetGroupRefMethods 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, setPropertyExMethods inherited from class org.pathvisio.libgpml.model.PathwayObject
addListener, dontFireEvents, fireObjectModifiedEvent, getElementId, getListeners, getPathwayModel, hasPathwayModel, removeListener, setElementId, setGeneratedElementId, setPathwayModel, unsetPathwayModelMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.pathvisio.libgpml.model.Drawable
getPathwayModelMethods 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:
getObjectTypein interfaceDrawable- Specified by:
getObjectTypein interfaceGraphLink.LinkableTo- Specified by:
getObjectTypein 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:
getTextLabelin 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:
setTextLabelin 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:
getZOrderin interfaceDrawable- Overrides:
getZOrderin 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:
setZOrderin interfaceDrawable- Overrides:
setZOrderin 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:
getGroupRefin interfaceGroupable- Overrides:
getGroupRefin 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:
setGroupRefToin interfaceGroupable- Overrides:
setGroupRefToin 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:
setPathwayModelToin classPathwayObject- Parameters:
pathwayModel- the parent pathway model.- Throws:
java.lang.IllegalArgumentExceptionjava.lang.IllegalStateException
-
terminate
protected void terminate()Terminates this state and removes all links and references.- Overrides:
terminatein 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:
copyin classPathwayElement- Returns:
- the copyElement for the new pathway element and this source pathway element.
-
getStaticPropertyKeys
Returns all static properties for this pathway object.- Overrides:
getStaticPropertyKeysin classShapedElement- Returns:
- result the set of static property for this pathway object.
-
getStaticProperty
Returns static property value for given key.- Overrides:
getStaticPropertyin 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:
setStaticPropertyin classShapedElement- Parameters:
key- the key.value- the static property value.
-