Package se.conciliate.extensions.store
Interface MTCompleteModel
- All Superinterfaces:
Comparable<MTNamedObject>
,MTDataObject
,MTHistoryEnabled
,MTModel
,MTModelHeader
,MTNamedObject
- All Known Subinterfaces:
MTCompleteSwimlaneModel
A completely loaded model. This can be obtained by
calling
loadCompleteModel()
on a MTModelHeader
.
The methods does not require accessing the database.
Note that the interface extends MTModel
and that using
the "find" methods in this interface will still access the database.-
Field Summary
Fields inherited from interface se.conciliate.extensions.store.MTModelHeader
LOCK_TIME_PERIOD
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addLayerType
(MTLayerType layerType) Adds a layer type to this complete model instance.
NOTE: This change will not be persisted.Adds an existing symbol to the model and returns a new MTCompleteVertex that will reference a symbol equal to the sent in symbol.Adds an existing symbol to the model and returns a new MTCompleteVertex that will reference a symbol equal to the sent in symbol.void
alignEdges
(Collection<MTCompleteEdge> edges, boolean avoidObstacles) Aligns a set of edges in the model to each other.createEdge
(String uuid, EdgeType type, EdgeRouter router, MTCompleteVertex from, MTCompleteVertex to, List<Point> points) Creates a new edge and adds it to the model.createEdge
(EdgeType type, EdgeRouter router, MTCompleteVertex from, MTCompleteVertex to, List<Point> points) Creates a new edge and adds it to the model.Finds the documents connected to the model as a read-only list.Returns the bounds of the model.default Rectangle
getBounds
(Collection<MTLayerTypeHeader> layers) default List<Document.DocumentID>
Deprecated, for removal: This API element is subject to removal in a future version.Returns the documents connected to the model as a read-only list.getEdges()
Returns the models edges as a read-only collection.Returns the "editable" state of the model when it was loaded from storage.Returns the available providers of extension documents for this model.getExtensionDocuments
(String provider) Returns the extension documents connected to the model.Returns the models layers that currently exists for this model, sorted in ascending order.Returns the layer types available for this model, as a read-only collection.getPluginData
(MTDataProvider provider) Returns the plugin data created for the model by a given provider.Returns the models edges as a sorted list.Returns the models symbols as a read-only collection.Returns the models vertices as a read-only collection.void
insertEdge
(MTCompleteEdge edge) Inserts the edge to this model.void
insertVertex
(MTCompleteVertex vertex) Inserts the vertex to this model.void
moveVertexToLayerType
(MTCompleteVertex vertex, MTLayerType layerType) Moves a vertex to a layer in the model.void
removeLayerType
(MTLayerType layerType) Removes the layer type from this complete model instance.
NOTE: This change will not be persisted.void
setPluginData
(MTDataProvider provider, Object data) Sets plugin data for a provider.Methods inherited from interface se.conciliate.extensions.store.MTDataObject
getCreated, getLastModified, getLastModifiedByName, getOwnerName, getPrefix, getReferenceID, getTypeID, isPrefixLocked, isRevisionLocked, isTranslated, isTranslated
Methods inherited from interface se.conciliate.extensions.store.MTHistoryEnabled
getHistory, getID, getUUID
Methods inherited from interface se.conciliate.extensions.store.MTModel
addDocument, addToRemovalHistory, canUserRead, canUserWrite, changeRevision, connectDocument, connectDocument, createRevision, disconnectDocument, disconnectDocument, getApprovers, getAttribute, getAttributes, getCreatedBy, getGroup, getLastModifiedBy, getMaintainers, getOwner, getPermissions, getProperty, getPropertyKeys, getPropertyProviders, getRemovalHistory, getReviewers, getRevisionLog, getSubscribers, hasPluginData, lockRevision, removeDocument, removeProperty, revertToRevision, save, setApprovers, setCreated, setCreatedBy, setGroup, setLastModified, setLastModifiedBy, setMaintainers, setNotify, setOwner, setPermissions, setPermissions, setPrefix, setPrefixLocked, setProperty, setReferenceID, setReviewers, setSubscribers, setTitle, setTitle, setTranslated, setType, setWorkflowState
Methods inherited from interface se.conciliate.extensions.store.MTModelHeader
createPluginData, expand, findAttributeByType, findAttributeHeaders, findAttributes, findBreakdowns, findDocumentHeaders, findDocumentIDs, findDocuments, findEdge, findEdgeHeaders, findEdges, findExtensionDocuments, findLayerHeaders, findLayers, findPluginData, findRevisions, findSymbolHeaders, findSymbols, findVertexHeaders, findVertices, getGroupTitle, getNewPluginData, getNewPluginRelations, getPluginDataBulkOperations, getRepositoryID, getRevision, getType, getWorkflowState, getWorkspaceID, isNotify, load, lock, lock, releaseLock, remove, restore, setNewPluginData, setNewPluginRelations
Methods inherited from interface se.conciliate.extensions.store.MTNamedObject
compareTo, getID, getParentRevisionID, getTitle, getTitle, getUUID
-
Method Details
-
getPluginData
Returns the plugin data created for the model by a given provider. The returned object is transient and will only be kept for this model reference.- Parameters:
provider
- The provider.- Returns:
- The plugin data created by the provider.
-
setPluginData
Sets plugin data for a provider. This is automatically set to the object returned by the provider when the model is loaded, but the value can be overridden by the plugin at any time.- Parameters:
provider
- The provider.data
- The new data to store for the provider.
-
getVertices
Collection<MTCompleteVertex> getVertices()Returns the models vertices as a read-only collection.- Returns:
- The models vertices.
- Since:
- 3.0
-
getEdges
Collection<MTCompleteEdge> getEdges()Returns the models edges as a read-only collection.- Returns:
- The models edges.
- Since:
- 3.0
-
getSortedEdges
List<MTCompleteEdge> getSortedEdges()Returns the models edges as a sorted list.- Returns:
- The models edges.
- Since:
- 3.0
-
getSymbols
Collection<MTCompleteSymbol> getSymbols()Returns the models symbols as a read-only collection.- Returns:
- The models symbols.
- Since:
- 3.0
-
getBounds
Rectangle getBounds()Returns the bounds of the model.- Returns:
- The model bounds.
- Since:
- 3.0
-
getBounds
-
getLayerTypes
Collection<MTLayerType> getLayerTypes()Returns the layer types available for this model, as a read-only collection.- Returns:
- The available layer types.
-
getLayers
Collection<MTCompleteLayer> getLayers()Returns the models layers that currently exists for this model, sorted in ascending order. The returned collection is read-only.- Returns:
- The models layers.
- Since:
- 3.0
-
getDocuments
List<MTDocument> getDocuments()Returns the documents connected to the model as a read-only list.- Returns:
- The documents connected to the model.
- Since:
- 3.0
-
getConnectedDocumentIDs
-
findConnectedDocuments
Finds the documents connected to the model as a read-only list.- Returns:
- The found documents.
-
getConnectedDocuments
Deprecated, for removal: This API element is subject to removal in a future version.Renamed to findConnectedDocuments() since this now loads the documents from the source and thus entails a cost and should be run on a background thread.- Returns:
- Calls
findConnectedDocuments()
-
getExtensionDocuments
Returns the extension documents connected to the model. Changes made to the returned list will not write through to the internal representation in this complete model.- Parameters:
provider
- The provider to get documents for.- Returns:
- The extension documents connected to the model.
- Since:
- 3.0
-
getExtensionDocumentProviders
Returns the available providers of extension documents for this model.- Returns:
- A list of provider strings.
-
createEdge
MTCompleteEdge createEdge(String uuid, EdgeType type, EdgeRouter router, MTCompleteVertex from, MTCompleteVertex to, List<Point> points) throws MTAccessException Creates a new edge and adds it to the model. This method should called from a worker thread since it will create the edge in storage before returning.- Parameters:
uuid
- The UUID of the edgetype
- The edge type.router
- The edge router used to create a edge path for this edgefrom
- The vertex the edge comes fromto
- The vertex the edge goes topoints
- The control points of the edge- Returns:
- The vertex for the created symbol.
- Throws:
MTAccessException
-
createEdge
MTCompleteEdge createEdge(EdgeType type, EdgeRouter router, MTCompleteVertex from, MTCompleteVertex to, List<Point> points) throws MTAccessException Creates a new edge and adds it to the model. This method should called from a worker thread since it will create the edge in storage before returning.- Parameters:
type
- The edge type.router
- The edge router used to create a edge path for this edgefrom
- The vertex the edge comes fromto
- The vertex the edge goes topoints
- The control points of the edge- Returns:
- The vertex for the created symbol.
- Throws:
MTAccessException
-
addSymbol
Adds an existing symbol to the model and returns a new MTCompleteVertex that will reference a symbol equal to the sent in symbol. Note that this means thatvertex.getSymbol() == symbol
might evaluate to false. Howeververtex.getSymbol().equals(symbol)
will always return true.
NOTE: The returned vertex will not be persisted. It is up to the caller to persist this object.- Parameters:
symbol
- The symbol to add to the model.location
- The location to place the resulting vertex at.- Returns:
- The vertex for the added symbol.
- Throws:
MTAccessException
-
addSymbol
MTCompleteVertex addSymbol(MTSymbol symbol, Point location, String vertexUUID) throws MTAccessException Adds an existing symbol to the model and returns a new MTCompleteVertex that will reference a symbol equal to the sent in symbol. Note that this means thatvertex.getSymbol() == symbol
might evaluate to false. Howeververtex.getSymbol().equals(symbol)
will always return true.
NOTE: The returned vertex will not be persisted. It is up to the caller to persist this object.- Parameters:
symbol
- The symbol to add to the model.location
- The location to place the resulting vertex at.vertexUUID
- The UUID of the created vertex for the symbol.- Returns:
- The vertex for the added symbol.
- Throws:
MTAccessException
-
insertVertex
Inserts the vertex to this model. The vertex's getModel() will return this model after the call completes. Also, getVertices() will return a collection containing the vertex parameter.- Parameters:
vertex
- The vertex to insert.- Throws:
IllegalArgumentException
- if the vertex is already part of a different model, that is, if it already belongs to another model.NullPointerException
- if the vertex parameter is null
-
insertEdge
Inserts the edge to this model. The edge's getModel() will return this model after the call completes. Also, getEdges() will return a collection containing the edge parameter.- Parameters:
edge
- The edge to insert.- Throws:
IllegalStateException
- if the edge is in an invalid state. An edge is in an invalid state if either its from or to vertex is null or if any of its from or to vertex does not belong to this model.IllegalArgumentException
- if the edge is already part of a different model, that is, if it already belongs to another model.NullPointerException
- if the edge parameter is null
-
addLayerType
Adds a layer type to this complete model instance.
NOTE: This change will not be persisted. The effect is local to this instance only and future calls to save() will not take this change into account and no calls to save() will be performed on any layers or layer types. The new layer type might however be used to create new layers when inserting or adding new vertices - if the layer type states that vertices of that type should be in a layer of the specified layer type.- Parameters:
layerType
- the layer type to add
-
removeLayerType
Removes the layer type from this complete model instance.
NOTE: This change will not be persisted. The effect is local to this instance only and future calls to save() will not take this change into account and no calls to remove() will be performed on any layers or layer types.- Parameters:
layerType
- The layer type to be internally removed from this complete model.
-
moveVertexToLayerType
Moves a vertex to a layer in the model.- Parameters:
vertex
- The vertex to move to a new layer.layerType
- The type of the layer to move the vertex to.- Throws:
IllegalArgumentException
- If the layer type does not belong to the model type of this model, or if the vertex does not belong to this model, or if the vertex was not created through this API.
-
getEditState
MTEditState getEditState()Returns the "editable" state of the model when it was loaded from storage. This might have changed since then.- Returns:
- The "editable" state of the model.
- Since:
- 3.3
-
alignEdges
Aligns a set of edges in the model to each other. The edges will be aligned in groups by router type, and it is up to the router implementations to decide how to align the edges in the group.- Parameters:
edges
- The edges to adjust.avoidObstacles
- Iftrue
this should be considered as a hint by the edge router to try and avoid other objects in the model (such as other vertices and labels).
-