|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.commands.common.EventManager
org.eclipse.core.commands.AbstractHandler
de.cau.cs.kieler.core.model.handlers.AbstractInitDiagramHandler
de.cau.cs.kieler.core.model.graphiti.ui.AbstractInitGraphitiDiagramHandler
public abstract class AbstractInitGraphitiDiagramHandler
Abstract super class for commands that initialize any graphiti diagram.
Constructor Summary | |
---|---|
AbstractInitGraphitiDiagramHandler(String diagramTypeNameParam,
int gridSizeParam,
boolean snapToGridParam)
Creates a new AbstractReInitGraphitiDiagramCommand. |
Method Summary | |
---|---|
protected boolean |
addChildrenRecursively(EObject eObj)
If true all contained elements will be added recursively. |
void |
alignBoxRelativeAnchors(org.eclipse.graphiti.mm.pictograms.AnchorContainer ac)
Align the BoxRelativeAnchors on one container to a sensible position. |
void |
alignBoxRelativeAnchors(org.eclipse.graphiti.mm.pictograms.AnchorContainer ac,
de.cau.cs.kieler.core.model.graphiti.ui.AbstractInitGraphitiDiagramHandler.LayoutDirection dir)
Align the BoxRelativeAnchors according to the layout direction. |
protected void |
alignPortsOnSide(List<org.eclipse.graphiti.mm.pictograms.BoxRelativeAnchor> ports,
de.cau.cs.kieler.core.model.graphiti.ui.AbstractInitGraphitiDiagramHandler.LayoutDirection side)
Distribute the ports equally on the specified side. |
protected TransactionalEditingDomain |
createEditingDomain()
Create a new transactional editing domain. |
IEditorPart |
createNewDiagram(EObject modelRootParam,
TransactionalEditingDomain editingDomain,
IFile diagramFile,
IProgressMonitor monitor)
Create a new diagram file from the given semantics model. |
protected void |
determineSideForAnchors(List<org.eclipse.graphiti.mm.pictograms.Anchor> anchors,
List<org.eclipse.graphiti.mm.pictograms.BoxRelativeAnchor> inPorts,
List<org.eclipse.graphiti.mm.pictograms.BoxRelativeAnchor> outPorts)
Determine on which side to place a port. |
protected org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm |
findVisibleGa(org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm graphicsAlgorithm)
Find a visible GraphicsAlgorithm to stick the ports on. |
protected abstract EObject |
getConnectionSource(EObject connection)
Get the source element of a connection. |
protected abstract EObject |
getConnectionTarget(EObject connection)
Get the target element for a connection. |
protected abstract String |
getEditorId()
Getter for the editor id. |
protected abstract boolean |
isConnection(EObject eObj)
The given domain model element represents a connection which should be dealt with after all other elements are added. |
protected void |
linkModelToDiagram(org.eclipse.graphiti.ui.editor.DiagramEditor editor)
Link the model to the newly created diagram inside the editor. |
protected org.eclipse.graphiti.features.context.impl.AddConnectionContext |
processConnection(Map<EObject,org.eclipse.graphiti.mm.pictograms.PictogramElement> elementsParam,
EObject connection)
Process a single connection. |
Methods inherited from class de.cau.cs.kieler.core.model.handlers.AbstractInitDiagramHandler |
---|
execute, getDiagramExtension, initializeDiagram, openDiagram, performPostOperationAction, performPreOperationActions, refreshWorkspace, reinitialize |
Methods inherited from class org.eclipse.core.commands.AbstractHandler |
---|
addHandlerListener, dispose, fireHandlerChanged, hasListeners, isEnabled, isHandled, removeHandlerListener, setBaseEnabled, setEnabled |
Methods inherited from class org.eclipse.core.commands.common.EventManager |
---|
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractInitGraphitiDiagramHandler(String diagramTypeNameParam, int gridSizeParam, boolean snapToGridParam)
diagramTypeNameParam
- the namegridSizeParam
- the grid sizesnapToGridParam
- true if it should snap to gridMethod Detail |
---|
protected abstract String getEditorId()
protected TransactionalEditingDomain createEditingDomain()
GMFEditingDomainFactory.INSTANCE.createEditingDomain()
createEditingDomain
in class AbstractInitDiagramHandler
public IEditorPart createNewDiagram(EObject modelRootParam, TransactionalEditingDomain editingDomain, IFile diagramFile, IProgressMonitor monitor)
createNewDiagram
in class AbstractInitDiagramHandler
modelRootParam
- the root element of the domain model.editingDomain
- the editing domain.diagramFile
- the destination filemonitor
- the progress monitor
public void alignBoxRelativeAnchors(org.eclipse.graphiti.mm.pictograms.AnchorContainer ac)
ac
- the anchor container.public void alignBoxRelativeAnchors(org.eclipse.graphiti.mm.pictograms.AnchorContainer ac, de.cau.cs.kieler.core.model.graphiti.ui.AbstractInitGraphitiDiagramHandler.LayoutDirection dir)
ac
- the anchor container.dir
- the direction.protected void alignPortsOnSide(List<org.eclipse.graphiti.mm.pictograms.BoxRelativeAnchor> ports, de.cau.cs.kieler.core.model.graphiti.ui.AbstractInitGraphitiDiagramHandler.LayoutDirection side)
ports
- the list of ports to distributeside
- the side on which to align the portsprotected org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm findVisibleGa(org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm graphicsAlgorithm)
graphicsAlgorithm
- parent GA
protected void determineSideForAnchors(List<org.eclipse.graphiti.mm.pictograms.Anchor> anchors, List<org.eclipse.graphiti.mm.pictograms.BoxRelativeAnchor> inPorts, List<org.eclipse.graphiti.mm.pictograms.BoxRelativeAnchor> outPorts)
anchors
- the anchors to distributeinPorts
- the ports on the leftoutPorts
- the ports on the rightprotected void linkModelToDiagram(org.eclipse.graphiti.ui.editor.DiagramEditor editor) throws InterruptedException, RollbackException
editor
- the editor
RollbackException
- if the transaction was rolled back
InterruptedException
- if the transaction was interruptedprotected abstract boolean isConnection(EObject eObj)
eObj
- the domain model element
protected abstract EObject getConnectionSource(EObject connection)
connection
- the connection
protected abstract EObject getConnectionTarget(EObject connection)
connection
- the connection
protected org.eclipse.graphiti.features.context.impl.AddConnectionContext processConnection(Map<EObject,org.eclipse.graphiti.mm.pictograms.PictogramElement> elementsParam, EObject connection)
elementsParam
- the map of already added elements.connection
- the domain model element of the connection to be added
protected boolean addChildrenRecursively(EObject eObj)
eObj
- the model element
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |