Package org.pathvisio.libgpml.model
Class PathwayElement
java.lang.Object
org.pathvisio.libgpml.model.PathwayObject
org.pathvisio.libgpml.model.PathwayElement
- All Implemented Interfaces:
java.lang.Cloneable,Referenceable,Referenceable.Annotatable,Referenceable.Citable,Referenceable.Evidenceable
- Direct Known Subclasses:
LineElement,Pathway,ShapedElement
public abstract class PathwayElement extends PathwayObject implements java.lang.Cloneable, Referenceable.Annotatable, Referenceable.Citable, Referenceable.Evidenceable
Abstract class of pathway elements which are part of a pathway, have an
elementId, have Comment,
Children: DataNode, State, Interaction, GraphicalLine, Label, Shape, Group.
- Author:
- unknown, AP20070508, finterly
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classPathwayElement.AnnotationRefThis class stores information for an AnnotationRef with sourceAnnotation, targetReferenceable.Annotatable, and a list ofPathwayElement.CitationRefand/orPathwayElement.EvidenceRef.classPathwayElement.CitationRefThis class stores information for a CitationRef with sourceCitation, targetReferenceable.Citable, and a list ofPathwayElement.AnnotationRef.classPathwayElement.CommentThis class stores all information relevant to a Comment.classPathwayElement.EvidenceRefThis class stores information for a EvidenceRef which references anEvidence.classPathwayElement.InfoRefAbstract class ofPathwayElement.AnnotationRef,PathwayElement.CitationRef, andPathwayElement.EvidenceRef.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 java.util.List<PathwayElement.AnnotationRef>annotationRefsprivate java.util.List<PathwayElement.CitationRef>citationRefsprivate java.util.List<PathwayElement.Comment>commentsprivate java.util.Map<java.lang.String,java.lang.String>dynamicPropertiesMap for storing dynamic properties.private java.util.List<PathwayElement.EvidenceRef>evidenceRefsFields inherited from class org.pathvisio.libgpml.model.PathwayObject
noFire, pathwayModel -
Constructor Summary
Constructors Constructor Description PathwayElement()Instantiates a pathway element with meta data information. -
Method Summary
Modifier and Type Method Description PathwayElement.AnnotationRefaddAnnotation(java.lang.String elementId, java.lang.String value, AnnotationType type, org.bridgedb.Xref xref, java.lang.String urlLink)Creates a annotation with given properties, and adds annotation to pathway model.PathwayElement.AnnotationRefaddAnnotation(java.lang.String value, AnnotationType type, org.bridgedb.Xref xref, java.lang.String urlLink)Creates a annotation with given properties, and adds annotation to pathway model.PathwayElement.AnnotationRefaddAnnotation(Annotation annotation)Creates and adds an annotationRef to annotationRefs list.PathwayElement.CitationRefaddCitation(java.lang.String elementId, org.bridgedb.Xref xref, java.lang.String urlLink)Creates a citation with given xref and urlLink, and adds citation to pathway model.PathwayElement.CitationRefaddCitation(org.bridgedb.Xref xref, java.lang.String urlLink)Creates a citation with given xref and urlLink, and adds citation to pathway model.PathwayElement.CitationRefaddCitation(Citation citation)Creates and adds an citationRef to citationRefs list.PathwayElement.CommentaddComment(java.lang.String commentText, java.lang.String source)Creates a comment with given properties and adds to comments list.voidaddComment(PathwayElement.Comment comment)Adds given comment to comments list.PathwayElement.EvidenceRefaddEvidence(java.lang.String elementId, java.lang.String value, org.bridgedb.Xref xref, java.lang.String urlLink)Creates an evidence with given properties, and adds evidence to pathway model.PathwayElement.EvidenceRefaddEvidence(java.lang.String value, org.bridgedb.Xref xref, java.lang.String urlLink)Creates an evidence with given properties, and adds evidence to pathway model.PathwayElement.EvidenceRefaddEvidence(Evidence evidence)Creates and adds an evidenceRef to evidenceRefs list.abstract CopyElementcopy()Copies this pathway element.private voidcopyAnnotationRefs(java.util.List<PathwayElement.AnnotationRef> annotationRefs)Copies annotationRefs and nested citationRefs and evidenceRefs if applicable.private voidcopyCitationRefs(java.util.List<PathwayElement.CitationRef> citationRefs)Copies citationsRefs and nested annotationRefs if applicable.private voidcopyEvidenceRefs(java.util.List<PathwayElement.EvidenceRef> evidenceRefs)Copies evidenceRefs.voidcopyReferencesFrom(PathwayElement srcElement)Copies references from the given source pathway element.voidcopyValuesFrom(PathwayElement src)Copies values from the given source pathway element.java.lang.StringfindComment(java.lang.String source)Finds the first comment with a specific source.java.util.List<PathwayElement.AnnotationRef>getAnnotationRefs()Returns the list of annotation references.java.util.List<PathwayElement.CitationRef>getCitationRefs()Returns the list of citation references.java.util.List<PathwayElement.Comment>getComments()java.util.Map<java.lang.String,java.lang.String>getDynamicProperties()Returns the map of dynamic properties.java.lang.StringgetDynamicProperty(java.lang.String key)Returns a dynamic property string value.java.util.Set<java.lang.String>getDynamicPropertyKeys()Returns a set of all dynamic property keys.java.util.List<PathwayElement.EvidenceRef>getEvidenceRefs()Returns the list of evidence references.java.lang.ObjectgetPropertyEx(java.lang.Object key)Returns property of given key.java.util.Set<java.lang.Object>getPropertyKeys()Returns keys of available static properties and dynamic properties as an object listjava.lang.ObjectgetStaticProperty(StaticProperty key)Returns static property value for given key.java.util.Set<StaticProperty>getStaticPropertyKeys()Returns all static properties for this pathway object.booleanhasAnnotationRef(PathwayElement.AnnotationRef annotationRef)Checks whether annotationRefs has the given annotationRef.booleanhasCitationRef(PathwayElement.CitationRef citationRef)Checks whether citationRefs has the given citationRef.booleanhasEvidenceRef(PathwayElement.EvidenceRef evidenceRef)Checks whether evidenceRefs has the given evidenceRef.voidremoveAnnotationRef(PathwayElement.AnnotationRef annotationRef)Removes given annotationRef from annotationRefs list.voidremoveAnnotationRefs()Removes all annotationRefs from annotationRefs list.voidremoveCitationRef(PathwayElement.CitationRef citationRef)Removes given citationRef from citationRefs list.voidremoveCitationRefs()Removes all citationRef from citationRefs list.voidremoveComment(PathwayElement.Comment comment)Removes given comment from comments list.voidremoveEvidenceRef(PathwayElement.EvidenceRef evidenceRef)Removes given evidenceRef from evidenceRefs list.voidremoveEvidenceRefs()Removes all evidenceRefs from evidenceRefs list.voidsetComments(java.util.List<PathwayElement.Comment> value)Sets comments to the given comments list.voidsetDynamicProperty(java.lang.String key, java.lang.String value)Sets a dynamic property.voidsetPropertyEx(java.lang.Object key, java.lang.Object value)Sets dynamic or static properties at the same time.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.protected voidterminate()Terminates this pathway element.Methods inherited from class org.pathvisio.libgpml.model.PathwayObject
addListener, dontFireEvents, fireObjectModifiedEvent, getElementId, getListeners, getObjectType, getPathwayModel, hasPathwayModel, removeListener, setElementId, setGeneratedElementId, setPathwayModel, setPathwayModelTo, unsetPathwayModelMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
comments
-
dynamicProperties
private java.util.Map<java.lang.String,java.lang.String> dynamicPropertiesMap for storing dynamic properties. Dynamic properties can have any String as key and value of type String. If a value is set to null the key should be removed. -
annotationRefs
-
citationRefs
-
evidenceRefs
-
-
Constructor Details
-
PathwayElement
public PathwayElement()Instantiates a pathway element with meta data information.
-
-
Method Details
-
getComments
-
addComment
Adds given comment to comments list.- Parameters:
comment- the comment to be added.
-
addComment
Creates a comment with given properties and adds to comments list. CallsaddComment(Comment comment).- Parameters:
commentText- the text of the comment, between Comment tags in GPML.source- the source of this comment.- Returns:
- the created comment.
-
removeComment
Removes given comment from comments list.- Parameters:
comment- the comment to be removed.
-
setComments
Sets comments to the given comments list.- Parameters:
value- the given comment list.
-
findComment
public java.lang.String findComment(java.lang.String source)Finds the first comment with a specific source.- Parameters:
source- the source of the comment to be found.- Returns:
- the comment content with a given source.
-
getDynamicProperties
public java.util.Map<java.lang.String,java.lang.String> getDynamicProperties()Returns the map of dynamic properties.- Returns:
- dynamicProperties the map of dynamic properties.
-
getDynamicPropertyKeys
public java.util.Set<java.lang.String> getDynamicPropertyKeys()Returns a set of all dynamic property keys.- Returns:
- a set of all dynamic property keys.
-
getDynamicProperty
public java.lang.String getDynamicProperty(java.lang.String key)Returns a dynamic property string value.- Parameters:
key- the key of a key value pair.- Returns:
- the value or dynamic property.
-
setDynamicProperty
public void setDynamicProperty(java.lang.String key, java.lang.String value)Sets a dynamic property. Setting to null means removing this dynamic property altogether.- Parameters:
key- the key of a key value pair.value- the value of a key value pair.
-
getAnnotationRefs
Returns the list of annotation references.- Specified by:
getAnnotationRefsin interfaceReferenceable.Annotatable- Returns:
- annotationRefs the list of annotation references, an empty list if no properties are defined.
-
hasAnnotationRef
Checks whether annotationRefs has the given annotationRef.- Specified by:
hasAnnotationRefin interfaceReferenceable.Annotatable- Parameters:
annotationRef- the annotationRef to look for.- Returns:
- true if has annotationRef, false otherwise.
-
addAnnotation
Creates and adds an annotationRef to annotationRefs list. Sets annotable for the given annotationRef.- Specified by:
addAnnotationin interfaceReferenceable.Annotatable- Parameters:
annotation- the annotation for annotationRef.- Returns:
- the annotationRef of added annotation.
-
addAnnotation
public PathwayElement.AnnotationRef addAnnotation(java.lang.String value, AnnotationType type, org.bridgedb.Xref xref, java.lang.String urlLink)Creates a annotation with given properties, and adds annotation to pathway model. Creates a annotationRef for annotation, and adds to annotationRefs list for this annotatable. CallsaddAnnotation(Annotation annotation).- Specified by:
addAnnotationin interfaceReferenceable.Annotatable- Parameters:
value- the name, term, or text of the annotation.type- the type of the annotation, e.g. ontology.xref- the annotation xref.urlLink- the url link of the annotation.- Returns:
- the annotationRef of added annotation.
-
addAnnotation
public PathwayElement.AnnotationRef addAnnotation(java.lang.String elementId, java.lang.String value, AnnotationType type, org.bridgedb.Xref xref, java.lang.String urlLink)Creates a annotation with given properties, and adds annotation to pathway model. Creates a annotationRef for annotation, and adds to annotationRefs list for this annotatable. Sets elementId for annotation. This method is used when reading gpml. CallsaddAnnotation(Annotation annotation).- Specified by:
addAnnotationin interfaceReferenceable.Annotatable- Parameters:
elementId- the elementId to set.value- the name, term, or text of the annotation.type- the type of the annotation, e.g. ontology.xref- the annotation xref.urlLink- the url link of the annotation.- Returns:
- the annotationRef of added annotation.
-
removeAnnotationRef
Removes given annotationRef from annotationRefs list. The annotationRef ceases to exist and is terminated.- Specified by:
removeAnnotationRefin interfaceReferenceable.Annotatable- Parameters:
annotationRef- the annotationRef to be removed.
-
removeAnnotationRefs
public void removeAnnotationRefs()Removes all annotationRefs from annotationRefs list.- Specified by:
removeAnnotationRefsin interfaceReferenceable.Annotatable
-
getCitationRefs
Returns the list of citation references.- Specified by:
getCitationRefsin interfaceReferenceable.Citable- Returns:
- citationRefs the list of citations referenced, an empty list if no properties are defined.
-
hasCitationRef
Checks whether citationRefs has the given citationRef.- Specified by:
hasCitationRefin interfaceReferenceable.Citable- Parameters:
citationRef- the citationRef to look for.- Returns:
- true if has citationRef, false otherwise.
-
addCitation
Creates and adds an citationRef to citationRefs list. Sets citable for the given citationRef.- Specified by:
addCitationin interfaceReferenceable.Citable- Parameters:
citation- the citation for citationRef.- Returns:
- the citationRef of added citation.
-
addCitation
Creates a citation with given xref and urlLink, and adds citation to pathway model. Creates a citationRef for citation, and adds to citationRefs list for this citable.CallsaddCitation(Citation citation).- Specified by:
addCitationin interfaceReferenceable.Citable- Parameters:
xref- the citation xref.urlLink- the url link and description (optional) for a web address.- Returns:
- the citationRef of added citation.
-
addCitation
public PathwayElement.CitationRef addCitation(java.lang.String elementId, org.bridgedb.Xref xref, java.lang.String urlLink)Creates a citation with given xref and urlLink, and adds citation to pathway model. Creates a citationRef for citation, and adds to citationRefs list for this citable. Sets elementId for citation. This method is used when reading gpml. CallsaddCitation(Citation citation).- Specified by:
addCitationin interfaceReferenceable.Citable- Parameters:
elementId- the elementId to set.xref- the citation xref.urlLink- the url link and description (optional) for a web address.- Returns:
- the citationRef of added citation.
-
removeCitationRef
Removes given citationRef from citationRefs list. The citationRef ceases to exist and is terminated.- Specified by:
removeCitationRefin interfaceReferenceable.Citable- Parameters:
citationRef- the citationRef to be removed.
-
removeCitationRefs
public void removeCitationRefs()Removes all citationRef from citationRefs list.- Specified by:
removeCitationRefsin interfaceReferenceable.Citable
-
getEvidenceRefs
Returns the list of evidence references.- Specified by:
getEvidenceRefsin interfaceReferenceable.Evidenceable- Returns:
- evidenceRefs the list of evidences referenced, an empty list if no properties are defined.
-
hasEvidenceRef
Checks whether evidenceRefs has the given evidenceRef.- Specified by:
hasEvidenceRefin interfaceReferenceable.Evidenceable- Parameters:
evidenceRef- the evidenceRef to look for.- Returns:
- true if has evidenceRef, false otherwise.
-
addEvidence
Creates and adds an evidenceRef to evidenceRefs list. Sets evidenceable for the given evidenceRef.- Specified by:
addEvidencein interfaceReferenceable.Evidenceable- Parameters:
evidence- the evidenceRef for evidenceRef.- Returns:
- the evidenceRef of added evidence.
-
addEvidence
public PathwayElement.EvidenceRef addEvidence(java.lang.String value, org.bridgedb.Xref xref, java.lang.String urlLink)Creates an evidence with given properties, and adds evidence to pathway model. Creates a evidenceRef for evidence, and adds to evidenceRefs list for this evidenceable. CallsaddEvidence(Evidence evidence).- Specified by:
addEvidencein interfaceReferenceable.Evidenceable- Parameters:
value- the name, term, or text of the evidence.xref- the evidence xref.urlLink- the url link and description (optional) for a web address.- Returns:
- the evidenceRef of added evidence.
-
addEvidence
public PathwayElement.EvidenceRef addEvidence(java.lang.String elementId, java.lang.String value, org.bridgedb.Xref xref, java.lang.String urlLink)Creates an evidence with given properties, and adds evidence to pathway model. Creates a evidenceRef for evidence, and adds to evidenceRefs list for this evidenceable. Sets elementId for evidence. This method is used when reading gpml. CallsaddEvidence(Evidence evidence).- Specified by:
addEvidencein interfaceReferenceable.Evidenceable- Parameters:
elementId- the elementId to set.value- the name, term, or text of the evidence.xref- the evidence xref.urlLink- the url link and description (optional) for a web address.- Returns:
- the evidenceRef of added evidence.
-
removeEvidenceRef
Removes given evidenceRef from evidenceRefs list. The evidenceRef ceases to exist and is terminated.- Specified by:
removeEvidenceRefin interfaceReferenceable.Evidenceable- Parameters:
evidenceRef- the evidenceRef to be removed.
-
removeEvidenceRefs
public void removeEvidenceRefs()Removes all evidenceRefs from evidenceRefs list.- Specified by:
removeEvidenceRefsin interfaceReferenceable.Evidenceable
-
terminate
protected void terminate()Terminates this pathway element. The pathway model, if any, is unset from this pathway element. Links to all annotationRefs, citationRefs, and evidenceRefs are removed from this data node.- Overrides:
terminatein classPathwayObject
-
copyValuesFrom
Copies values from the given source pathway element.NB:
- Doesn't change parent, only fields
- Used by UndoAction.
- AnnotationRefs, citationRefs, and evidenceRefs are copied later using
copyReferencesFrom(org.pathvisio.libgpml.model.PathwayElement).
- Parameters:
src- the source pathway element.
-
copy
Copies this pathway element.- Returns:
- the copyElement for the new pathway element and this source pathway element.
-
copyReferencesFrom
Copies references from the given source pathway element.NB:
- To be called after new pathway element is added to a pathway model.
- The srcElement may be the immediate copy element source of the new pathway element, or an older source.
- Parameters:
srcElement- the source element to copy references from.
-
copyCitationRefs
Copies citationsRefs and nested annotationRefs if applicable.- Parameters:
citationRefs- the citationsRefs list.
-
copyAnnotationRefs
Copies annotationRefs and nested citationRefs and evidenceRefs if applicable.- Parameters:
annotationRefs- the annotationRefs list.
-
copyEvidenceRefs
Copies evidenceRefs.- Parameters:
evidenceRefs- the evidenceRefs list.
-
getPropertyKeys
public java.util.Set<java.lang.Object> getPropertyKeys()Returns keys of available static properties and dynamic properties as an object list- Overrides:
getPropertyKeysin classPathwayObject- Returns:
- keys the keys of available properties.
-
getStaticPropertyKeys
Returns all static properties for this pathway object.- Overrides:
getStaticPropertyKeysin classPathwayObject- Returns:
- result the set of static property for this pathway object.
-
getPropertyEx
public java.lang.Object getPropertyEx(java.lang.Object key)Returns property of given key.- Overrides:
getPropertyExin classPathwayObject- Parameters:
key- the key.- Returns:
- the property of given key.
-
setPropertyEx
public void setPropertyEx(java.lang.Object key, java.lang.Object value)Sets dynamic or static properties at the same time.- Overrides:
setPropertyExin classPathwayObject- Parameters:
key- the key for the property to set.value- the value for the property to set.
-
getStaticProperty
Returns static property value for given key.- Overrides:
getStaticPropertyin classPathwayObject- 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 classPathwayObject- Parameters:
key- the key.value- the property value.
-