Package org.pathvisio.libgpml.model
Class DataNode
java.lang.Object
org.pathvisio.libgpml.model.PathwayObject
org.pathvisio.libgpml.model.PathwayElement
org.pathvisio.libgpml.model.ShapedElement
org.pathvisio.libgpml.model.DataNode
- All Implemented Interfaces:
java.lang.Cloneable,Drawable,GraphLink.LinkableTo,Groupable,Referenceable,Referenceable.Annotatable,Referenceable.Citable,Referenceable.Evidenceable,Xrefable
public class DataNode extends ShapedElement implements Xrefable
This class stores information for a DataNode pathway element.
- Author:
- finterly
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classDataNode.StateThis class stores all information relevant to a State pathway element.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 GroupaliasRefprivate java.util.List<DataNode.State>statesprivate java.lang.StringtextLabelprivate DataNodeTypetypeprivate org.bridgedb.XrefxrefFields inherited from class org.pathvisio.libgpml.model.PathwayObject
noFire, pathwayModel -
Constructor Summary
Constructors Constructor Description DataNode(java.lang.String textLabel, DataNodeType type)Instantiates a DataNode given all required parameters.DataNode(java.lang.String textLabel, DataNodeType type, org.bridgedb.Xref xref, Group aliasRef)Instantiates a DataNode given all possible parameters. -
Method Summary
Modifier and Type Method Description DataNode.StateaddState(java.lang.String elementId, java.lang.String textLabel, StateType type, double relX, double relY)Instantiates a state with the given properties including elementId.DataNode.StateaddState(java.lang.String textLabel, StateType type, double relX, double relY)Instantiates a state with the given properties.voidaddState(DataNode.State state)Adds given state to states list.CopyElementcopy()Copies this pathway element.voidcopyReferencesFrom(PathwayElement srcDataNode)Copies references from the given source data node, including state references.voidcopyValuesFrom(DataNode src)Copies values from the given source pathway element.GroupgetAliasRef()Returns the pathway element to which the data node refers to as an alias.ObjectTypegetObjectType()Returns the object type of this pathway element.java.util.List<DataNode.State>getStates()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 this datanode.DataNodeTypegetType()Returns the type of this datanode.org.bridgedb.XrefgetXref()Returns the Xref for this datanode.booleanhasState(DataNode.State state)Checks whether states has the given state.voidremoveState(DataNode.State state)Removes given state from states list.private voidremoveStates()Removes all states from states list.voidsetAliasRef(Group v)Sets the group aliasRef to which this data node refers to as an alias.protected voidsetPathwayModelTo(PathwayModel pathwayModel)Sets the pathway model for this pathway element.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 this shaped pathway element.voidsetType(DataNodeType v)Sets the type of this datanode, e.g.voidsetXref(org.bridgedb.Xref v)Sets the Xref for this datanode.protected voidterminate()Terminates this data node and removes all links and references.voidunsetAliasRef()Unsets the aliasRef, if any, from this data node.Methods inherited from class org.pathvisio.libgpml.model.ShapedElement
copyValuesFrom, getBorderColor, getBorderStyle, getBorderWidth, getBounds, getCenterX, getCenterY, getFillColor, getFontDecoration, getFontName, getFontSize, getFontStrikethru, getFontStyle, getFontWeight, getGroupRef, getHAlign, getHeight, getLeft, getLinkableFroms, getRotatedBounds, getRotation, getShapeType, getTextColor, getTop, getVAlign, getWidth, getZOrder, hasGroupRef, setBorderColor, setBorderStyle, setBorderWidth, setCenterX, setCenterY, setFillColor, setFontDecoration, setFontName, setFontSize, setFontStrikethru, setFontStyle, setFontWeight, setGroupRefTo, setHAlign, setHeight, setLeft, setRotation, setShapeType, setTextColor, setTop, setVAlign, setWidth, setZOrder, toAbsoluteCoordinate, toRelativeCoordinate, unsetAllLinkableFroms, unsetGroupRefMethods inherited from class org.pathvisio.libgpml.model.PathwayElement
addAnnotation, addAnnotation, addAnnotation, addCitation, addCitation, addCitation, addComment, addComment, addEvidence, addEvidence, addEvidence, 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
-
states
-
xref
private org.bridgedb.Xref xref -
aliasRef
-
-
Constructor Details
-
DataNode
public DataNode(java.lang.String textLabel, DataNodeType type, org.bridgedb.Xref xref, Group aliasRef)Instantiates a DataNode given all possible parameters. A DataNode of type Alias can have an aliasRef which refers to aGroupand/or have a textLabel which points to a group somewhere.- Parameters:
textLabel- the text or link of this datanode.type- the type of datanode, e.g. complex.xref- the data node Xref.aliasRef- the group this data node alias refers to.
-
DataNode
Instantiates a DataNode given all required parameters.- Parameters:
textLabel- the datanode text label.type- the datanode type.
-
-
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.
-
getTextLabel
public java.lang.String getTextLabel()Returns the text of this datanode.- Specified by:
getTextLabelin classShapedElement- Returns:
- textLabel the text of this datanode.
-
setTextLabel
public void setTextLabel(java.lang.String v)Sets the text of this shaped pathway element.- Specified by:
setTextLabelin classShapedElement- Parameters:
v- the text to set.
-
getType
Returns the type of this datanode.- Returns:
- type the type of this datanode, e.g. complex.
-
setType
Sets the type of this datanode, e.g. complex. NB: Cannot change type if this is an alias data node.- Parameters:
v- the type to set for this datanode.
-
getXref
public org.bridgedb.Xref getXref()Returns the Xref for this datanode. -
setXref
public void setXref(org.bridgedb.Xref v)Sets the Xref for this datanode. -
getStates
-
hasState
Checks whether states has the given state.- Parameters:
state- the state to look for.- Returns:
- true if has state, false otherwise.
-
addState
Adds given state to states list. Sets datanode for the given state.- Parameters:
state- the state to be added.
-
addState
public DataNode.State addState(java.lang.String textLabel, StateType type, double relX, double relY)Instantiates a state with the given properties. Adds new state to states list and pathway model.- Parameters:
textLabel- the text label of the state.type- the type of the state, e.g. protein modification.relX- the relative x coordinates.relY- the relative y coordinates.- Returns:
- state the instantiated state.
-
addState
public DataNode.State addState(java.lang.String elementId, java.lang.String textLabel, StateType type, double relX, double relY)Instantiates a state with the given properties including elementId. Adds new state to states list and pathway model.- Parameters:
elementId- the elementId to set for the instantiated state.textLabel- the text label of the state.type- the type of the state, e.g. protein modification.relX- the relative x coordinates.relY- the relative y coordinates.- Returns:
- state the instantiated state.
-
removeState
Removes given state from states list. State ceases to exist and is terminated.- Parameters:
state- the state to be removed.
-
removeStates
private void removeStates()Removes all states from states list. -
getAliasRef
Returns the pathway element to which the data node refers to as an alias. In GPML, this is aliasRef which refers to the elementId of a pathway element (normally gpml:Group).- Returns:
- aliasRef the pathway element to which the data node refers.
-
setAliasRef
Sets the group aliasRef to which this data node refers to as an alias. In GPML, this is aliasRef which refers to the elementId of gpml:Group.NB:
- This method calls
unsetAliasRef()to remove any existing links. - This method calls
PathwayModel.linkAlias(org.pathvisio.libgpml.model.Group, org.pathvisio.libgpml.model.DataNode)to add information to pathway model. - DataNode type must be "Alias".
- Parameters:
v- the group to which this data node refers.
- This method calls
-
unsetAliasRef
public void unsetAliasRef()Unsets the aliasRef, if any, from this data node. Also removes references in pathway model.- This method calls
unsetAliasRef()to remove any existing links. - This method calls
PathwayModel.unlinkAlias(org.pathvisio.libgpml.model.Group, org.pathvisio.libgpml.model.DataNode)to remove information in the pathway model. - This method is also called when this data node alias is
terminate().
- This method calls
-
copyValuesFrom
Copies values from the given source pathway element.NB:
- AliasRef value is not copied. References to other PathwayObjects are
stored in
CopyElementbycopy().
- Parameters:
src- the source pathway element.
- AliasRef value is not copied. References to other PathwayObjects are
stored in
-
copy
Copies this pathway element.- Specified by:
copyin classPathwayElement- Returns:
- the copyElement for the new pathway element and this source pathway element.
-
copyReferencesFrom
Copies references from the given source data node, including state references.NB:
- For each state, copies references from the corresponding source state.
- To be called after new data node is added to a pathway model.
- The source data node may be the immediate copy element source of the new data node, or an older source data node.
- Overrides:
copyReferencesFromin classPathwayElement- Parameters:
srcDataNode- the source element to copy references from.
-
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.
-
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. This method is not used directly. 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 data node and removes all links and references.- Overrides:
terminatein classShapedElement
-