Package org.pathvisio.libgpml.model
Class PathwayModel
java.lang.Object
org.pathvisio.libgpml.model.PathwayModel
public class PathwayModel
extends java.lang.Object
This class stores information for a Pathway model. Pathway model contains
pathway elements and properties. The pathway model stores all information
necessary for maintaining, loading and saving pathway data; reading in,
writing from.
- Author:
- unknown, finterly
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PathwayModel.StatusFlagEvent
Event for a change in the "changed" status of this Pathwaystatic interface
PathwayModel.StatusFlagListener
Implement this interface if you want to be notified when the "changed" status changes. -
Field Summary
Fields Modifier and Type Field Description private java.util.Map<Group,java.util.Set<DataNode>>
aliasRefToAliases
private java.util.List<Annotation>
annotations
private boolean
changed
private java.util.List<Citation>
citations
private java.util.List<DataNode>
dataNodes
private java.util.Map<java.lang.String,PathwayObject>
elementIdToPathwayObject
private java.util.Map<GraphLink.LinkableTo,java.util.Set<GraphLink.LinkableFrom>>
elementRefToLinePoints
private java.util.List<Evidence>
evidences
private java.util.List<GraphicalLine>
graphicalLines
private java.util.List<Group>
groups
private java.util.List<Interaction>
interactions
private java.util.List<Label>
labels
private java.util.List<PathwayModelListener>
listeners
private Pathway
pathway
private java.util.List<Shape>
shapes
private java.io.File
sourceFile
private java.util.List<PathwayModel.StatusFlagListener>
statusFlagListeners
-
Constructor Summary
Constructors Constructor Description PathwayModel()
Initializes a pathway model object with defaultPathway
. -
Method Summary
Modifier and Type Method Description void
add(PathwayObject o)
Adds a PathwayObject to this Pathway.protected Annotation
addAnnotation(Annotation annotation)
Adds given annotation to annotations list.protected Citation
addCitation(Citation citation)
Adds given citation to citations list.void
addDataNode(DataNode dataNode)
Adds the given dataNode to dataNodes list.void
addElementId(java.lang.String elementId, PathwayObject pathwayObject)
Adds mapping of elementId key to PathwayObject value in the elementIdToPathwayObject hash map.protected void
addElementRef(GraphLink.LinkableTo elementRef, GraphLink.LinkableFrom linePoint)
Register a link from a elementRef to a linePoint(s).protected Evidence
addEvidence(Evidence evidence)
Adds given evidence to evidences.void
addGraphicalLine(GraphicalLine graphicalLine)
Adds the given graphicalLine to graphicalLines list.void
addGroup(Group group)
Adds the given group to groups list.void
addInteraction(Interaction interaction)
Adds the given interaction to interactions list.void
addLabel(Label label)
Adds the given label to labels list.void
addListener(PathwayModelListener v)
Adds listener to this pathway model.protected void
addPathwayObject(PathwayObject o)
Adds the given pathway object to pathway model.void
addShape(Shape shape)
Adds the given shape to shapes list.Sets pathwayModel and elementId, and maps to elementIdToPathwayObject.void
addStatusFlagListener(PathwayModel.StatusFlagListener v)
Registers a status flag listenerprotected void
checkMBoardSize(PathwayObject e)
Checks whether the board size is still large enough for the givenPathwayElement
and increases the size if not(package private) void
childModified(PathwayObjectEvent e)
Used by children of this Pathway to notify the parent of modifications.void
clearChangedFlag()
ClearChangedFlag should be called after when the current pathway is known to be the same as the one on disk.PathwayModel
clone()
Clones this pathway model.void
fireObjectModifiedEvent(PathwayModelEvent e)
Firing the ObjectModifiedEvent has the side effect of marking the Pathway as changed.void
fireStatusFlagEvent(PathwayModel.StatusFlagEvent e)
Fires status flag event.java.util.Set<Group>
getAliasRefs()
Returns the set of Group aliasRef keys for this pathway model.java.util.List<Annotation>
getAnnotations()
Returns the list of annotations.java.util.List<Citation>
getCitations()
Returns the list of citations.java.util.List<DataNode>
getDataNodes()
Returns the list of data node pathway elements.java.util.List<org.bridgedb.Xref>
getDataNodeXrefs()
Returns the Xref of all DataNodes in this pathway as a List.java.util.Set<java.lang.String>
getElementIds()
Returns a set view of String elementId keys from the elementIdToPathwayObject hash map.java.util.List<Evidence>
getEvidences()
Returns the list of evidences.java.util.List<GraphicalLine>
getGraphicalLines()
Returns the list of graphical line pathway elements.java.util.List<Group>
getGroups()
Returns the list of group pathway elements.java.util.List<org.bridgedb.Xref>
getGroupXrefs()
Returns the Xref of all Groups in this pathway as a List.java.util.List<Interaction>
getInteractions()
Returns the list of interaction pathway elements.java.util.List<org.bridgedb.Xref>
getInteractionXrefs()
Returns the Xref of all Interactions in this pathway as a List.java.util.List<Label>
getLabels()
Returns the list of label pathway elements.java.util.List<LineElement>
getLineElements()
Returns all line pathway elements for the pathway model (interactions and graphicalLines).java.util.Set<DataNode>
getLinkedAliases(Group aliasRef)
Returns the set of DataNode aliases for a Group aliasRef.Pathway
getPathway()
Returns the pathway object containing metadata, e.g.java.util.List<PathwayElement>
getPathwayElements()
Returns all pathway elements for the pathway model (pathway, dataNodes, interactions, graphicalLines, labels, shapes, and groups).PathwayObject
getPathwayObject(java.lang.String elementId)
Returns Pathway Object for the given String elementId key.java.util.List<PathwayObject>
getPathwayObjects()
Returns all pathway objects for the pathway model.java.util.Set<GraphLink.LinkableFrom>
getReferringLinkableFroms(GraphLink.LinkableTo elementRef)
Returns allGraphLink.LinkableFrom
LineElement.LinePoint
that refer to aGraphLink.LinkableTo
pathway element or anchor.java.util.List<ShapedElement>
getShapedElements()
Returns all shaped pathway elements for the pathway model (dataNodes, states, labels, shapes, and groups).java.util.List<ShapedElement>
getShapedElementsExclStates()
Returns all shaped pathway elements for the pathway model (dataNodes, labels, shapes, and groups).java.util.List<Shape>
getShapes()
Returns the list of shape pathway elements.java.io.File
getSourceFile()
Returns the xml file containing the Gpml/mapp pathway currently displayedjava.util.List<org.bridgedb.Xref>
getStateXrefs()
Returns the Xref of all States of all DataNodes in this pathway as a List.java.lang.String
getUniqueElementId()
Returns a unique elementId.static java.lang.String
getUniqueId(java.util.Set<java.lang.String> ids)
Randomly generates a new unique ID, based on strings of hex digits (0..9 or a..f) given a set of existing IDs.boolean
hasAliasRef(Group aliasRef)
Returns true if pathway model has Group aliasRef.boolean
hasChanged()
The "changed" flag tracks if the Pathway has been changed since the file was opened or last saved.private Annotation
hasEqualAnnotation(Annotation annotation)
Checks if given annotation already exists for the pathway model.private Citation
hasEqualCitation(Citation citation)
Checks if given citation already exists for the pathway model.private Evidence
hasEqualEvidence(Evidence evidence)
Checks if given evidence already exists for the pathway model.protected boolean
hasLinkedAlias(Group aliasRef, DataNode alias)
Returns true if pathway model has DataNode alias and Group aliasRef.boolean
hasPathwayObject(PathwayObject pathwayObject)
Checks if the pathway model has the given pathway object.protected void
linkAlias(Group aliasRef, DataNode alias)
Adds mapping of aliasRef to data node alias in the aliasRefToAliases hash map.private void
markChanged()
To be called after each edit operationvoid
readFromXml(java.io.File file, boolean validate)
void
readFromXml(java.io.InputStream in, boolean validate)
void
readFromXml(java.io.Reader in, boolean validate)
void
remove(PathwayObject o)
Removes a PathwayObject from this Pathway.protected void
removeAliasRef(Group aliasRef)
Removes the mapping of given elementRef key from the elementRefToDataNode hash map.void
removeAnnotation(Annotation annotation)
Removes given annotation from annotations list and elementIdToPathwayObject map.void
removeCitation(Citation citation)
Removes given citation from citations list and elementIdToPathwayObject map.void
removeDataNode(DataNode dataNode)
Removes the given dataNode from dataNodes list and elementIdToPathwayObject map.protected void
removeElementId(java.lang.String elementId)
Removes the mapping of given elementId key from the elementIdToPathwayObject hash map.protected void
removeElementRef(GraphLink.LinkableTo elementRef, GraphLink.LinkableFrom linePoint)
Removes a linePoint linked to a elementRef.void
removeEvidence(Evidence evidence)
Removes given evidence from evidences list and elementIdToPathwayObject map.void
removeGraphicalLine(GraphicalLine graphicalLine)
Removes the given graphicalLine from graphicalLines list and elementIdToPathwayObject map..void
removeGroup(Group group)
Removes the given group from groups list and elementIdToPathwayObject map.void
removeInteraction(Interaction interaction)
Removes the given interaction from interactions list and elementIdToPathwayObject map..void
removeLabel(Label label)
Removes the given label from labels list and elementIdToPathwayObject map.void
removeListener(PathwayModelListener v)
Removes listener from this pathway model.private void
removeOldPathway(Pathway oldP)
Removes old pathway prior tosetNewPathway(org.pathvisio.libgpml.model.Pathway)
, both called byreplacePathway(org.pathvisio.libgpml.model.Pathway)
.protected void
removePathwayObject(PathwayObject o)
Removes the given pathway object from pathway model and elementIdToPathwayObject map.void
removeShape(Shape shape)
Removes the given shape from shapes list and elementIdToPathwayObject map.void
removeStatusFlagListener(PathwayModel.StatusFlagListener v)
Removes a status flag listenerprotected void
replacePathway(Pathway newP)
Replaces the Pathway, callsremoveOldPathway(org.pathvisio.libgpml.model.Pathway)
and thensetNewPathway(org.pathvisio.libgpml.model.Pathway)
.private void
setNewPathway(Pathway newP)
Sets new pathway after toremoveOldPathway(org.pathvisio.libgpml.model.Pathway)
, both called byreplacePathway(org.pathvisio.libgpml.model.Pathway)
.void
setSourceFile(java.io.File file)
java.lang.String
summary()
Prints a summary of this pathway model.void
transferStatusFlagListeners(PathwayModel dest)
Transfer statusflag listeners from one pathway to another.protected void
unlinkAlias(Group aliasRef, DataNode alias)
Removes the link between given aliasRef and alias, and removes mapping from aliasRefToAliases of this pathway model.void
writeToXml(java.io.File file, boolean validate)
Writes the JDOM document to the file specifiedMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
pathway
-
elementIdToPathwayObject
-
elementRefToLinePoints
private java.util.Map<GraphLink.LinkableTo,java.util.Set<GraphLink.LinkableFrom>> elementRefToLinePoints -
aliasRefToAliases
-
dataNodes
-
interactions
-
graphicalLines
-
labels
-
shapes
-
groups
-
annotations
-
citations
-
evidences
-
sourceFile
private java.io.File sourceFile -
changed
private boolean changed -
statusFlagListeners
-
listeners
-
-
Constructor Details
-
PathwayModel
public PathwayModel()Initializes a pathway model object with defaultPathway
.
-
-
Method Details
-
getPathway
Returns the pathway object containing metadata, e.g. title, organism.- Returns:
- pathway the pathway meta information.
-
replacePathway
Replaces the Pathway, callsremoveOldPathway(org.pathvisio.libgpml.model.Pathway)
and thensetNewPathway(org.pathvisio.libgpml.model.Pathway)
. NB: There can only be one pathway per pathway model.- Parameters:
newP
- the new pathway info.
-
removeOldPathway
Removes old pathway prior tosetNewPathway(org.pathvisio.libgpml.model.Pathway)
, both called byreplacePathway(org.pathvisio.libgpml.model.Pathway)
.- Parameters:
oldP
- the old pathway.
-
setNewPathway
Sets new pathway after toremoveOldPathway(org.pathvisio.libgpml.model.Pathway)
, both called byreplacePathway(org.pathvisio.libgpml.model.Pathway)
.- Parameters:
newP
- the new pathway to be set.
-
getPathwayElements
Returns all pathway elements for the pathway model (pathway, dataNodes, interactions, graphicalLines, labels, shapes, and groups). Includes Pathway.- Returns:
- the pathway elements for this pathway model.
-
getShapedElements
Returns all shaped pathway elements for the pathway model (dataNodes, states, labels, shapes, and groups). NB: Includes states.- Returns:
- the pathway elements for this pathway model.
-
getShapedElementsExclStates
Returns all shaped pathway elements for the pathway model (dataNodes, labels, shapes, and groups). NB: Excludes states.- Returns:
- the pathway elements for this pathway model.
-
getLineElements
Returns all line pathway elements for the pathway model (interactions and graphicalLines).- Returns:
- the pathway elements for this pathway model.
-
getUniqueElementId
public java.lang.String getUniqueElementId()Returns a unique elementId.- Returns:
- a unique elementId.
-
getPathwayObject
Returns Pathway Object for the given String elementId key.- Parameters:
elementId
- the given elementId key.- Returns:
- the PathwayObject for the given elementId key.
-
getPathwayObjects
Returns all pathway objects for the pathway model.- Returns:
- pathwayObjects the pathway objects for this pathway model.
-
hasPathwayObject
Checks if the pathway model has the given pathway object.- Parameters:
pathwayObject
- the pathway object to check for.- Returns:
- true if pathway model has given pathway object, false otherwise.
-
getElementIds
public java.util.Set<java.lang.String> getElementIds()Returns a set view of String elementId keys from the elementIdToPathwayObject hash map.- Returns:
- a list of elementId keys.
-
addElementId
Adds mapping of elementId key to PathwayObject value in the elementIdToPathwayObject hash map.- Parameters:
elementId
- the elementIdpathwayObject
- the pathway object- Throws:
java.lang.IllegalArgumentException
- if elementId or elementIdContainer are null.java.lang.IllegalArgumentException
- if elementId is not unique.
-
removeElementId
protected void removeElementId(java.lang.String elementId)Removes the mapping of given elementId key from the elementIdToPathwayObject hash map.- Parameters:
elementId
- the elementId key.
-
getUniqueId
public static java.lang.String getUniqueId(java.util.Set<java.lang.String> ids)Randomly generates a new unique ID, based on strings of hex digits (0..9 or a..f) given a set of existing IDs.- Parameters:
ids
- the collection of already existing IDs.- Returns:
- result the new unique ID.
-
getReferringLinkableFroms
public java.util.Set<GraphLink.LinkableFrom> getReferringLinkableFroms(GraphLink.LinkableTo elementRef)Returns allGraphLink.LinkableFrom
LineElement.LinePoint
that refer to aGraphLink.LinkableTo
pathway element or anchor. -
addElementRef
Register a link from a elementRef to a linePoint(s).- Parameters:
elementRef
- the pathway element which can be linked to.linePoint
- the linePoint with given elementRef.
-
removeElementRef
Removes a linePoint linked to a elementRef.- Parameters:
elementRef
- the pathway element which is linked to linePoint.linePoint
- the linePoint with given elementRef.
-
getAliasRefs
Returns the set of Group aliasRef keys for this pathway model. A Group aliasRef can have or more DataNode aliases.- Returns:
- the group aliasRef keys for this pathway model
-
getLinkedAliases
Returns the set of DataNode aliases for a Group aliasRef. When a DataNode has type="alias" it may be an alias for a Group pathway element. To get aliasRef for a dataNode useDataNode.getAliasRef()
.- Parameters:
aliasRef
- the group which has datanode aliases.- Returns:
- the datanode aliases for the group aliasRef.
-
hasAliasRef
Returns true if pathway model has Group aliasRef.- Parameters:
aliasRef
- the group.- Returns:
- true if pathway model has aliasRef.
-
hasLinkedAlias
Returns true if pathway model has DataNode alias and Group aliasRef.- Parameters:
aliasRef
- the group.alias
- the alias datanode.- Returns:
- true if pathway model has alias and aliasRef.
-
linkAlias
Adds mapping of aliasRef to data node alias in the aliasRefToAliases hash map. NB: This method is not used directly.- It is called from
DataNode.setAliasRef(org.pathvisio.libgpml.model.Group)
.
- Parameters:
aliasRef
- the group for which a dataNode alias refers.alias
- the datanode which has an aliasRef.- Throws:
java.lang.IllegalArgumentException
- if elementRef or dataNode are null.
- It is called from
-
unlinkAlias
Removes the link between given aliasRef and alias, and removes mapping from aliasRefToAliases of this pathway model.NB: This method is not used directly.
- It is called from
DataNode.unsetAliasRef()
.
- Parameters:
aliasRef
- the group for which a dataNode alias refers.alias
- the datanode which has an aliasRef.
- It is called from
-
removeAliasRef
Removes the mapping of given elementRef key from the elementRefToDataNode hash map.- Parameters:
aliasRef
- the aliasRef key.
-
getDataNodes
Returns the list of data node pathway elements.- Returns:
- dataNodes the list of data nodes.
-
addDataNode
Adds the given dataNode to dataNodes list. Sets pathwayModel and elementId, and maps to elementIdToPathwayObject.- Parameters:
dataNode
- the data node to be added.
-
removeDataNode
Removes the given dataNode from dataNodes list and elementIdToPathwayObject map.- Parameters:
dataNode
- the data node to be removed.
-
getInteractions
Returns the list of interaction pathway elements.- Returns:
- interactions the list of interactions.
-
addInteraction
Adds the given interaction to interactions list. Sets pathwayModel and elementId, and maps to elementIdToPathwayObject.- Parameters:
interaction
- the interaction to be added.
-
removeInteraction
Removes the given interaction from interactions list and elementIdToPathwayObject map..- Parameters:
interaction
- the interaction to be removed.
-
getGraphicalLines
Returns the list of graphical line pathway elements.- Returns:
- graphicalLines the list of graphicalLines.
-
addGraphicalLine
Adds the given graphicalLine to graphicalLines list. Sets pathwayModel and elementId, and maps to elementIdToPathwayObject.- Parameters:
graphicalLine
- the graphicalLine to be added.
-
removeGraphicalLine
Removes the given graphicalLine from graphicalLines list and elementIdToPathwayObject map..- Parameters:
graphicalLine
- the graphicalLine to be removed.
-
getLabels
Returns the list of label pathway elements.- Returns:
- labels the list of labels.
-
addLabel
Adds the given label to labels list. Sets pathwayModel and elementId, and maps to elementIdToPathwayObject.- Parameters:
label
- the label to be added.
-
removeLabel
Removes the given label from labels list and elementIdToPathwayObject map.- Parameters:
label
- the label to be removed.
-
getShapes
Returns the list of shape pathway elements.- Returns:
- shapes the list of shapes.
-
addShape
Adds the given shape to shapes list.Sets pathwayModel and elementId, and maps to elementIdToPathwayObject.- Parameters:
shape
- the shape to be added.
-
removeShape
Removes the given shape from shapes list and elementIdToPathwayObject map.- Parameters:
shape
- the shape to be removed.
-
getGroups
Returns the list of group pathway elements.- Returns:
- groups the list of groups.
-
addGroup
Adds the given group to groups list. Sets pathwayModel and elementId, and maps to elementIdToPathwayObject.- Parameters:
group
- the group to be added.
-
removeGroup
Removes the given group from groups list and elementIdToPathwayObject map. Also removes group from aliasRefToAliases if applicable.- Parameters:
group
- the group to be removed.
-
getAnnotations
Returns the list of annotations.- Returns:
- annotations the list of annotations.
-
addAnnotation
Adds given annotation to annotations list. If there is an annotation with equivalent properties in the pathway model, the given annotation is not added and the equivalent annotation is returned. Also sets pathwayModel and elementId, and maps to elementIdToPathwayObject.- Parameters:
annotation
- the new annotation to be added.- Returns:
- annotation the new annotation or annotationExisting the existing equivalent annotation.
-
hasEqualAnnotation
Checks if given annotation already exists for the pathway model.- Parameters:
annotation
- the given annotation to be checked.- Returns:
- annotationExisting the existing equivalent annotation, or null if no equivalent annotation exists for given citation.
-
removeAnnotation
Removes given annotation from annotations list and elementIdToPathwayObject map.- Parameters:
annotation
- the annotation to be removed.
-
getCitations
Returns the list of citations.- Returns:
- citation the list of citations.
-
addCitation
Adds given citation to citations list. If there is an citation with equivalent properties in the pathway model, the given citation is not added and the equivalent citation is returned. Also sets pathwayModel and elementId, and maps to elementIdToPathwayObject.- Parameters:
citation
- the new citation to be added.- Returns:
- citation the new citation or citationExisting the existing equivalent citation.
-
hasEqualCitation
Checks if given citation already exists for the pathway model.- Parameters:
citation
- the given citation to be checked.- Returns:
- citationExisting the existing equivalent citation, or null if no equivalent citation exists for given citation.
-
removeCitation
Removes given citation from citations list and elementIdToPathwayObject map.- Parameters:
citation
- the citation to be removed.
-
getEvidences
Returns the list of evidences.- Returns:
- evidences the list of evidences.
-
addEvidence
Adds given evidence to evidences. If there is an evidence with equivalent properties in the pathway model, the given evidence is not added and the equivalent evidence is returned. Also sets pathwayModel and elementId, and maps to elementIdToPathwayObject.- Parameters:
evidence
- the evidence to be added.
-
hasEqualEvidence
Checks if given evidence already exists for the pathway model.- Parameters:
evidence
- the given evidence to be checked.- Returns:
- evidenceExisting the existing equivalent citation, or null if no equivalent citation exists for given citation.
-
removeEvidence
Removes given evidence from evidences list and elementIdToPathwayObject map.- Parameters:
evidence
- the evidence to be removed.
-
addPathwayObject
Adds the given pathway object to pathway model. Sets pathwayModel for the given pathway object. Sets an unique elementId for given pathway object if not already set. Corresponding elementId and given pathway object are added to elementIdToPathwayObject map. Fires PathwayEvent.ADDED event after addition of the object- Parameters:
o
- the pathway object to add.
-
removePathwayObject
Removes the given pathway object from pathway model and elementIdToPathwayObject map. The pathway object is terminated in the process. Sets parent of object to null and removed elementId before removal of the object. Fires PathwayEvent.DELETED event after removal of the object- Parameters:
o
- the pathway object to remove.
-
add
Adds a PathwayObject to this Pathway. Calls the appropriate add method based on PathwayObject class.- Parameters:
o
- the pathway object to add
-
remove
Removes a PathwayObject from this Pathway. Calls the appropriate remove method based on PathwayObject class.- Parameters:
o
- the pathway object to remove
-
getDataNodeXrefs
public java.util.List<org.bridgedb.Xref> getDataNodeXrefs()Returns the Xref of all DataNodes in this pathway as a List.- Returns:
- result the list of xref of all datanodes or an empty arraylist if there are no datanodes in this pathway.
-
getStateXrefs
public java.util.List<org.bridgedb.Xref> getStateXrefs()Returns the Xref of all States of all DataNodes in this pathway as a List.- Returns:
- result the list of xref of all states or an empty arraylist if there are no interactions in this pathway.
-
getInteractionXrefs
public java.util.List<org.bridgedb.Xref> getInteractionXrefs()Returns the Xref of all Interactions in this pathway as a List.- Returns:
- result the list of xref of all interactions or an empty arraylist if there are no interactions in this pathway.
-
getGroupXrefs
public java.util.List<org.bridgedb.Xref> getGroupXrefs()Returns the Xref of all Groups in this pathway as a List.- Returns:
- result the list of xref of all groups or an empty arraylist if there are no interactions in this pathway.
-
clone
Clones this pathway model.- Overrides:
clone
in classjava.lang.Object
- Returns:
- the clone of this pathway model.
-
getSourceFile
public java.io.File getSourceFile()Returns the xml file containing the Gpml/mapp pathway currently displayed- Returns:
- current xml file
-
setSourceFile
public void setSourceFile(java.io.File file) -
writeToXml
Writes the JDOM document to the file specified- Parameters:
file
- the file to which the JDOM document should be savedvalidate
- if true, validate the dom structure before writing to file. If there is a validation error, or the xsd is not in the classpath, an exception will be thrown.- Throws:
ConverterException
-
readFromXml
- Throws:
ConverterException
-
readFromXml
- Throws:
ConverterException
-
readFromXml
- Throws:
ConverterException
-
hasChanged
public boolean hasChanged()The "changed" flag tracks if the Pathway has been changed since the file was opened or last saved. New pathways start changed. -
clearChangedFlag
public void clearChangedFlag()ClearChangedFlag should be called after when the current pathway is known to be the same as the one on disk. This happens when you just opened it, or when you just saved it. -
markChanged
private void markChanged()To be called after each edit operation -
childModified
Used by children of this Pathway to notify the parent of modifications. A coordinate change could trigger dependent objects such as states, groups and connectors to be updated as well.- Parameters:
e
- the pathway object event.
-
checkMBoardSize
Checks whether the board size is still large enough for the givenPathwayElement
and increases the size if not- Parameters:
e
- The element to check the board size for
-
addStatusFlagListener
Registers a status flag listener- Parameters:
v
- the given status flag listener to add.
-
removeStatusFlagListener
Removes a status flag listener- Parameters:
v
- the given status flag listener to remove.
-
fireStatusFlagEvent
Fires status flag event. TODO make private if possible- Parameters:
e
- the status flag event.
-
transferStatusFlagListeners
Transfer statusflag listeners from one pathway to another. This is used needed when copies of the pathway are created / returned by UndoManager. The status flag listeners are only interested in status flag events of the active copy. -
addListener
Adds listener to this pathway model.- Parameters:
v
- the pathway model listener to add.
-
removeListener
Removes listener from this pathway model.- Parameters:
v
- the pathway model listener to removed.
-
fireObjectModifiedEvent
Firing the ObjectModifiedEvent has the side effect of marking the Pathway as changed.- Parameters:
e
- the pathway model event.
-
summary
public java.lang.String summary()Prints a summary of this pathway model.- Returns:
- the string summary of this pathway model.
-