Rename DiagramSupport to DiagramBehavior
Change-Id: I241869dd7c7e377c3aa08c650eaa5a6b290d8e19
diff --git a/plugins/org.eclipse.graphiti.ui/.settings/.api_filters b/plugins/org.eclipse.graphiti.ui/.settings/.api_filters
index d99e918..b2d65f5 100644
--- a/plugins/org.eclipse.graphiti.ui/.settings/.api_filters
+++ b/plugins/org.eclipse.graphiti.ui/.settings/.api_filters
@@ -96,6 +96,15 @@
</message_arguments>
</filter>
</resource>
+ <resource path="src/org/eclipse/graphiti/ui/editor/DiagramBehavior.java" type="org.eclipse.graphiti.ui.editor.DiagramBehavior">
+ <filter id="574660632">
+ <message_arguments>
+ <message_argument value="IDiagramBehaviorUI"/>
+ <message_argument value="IDiagramBehavior"/>
+ <message_argument value="DiagramBehavior"/>
+ </message_arguments>
+ </filter>
+ </resource>
<resource path="src/org/eclipse/graphiti/ui/editor/DiagramComposite.java" type="org.eclipse.graphiti.ui.editor.DiagramComposite">
<filter id="574660632">
<message_arguments>
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DefaultMarkerBehavior.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DefaultMarkerBehavior.java
index 61f0940..f966e35 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DefaultMarkerBehavior.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DefaultMarkerBehavior.java
@@ -39,22 +39,22 @@
import org.eclipse.swt.widgets.Display;
/**
- * The default implementation for the {@link DiagramSupport} behavior extension
+ * The default implementation for the {@link DiagramBehavior} behavior extension
* that controls how markers are handled in the editor. Clients may subclass to
- * change the marker behavior; use {@link DiagramSupport#createMarkerBehavior()}
+ * change the marker behavior; use {@link DiagramBehavior#createMarkerBehavior()}
* to return the instance that shall be used.<br>
- * Note that there is always a 1:1 relation with a {@link DiagramSupport}.
+ * Note that there is always a 1:1 relation with a {@link DiagramBehavior}.
*
* @since 0.9
*/
public class DefaultMarkerBehavior {
/**
- * The associated {@link DiagramSupport}
+ * The associated {@link DiagramBehavior}
*
* @since 0.10
*/
- protected DiagramSupport diagramSupport;
+ protected DiagramBehavior diagramBehavior;
/**
* The marker helper instance is responsible for creating workspace resource
@@ -74,15 +74,15 @@
/**
* Creates a new instance of {@link DefaultMarkerBehavior} that is
- * associated with the given {@link DiagramSupport}.
+ * associated with the given {@link DiagramBehavior}.
*
- * @param diagramSupport
- * the associated {@link DiagramSupport}
+ * @param diagramBehavior
+ * the associated {@link DiagramBehavior}
* @since 0.10
*/
- public DefaultMarkerBehavior(DiagramSupport diagramSupport) {
+ public DefaultMarkerBehavior(DiagramBehavior diagramBehavior) {
super();
- this.diagramSupport = diagramSupport;
+ this.diagramBehavior = diagramBehavior;
}
/**
@@ -91,7 +91,7 @@
* change.
*/
public void initialize() {
- diagramSupport.getResourceSet().eAdapters().add(problemIndicationAdapter);
+ diagramBehavior.getResourceSet().eAdapters().add(problemIndicationAdapter);
}
/**
@@ -130,11 +130,11 @@
* {@link EditUIMarkerHelper} to check and set markers for {@link EObject}s.
*/
void updateProblemIndication() {
- if (diagramSupport == null) {
+ if (diagramBehavior == null) {
// Already disposed
return;
}
- TransactionalEditingDomain editingDomain = diagramSupport.getEditingDomain();
+ TransactionalEditingDomain editingDomain = diagramBehavior.getEditingDomain();
if (updateProblemIndication && editingDomain != null) {
ResourceSet resourceSet = editingDomain.getResourceSet();
final BasicDiagnostic diagnostic = new BasicDiagnostic(Diagnostic.OK, GraphitiUIPlugin.PLUGIN_ID, 0, null,
@@ -195,11 +195,11 @@
*/
public void dispose() {
disableProblemIndicationUpdate();
- diagramSupport.getResourceSet().eAdapters().remove(problemIndicationAdapter);
+ diagramBehavior.getResourceSet().eAdapters().remove(problemIndicationAdapter);
problemIndicationAdapter = null;
markerHelper = null;
- diagramSupport = null;
+ diagramBehavior = null;
resourceToDiagnosticMap.clear();
resourceToDiagnosticMap = null;
}
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DefaultPaletteBehavior.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DefaultPaletteBehavior.java
index e459570..4806deb 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DefaultPaletteBehavior.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DefaultPaletteBehavior.java
@@ -41,8 +41,8 @@
* the way GEF handles the palette within its editors, see
* {@link GraphicalEditorWithFlyoutPalette} for more information on that. To
* exchange the default implementation you have to return an instance of your
- * subclass in the method {@link DiagramSupport#createPaletteBehaviour()}.<br>
- * Note that there is always a 1:1 relation with a {@link DiagramSupport}.
+ * subclass in the method {@link DiagramBehavior#createPaletteBehaviour()}.<br>
+ * Note that there is always a 1:1 relation with a {@link DiagramBehavior}.
*
* @since 0.9
*/
@@ -72,26 +72,26 @@
protected static final int DEFAULT_PALETTE_SIZE = 130;
/**
- * The associated {@link DiagramSupport}
+ * The associated {@link DiagramBehavior}
*
* @since 0.10
*/
- protected final DiagramSupport diagramSupport;
+ protected final DiagramBehavior diagramBehavior;
private PaletteRoot paletteRoot;
/**
* Creates a new standard palette behaviour for a Graphiti diagram editor.
- * The passed {@link DiagramSupport} is closely linked to this instance (1:1
+ * The passed {@link DiagramBehavior} is closely linked to this instance (1:1
* relation) and both instances will have a common lifecycle.
*
* @param diagramEditor
- * The associated {@link DiagramSupport}.
+ * The associated {@link DiagramBehavior}.
* @since 0.10
*/
- public DefaultPaletteBehavior(DiagramSupport diagramSupport) {
+ public DefaultPaletteBehavior(DiagramBehavior diagramBehavior) {
super();
- this.diagramSupport = diagramSupport;
+ this.diagramBehavior = diagramBehavior;
}
/**
@@ -104,12 +104,12 @@
* @see org.eclipse.graphiti.ui.editor.GraphicalEditorIncludingPalette#getPaletteRoot()
*/
protected PaletteRoot createPaletteRoot() {
- return new GFPaletteRoot(diagramSupport.getDiagramTypeProvider());
+ return new GFPaletteRoot(diagramBehavior.getDiagramTypeProvider());
}
/**
* Returns the already existing {@link PaletteRoot} instance for the
- * {@link DiagramSupport} associated the this palette behavior or creates a
+ * {@link DiagramBehavior} associated the this palette behavior or creates a
* new {@link PaletteRoot} instance in case none exists.
*
* @return a new Graphiti specific {@link PaletteRoot} instance
@@ -129,7 +129,7 @@
*/
public void initializeViewer() {
// Set preference-store for palette
- PaletteViewer paletteViewer = diagramSupport.getEditDomain().getPaletteViewer();
+ PaletteViewer paletteViewer = diagramBehavior.getEditDomain().getPaletteViewer();
if (paletteViewer != null) {
IPreferenceStore store = GraphitiUIPlugin.getDefault().getPreferenceStore();
paletteViewer.setPaletteViewerPreferences(new DefaultPaletteViewerPreferences(store));
@@ -158,7 +158,7 @@
public int getPaletteState() {
// TODO ? Move isShowFlyoutPalette from TBP to
// DefaultPaletteBehaviour?
- if (!diagramSupport.getDiagramTypeProvider().getCurrentToolBehaviorProvider().isShowFlyoutPalette()) {
+ if (!diagramBehavior.getDiagramTypeProvider().getCurrentToolBehaviorProvider().isShowFlyoutPalette()) {
return 8; // FlyoutPaletteComposite.STATE_HIDDEN is private
}
return getPreferenceStore().getInt(PROPERTY_PALETTE_STATE);
@@ -196,7 +196,7 @@
* PaletteViewer.
*/
protected PaletteViewerProvider createPaletteViewerProvider() {
- return new PaletteViewerProvider(diagramSupport.getEditDomain()) {
+ return new PaletteViewerProvider(diagramBehavior.getEditDomain()) {
private KeyHandler paletteKeyHandler = null;
protected void configurePaletteViewer(PaletteViewer viewer) {
@@ -227,7 +227,7 @@
if (event.keyCode == SWT.Selection) {
Tool tool = getEditDomain().getPaletteViewer().getActiveTool().createTool();
if (tool instanceof CreationTool || tool instanceof ConnectionCreationTool) {
- tool.keyUp(event, diagramSupport.getDiagramContainer().getGraphicalViewer());
+ tool.keyUp(event, diagramBehavior.getDiagramContainer().getGraphicalViewer());
// Deactivate current selection
getEditDomain().getPaletteViewer().setActiveTool(null);
return true;
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DefaultPersistencyBehavior.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DefaultPersistencyBehavior.java
index 041749e..c03d4c1 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DefaultPersistencyBehavior.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DefaultPersistencyBehavior.java
@@ -50,23 +50,23 @@
import org.eclipse.swt.widgets.Display;
/**
- * The default implementation for the {@link DiagramSupport} behavior extension
+ * The default implementation for the {@link DiagramBehavior} behavior extension
* that controls the persistence behavior of the Graphiti diagram Editor.
* Clients may subclass to change the behavior; use
- * {@link DiagramSupport#createPersistencyBehavior()} to return the instance
+ * {@link DiagramBehavior#createPersistencyBehavior()} to return the instance
* that shall be used.<br>
- * Note that there is always a 1:1 relation with a {@link DiagramSupport}.
+ * Note that there is always a 1:1 relation with a {@link DiagramBehavior}.
*
* @since 0.9
*/
public class DefaultPersistencyBehavior {
/**
- * The associated {@link DiagramSupport}
+ * The associated {@link DiagramBehavior}
*
* @since 0.10
*/
- protected final DiagramSupport diagramSupport;
+ protected final DiagramBehavior diagramBehavior;
/**
* Used to store the command that was executed before the editor was saved.
@@ -77,14 +77,14 @@
/**
* Creates a new instance of {@link DefaultPersistencyBehavior} that is
- * associated with the given {@link DiagramSupport}.
+ * associated with the given {@link DiagramBehavior}.
*
* @param diagramEditor
- * the associated {@link DiagramSupport}
+ * the associated {@link DiagramBehavior}
* @since 0.10
*/
- public DefaultPersistencyBehavior(DiagramSupport diagramSupport) {
- this.diagramSupport = diagramSupport;
+ public DefaultPersistencyBehavior(DiagramBehavior diagramBehavior) {
+ this.diagramBehavior = diagramBehavior;
}
/**
@@ -102,7 +102,7 @@
*/
public Diagram loadDiagram(URI uri) {
if (uri != null) {
- final TransactionalEditingDomain editingDomain = diagramSupport.getEditingDomain();
+ final TransactionalEditingDomain editingDomain = diagramBehavior.getEditingDomain();
if (editingDomain != null) {
// First try the URI resolution without loading not yet loaded
// resources because calling with loadOnDemand will _always_
@@ -137,14 +137,14 @@
/**
* This method is called to save a diagram. The default implementation here
* saves all changes done to any of the EMF resources loaded within the
- * {@link DiagramSupport} so that the complete state of all modified objects
+ * {@link DiagramBehavior} so that the complete state of all modified objects
* will be persisted in the file system.<br>
* The default implementation also sets the current version information
* (currently 0.10.0) to the diagram before saving it and wraps the save
* operation inside a {@link IRunnableWithProgress} that cares about sending
* only one {@link Resource} change event holding all modified files.
* Besides also all adapters are temporarily switched off (see
- * {@link DiagramSupport#disableAdapters()}).<br>
+ * {@link DiagramBehavior#disableAdapters()}).<br>
* To only modify the actual saving clients should rather override
* {@link #save(TransactionalEditingDomain, Map)}.
*
@@ -157,43 +157,43 @@
}
// set version info.
- final Diagram diagram = diagramSupport.getDiagramTypeProvider().getDiagram();
+ final Diagram diagram = diagramBehavior.getDiagramTypeProvider().getDiagram();
setDiagramVersion(diagram);
Map<Resource, Map<?, ?>> saveOptions = createSaveOptions();
final Set<Resource> savedResources = new HashSet<Resource>();
final IRunnableWithProgress operation = createOperation(savedResources, saveOptions);
- diagramSupport.disableAdapters();
+ diagramBehavior.disableAdapters();
try {
// This runs the options in a background thread reporting progress
// to the progress monitor passed into this method (see Bug 393074)
ModalContext.run(operation, true, monitor, Display.getCurrent());
- BasicCommandStack commandStack = (BasicCommandStack) diagramSupport.getEditingDomain().getCommandStack();
+ BasicCommandStack commandStack = (BasicCommandStack) diagramBehavior.getEditingDomain().getCommandStack();
commandStack.saveIsDone();
// Store the last executed command on the undo stack as save point
// and refresh the dirty state of the editor
savedCommand = commandStack.getUndoCommand();
- diagramSupport.getDiagramContainer().updateDirtyState();
+ diagramBehavior.getDiagramContainer().updateDirtyState();
} catch (final Exception exception) {
// Something went wrong that shouldn't.
T.racer().error(exception.getMessage(), exception);
} finally {
- diagramSupport.enableAdapters();
+ diagramBehavior.enableAdapters();
}
Resource[] savedResourcesArray = savedResources.toArray(new Resource[savedResources.size()]);
- diagramSupport.getDiagramContainer().commandStackChanged(null);
- IDiagramTypeProvider provider = diagramSupport.getConfigurationProvider().getDiagramTypeProvider();
+ diagramBehavior.getDiagramContainer().commandStackChanged(null);
+ IDiagramTypeProvider provider = diagramBehavior.getConfigurationProvider().getDiagramTypeProvider();
provider.resourcesSaved(provider.getDiagram(), savedResourcesArray);
}
/**
* Returns if the editor needs to be saved or not. Is queried by the
- * {@link DiagramSupport#isDirty()} method. The default implementation
+ * {@link DiagramBehavior#isDirty()} method. The default implementation
* checks if the top of the current undo stack is equal to the stored top
* command of the undo stack at the time of the last saving of the editor.
*
@@ -201,7 +201,7 @@
* <code>false</code> otherwise.
*/
public boolean isDirty() {
- BasicCommandStack commandStack = (BasicCommandStack) diagramSupport.getEditingDomain().getCommandStack();
+ BasicCommandStack commandStack = (BasicCommandStack) diagramBehavior.getEditingDomain().getCommandStack();
return savedCommand != commandStack.getUndoCommand();
}
@@ -215,7 +215,7 @@
// Save only resources that have actually changed.
final Map<Object, Object> saveOption = new HashMap<Object, Object>();
saveOption.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);
- EList<Resource> resources = diagramSupport.getEditingDomain().getResourceSet().getResources();
+ EList<Resource> resources = diagramBehavior.getEditingDomain().getResourceSet().getResources();
final Map<Resource, Map<?, ?>> saveOptions = new HashMap<Resource, Map<?, ?>>();
for (Resource resource : resources) {
saveOptions.put(resource, saveOption);
@@ -247,7 +247,7 @@
public void run(IProgressMonitor monitor) {
// Save the resources to the file system.
try {
- savedResources.addAll(save(diagramSupport.getEditingDomain(), saveOptions, monitor));
+ savedResources.addAll(save(diagramBehavior.getEditingDomain(), saveOptions, monitor));
} catch (final WrappedException e) {
final MultiStatus errorStatus = new MultiStatus(GraphitiUIPlugin.PLUGIN_ID, 0, e.getMessage(),
e.exception());
@@ -293,8 +293,8 @@
// Only trigger a command if the version really changes to avoid an
// empty entry in the command stack / undo stack
if (!IDiagramVersion.CURRENT.equals(diagram.getVersion())) {
- CommandStack commandStack = diagramSupport.getEditingDomain().getCommandStack();
- commandStack.execute(new RecordingCommand(diagramSupport.getEditingDomain()) {
+ CommandStack commandStack = diagramBehavior.getEditingDomain().getCommandStack();
+ commandStack.execute(new RecordingCommand(diagramBehavior.getEditingDomain()) {
@Override
protected void doExecute() {
diagram.eSet(PictogramsPackage.eINSTANCE.getDiagram_Version(), IDiagramVersion.CURRENT);
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DefaultRefreshBehavior.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DefaultRefreshBehavior.java
index be25f3d..51ccf89 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DefaultRefreshBehavior.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DefaultRefreshBehavior.java
@@ -39,38 +39,38 @@
import org.eclipse.swt.widgets.Display;
/**
- * The default implementation for the {@link DiagramSupport} behavior extension
+ * The default implementation for the {@link DiagramBehavior} behavior extension
* that controls the refresh behavior of the Graphiti diagram editor. Clients
* may subclass to change the behavior; use
- * {@link DiagramSupport#createRefreshBehavior()} to return the instance that
+ * {@link DiagramBehavior#createRefreshBehavior()} to return the instance that
* shall be used.<br>
- * Note that there is always a 1:1 relation with a {@link DiagramSupport}.
+ * Note that there is always a 1:1 relation with a {@link DiagramBehavior}.
*
* @since 0.9
*/
public class DefaultRefreshBehavior {
/**
- * The associated {@link DiagramSupport}. Set on construction of this class.
+ * The associated {@link DiagramBehavior}. Set on construction of this class.
*
* @since 0.10
*/
- protected final DiagramSupport diagramSupport;
+ protected final DiagramBehavior diagramBehavior;
private RefreshPerformanceCache refreshPerformanceCache = new RefreshPerformanceCache();
/**
* Creates a new standard refresh behaviour for a Graphiti diagram editor.
- * The passed {@link DiagramSupport} is closely linked to this instance (1:1
+ * The passed {@link DiagramBehavior} is closely linked to this instance (1:1
* relation) and both instances will have a common lifecycle.
*
* @param diagramEditor
- * The associated {@link DiagramSupport}.
+ * The associated {@link DiagramBehavior}.
* @since 0.10
*/
- public DefaultRefreshBehavior(DiagramSupport diagramSupport) {
+ public DefaultRefreshBehavior(DiagramBehavior diagramBehavior) {
super();
- this.diagramSupport = diagramSupport;
+ this.diagramBehavior = diagramBehavior;
}
/**
@@ -86,8 +86,8 @@
/**
* Handles the auto update at startup of the editor and is called by the
- * Graphiti {@link DiagramSupport} when the input is set (
- * {@link DiagramSupport#setInput(org.eclipse.ui.IEditorInput)}). The
+ * Graphiti {@link DiagramBehavior} when the input is set (
+ * {@link DiagramBehavior#setInput(org.eclipse.ui.IEditorInput)}). The
* default implementation checks the desired behavior as defined in
* {@link IDiagramTypeProvider#isAutoUpdateAtStartup()} and calls
* {@link #autoUpdate(Diagram, IDiagramTypeProvider)} in case an update
@@ -96,7 +96,7 @@
* @since 0.9
*/
protected void handleAutoUpdateAtStartup() {
- IDiagramTypeProvider diagramTypeProvider = diagramSupport.getDiagramTypeProvider();
+ IDiagramTypeProvider diagramTypeProvider = diagramBehavior.getDiagramTypeProvider();
if (diagramTypeProvider.isAutoUpdateAtStartup()) {
autoUpdate();
}
@@ -106,7 +106,7 @@
* Handles the auto update at rest of the editor (the editor performs a
* reload of the EMF resources because e.g. the underlying file has been
* changed by another editor) and is called by the Graphiti
- * {@link DiagramSupport} after the {@link Diagram} has been reloaded. The
+ * {@link DiagramBehavior} after the {@link Diagram} has been reloaded. The
* default implementation checks the desired behavior as defined in
* {@link IDiagramTypeProvider#isAutoUpdateAtReset()} and calls
* {@link #autoUpdate(Diagram, IDiagramTypeProvider)} in case an update
@@ -115,7 +115,7 @@
* @since 0.9
*/
protected void handleAutoUpdateAtReset() {
- IDiagramTypeProvider diagramTypeProvider = diagramSupport.getDiagramTypeProvider();
+ IDiagramTypeProvider diagramTypeProvider = diagramBehavior.getDiagramTypeProvider();
if (diagramTypeProvider.isAutoUpdateAtReset()) {
autoUpdate();
}
@@ -132,7 +132,7 @@
* @since 0.9
*/
protected void autoUpdate() {
- IDiagramTypeProvider diagramTypeProvider = diagramSupport.getDiagramTypeProvider();
+ IDiagramTypeProvider diagramTypeProvider = diagramBehavior.getDiagramTypeProvider();
Diagram diagram = diagramTypeProvider.getDiagram();
IFeatureProvider featureProvider = diagramTypeProvider.getFeatureProvider();
IUpdateContext updateCtx = new UpdateContext(diagram);
@@ -146,7 +146,7 @@
* case direct editing is active it is cancelled.
*/
public void refresh() {
- if (!diagramSupport.isAlive()) {
+ if (!diagramBehavior.isAlive()) {
return;
}
@@ -167,14 +167,14 @@
long start = System.currentTimeMillis();
- final EditPart contentEditPart = diagramSupport.getContentEditPart();
+ final EditPart contentEditPart = diagramBehavior.getContentEditPart();
if (contentEditPart == null) {
return;
}
internalRefreshEditPart(contentEditPart);
- diagramSupport.getDiagramContainer().refreshTitle();
+ diagramBehavior.getDiagramContainer().refreshTitle();
long stop = System.currentTimeMillis();
long time = (stop - start);
@@ -184,9 +184,9 @@
}
// prove if switch to direct editing is required
- IDirectEditingInfo dei = diagramSupport.getConfigurationProvider().getFeatureProvider().getDirectEditingInfo();
+ IDirectEditingInfo dei = diagramBehavior.getConfigurationProvider().getFeatureProvider().getDirectEditingInfo();
if (dei.isActive()) {
- EditPart editPart = (EditPart) diagramSupport.getDiagramContainer().getGraphicalViewer().getEditPartRegistry()
+ EditPart editPart = (EditPart) diagramBehavior.getDiagramContainer().getGraphicalViewer().getEditPartRegistry()
.get(dei.getMainPictogramElement());
if (editPart instanceof ShapeEditPart) {
ShapeEditPart shapeEditPart = (ShapeEditPart) editPart;
@@ -195,7 +195,7 @@
dei.reset();
}
}
- diagramSupport.selectBufferedPictogramElements();
+ diagramBehavior.selectBufferedPictogramElements();
}
/**
@@ -209,7 +209,7 @@
if (pe == null || !pe.isActive()) {
return;
}
- GraphicalEditPart editPart = diagramSupport.getEditPartForPictogramElement(pe);
+ GraphicalEditPart editPart = diagramBehavior.getEditPartForPictogramElement(pe);
if (editPart != null && editPart instanceof IPictogramElementEditPart) {
IPictogramElementEditPart ep = (IPictogramElementEditPart) editPart;
IPictogramElementDelegate delegate = ep.getPictogramElementDelegate();
@@ -228,7 +228,7 @@
* the {@link PictogramElement} to refresh the decorators for
*/
public void refreshRenderingDecorators(PictogramElement pe) {
- GraphicalEditPart ep = diagramSupport.getEditPartForPictogramElement(pe);
+ GraphicalEditPart ep = diagramBehavior.getEditPartForPictogramElement(pe);
if (ep instanceof IShapeEditPart) {
IShapeEditPart sep = (IShapeEditPart) ep;
sep.refreshDecorators();
@@ -256,7 +256,7 @@
long start = System.currentTimeMillis();
try {
- ((IConfigurationProviderInternal) diagramSupport.getConfigurationProvider()).getContextButtonManager()
+ ((IConfigurationProviderInternal) diagramBehavior.getConfigurationProvider()).getContextButtonManager()
.hideContextButtonsInstantly();
editPart.refresh();
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DefaultUpdateBehavior.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DefaultUpdateBehavior.java
index 371b93e..8b98829 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DefaultUpdateBehavior.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DefaultUpdateBehavior.java
@@ -67,10 +67,10 @@
/**
* @since 0.10
*/
- protected final DiagramSupport diagramSupport;
+ protected final DiagramBehavior diagramBehavior;
/**
- * The editing domain that is used throughout the {@link DiagramSupport} is
+ * The editing domain that is used throughout the {@link DiagramBehavior} is
* kept here and only here.
*/
private TransactionalEditingDomain editingDomain;
@@ -129,7 +129,7 @@
if (msg.getNewBooleanValue() == Boolean.FALSE) {
final Resource resource = (Resource) msg.getNotifier();
final URI uri = resource.getURI();
- IDiagramContainerUI diagramContainer = diagramSupport.getDiagramContainer();
+ IDiagramContainerUI diagramContainer = diagramBehavior.getDiagramContainer();
if (editingDomain.getResourceSet().getURIConverter().exists(uri, null)) {
// file content has changes
setResourceChanged(true);
@@ -183,15 +183,15 @@
/**
* Creates a new {@link DefaultUpdateBehavior} instance associated with the
- * given {@link DiagramSupport}.
+ * given {@link DiagramBehavior}.
*
* @param diagramEditor
* the part this model editor works on
* @since 0.10
*/
- public DefaultUpdateBehavior(DiagramSupport diagramSupport) {
+ public DefaultUpdateBehavior(DiagramBehavior diagramBehavior) {
super();
- this.diagramSupport = diagramSupport;
+ this.diagramBehavior = diagramBehavior;
}
/**
@@ -307,13 +307,13 @@
* Handles what to do with changed resources on editor activation.
*/
protected void handleChangedResources() {
- if (!diagramSupport.getDiagramContainer().isDirty() || handleDirtyConflict()) {
+ if (!diagramBehavior.getDiagramContainer().isDirty() || handleDirtyConflict()) {
IUndoContext undoContext = ((IWorkspaceCommandStack) getEditingDomain().getCommandStack())
.getDefaultUndoContext();
getOperationHistory().dispose(undoContext, true, true, true);
// Disable adapters temporarily.
- diagramSupport.disableAdapters();
+ diagramBehavior.disableAdapters();
try {
// We unload our resources such that refreshEditorContent does a
@@ -322,10 +322,10 @@
for (Resource resource : resources) {
resource.unload();
}
- diagramSupport.refreshContent();
+ diagramBehavior.refreshContent();
} finally {
// Re-enable adapters again
- diagramSupport.enableAdapters();
+ diagramBehavior.enableAdapters();
}
}
}
@@ -362,10 +362,10 @@
}
// Retrieve the object from the editor input
- final EObject object = (EObject) diagramSupport.getAdapter(Diagram.class);
+ final EObject object = (EObject) diagramBehavior.getAdapter(Diagram.class);
// Register for object deletion
if (object != null) {
- elementDeleteListener = new ElementDeleteListener(diagramSupport);
+ elementDeleteListener = new ElementDeleteListener(diagramBehavior);
object.eAdapters().add(elementDeleteListener);
}
@@ -402,7 +402,7 @@
workspaceSynchronizer = new WorkspaceSynchronizer(getEditingDomain(), createWorkspaceSynchronizerDelegate());
// Problem analysis
- diagramSupport.editingDomainInitialized();
+ diagramBehavior.editingDomainInitialized();
}
/**
@@ -419,7 +419,7 @@
* @since 0.10
*/
protected WorkspaceSynchronizer.Delegate createWorkspaceSynchronizerDelegate() {
- return new DomainModelWorkspaceSynchronizerDelegate(diagramSupport);
+ return new DomainModelWorkspaceSynchronizerDelegate(diagramBehavior);
}
/**
@@ -438,7 +438,7 @@
r.eAdapters().remove(updateAdapter);
}
- EObject object = (EObject) diagramSupport.getAdapter(Diagram.class);
+ EObject object = (EObject) diagramBehavior.getAdapter(Diagram.class);
if (object != null) {
object.eAdapters().remove(elementDeleteListener);
}
@@ -470,17 +470,17 @@
switch (event.getEventType()) {
case OperationHistoryEvent.REDONE:
case OperationHistoryEvent.UNDONE:
- diagramSupport.getDiagramContainer().updateDirtyState();
+ diagramBehavior.getDiagramContainer().updateDirtyState();
break;
}
}
private Shell getShell() {
- return diagramSupport.getDiagramContainer().getSite().getShell();
+ return diagramBehavior.getDiagramContainer().getSite().getShell();
}
private void closeContainer() {
- IDiagramContainerUI diagramContainer = diagramSupport.getDiagramContainer();
+ IDiagramContainerUI diagramContainer = diagramBehavior.getDiagramContainer();
if (diagramContainer == null) {
return;
}
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramSupport.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramBehavior.java
similarity index 98%
rename from plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramSupport.java
rename to plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramBehavior.java
index a1af915..0e6ac2b 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramSupport.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramBehavior.java
@@ -145,7 +145,7 @@
*
* @since 0.10
*/
-public class DiagramSupport implements IDiagramBehaviorUI {
+public class DiagramBehavior implements IDiagramBehaviorUI {
private IDiagramContainerUI diagramContainer;
@@ -172,7 +172,7 @@
private IWorkbenchPart parentPart;
- DiagramSupport(IDiagramContainerUI diagramContainer) {
+ DiagramBehavior(IDiagramContainerUI diagramContainer) {
this.diagramContainer = diagramContainer;
markerBehavior = createMarkerBehavior();
updateBehavior = createUpdateBehavior();
@@ -764,7 +764,7 @@
}
/**
- * The EMF {@link ResourceSet} used within this {@link DiagramSupport}. The
+ * The EMF {@link ResourceSet} used within this {@link DiagramBehavior}. The
* resource set is always associated in a 1:1 relation to the
* {@link TransactionalEditingDomain}.
*
@@ -788,7 +788,7 @@
/**
* Executes the given {@link IFeature} with the given {@link IContext} in
- * the scope of this {@link DiagramSupport}, meaning within its
+ * the scope of this {@link DiagramBehavior}, meaning within its
* {@link TransactionalEditingDomain} and on its
* {@link org.eclipse.emf.common.command.CommandStack}.
*
@@ -1252,7 +1252,7 @@
* Hook that is called to unregister the listeners for changes of the
* business objects (domain objects).
*
- * @see DiagramSupport#registerBusinessObjectsListener()
+ * @see DiagramBehavior#registerBusinessObjectsListener()
*/
void unregisterBusinessObjectsListener() {
if (domainModelListener != null) {
@@ -1293,7 +1293,7 @@
}
/**
- * Disposes this {@link DiagramSupport} instance and frees all used
+ * Disposes this {@link DiagramBehavior} instance and frees all used
* resources and clears all references. Also delegates to all the behavior
* extensions to also free their resources (e.g. and most important is the
* {@link TransactionalEditingDomain} held by the
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramComposite.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramComposite.java
index bd684b4..7edcc47 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramComposite.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramComposite.java
@@ -45,12 +45,12 @@
*/
public class DiagramComposite extends GraphicalComposite implements IDiagramContainerUI {
- private DiagramSupport diagramSupport;
+ private DiagramBehavior diagramBehavior;
public DiagramComposite(IWorkbenchPart ownedPart, Composite parent, int style) {
super(parent, style);
- diagramSupport = new DiagramSupport(this);
- diagramSupport.setParentPart(ownedPart);
+ diagramBehavior = new DiagramBehavior(this);
+ diagramBehavior.setParentPart(ownedPart);
setEditDomain(new DefaultEditDomain(null));
}
@@ -67,35 +67,35 @@
public void setInput(TransactionalEditingDomain editingDomain, IDiagramEditorInput input) {
// assign editing domain to update behavior
- diagramSupport.getUpdateBehavior().setEditingDomain(editingDomain);
- this.diagramSupport.setInput(input);
+ getUpdateBehavior().setEditingDomain(editingDomain);
+ this.diagramBehavior.setInput(input);
- if (this.diagramSupport.getEditorInitializationError() != null) {
- this.diagramSupport.createErrorPartControl(this);
+ if (this.diagramBehavior.getEditorInitializationError() != null) {
+ this.diagramBehavior.createErrorPartControl(this);
return;
}
- diagramSupport.getUpdateBehavior().init();
+ diagramBehavior.getUpdateBehavior().init();
init();
- this.diagramSupport.migrateDiagramModelIfNecessary();
- this.diagramSupport.createPartControl();
+ this.diagramBehavior.migrateDiagramModelIfNecessary();
+ this.diagramBehavior.createPartControl();
}
@Override
public void initializeGraphicalViewer() {
super.initializeGraphicalViewer();
- this.diagramSupport.initializeGraphicalViewer();
+ this.diagramBehavior.initializeGraphicalViewer();
}
@Override
protected void createGraphicalViewer() {
- this.diagramSupport.createGraphicalViewer(this);
+ this.diagramBehavior.createGraphicalViewer(this);
}
@Override
protected void configureGraphicalViewer() {
super.configureGraphicalViewer();
- this.diagramSupport.configureGraphicalViewer();
+ this.diagramBehavior.configureGraphicalViewer();
}
public void refreshTitle() {
@@ -125,7 +125,7 @@
@Override
public IWorkbenchPart getWorkbenchPart() {
- return diagramSupport.getParentPart();
+ return diagramBehavior.getParentPart();
}
public void close() {
@@ -133,7 +133,7 @@
}
public Object getAdapter(@SuppressWarnings("rawtypes") Class type) {
- Object returnObj = this.diagramSupport.getAdapter(type);
+ Object returnObj = this.diagramBehavior.getAdapter(type);
if (returnObj != null)
return returnObj;
return super.getAdapter(type);
@@ -146,7 +146,7 @@
getWorkbenchPart().getSite().getPage().removeSelectionListener(this);
}
- this.diagramSupport.preSuperDispose();
+ this.diagramBehavior.preSuperDispose();
RuntimeException exc = null;
try {
@@ -155,7 +155,7 @@
exc = e;
}
- this.diagramSupport.postSuperDispose();
+ this.diagramBehavior.postSuperDispose();
if (exc != null) {
throw exc;
@@ -173,92 +173,92 @@
}
if (super.setFocus()) {
- diagramSupport.getUpdateBehavior().handleActivate();
+ diagramBehavior.getUpdateBehavior().handleActivate();
return true;
}
return false;
}
- /* Methods routed directly to DiagramSupport */
+ /* Methods routed directly to DiagramBehavior */
public final DefaultUpdateBehavior getUpdateBehavior() {
- return this.diagramSupport.getUpdateBehavior();
+ return this.diagramBehavior.getUpdateBehavior();
}
public final DefaultRefreshBehavior getRefreshBehavior() {
- return this.diagramSupport.getRefreshBehavior();
+ return this.diagramBehavior.getRefreshBehavior();
}
public void editingDomainInitialized() {
- this.diagramSupport.editingDomainInitialized();
+ this.diagramBehavior.editingDomainInitialized();
}
public void disableAdapters() {
- this.diagramSupport.disableAdapters();
+ this.diagramBehavior.disableAdapters();
}
public void enableAdapters() {
- this.diagramSupport.enableAdapters();
+ this.diagramBehavior.enableAdapters();
}
public boolean isDirty() {
- return this.diagramSupport.isDirty();
+ return this.diagramBehavior.isDirty();
}
protected final PaletteViewerProvider createPaletteViewerProvider() {
- return this.diagramSupport.createPaletteViewerProvider();
+ return this.diagramBehavior.createPaletteViewerProvider();
}
protected final FlyoutPreferences getPalettePreferences() {
- return this.diagramSupport.getPalettePreferences();
+ return this.diagramBehavior.getPalettePreferences();
}
protected final PaletteRoot getPaletteRoot() {
- return this.diagramSupport.getPaletteRoot();
+ return this.diagramBehavior.getPaletteRoot();
}
public PictogramElement[] getSelectedPictogramElements() {
- return diagramSupport.getSelectedPictogramElements();
+ return this.diagramBehavior.getSelectedPictogramElements();
}
public void selectPictogramElements(PictogramElement[] pictogramElements) {
- diagramSupport.selectPictogramElements(pictogramElements);
+ this.diagramBehavior.selectPictogramElements(pictogramElements);
}
public void setPictogramElementForSelection(PictogramElement pictogramElement) {
- diagramSupport.setPictogramElementForSelection(pictogramElement);
+ this.diagramBehavior.setPictogramElementForSelection(pictogramElement);
}
public void setPictogramElementsForSelection(PictogramElement pictogramElements[]) {
- diagramSupport.setPictogramElementsForSelection(pictogramElements);
+ this.diagramBehavior.setPictogramElementsForSelection(pictogramElements);
}
public IDiagramTypeProvider getDiagramTypeProvider() {
- return this.diagramSupport.getDiagramTypeProvider();
+ return this.diagramBehavior.getDiagramTypeProvider();
}
public GraphicalEditPart getEditPartForPictogramElement(PictogramElement pe) {
- return this.diagramSupport.getEditPartForPictogramElement(pe);
+ return this.diagramBehavior.getEditPartForPictogramElement(pe);
}
public double getZoomLevel() {
- return this.diagramSupport.getZoomLevel();
+ return this.diagramBehavior.getZoomLevel();
}
public boolean isAlive() {
- return this.diagramSupport.isAlive();
+ return this.diagramBehavior.isAlive();
}
public boolean isDirectEditingActive() {
- return this.diagramSupport.isDirectEditingActive();
+ return this.diagramBehavior.isDirectEditingActive();
}
public void setDirectEditingActive(boolean directEditingActive) {
- this.diagramSupport.setDirectEditingActive(directEditingActive);
+ this.diagramBehavior.setDirectEditingActive(directEditingActive);
}
public IDiagramEditorInput getDiagramEditorInput() {
- return diagramSupport.getInput();
+ return this.diagramBehavior.getInput();
}
/* Methods from container interface */
@@ -276,10 +276,10 @@
}
public void doSave(IProgressMonitor monitor) {
- diagramSupport.getPersistencyBehavior().saveDiagram(monitor);
+ this.diagramBehavior.getPersistencyBehavior().saveDiagram(monitor);
}
- public DiagramSupport getDiagramSupport() {
- return diagramSupport;
+ public DiagramBehavior getDiagramBehavior() {
+ return diagramBehavior;
}
}
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramEditor.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramEditor.java
index 3193c33..362b865 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramEditor.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramEditor.java
@@ -133,7 +133,7 @@
ITabbedPropertySheetPageContributor, IEditingDomainProvider {
private String contributorId;
- private DiagramSupport diagramSupport;
+ private DiagramBehavior diagramBehavior;
/**
* The ID of the {@link DiagramEditor} as it is registered with the
@@ -148,8 +148,8 @@
*/
public DiagramEditor() {
super();
- diagramSupport = new DiagramSupport(this);
- diagramSupport.setParentPart(this);
+ diagramBehavior = new DiagramBehavior(this);
+ diagramBehavior.setParentPart(this);
}
/**
@@ -159,8 +159,8 @@
*
* @since 0.10
*/
- public DiagramSupport getDiagramSupport() {
- return diagramSupport;
+ public DiagramBehavior getDiagramBehavior() {
+ return diagramBehavior;
}
// ------------------ Initializazion ---------------------------------------
@@ -193,7 +193,7 @@
*
*/
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
- // TODO check move parts to DiagramSupport
+ // TODO check move parts to DiagramBehavior
// Eclipse may call us with other inputs when a file is to be
// opened. Try to convert this to a valid diagram input.
@@ -205,14 +205,14 @@
}
}
- diagramSupport.getUpdateBehavior().createEditingDomain();
+ diagramBehavior.getUpdateBehavior().createEditingDomain();
// The GEF GraphicalEditor init(...) functionality, adapted to provide a
// nice error message to the user in case of an error when opening an
// editor with e.g. an invalid diagram, see Bug 376008
setSite(site);
setInput(input);
- if (diagramSupport.getEditorInitializationError() != null) {
+ if (diagramBehavior.getEditorInitializationError() != null) {
// In case of error simply show an primitive editor with a label
return;
}
@@ -221,9 +221,9 @@
initializeActionRegistry();
// ... End of GEF functionality taken over
- diagramSupport.getUpdateBehavior().init();
+ diagramBehavior.getUpdateBehavior().init();
- diagramSupport.migrateDiagramModelIfNecessary();
+ diagramBehavior.migrateDiagramModelIfNecessary();
IContextService contextService = (IContextService) getSite().getService(IContextService.class);
contextService.activateContext(getDiagramTypeProvider().getContextId());
}
@@ -278,7 +278,7 @@
*/
protected void setInput(IEditorInput input) {
super.setInput(input);
- diagramSupport.setInput((IDiagramEditorInput) input);
+ diagramBehavior.setInput((IDiagramEditorInput) input);
}
/**
@@ -288,11 +288,11 @@
* dirty state of the editor.
*/
public void createPartControl(Composite parent) {
- if (diagramSupport.getEditorInitializationError() != null) {
- diagramSupport.createErrorPartControl(parent);
+ if (diagramBehavior.getEditorInitializationError() != null) {
+ diagramBehavior.createErrorPartControl(parent);
} else {
super.createPartControl(parent);
- diagramSupport.createPartControl();
+ diagramBehavior.createPartControl();
}
}
@@ -306,7 +306,7 @@
* The parent composite
*/
protected void createGraphicalViewer(Composite parent) {
- diagramSupport.createGraphicalViewer(parent);
+ diagramBehavior.createGraphicalViewer(parent);
}
/**
@@ -319,7 +319,7 @@
public void initializeGraphicalViewer() {
super.initializeGraphicalViewer();
- diagramSupport.initializeGraphicalViewer();
+ diagramBehavior.initializeGraphicalViewer();
// this will cause the ActionBarContributor to refresh with the
// new actions (there is no specific refresh-action).
@@ -337,7 +337,7 @@
*/
protected void configureGraphicalViewer() {
super.configureGraphicalViewer();
- diagramSupport.configureGraphicalViewer();
+ diagramBehavior.configureGraphicalViewer();
}
// ------------------- Dirty state -----------------------------------------
@@ -362,7 +362,7 @@
* the Eclipse progress monitor to report progress with.
*/
public void doSave(IProgressMonitor monitor) {
- diagramSupport.getPersistencyBehavior().saveDiagram(monitor);
+ diagramBehavior.getPersistencyBehavior().saveDiagram(monitor);
}
/**
@@ -373,7 +373,7 @@
* otherwise.
*/
public boolean isDirty() {
- return diagramSupport.isDirty();
+ return diagramBehavior.isDirty();
}
// ---------------------- Palette --------------------------------------- //
@@ -387,7 +387,7 @@
* @return the {@link PaletteViewerProvider} to use
*/
protected final PaletteViewerProvider createPaletteViewerProvider() {
- return diagramSupport.createPaletteViewerProvider();
+ return diagramBehavior.createPaletteViewerProvider();
}
/**
@@ -398,7 +398,7 @@
* @return the {@link PaletteViewerProvider} preferences to use.
*/
protected final FlyoutPreferences getPalettePreferences() {
- return diagramSupport.getPalettePreferences();
+ return diagramBehavior.getPalettePreferences();
}
/**
@@ -408,7 +408,7 @@
* @return the {@link PaletteRoot} to use
*/
protected final PaletteRoot getPaletteRoot() {
- return diagramSupport.getPaletteRoot();
+ return diagramBehavior.getPaletteRoot();
}
// ---------------------- Refresh --------------------------------------- //
@@ -455,7 +455,7 @@
* @return the adapter instance
*/
public Object getAdapter(@SuppressWarnings("rawtypes") Class type) {
- Object returnObj = diagramSupport.getAdapter(type);
+ Object returnObj = diagramBehavior.getAdapter(type);
if (returnObj != null) {
return returnObj;
}
@@ -474,7 +474,7 @@
* <code>super.dispose()</code> in case you override this method!
*/
public void dispose() {
- diagramSupport.preSuperDispose();
+ diagramBehavior.preSuperDispose();
RuntimeException exc = null;
if (getEditDomain() != null) {
@@ -487,7 +487,7 @@
}
}
- diagramSupport.postSuperDispose();
+ diagramBehavior.postSuperDispose();
if (exc != null) {
throw exc;
@@ -505,7 +505,7 @@
}
super.setFocus();
- diagramSupport.getUpdateBehavior().handleActivate();
+ diagramBehavior.getUpdateBehavior().handleActivate();
}
// ---------------------- Selection ------------------------------------- //
@@ -519,7 +519,7 @@
* @since 0.9
*/
public PictogramElement[] getSelectedPictogramElements() {
- return diagramSupport.getSelectedPictogramElements();
+ return diagramBehavior.getSelectedPictogramElements();
}
/**
@@ -627,7 +627,7 @@
* @since 0.9
*/
public void selectPictogramElements(PictogramElement[] pictogramElements) {
- diagramSupport.selectPictogramElements(pictogramElements);
+ diagramBehavior.selectPictogramElements(pictogramElements);
}
/**
@@ -650,7 +650,7 @@
* @since 0.9
*/
public void setPictogramElementForSelection(PictogramElement pictogramElement) {
- diagramSupport.setPictogramElementForSelection(pictogramElement);
+ diagramBehavior.setPictogramElementForSelection(pictogramElement);
}
/**
@@ -673,7 +673,7 @@
* @since 0.9
*/
public void setPictogramElementsForSelection(PictogramElement pictogramElements[]) {
- diagramSupport.setPictogramElementsForSelection(pictogramElements);
+ diagramBehavior.setPictogramElementsForSelection(pictogramElements);
}
// ---------------------- Other ----------------------------------------- //
@@ -703,14 +703,14 @@
* and the provider.
* <p>
* Note that this is a pure delegation method. Overrides should happen in
- * {@link DiagramSupport}.
+ * {@link DiagramBehavior}.
*
* @return the associated {@link IDiagramTypeProvider} instance.
*
* @since 0.9
*/
public IDiagramTypeProvider getDiagramTypeProvider() {
- return diagramSupport.getDiagramTypeProvider();
+ return diagramBehavior.getDiagramTypeProvider();
}
/**
@@ -775,14 +775,14 @@
* @since 0.9
*/
public TransactionalEditingDomain getEditingDomain() {
- return diagramSupport.getEditingDomain();
+ return diagramBehavior.getEditingDomain();
}
/**
* @since 0.10
*/
public IDiagramEditorInput getDiagramEditorInput() {
- return diagramSupport.getInput();
+ return diagramBehavior.getInput();
}
/**
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramEditorContextMenuProvider.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramEditorContextMenuProvider.java
index a36a243..2389563 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramEditorContextMenuProvider.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramEditorContextMenuProvider.java
@@ -241,7 +241,7 @@
IFeature feature = cmEntry.getFeature();
if (feature instanceof ICustomFeature && feature.isAvailable(context)) {
IAction action = new CustomAction((ICustomFeature) feature, context,
- configurationProvider.getDiagramSupport());
+ configurationProvider.getDiagramBehavior());
if (textParentEntry != null) {
text = textParentEntry + " " + text; //$NON-NLS-1$
}
@@ -438,7 +438,7 @@
return ret;
}
- private DiagramSupport getEditor() {
- return configurationProvider.getDiagramSupport();
+ private DiagramBehavior getEditor() {
+ return configurationProvider.getDiagramBehavior();
}
}
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramEditorInput.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramEditorInput.java
index bbd2327..5455165 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramEditorInput.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramEditorInput.java
@@ -103,7 +103,7 @@
* @param providerId
* A {@link String} which holds the diagram type id. When it is
* null, it is set later in
- * {@link DiagramSupport#setInput(IEditorInput)}
+ * {@link DiagramBehavior#setInput(IEditorInput)}
* @throws IllegalArgumentException
* if <code>uriString</code> parameter is null <br>
*
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/ElementDeleteListener.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/ElementDeleteListener.java
index f4788c5..6aabf41 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/ElementDeleteListener.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/ElementDeleteListener.java
@@ -36,13 +36,13 @@
*/
public final class ElementDeleteListener extends AdapterImpl {
- private DiagramSupport diagramSupport;
+ private DiagramBehavior diagramBehavior;
/**
* @since 0.10
*/
- public ElementDeleteListener(DiagramSupport diagramSupport) {
- this.diagramSupport = diagramSupport;
+ public ElementDeleteListener(DiagramBehavior diagramBehavior) {
+ this.diagramBehavior = diagramBehavior;
}
@Override
@@ -53,14 +53,14 @@
@Override
public void notifyChanged(Notification msg) {
if (T.racer().debug()) {
- final String editorName = diagramSupport.getDiagramContainer().getTitle();
+ final String editorName = diagramBehavior.getDiagramContainer().getTitle();
T.racer().debug("Delete listener called of editor " //$NON-NLS-1$
+ editorName + " with events " + msg.toString()); //$NON-NLS-1$
}
- final IDiagramEditorInput in = diagramSupport.getDiagramContainer().getDiagramEditorInput();
+ final IDiagramEditorInput in = diagramBehavior.getDiagramContainer().getDiagramEditorInput();
if (in != null) {
- final IWorkbenchPartSite site = diagramSupport.getDiagramContainer().getWorkbenchPart().getSite();
+ final IWorkbenchPartSite site = diagramBehavior.getDiagramContainer().getWorkbenchPart().getSite();
if (site == null) {
return;
}
@@ -70,7 +70,7 @@
// which may provoke deadlocks.
shell.getDisplay().asyncExec(new Runnable() {
public void run() {
- if (diagramSupport == null) {
+ if (diagramBehavior == null) {
return; // disposed
}
if (shell.isDisposed()) {
@@ -78,7 +78,7 @@
}
Diagram diagram = null;
try {
- diagram = (Diagram) diagramSupport.getAdapter(Diagram.class);
+ diagram = (Diagram) diagramBehavior.getAdapter(Diagram.class);
} catch (final Exception e) {
// Ignore, exception indicates that the diagram has
// been deleted
@@ -86,10 +86,10 @@
if (diagram == null || EcoreUtil.getRootContainer(diagram) == null) {
// diagram is gone so try to close
if (T.racer().debug()) {
- final String editorName = diagramSupport.getDiagramContainer().getTitle();
+ final String editorName = diagramBehavior.getDiagramContainer().getTitle();
T.racer().debug("Closing editor " + editorName); //$NON-NLS-1$
}
- diagramSupport.getDiagramContainer().close();
+ diagramBehavior.getDiagramContainer().close();
}
}
});
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/IDiagramContainerUI.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/IDiagramContainerUI.java
index 2a58936..bd2c413 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/IDiagramContainerUI.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/IDiagramContainerUI.java
@@ -84,7 +84,7 @@
/**
* Sets the GEF edit domain to the container. Needed for initializing the
- * container from the {@link DiagramSupport} instance.
+ * container from the {@link DiagramBehavior} instance.
*
* @param editDomain
* The {@link DefaultEditDomain} to set
@@ -160,7 +160,7 @@
/**
* Sets the {@link GraphicalViewer} to be used inside the container. The
- * viewer is created by the {@link DiagramSupport} instance and needs to be
+ * viewer is created by the {@link DiagramBehavior} instance and needs to be
* set in the GEF container.
*
* @param viewer
@@ -179,10 +179,10 @@
public void hookGraphicalViewer();
/**
- * Returns the {@link DiagramSupport} instance associated with this
+ * Returns the {@link DiagramBehavior} instance associated with this
* container.
*
- * @return The associated {@link DiagramSupport} instance
+ * @return The associated {@link DiagramBehavior} instance
*/
- public DiagramSupport getDiagramSupport();
+ public DiagramBehavior getDiagramBehavior();
}
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/features/AbstractPasteFeature.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/features/AbstractPasteFeature.java
index 8a16ddc..e0106e5 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/features/AbstractPasteFeature.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/features/AbstractPasteFeature.java
@@ -30,7 +30,7 @@
import org.eclipse.graphiti.features.context.IPasteContext;
import org.eclipse.graphiti.features.impl.AbstractFeature;
import org.eclipse.graphiti.internal.Messages;
-import org.eclipse.graphiti.ui.editor.DiagramSupport;
+import org.eclipse.graphiti.ui.editor.DiagramBehavior;
import org.eclipse.graphiti.ui.internal.util.clipboard.ModelClipboard;
/**
@@ -117,7 +117,7 @@
/**
* Checks if the given {@link EObject} can be resolved in the local
- * {@link EditingDomain} of the current {@link DiagramSupport}. Pasting an
+ * {@link EditingDomain} of the current {@link DiagramBehavior}. Pasting an
* EObject that is not resolvable (e.g. it was just created in another
* editor and has not yet been persisted) may cause issues with the
* graphical presentation of the new object: the Graphiti update will not
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/action/AbstractPreDefinedAction.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/action/AbstractPreDefinedAction.java
index 84a57ae..5a1ce2c 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/action/AbstractPreDefinedAction.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/action/AbstractPreDefinedAction.java
@@ -72,7 +72,7 @@
protected void executeOnCommandStack(ICommand command) {
CommandStack commandStack = getConfigurationProvider().getDiagramEditor().getEditDomain().getCommandStack();
- commandStack.execute(new GefCommandWrapper(command, getConfigurationProvider().getDiagramSupport()
+ commandStack.execute(new GefCommandWrapper(command, getConfigurationProvider().getDiagramBehavior()
.getEditingDomain()));
}
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/action/CustomAction.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/action/CustomAction.java
index d6d3306..addf344 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/action/CustomAction.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/action/CustomAction.java
@@ -23,7 +23,7 @@
import org.eclipse.graphiti.internal.command.CommandContainer;
import org.eclipse.graphiti.internal.command.GenericFeatureCommandWithContext;
import org.eclipse.graphiti.internal.command.ICommand;
-import org.eclipse.graphiti.ui.editor.DiagramSupport;
+import org.eclipse.graphiti.ui.editor.DiagramBehavior;
import org.eclipse.graphiti.ui.internal.command.GefCommandWrapper;
import org.eclipse.jface.action.Action;
@@ -37,13 +37,13 @@
private ICustomContext context;
- private DiagramSupport diagramSupport;
+ private DiagramBehavior diagramBehavior;
- public CustomAction(ICustomFeature customFeature, ICustomContext context, DiagramSupport diagramSupport) {
+ public CustomAction(ICustomFeature customFeature, ICustomContext context, DiagramBehavior diagramBehavior) {
super();
this.customFeature = customFeature;
this.context = context;
- this.diagramSupport = diagramSupport;
+ this.diagramBehavior = diagramBehavior;
setText(customFeature.getName());
setToolTipText(customFeature.getDescription());
}
@@ -61,7 +61,7 @@
}
protected void executeOnCommandStack(ICommand command) {
- CommandStack commandStack = diagramSupport.getEditDomain().getCommandStack();
- commandStack.execute(new GefCommandWrapper(command, diagramSupport.getEditingDomain()));
+ CommandStack commandStack = diagramBehavior.getEditDomain().getCommandStack();
+ commandStack.execute(new GefCommandWrapper(command, diagramBehavior.getEditingDomain()));
}
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/action/FeatureExecutionHandler.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/action/FeatureExecutionHandler.java
index a106ae7..9269d7d 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/action/FeatureExecutionHandler.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/action/FeatureExecutionHandler.java
@@ -101,7 +101,7 @@
protected void executeOnCommandStack(ICommand command) {
CommandStack commandStack = getConfigurationProvider().getDiagramEditor().getEditDomain().getCommandStack();
- commandStack.execute(new GefCommandWrapper(command, getConfigurationProvider().getDiagramSupport()
+ commandStack.execute(new GefCommandWrapper(command, getConfigurationProvider().getDiagramBehavior()
.getEditingDomain()));
}
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/action/PasteAction.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/action/PasteAction.java
index 7da0bec..110644e 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/action/PasteAction.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/action/PasteAction.java
@@ -96,8 +96,8 @@
IWorkbenchPart workbenchPart = getWorkbenchPart();
if (workbenchPart instanceof IDiagramContainerUI) {
IDiagramContainerUI diagramContainer = (IDiagramContainerUI) workbenchPart;
- pasteLocation = diagramContainer.getDiagramSupport().calculateRealMouseLocation(
- diagramContainer.getDiagramSupport().getMouseLocation());
+ pasteLocation = diagramContainer.getDiagramBehavior().calculateRealMouseLocation(
+ diagramContainer.getDiagramBehavior().getMouseLocation());
}
context.setLocation(pasteLocation.x, pasteLocation.y);
return context;
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/action/SaveImageAction.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/action/SaveImageAction.java
index e2e01f0..ede8ff9 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/action/SaveImageAction.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/action/SaveImageAction.java
@@ -21,7 +21,7 @@
import org.eclipse.gef.GraphicalViewer;
import org.eclipse.graphiti.features.ISaveImageFeature;
import org.eclipse.graphiti.features.context.ISaveImageContext;
-import org.eclipse.graphiti.ui.editor.DiagramSupport;
+import org.eclipse.graphiti.ui.editor.DiagramBehavior;
import org.eclipse.graphiti.ui.internal.Messages;
import org.eclipse.graphiti.ui.internal.services.GraphitiUiInternal;
import org.eclipse.jface.action.Action;
@@ -36,7 +36,7 @@
private ISaveImageContext context;
- private DiagramSupport diagramSupport;
+ private DiagramBehavior diagramBehavior;
public static final String TOOL_TIP = Messages.SaveImageAction_1_xmsg;
@@ -47,11 +47,11 @@
public static final String ACTION_DEFINITION_ID = "org.eclipse.graphiti.ui.internal.action.SaveImageAction"; //$NON-NLS-1$
public SaveImageAction(ISaveImageFeature saveImageFeature, ISaveImageContext context,
- DiagramSupport diagramSupport) {
+ DiagramBehavior diagramBehavior) {
super();
this.saveImageFeature = saveImageFeature;
this.context = context;
- this.diagramSupport = diagramSupport;
+ this.diagramBehavior = diagramBehavior;
setText(TEXT);
setToolTipText(TOOL_TIP);
setId(ACTION_ID);
@@ -68,7 +68,7 @@
saveImageFeature.preSave(context);
// get viewer and start save-image-dialog
- GraphicalViewer viewer = (GraphicalViewer) diagramSupport.getDiagramContainer().getGraphicalViewer();
+ GraphicalViewer viewer = (GraphicalViewer) diagramBehavior.getDiagramContainer().getGraphicalViewer();
GraphitiUiInternal.getUiService().startSaveAsImageDialog(viewer);
saveImageFeature.postSave(context);
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/action/ToggleContextButtonPadAction.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/action/ToggleContextButtonPadAction.java
index 9861327..f1aa4d9 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/action/ToggleContextButtonPadAction.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/action/ToggleContextButtonPadAction.java
@@ -17,7 +17,7 @@
*******************************************************************************/
package org.eclipse.graphiti.ui.internal.action;
-import org.eclipse.graphiti.ui.editor.DiagramSupport;
+import org.eclipse.graphiti.ui.editor.DiagramBehavior;
import org.eclipse.graphiti.ui.internal.Messages;
import org.eclipse.graphiti.ui.internal.contextbuttons.IContextButtonManager;
import org.eclipse.jface.action.Action;
@@ -28,7 +28,7 @@
*/
public class ToggleContextButtonPadAction extends Action {
- private DiagramSupport diagramSupport;
+ private DiagramBehavior diagramBehavior;
public static final String TOOL_TIP = Messages.ToggleContextButtonPadAction_0_xmsg;
@@ -36,9 +36,9 @@
public static final String ACTION_ID = "toggle_context_button_pad"; //$NON-NLS-1$
- public ToggleContextButtonPadAction(DiagramSupport diagramSupport) {
+ public ToggleContextButtonPadAction(DiagramBehavior diagramBehavior) {
super();
- this.diagramSupport = diagramSupport;
+ this.diagramBehavior = diagramBehavior;
setText(TEXT);
setToolTipText(TOOL_TIP);
setId(ACTION_ID);
@@ -46,7 +46,7 @@
@Override
public void run() {
- IContextButtonManager contextButtonManager = (IContextButtonManager) diagramSupport
+ IContextButtonManager contextButtonManager = (IContextButtonManager) diagramBehavior
.getAdapter(IContextButtonManager.class);
contextButtonManager.setContextButtonShowing(!isChecked());
}
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/command/AbstractCommand.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/command/AbstractCommand.java
index bb670f4..84fbf12 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/command/AbstractCommand.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/command/AbstractCommand.java
@@ -48,6 +48,6 @@
}
protected TransactionalEditingDomain getTransactionalEditingDomain() {
- return configurationProvider.getDiagramSupport().getEditingDomain();
+ return configurationProvider.getDiagramBehavior().getEditingDomain();
}
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/config/ConfigurationProvider.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/config/ConfigurationProvider.java
index fe67fed..7eee88c 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/config/ConfigurationProvider.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/config/ConfigurationProvider.java
@@ -20,7 +20,7 @@
import org.eclipse.graphiti.dt.IDiagramTypeProvider;
import org.eclipse.graphiti.features.IFeatureProvider;
import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.ui.editor.DiagramSupport;
+import org.eclipse.graphiti.ui.editor.DiagramBehavior;
import org.eclipse.graphiti.ui.editor.IDiagramContainerUI;
import org.eclipse.graphiti.ui.internal.IResourceRegistry;
import org.eclipse.graphiti.ui.internal.ResourceRegistry;
@@ -45,7 +45,7 @@
private IWorkbenchPart _workbenchPart;
- private DiagramSupport diagramSupport;
+ private DiagramBehavior diagramBehavior;
private IDiagramTypeProvider diagramTypeProvider;
@@ -62,8 +62,8 @@
* @param diagramTypeProvider
* the diagram type provider
*/
- public ConfigurationProvider(DiagramSupport diagramSupport, IDiagramTypeProvider diagramTypeProvider) {
- this.diagramSupport = diagramSupport;
+ public ConfigurationProvider(DiagramBehavior diagramBehavior, IDiagramTypeProvider diagramTypeProvider) {
+ this.diagramBehavior = diagramBehavior;
setDiagramTypeProvider(diagramTypeProvider);
}
@@ -160,7 +160,7 @@
* getDiagramEditor()
*/
public IDiagramContainerUI getDiagramEditor() {
- return diagramSupport.getDiagramContainer();
+ return diagramBehavior.getDiagramContainer();
}
/*
@@ -171,11 +171,11 @@
* ()
*/
public IDiagramContainerUI getDiagramContainer() {
- return diagramSupport.getDiagramContainer();
+ return diagramBehavior.getDiagramContainer();
}
- public DiagramSupport getDiagramSupport() {
- return diagramSupport;
+ public DiagramBehavior getDiagramBehavior() {
+ return diagramBehavior;
}
// ===================== overwriteable behaviour ==========================
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/contextbuttons/ContextButton.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/contextbuttons/ContextButton.java
index 8fdbd6c..06a3b9e 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/contextbuttons/ContextButton.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/contextbuttons/ContextButton.java
@@ -38,7 +38,7 @@
import org.eclipse.graphiti.internal.contextbuttons.PositionedContextButton;
import org.eclipse.graphiti.tb.ContextButtonEntry;
import org.eclipse.graphiti.tb.IContextButtonEntry;
-import org.eclipse.graphiti.ui.editor.DiagramSupport;
+import org.eclipse.graphiti.ui.editor.DiagramBehavior;
import org.eclipse.graphiti.ui.editor.IDiagramContainerUI;
import org.eclipse.graphiti.ui.internal.editor.GFDragConnectionTool;
import org.eclipse.graphiti.ui.internal.figures.GFFigureUtil;
@@ -242,8 +242,8 @@
* @return The {@link IDiagramContainerUI} for which the context button is
* displayed.
*/
- public final DiagramSupport getDiagramSupport() {
- return getContextButtonPad().getDiagramSupport();
+ public final DiagramBehavior getDiagramBehavior() {
+ return getContextButtonPad().getDiagramBehavior();
}
/**
@@ -564,10 +564,10 @@
// creates a new drag-connection tool on each mouse move
mouseDragMoveListener = new MouseMoveListener() {
public void mouseMove(org.eclipse.swt.events.MouseEvent e) {
- EditPart targetEditPart = getDiagramSupport().getDiagramContainer().getGraphicalViewer()
+ EditPart targetEditPart = getDiagramBehavior().getDiagramContainer().getGraphicalViewer()
.findObjectAt(new Point(e.x, e.y));
createNewGFDragConnectionTool().continueConnection(getEditPart(),
- getDiagramSupport(), getEntry(),
+ getDiagramBehavior(), getEntry(),
targetEditPart);
}
};
@@ -576,9 +576,9 @@
mouseDragUpListener = new MouseAdapter() {
@Override
public void mouseUp(org.eclipse.swt.events.MouseEvent e) {
- getDiagramSupport().getDiagramContainer().getGraphicalViewer().getControl()
+ getDiagramBehavior().getDiagramContainer().getGraphicalViewer().getControl()
.removeMouseListener(mouseDragUpListener);
- getDiagramSupport().getDiagramContainer().getGraphicalViewer().getControl()
+ getDiagramBehavior().getDiagramContainer().getGraphicalViewer().getControl()
.removeMouseMoveListener(mouseDragMoveListener);
mouseDragUpListener = null;
mouseDragMoveListener = null;
@@ -586,9 +586,9 @@
};
// adds the mouse-drag listeners
- getDiagramSupport().getDiagramContainer().getGraphicalViewer().getControl()
+ getDiagramBehavior().getDiagramContainer().getGraphicalViewer().getControl()
.addMouseListener(mouseDragUpListener);
- getDiagramSupport().getDiagramContainer().getGraphicalViewer().getControl()
+ getDiagramBehavior().getDiagramContainer().getGraphicalViewer().getControl()
.addMouseMoveListener(mouseDragMoveListener);
}
}
@@ -601,7 +601,7 @@
* active tool.
*/
private GFDragConnectionTool createNewGFDragConnectionTool() {
- DefaultEditDomain editDomain = getDiagramSupport().getEditDomain();
+ DefaultEditDomain editDomain = getDiagramBehavior().getEditDomain();
GFDragConnectionTool dragConnectionTool = new GFDragConnectionTool();
dragConnectionTool.setEditDomain(editDomain);
editDomain.setActiveTool(dragConnectionTool);
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/contextbuttons/ContextButtonManagerForPad.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/contextbuttons/ContextButtonManagerForPad.java
index 8d7bd38..78178c4 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/contextbuttons/ContextButtonManagerForPad.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/contextbuttons/ContextButtonManagerForPad.java
@@ -46,7 +46,7 @@
import org.eclipse.graphiti.mm.pictograms.PictogramElement;
import org.eclipse.graphiti.tb.IContextButtonPadData;
import org.eclipse.graphiti.tb.IToolBehaviorProvider;
-import org.eclipse.graphiti.ui.editor.DiagramSupport;
+import org.eclipse.graphiti.ui.editor.DiagramBehavior;
import org.eclipse.graphiti.ui.internal.IResourceRegistry;
import org.eclipse.graphiti.ui.internal.parts.IPictogramElementEditPart;
import org.eclipse.swt.SWT;
@@ -70,7 +70,7 @@
* The container on which this context button manager works, see
* {@link #getContainer()}. It is set in the constructor.
*/
- private DiagramSupport diagramSupport;
+ private DiagramBehavior diagramBehavior;
/**
* A backward-map from the edit-part figures to their edit-parts as
@@ -122,12 +122,12 @@
}
private void reactOnMouse(MouseEvent me) {
- DiagramSupport diagramSupport = getDiagramSupport();
+ DiagramBehavior diagramBehavior = getDiagramBehavior();
- if (diagramSupport.isDirectEditingActive()) {
+ if (diagramBehavior.isDirectEditingActive()) {
return;
}
- Tool activeTool = diagramSupport.getEditDomain().getActiveTool();
+ Tool activeTool = diagramBehavior.getEditDomain().getActiveTool();
if (activeTool instanceof CreationTool || activeTool instanceof AbstractConnectionCreationTool) {
return;
}
@@ -160,11 +160,11 @@
* {@link #getContainer()}.
* @param iResourceRegistry
*/
- public ContextButtonManagerForPad(DiagramSupport diagramSupport, IResourceRegistry resourceRegistry) {
- this.diagramSupport = diagramSupport;
+ public ContextButtonManagerForPad(DiagramBehavior diagramBehavior, IResourceRegistry resourceRegistry) {
+ this.diagramBehavior = diagramBehavior;
this.resourceRegistry = resourceRegistry;
- ZoomManager zoomMgr = (ZoomManager) getDiagramSupport().getDiagramContainer().getGraphicalViewer()
+ ZoomManager zoomMgr = (ZoomManager) getDiagramBehavior().getDiagramContainer().getGraphicalViewer()
.getProperty(ZoomManager.class.toString());
if (zoomMgr != null) {
zoomMgr.addZoomListener(zoomListener);
@@ -181,8 +181,8 @@
*
* @return The container this context button manager works on.
*/
- public DiagramSupport getDiagramSupport() {
- return diagramSupport;
+ public DiagramBehavior getDiagramBehavior() {
+ return diagramBehavior;
}
/**
@@ -271,7 +271,7 @@
public void hideContextButtonsInstantly() {
if (getActiveContextButtonPad() != null) {
synchronized (this) {
- ScalableFreeformRootEditPart rootEditPart = (ScalableFreeformRootEditPart) getDiagramSupport()
+ ScalableFreeformRootEditPart rootEditPart = (ScalableFreeformRootEditPart) getDiagramBehavior()
.getDiagramContainer().getGraphicalViewer().getRootEditPart();
IFigure feedbackLayer = rootEditPart.getLayer(LayerConstants.HANDLE_LAYER);
feedbackLayer.remove(getActiveContextButtonPad());
@@ -351,7 +351,7 @@
hideContextButtonsInstantly();
// determine zoom level
- ScalableFreeformRootEditPart rootEditPart = (ScalableFreeformRootEditPart) getDiagramSupport()
+ ScalableFreeformRootEditPart rootEditPart = (ScalableFreeformRootEditPart) getDiagramBehavior()
.getDiagramContainer().getGraphicalViewer().getRootEditPart();
double zoom = rootEditPart.getZoomManager().getZoom();
if (zoom < MINIMUM_ZOOM_LEVEL) {
@@ -373,7 +373,7 @@
PictogramElementContext context = new PictogramElementContext(pe);
// retrieve context button pad data
- IToolBehaviorProvider toolBehaviorProvider = getDiagramSupport().getDiagramTypeProvider()
+ IToolBehaviorProvider toolBehaviorProvider = getDiagramBehavior().getDiagramTypeProvider()
.getCurrentToolBehaviorProvider();
IContextButtonPadData contextButtonPadData = toolBehaviorProvider.getContextButtonPad(context);
if (contextButtonPadData == null) {
@@ -400,7 +400,7 @@
// create context button pad and add to handle layer
EditPart activeEditPart = getFigure2EditPart().get(figure);
- ContextButtonPad contextButtonPad = new ContextButtonPad(this, declaration, zoom, getDiagramSupport(),
+ ContextButtonPad contextButtonPad = new ContextButtonPad(this, declaration, zoom, getDiagramBehavior(),
activeEditPart, resourceRegistry);
setActive(figure, contextButtonPad);
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/contextbuttons/ContextButtonPad.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/contextbuttons/ContextButtonPad.java
index 07c7660..232ea2c 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/contextbuttons/ContextButtonPad.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/contextbuttons/ContextButtonPad.java
@@ -32,7 +32,7 @@
import org.eclipse.graphiti.internal.contextbuttons.IContextButtonPadDeclaration;
import org.eclipse.graphiti.internal.contextbuttons.IContextButtonPadDeclaration.PadStyle;
import org.eclipse.graphiti.internal.contextbuttons.PositionedContextButton;
-import org.eclipse.graphiti.ui.editor.DiagramSupport;
+import org.eclipse.graphiti.ui.editor.DiagramBehavior;
import org.eclipse.graphiti.ui.internal.IResourceRegistry;
import org.eclipse.graphiti.ui.internal.figures.GFFigureUtil;
import org.eclipse.graphiti.ui.internal.util.DataTypeTransformation;
@@ -88,7 +88,7 @@
/**
* The container as described in {@link #getContainer()}.
*/
- private DiagramSupport diagramSupport;
+ private DiagramBehavior diagramBehavior;
/**
* The edit-part as described in {@link #getEditPart()}.
@@ -174,12 +174,12 @@
* @param resourceRegistry
*/
public ContextButtonPad(ContextButtonManagerForPad contextButtonManagerForPad,
- IContextButtonPadDeclaration declaration, double zoomLevel, DiagramSupport diagramSupport,
+ IContextButtonPadDeclaration declaration, double zoomLevel, DiagramBehavior diagramBehavior,
EditPart editPart,
IResourceRegistry resourceRegistry) {
this.declaration = declaration;
this.zoomLevel = zoomLevel;
- this.diagramSupport = diagramSupport;
+ this.diagramBehavior = diagramBehavior;
this.editPart = editPart;
this.resourceRegistry = resourceRegistry;
this.contextButtonManagerForPad = contextButtonManagerForPad;
@@ -222,8 +222,8 @@
*
* @return The container, which can be used to access the environment.
*/
- public final DiagramSupport getDiagramSupport() {
- return diagramSupport;
+ public final DiagramBehavior getDiagramBehavior() {
+ return diagramBehavior;
}
/**
@@ -296,7 +296,7 @@
Rectangle position = transformGenericRectangle(positionedButton.getPosition(), 0);
// translate position relative to bounds (after the bounds are set!)
position.translate(-getBounds().getTopLeft().x, -getBounds().getTopLeft().y);
- ContextButton cb = new ContextButton(diagramSupport.getDiagramTypeProvider().getProviderId(),
+ ContextButton cb = new ContextButton(diagramBehavior.getDiagramTypeProvider().getProviderId(),
positionedButton,
this);
add(cb, position);
@@ -522,7 +522,7 @@
public void addNotify() {
super.addNotify();
- Control control = diagramSupport.getDiagramContainer().getGraphicalViewer().getControl();
+ Control control = diagramBehavior.getDiagramContainer().getGraphicalViewer().getControl();
control.addMouseMoveListener(mouseMoveListener);
control.addMouseTrackListener(mouseTrackListener);
@@ -544,7 +544,7 @@
*/
@Override
public void removeNotify() {
- Control control = diagramSupport.getDiagramContainer().getGraphicalViewer().getControl();
+ Control control = diagramBehavior.getDiagramContainer().getGraphicalViewer().getControl();
control.removeMouseMoveListener(mouseMoveListener);
control.removeMouseTrackListener(mouseTrackListener);
@@ -717,8 +717,8 @@
*/
public boolean isMouseInOverlappingArea() {
// determine mouse location in correct coordinates
- Point editorMouseLocation = new Point(diagramSupport.getMouseLocation());
- Point viewPortMouseLocation = diagramSupport.calculateRealMouseLocation(editorMouseLocation);
+ Point editorMouseLocation = new Point(diagramBehavior.getMouseLocation());
+ Point viewPortMouseLocation = diagramBehavior.calculateRealMouseLocation(editorMouseLocation);
Point mouseLocation = viewPortMouseLocation.scale(getZoomLevel());
// hide if mouse location outside overlapping containment rectangles
boolean containsPointOverlapping = containsPointOverlapping(mouseLocation.x, mouseLocation.y);
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/dnd/GFTemplateTransferDropTargetListener.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/dnd/GFTemplateTransferDropTargetListener.java
index 9ef0f3c..ab6132a 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/dnd/GFTemplateTransferDropTargetListener.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/dnd/GFTemplateTransferDropTargetListener.java
@@ -21,7 +21,7 @@
import org.eclipse.gef.EditPartViewer;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.dnd.TemplateTransferDropTargetListener;
-import org.eclipse.graphiti.ui.editor.DiagramSupport;
+import org.eclipse.graphiti.ui.editor.DiagramBehavior;
import org.eclipse.swt.dnd.DND;
/**
@@ -35,13 +35,13 @@
*/
public class GFTemplateTransferDropTargetListener extends TemplateTransferDropTargetListener {
- private DiagramSupport diagramSupport;
+ private DiagramBehavior diagramBehavior;
- public GFTemplateTransferDropTargetListener(EditPartViewer viewer, DiagramSupport diagramSupport) {
+ public GFTemplateTransferDropTargetListener(EditPartViewer viewer, DiagramBehavior diagramBehavior) {
super(viewer);
// it is important to set this value to true
setEnablementDeterminedByCommand(true);
- this.diagramSupport = diagramSupport;
+ this.diagramBehavior = diagramBehavior;
}
@Override
@@ -58,7 +58,7 @@
} else
getCurrentEvent().detail = DND.DROP_NONE;
- if (!diagramSupport.isDirectEditingActive()) {
+ if (!diagramBehavior.isDirectEditingActive()) {
selectAddedObject();
}
}
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramChangeListener.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramChangeListener.java
index fd3d033..6a261e4 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramChangeListener.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramChangeListener.java
@@ -53,7 +53,7 @@
import org.eclipse.graphiti.mm.pictograms.PictogramElement;
import org.eclipse.graphiti.mm.pictograms.PictogramsPackage;
import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.ui.editor.DiagramSupport;
+import org.eclipse.graphiti.ui.editor.DiagramBehavior;
import org.eclipse.graphiti.ui.internal.Messages;
import org.eclipse.graphiti.ui.internal.T;
import org.eclipse.graphiti.ui.internal.parts.ConnectionEditPart;
@@ -69,10 +69,10 @@
public class DiagramChangeListener implements ResourceSetListener {
private DiagramRefreshJob diagramRefreshJob;
- private DiagramSupport diagramSupport;
+ private DiagramBehavior diagramBehavior;
- public DiagramChangeListener(DiagramSupport diagramSupport) {
- this.diagramSupport = diagramSupport;
+ public DiagramChangeListener(DiagramBehavior diagramBehavior) {
+ this.diagramBehavior = diagramBehavior;
}
public NotificationFilter getFilter() {
@@ -92,13 +92,13 @@
}
public void resourceSetChanged(ResourceSetChangeEvent event) {
- if (!diagramSupport.getRefreshBehavior().isAutoRefresh()) {
+ if (!diagramBehavior.getRefreshBehavior().isAutoRefresh()) {
return;
}
DiagramRefreshJob refreshDiagramJob = getRefreshDiagramJob();
if (!refreshDiagramJob.isRefreshAll()) {
- GraphicalViewer graphicalViewer = diagramSupport.getDiagramContainer().getGraphicalViewer();
+ GraphicalViewer graphicalViewer = diagramBehavior.getDiagramContainer().getGraphicalViewer();
if (graphicalViewer == null) {
return;
}
@@ -192,7 +192,7 @@
}
private void addRelevantChildEditPartsToRefreshJob(PictogramElement pe) {
- Map<?, ?> editPartRegistry = diagramSupport.getDiagramContainer().getGraphicalViewer().getEditPartRegistry();
+ Map<?, ?> editPartRegistry = diagramBehavior.getDiagramContainer().getGraphicalViewer().getEditPartRegistry();
DiagramRefreshJob refreshJob = getRefreshDiagramJob();
if (pe instanceof AnchorContainer) {
@@ -299,7 +299,7 @@
private DiagramRefreshJob getRefreshDiagramJob() {
if (diagramRefreshJob == null) {
- diagramRefreshJob = new DiagramRefreshJob(Messages.DiagramEditor_0_xmsg, diagramSupport);
+ diagramRefreshJob = new DiagramRefreshJob(Messages.DiagramEditor_0_xmsg, diagramBehavior);
}
return diagramRefreshJob;
}
@@ -344,18 +344,18 @@
// */
//class DiagramChangeListener extends EContentAdapter {
// private DiagramRefreshJob diagramRefreshJob;
-// private DiagramEditorInternal diagramSupport;
+// private DiagramEditorInternal diagramBehavior;
//
-// DiagramChangeListener(DiagramEditorInternal diagramSupport) {
+// DiagramChangeListener(DiagramEditorInternal diagramBehavior) {
// super();
-// this.ed = diagramSupport;
+// this.ed = diagramBehavior;
// }
//
// @Override
// public void notifyChanged(Notification notification) {
// super.notifyChanged(notification);
//
-// if (!diagramSupport.isAutoRefresh()) {
+// if (!diagramBehavior.isAutoRefresh()) {
// return;
// }
// if (GFTestConfiguration.isCPUProfilingTraceActive()) {
@@ -367,7 +367,7 @@
// }
//
// private void addRelevantChildEditPartsToRefreshJob(PictogramElement pe) {
-// Map editPartRegistry = diagramSupport.getGraphicalViewer().getEditPartRegistry();
+// Map editPartRegistry = diagramBehavior.getGraphicalViewer().getEditPartRegistry();
// DiagramRefreshJob refreshJob = getRefreshDiagramJob();
//
// if (pe instanceof AnchorContainer) {
@@ -439,7 +439,7 @@
//
// private DiagramRefreshJob getRefreshDiagramJob() {
// if (diagramRefreshJob == null) {
-// diagramRefreshJob = new DiagramRefreshJob(Messages.DiagramEditor_0_xmsg, diagramSupport);
+// diagramRefreshJob = new DiagramRefreshJob(Messages.DiagramEditor_0_xmsg, diagramBehavior);
// }
// return diagramRefreshJob;
// }
@@ -448,7 +448,7 @@
// boolean singleEditPart = false;
// DiagramRefreshJob refreshDiagramJob = getRefreshDiagramJob();
// if (!refreshDiagramJob.isRefreshAll()) {
-// GraphicalViewer graphicalViewer = diagramSupport.getGraphicalViewer();
+// GraphicalViewer graphicalViewer = diagramBehavior.getGraphicalViewer();
// if (graphicalViewer == null) {
// return;
// }
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramEditorDummy.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramEditorDummy.java
index d9f96aa..4b1c979 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramEditorDummy.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramEditorDummy.java
@@ -100,7 +100,7 @@
public void close() {
}
- public IDiagramBehavior getDiagramSupport() {
+ public IDiagramBehavior getDiagramBehavior() {
return diagramBehavior;
}
}
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramRefreshJob.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramRefreshJob.java
index 8bd0032..73fdb39 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramRefreshJob.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramRefreshJob.java
@@ -29,7 +29,7 @@
import org.eclipse.graphiti.features.IDirectEditingInfo;
import org.eclipse.graphiti.internal.pref.GFPreferences;
import org.eclipse.graphiti.internal.util.T;
-import org.eclipse.graphiti.ui.editor.DiagramSupport;
+import org.eclipse.graphiti.ui.editor.DiagramBehavior;
import org.eclipse.graphiti.ui.internal.parts.ConnectionDecoratorEditPart;
import org.eclipse.graphiti.ui.internal.parts.DiagramEditPart;
import org.eclipse.graphiti.ui.internal.parts.ShapeEditPart;
@@ -53,11 +53,11 @@
private boolean refreshAll = false;
- private DiagramSupport diagramSupport;
+ private DiagramBehavior diagramBehavior;
- DiagramRefreshJob(String name, DiagramSupport diagramSupport) {
+ DiagramRefreshJob(String name, DiagramBehavior diagramBehavior) {
super(name);
- this.diagramSupport = diagramSupport;
+ this.diagramBehavior = diagramBehavior;
}
void addEditPart(EditPart ep) {
@@ -95,21 +95,21 @@
}
}
- diagramSupport.getRefreshBehavior().initRefresh();
+ diagramBehavior.getRefreshBehavior().initRefresh();
// prove if switch to auto activate direct editing is required
// if yes, call always global editor refresh -> this refresh will activate the direct editing
- IDirectEditingInfo dei = diagramSupport.getDiagramTypeProvider().getFeatureProvider().getDirectEditingInfo();
+ IDirectEditingInfo dei = diagramBehavior.getDiagramTypeProvider().getFeatureProvider().getDirectEditingInfo();
if (refreshAll || dei.isActive()) {
- diagramSupport.refresh();
+ diagramBehavior.refresh();
} else {
for (EditPart ep : editParts) {
if (!hasNewParent(ep)) {
- diagramSupport.getRefreshBehavior().internalRefreshEditPart(ep);
+ diagramBehavior.getRefreshBehavior().internalRefreshEditPart(ep);
}
}
// refresh all active connection decorators
@SuppressWarnings({ "unchecked" })
- Set<Entry> entrySet = diagramSupport.getDiagramContainer().getGraphicalViewer().getEditPartRegistry()
+ Set<Entry> entrySet = diagramBehavior.getDiagramContainer().getGraphicalViewer().getEditPartRegistry()
.entrySet();
for (Entry e : entrySet) {
Object value = e.getValue();
@@ -118,7 +118,7 @@
ep.refresh();
}
}
- diagramSupport.selectBufferedPictogramElements();
+ diagramBehavior.selectBufferedPictogramElements();
}
refreshAll = false;
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DomainModelChangeListener.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DomainModelChangeListener.java
index 9a58b40..67e4880 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DomainModelChangeListener.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DomainModelChangeListener.java
@@ -32,7 +32,7 @@
import org.eclipse.graphiti.dt.IDiagramTypeProvider;
import org.eclipse.graphiti.mm.pictograms.Diagram;
import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.ui.editor.DiagramSupport;
+import org.eclipse.graphiti.ui.editor.DiagramBehavior;
import org.eclipse.swt.widgets.Display;
/**
@@ -43,10 +43,10 @@
*/
public class DomainModelChangeListener implements ResourceSetListener {
- private DiagramSupport diagramSupport;
+ private DiagramBehavior diagramBehavior;
- public DomainModelChangeListener(DiagramSupport diagramSupport) {
- setDiagramSupport(diagramSupport);
+ public DomainModelChangeListener(DiagramBehavior diagramBehavior) {
+ setDiagramBehavior(diagramBehavior);
}
public NotificationFilter getFilter() {
@@ -132,14 +132,14 @@
}
private IDiagramTypeProvider getDiagramTypeProvider() {
- return getDiagramSupport().getDiagramTypeProvider();
+ return getDiagramBehavior().getDiagramTypeProvider();
}
- private DiagramSupport getDiagramSupport() {
- return diagramSupport;
+ private DiagramBehavior getDiagramBehavior() {
+ return diagramBehavior;
}
- private void setDiagramSupport(DiagramSupport diagramSupport) {
- this.diagramSupport = diagramSupport;
+ private void setDiagramBehavior(DiagramBehavior diagramBehavior) {
+ this.diagramBehavior = diagramBehavior;
}
}
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DomainModelWorkspaceSynchronizerDelegate.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DomainModelWorkspaceSynchronizerDelegate.java
index 37ab828..5cf834a 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DomainModelWorkspaceSynchronizerDelegate.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DomainModelWorkspaceSynchronizerDelegate.java
@@ -22,7 +22,7 @@
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
-import org.eclipse.graphiti.ui.editor.DiagramSupport;
+import org.eclipse.graphiti.ui.editor.DiagramBehavior;
import org.eclipse.graphiti.ui.editor.IDiagramEditorInput;
/**
@@ -31,18 +31,18 @@
*/
public class DomainModelWorkspaceSynchronizerDelegate implements WorkspaceSynchronizer.Delegate {
- private DiagramSupport diagramSupport;
+ private DiagramBehavior diagramBehavior;
/**
* The DiagramEditorBehavior reacts on a setResourceChanged(true) if he gets
* activated.
*/
- public DomainModelWorkspaceSynchronizerDelegate(DiagramSupport diagramSupport) {
- this.diagramSupport = diagramSupport;
+ public DomainModelWorkspaceSynchronizerDelegate(DiagramBehavior diagramBehavior) {
+ this.diagramBehavior = diagramBehavior;
}
public void dispose() {
- diagramSupport = null;
+ diagramBehavior = null;
}
@@ -50,13 +50,13 @@
IFile file = WorkspaceSynchronizer.getUnderlyingFile(resource);
// Since we cannot get timestamp information, we have to be pessimistic
if (file == null){
- diagramSupport.getUpdateBehavior().setResourceChanged(true);
+ diagramBehavior.getUpdateBehavior().setResourceChanged(true);
return true;
}
// if file does not exist the getLocalTimeStamp method will return
// NULL_TIMESTAMP and we will also get a refresh
if (file.getLocalTimeStamp() != resource.getTimeStamp()) {
- diagramSupport.getUpdateBehavior().setResourceChanged(true);
+ diagramBehavior.getUpdateBehavior().setResourceChanged(true);
return true;
}
return true;
@@ -74,11 +74,11 @@
// (ResourceSetimpl(deb.getEditingDomain().getResourceSet())).getURIResourceMap().remove(resource.getURI());
// Map<URI, Resource> uriResourceMap = ((ResourceSetImpl)deb.getEditingDomain().getResourceSet()).getURIResourceMap();
resource.setURI(newURI);
- IDiagramEditorInput editorInput = diagramSupport.getDiagramContainer().getDiagramEditorInput();
+ IDiagramEditorInput editorInput = diagramBehavior.getDiagramContainer().getDiagramEditorInput();
if (editorInput != null) {
((IDiagramEditorInput) editorInput).updateUri(newURI);
}
- diagramSupport.refreshContent();
+ diagramBehavior.refreshContent();
return true;
}
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/GFDragConnectionTool.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/GFDragConnectionTool.java
index c14e507..d244903 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/GFDragConnectionTool.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/GFDragConnectionTool.java
@@ -24,7 +24,7 @@
import org.eclipse.gef.requests.CreateConnectionRequest;
import org.eclipse.gef.tools.ConnectionDragCreationTool;
import org.eclipse.graphiti.tb.ContextButtonEntry;
-import org.eclipse.graphiti.ui.editor.DiagramSupport;
+import org.eclipse.graphiti.ui.editor.DiagramBehavior;
import org.eclipse.graphiti.ui.internal.command.CreateConnectionCommand;
import org.eclipse.graphiti.ui.internal.requests.ContextButtonDragRequest;
@@ -60,8 +60,8 @@
@Override
protected boolean handleButtonUp(int button) {
boolean b = super.handleButtonUp(button);
- setViewer(diagramSupport.getDiagramContainer().getGraphicalViewer());
- diagramSupport.getEditDomain().setActiveTool(diagramSupport.getEditDomain().getDefaultTool());
+ setViewer(diagramBehavior.getDiagramContainer().getGraphicalViewer());
+ diagramBehavior.getEditDomain().setActiveTool(diagramBehavior.getEditDomain().getDefaultTool());
return b;
}
@@ -81,7 +81,7 @@
return request;
}
- private DiagramSupport diagramSupport;
+ private DiagramBehavior diagramBehavior;
private ContextButtonEntry contextButtonEntry;
@@ -95,10 +95,10 @@
* @param contextButtonEntry
* the context button entry
*/
- public void startConnection(EditPart targetEditPart, DiagramSupport diagramSupport,
+ public void startConnection(EditPart targetEditPart, DiagramBehavior diagramBehavior,
ContextButtonEntry contextButtonEntry) {
- this.diagramSupport = diagramSupport;
+ this.diagramBehavior = diagramBehavior;
this.contextButtonEntry = contextButtonEntry;
activate();
setConnectionSource(targetEditPart);
@@ -112,7 +112,7 @@
}
handleDrag();
- setViewer(diagramSupport.getDiagramContainer().getGraphicalViewer());
+ setViewer(diagramBehavior.getDiagramContainer().getGraphicalViewer());
unlockTargetEditPart();
}
@@ -128,11 +128,11 @@
* @param targetTargetEditPart
* the target target edit part
*/
- public void continueConnection(EditPart targetEditPart, DiagramSupport diagramSupport,
+ public void continueConnection(EditPart targetEditPart, DiagramBehavior diagramBehavior,
ContextButtonEntry contextButtonEntry,
EditPart targetTargetEditPart) {
- this.diagramSupport = diagramSupport;
+ this.diagramBehavior = diagramBehavior;
this.contextButtonEntry = contextButtonEntry;
activate();
setConnectionSource(targetEditPart);
@@ -148,7 +148,7 @@
}
handleDrag();
- setViewer(diagramSupport.getDiagramContainer().getGraphicalViewer());
+ setViewer(diagramBehavior.getDiagramContainer().getGraphicalViewer());
unlockTargetEditPart();
}
@@ -169,7 +169,7 @@
request.setType(getCommandName());
//
- Point absoluteMousePosition = diagramSupport.getMouseLocation();
+ Point absoluteMousePosition = diagramBehavior.getMouseLocation();
request.setLocation(absoluteMousePosition);
}
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/GFFigureCanvas.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/GFFigureCanvas.java
index 72e4758..b10d807 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/GFFigureCanvas.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/GFFigureCanvas.java
@@ -35,7 +35,7 @@
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.EditPart;
-import org.eclipse.graphiti.ui.editor.DiagramSupport;
+import org.eclipse.graphiti.ui.editor.DiagramBehavior;
import org.eclipse.graphiti.ui.internal.parts.DiagramEditPart;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
@@ -91,7 +91,7 @@
private final GFUpdateListener gfUpdateListener = new GFUpdateListener();
- private DiagramSupport diagramSupport = null;
+ private DiagramBehavior diagramBehavior = null;
private boolean init = true;
@@ -177,8 +177,8 @@
* @param diagramEditor
* the diagram editor
*/
- public GFFigureCanvas(Composite parent, DiagramSupport diagramSupport) {
- this(parent, SWT.DOUBLE_BUFFERED, new LightweightSystem(), diagramSupport);
+ public GFFigureCanvas(Composite parent, DiagramBehavior diagramBehavior) {
+ this(parent, SWT.DOUBLE_BUFFERED, new LightweightSystem(), diagramBehavior);
}
/**
@@ -192,8 +192,8 @@
* the diagram editor
* @since 3.1
*/
- public GFFigureCanvas(Composite parent, int style, DiagramSupport diagramSupport) {
- this(parent, style, new LightweightSystem(), diagramSupport);
+ public GFFigureCanvas(Composite parent, int style, DiagramBehavior diagramBehavior) {
+ this(parent, style, new LightweightSystem(), diagramBehavior);
}
/**
@@ -207,8 +207,8 @@
* @param diagramEditor
* the diagram editor
*/
- public GFFigureCanvas(Composite parent, LightweightSystem lws, DiagramSupport diagramSupport) {
- this(parent, SWT.DOUBLE_BUFFERED, lws, diagramSupport);
+ public GFFigureCanvas(Composite parent, LightweightSystem lws, DiagramBehavior diagramBehavior) {
+ this(parent, SWT.DOUBLE_BUFFERED, lws, diagramBehavior);
}
/**
@@ -224,12 +224,12 @@
* the diagram editor
* @since 3.1
*/
- public GFFigureCanvas(Composite parent, int style, LightweightSystem lws, DiagramSupport diagramSupport) {
+ public GFFigureCanvas(Composite parent, int style, LightweightSystem lws, DiagramBehavior diagramBehavior) {
super(parent, checkStyle(style | SWT.NO_REDRAW_RESIZE | SWT.NO_BACKGROUND | SWT.V_SCROLL | SWT.H_SCROLL));
getHorizontalBar().setVisible(false);
getVerticalBar().setVisible(false);
this.lws = lws;
- this.diagramSupport = diagramSupport;
+ this.diagramBehavior = diagramBehavior;
lws.setControl(this);
hook();
}
@@ -701,11 +701,11 @@
}
private double getZoomLevel() {
- return diagramSupport.getZoomLevel();
+ return diagramBehavior.getZoomLevel();
}
private Rectangle getDiagramBoundsFromDiagramEditPart() {
- EditPart ep = diagramSupport.getContentEditPart();
+ EditPart ep = diagramBehavior.getContentEditPart();
if (ep instanceof DiagramEditPart && ((DiagramEditPart) ep).getFigure().getChildren().size() > 0) {
return ((DiagramEditPart) ep).getFigure().getBounds();
} else {
@@ -714,7 +714,7 @@
}
public Rectangle getDiagramBoundsFromEditPartChildren() {
- EditPart ep = diagramSupport.getContentEditPart();
+ EditPart ep = diagramBehavior.getContentEditPart();
if (!(ep instanceof DiagramEditPart) || ((DiagramEditPart) ep).getFigure().getChildren().size() == 0) {
return new Rectangle();
}
@@ -953,7 +953,7 @@
// this.setBackgroundColor(ColorConstants.red);
// this.setOpaque(true);
/* <-- debug settings */
- EditPart ep = diagramSupport.getContentEditPart();
+ EditPart ep = diagramBehavior.getContentEditPart();
((DiagramEditPart) ep).getFigure().add(this);
}
@@ -974,7 +974,7 @@
* Removes the.
*/
protected void remove() {
- EditPart ep = diagramSupport.getContentEditPart();
+ EditPart ep = diagramBehavior.getContentEditPart();
IFigure diagram = ((DiagramEditPart) ep).getFigure();
diagram.getChildren().remove(this);
}
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/GFScrollingGraphicalViewer.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/GFScrollingGraphicalViewer.java
index 4876c1d..ce0470b 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/GFScrollingGraphicalViewer.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/GFScrollingGraphicalViewer.java
@@ -26,7 +26,7 @@
import org.eclipse.gef.EditPart;
import org.eclipse.gef.ExposeHelper;
import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.graphiti.ui.editor.DiagramSupport;
+import org.eclipse.graphiti.ui.editor.DiagramBehavior;
import org.eclipse.graphiti.ui.internal.fixed.FixedScalableRootEditPart;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
@@ -53,8 +53,8 @@
* @param diagramEditor
* the diagram editor
*/
- public GFScrollingGraphicalViewer(DiagramSupport diagramSupport) {
- super(diagramSupport);
+ public GFScrollingGraphicalViewer(DiagramBehavior diagramBehavior) {
+ super(diagramBehavior);
}
/**
@@ -73,7 +73,7 @@
* @return the control
*/
public final Control createGFControl(Composite parent) {
- GFFigureCanvas canvas = new GFFigureCanvas(parent, getLightweightSystem(), getDiagramSupport());
+ GFFigureCanvas canvas = new GFFigureCanvas(parent, getLightweightSystem(), getDiagramBehavior());
canvas.setData(new String("name"), canvas.getClass().toString()); //$NON-NLS-1$
setControl(canvas);
installRootFigure();
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/GraphitiScrollingGraphicalViewer.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/GraphitiScrollingGraphicalViewer.java
index e2958b0..d39aaef 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/GraphitiScrollingGraphicalViewer.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/GraphitiScrollingGraphicalViewer.java
@@ -24,22 +24,22 @@
import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer;
import org.eclipse.graphiti.mm.pictograms.Connection;
import org.eclipse.graphiti.tb.IToolBehaviorProvider;
-import org.eclipse.graphiti.ui.editor.DiagramSupport;
+import org.eclipse.graphiti.ui.editor.DiagramBehavior;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
public class GraphitiScrollingGraphicalViewer extends ScrollingGraphicalViewer {
- private DiagramSupport diagramSupport;
+ private DiagramBehavior diagramBehavior;
- public GraphitiScrollingGraphicalViewer(DiagramSupport diagramSupport) {
- this.setDiagramSupport(diagramSupport);
+ public GraphitiScrollingGraphicalViewer(DiagramBehavior diagramBehavior) {
+ this.setDiagramBehavior(diagramBehavior);
}
@Override
public void select(EditPart editpart) {
- IToolBehaviorProvider tbp = getDiagramSupport().getDiagramTypeProvider().getCurrentToolBehaviorProvider();
+ IToolBehaviorProvider tbp = getDiagramBehavior().getDiagramTypeProvider().getCurrentToolBehaviorProvider();
boolean connectionPossible = tbp.isConnectionSelectionEnabled();
if (connectionPossible) {
@@ -56,7 +56,7 @@
@Override
public void setSelection(ISelection newSelection) {
- IToolBehaviorProvider tbp = getDiagramSupport().getDiagramTypeProvider().getCurrentToolBehaviorProvider();
+ IToolBehaviorProvider tbp = getDiagramBehavior().getDiagramTypeProvider().getCurrentToolBehaviorProvider();
boolean multiPossible = tbp.isMultiSelectionEnabled();
boolean connectionPossible = tbp.isConnectionSelectionEnabled();
@@ -130,7 +130,7 @@
@Override
public void appendSelection(EditPart editpart) {
- IToolBehaviorProvider tbp = getDiagramSupport().getDiagramTypeProvider().getCurrentToolBehaviorProvider();
+ IToolBehaviorProvider tbp = getDiagramBehavior().getDiagramTypeProvider().getCurrentToolBehaviorProvider();
boolean multiPossible = tbp.isMultiSelectionEnabled();
boolean connectionPossible = tbp.isConnectionSelectionEnabled();
@@ -171,11 +171,11 @@
}
}
- private void setDiagramSupport(DiagramSupport diagramSupport) {
- this.diagramSupport = diagramSupport;
+ private void setDiagramBehavior(DiagramBehavior diagramBehavior) {
+ this.diagramBehavior = diagramBehavior;
}
- protected DiagramSupport getDiagramSupport() {
- return diagramSupport;
+ protected DiagramBehavior getDiagramBehavior() {
+ return diagramBehavior;
}
}
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/parts/ConnectionEditPart.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/parts/ConnectionEditPart.java
index 9056a79..694ca5d 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/parts/ConnectionEditPart.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/parts/ConnectionEditPart.java
@@ -40,7 +40,7 @@
import org.eclipse.graphiti.mm.pictograms.Connection;
import org.eclipse.graphiti.mm.pictograms.PictogramElement;
import org.eclipse.graphiti.tb.IToolBehaviorProvider;
-import org.eclipse.graphiti.ui.editor.DiagramSupport;
+import org.eclipse.graphiti.ui.editor.DiagramBehavior;
import org.eclipse.graphiti.ui.internal.command.GefCommandWrapper;
import org.eclipse.graphiti.ui.internal.config.IConfigurationProviderInternal;
import org.eclipse.graphiti.ui.platform.GraphitiConnectionEditPart;
@@ -266,9 +266,9 @@
if (doubleClickFeature != null && doubleClickFeature.canExecute(dcc)) {
GenericFeatureCommandWithContext commandWithContext = new GenericFeatureCommandWithContext(doubleClickFeature, dcc);
- DiagramSupport diagramSupport = getConfigurationProvider().getDiagramSupport();
- CommandStack commandStack = diagramSupport.getEditDomain().getCommandStack();
- commandStack.execute(new GefCommandWrapper(commandWithContext, diagramSupport.getEditingDomain()));
+ DiagramBehavior diagramBehavior = getConfigurationProvider().getDiagramBehavior();
+ CommandStack commandStack = diagramBehavior.getEditDomain().getCommandStack();
+ commandStack.execute(new GefCommandWrapper(commandWithContext, diagramBehavior.getEditingDomain()));
}
}
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/parts/DiagramEditPart.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/parts/DiagramEditPart.java
index 2eeb0de..71a0363 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/parts/DiagramEditPart.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/parts/DiagramEditPart.java
@@ -40,7 +40,7 @@
import org.eclipse.graphiti.mm.pictograms.Diagram;
import org.eclipse.graphiti.mm.pictograms.PictogramElement;
import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.ui.editor.DiagramSupport;
+import org.eclipse.graphiti.ui.editor.DiagramBehavior;
import org.eclipse.graphiti.ui.internal.config.IConfigurationProviderInternal;
import org.eclipse.graphiti.ui.internal.util.DataTypeTransformation;
import org.eclipse.swt.SWT;
@@ -182,8 +182,8 @@
*/
@Override
public void refresh() {
- DiagramSupport diagramSupport = getConfigurationProvider().getDiagramSupport();
- diagramSupport.getRefreshBehavior().initRefresh();
+ DiagramBehavior diagramBehavior = getConfigurationProvider().getDiagramBehavior();
+ diagramBehavior.getRefreshBehavior().initRefresh();
super.refresh();
}
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/parts/PictogramElementDelegate.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/parts/PictogramElementDelegate.java
index f4c5739..7626380 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/parts/PictogramElementDelegate.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/parts/PictogramElementDelegate.java
@@ -107,7 +107,7 @@
import org.eclipse.graphiti.tb.IImageDecorator;
import org.eclipse.graphiti.tb.IToolBehaviorProvider;
import org.eclipse.graphiti.ui.editor.DefaultRefreshBehavior;
-import org.eclipse.graphiti.ui.editor.DiagramSupport;
+import org.eclipse.graphiti.ui.editor.DiagramBehavior;
import org.eclipse.graphiti.ui.internal.IResourceRegistry;
import org.eclipse.graphiti.ui.internal.config.IConfigurationProviderInternal;
import org.eclipse.graphiti.ui.internal.figures.DecoratorImageFigure;
@@ -206,7 +206,7 @@
public IFigure createFigure() {
PictogramElement pe = getPictogramElement();
IFigure ret = createFigureForPictogramElement(pe);
- if (getDiagramSupport().getRefreshBehavior().isMultipleRefreshSupressionActive()) {
+ if (getDiagramBehavior().getRefreshBehavior().isMultipleRefreshSupressionActive()) {
return ret;
} else {
refreshFigureForPictogramElement(pe);
@@ -326,7 +326,7 @@
public void refreshFigureForEditPart() {
// DR: Avoid multiple refresh of the same edit part
- DefaultRefreshBehavior refreshBehavior = getDiagramSupport().getRefreshBehavior();
+ DefaultRefreshBehavior refreshBehavior = getDiagramBehavior().getRefreshBehavior();
if (!isForceRefresh() && refreshBehavior.isMultipleRefreshSupressionActive()) {
if (!refreshBehavior.shouldRefresh(getContainerEditPart())) {
return;
@@ -448,7 +448,7 @@
return;
}
- DefaultRefreshBehavior refreshBehavior = getDiagramSupport().getRefreshBehavior();
+ DefaultRefreshBehavior refreshBehavior = getDiagramBehavior().getRefreshBehavior();
if (!isForceRefresh() && refreshBehavior.isMultipleRefreshSupressionActive()) {
if (!refreshBehavior.shouldRefresh(graphicsAlgorithm)) {
return;
@@ -1174,7 +1174,7 @@
private void refreshFigureForPictogramElement(PictogramElement pe) {
if (pe != null) {
- DefaultRefreshBehavior refreshBehavior = getDiagramSupport().getRefreshBehavior();
+ DefaultRefreshBehavior refreshBehavior = getDiagramBehavior().getRefreshBehavior();
if (!isForceRefresh() && refreshBehavior.isMultipleRefreshSupressionActive()) {
if (!refreshBehavior.shouldRefresh(pe)) {
return;
@@ -1531,8 +1531,8 @@
return forceRefresh;
}
- private DiagramSupport getDiagramSupport() {
- return getConfigurationProvider().getDiagramSupport();
+ private DiagramBehavior getDiagramBehavior() {
+ return getConfigurationProvider().getDiagramBehavior();
}
protected void addDecorators(final GraphicsAlgorithm graphicsAlgorithm, final PictogramElement pe,
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/parts/ShapeEditPart.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/parts/ShapeEditPart.java
index 6363380..39cc4d5 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/parts/ShapeEditPart.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/parts/ShapeEditPart.java
@@ -73,7 +73,7 @@
import org.eclipse.graphiti.mm.pictograms.Shape;
import org.eclipse.graphiti.services.Graphiti;
import org.eclipse.graphiti.tb.IToolBehaviorProvider;
-import org.eclipse.graphiti.ui.editor.DiagramSupport;
+import org.eclipse.graphiti.ui.editor.DiagramBehavior;
import org.eclipse.graphiti.ui.internal.command.GefCommandWrapper;
import org.eclipse.graphiti.ui.internal.config.IConfigurationProviderInternal;
import org.eclipse.graphiti.ui.internal.contextbuttons.IContextButtonManager;
@@ -538,10 +538,10 @@
if (singleClickFeature != null && singleClickFeature.canExecute(scc)) {
GenericFeatureCommandWithContext commandWithContext = new GenericFeatureCommandWithContext(
singleClickFeature, scc);
- DiagramSupport diagramSupport = getConfigurationProvider().getDiagramSupport();
- CommandStack commandStack = diagramSupport.getEditDomain().getCommandStack();
+ DiagramBehavior diagramBehavior = getConfigurationProvider().getDiagramBehavior();
+ CommandStack commandStack = diagramBehavior.getEditDomain().getCommandStack();
commandStack
-.execute(new GefCommandWrapper(commandWithContext, diagramSupport
+.execute(new GefCommandWrapper(commandWithContext, diagramBehavior
.getEditingDomain()));
}
}
@@ -560,9 +560,9 @@
if (doubleClickFeature != null && doubleClickFeature.canExecute(dcc)) {
GenericFeatureCommandWithContext commandWithContext = new GenericFeatureCommandWithContext(
doubleClickFeature, dcc);
- DiagramSupport diagramSupport = getConfigurationProvider().getDiagramSupport();
- CommandStack commandStack = diagramSupport.getEditDomain().getCommandStack();
- commandStack.execute(new GefCommandWrapper(commandWithContext, diagramSupport.getEditingDomain()));
+ DiagramBehavior diagramBehavior = getConfigurationProvider().getDiagramBehavior();
+ CommandStack commandStack = diagramBehavior.getEditDomain().getCommandStack();
+ commandStack.execute(new GefCommandWrapper(commandWithContext, diagramBehavior.getEditingDomain()));
}
}
@@ -580,7 +580,7 @@
@Override
public void refresh() {
- if (getConfigurationProvider().getDiagramSupport().isAlive()) {
+ if (getConfigurationProvider().getDiagramBehavior().isAlive()) {
long start = System.currentTimeMillis();
super.refresh();
@@ -718,7 +718,7 @@
directEditManager.setDirectEditingContext(directEditingContext);
directEditManager.show();
- getConfigurationProvider().getDiagramSupport().setPictogramElementForSelection(getPictogramElement());
+ getConfigurationProvider().getDiagramBehavior().setPictogramElementForSelection(getPictogramElement());
}
private Anchor getChopboxAnchor(AnchorContainer anchorContainer) {
@@ -734,20 +734,20 @@
}
private Point getRelativeMouseLocation() {
- DiagramSupport diagramSupport = getConfigurationProvider().getDiagramSupport();
+ DiagramBehavior diagramBehavior = getConfigurationProvider().getDiagramBehavior();
// get current mouse location from the viewer
- Point mouseLocation = new Point(diagramSupport.getMouseLocation());
+ Point mouseLocation = new Point(diagramBehavior.getMouseLocation());
// calculate location in pictogram model in dependence from scroll and
// zoom
- mouseLocation = diagramSupport.calculateRealMouseLocation(mouseLocation);
+ mouseLocation = diagramBehavior.calculateRealMouseLocation(mouseLocation);
Rectangle bounds = getFigure().getBounds().getCopy();
// set bounds location in dependence from scroll and zoom
// bounds dimension is not of interest
- bounds.setLocation(diagramSupport.calculateRealMouseLocation(bounds.getLocation()));
+ bounds.setLocation(diagramBehavior.calculateRealMouseLocation(bounds.getLocation()));
// get bounds in dependence to the main figure
// this method also considers sroll and zoom
@@ -774,7 +774,7 @@
.getDiagramTypeProvider()
.getCurrentToolBehaviorProvider()
.getSelection(getPictogramElement(),
- configurationProvider.getDiagramSupport().getSelectedPictogramElements());
+ configurationProvider.getDiagramBehavior().getSelectedPictogramElements());
if (alternativeSelection != null && request instanceof SelectionRequest) {
Object object = configurationProvider.getDiagramEditor().getGraphicalViewer().getEditPartRegistry()
.get(alternativeSelection);
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/parts/directedit/GFDirectEditManager.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/parts/directedit/GFDirectEditManager.java
index 7114e82..5943688 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/parts/directedit/GFDirectEditManager.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/parts/directedit/GFDirectEditManager.java
@@ -30,7 +30,7 @@
import org.eclipse.graphiti.func.IDirectEditing;
import org.eclipse.graphiti.func.IProposal;
import org.eclipse.graphiti.func.Proposal;
-import org.eclipse.graphiti.ui.editor.DiagramSupport;
+import org.eclipse.graphiti.ui.editor.DiagramBehavior;
import org.eclipse.graphiti.ui.internal.figures.GFMultilineText;
import org.eclipse.graphiti.ui.internal.figures.GFText;
import org.eclipse.graphiti.ui.internal.parts.ShapeEditPart;
@@ -65,7 +65,7 @@
private IDirectEditingFeature directEditingFeature;
- private DiagramSupport diagramSupport;
+ private DiagramBehavior diagramBehavior;
private Font cellEditorFont = null;
@@ -85,7 +85,7 @@
public GFDirectEditManager(ShapeEditPart part, TextCellLocator cellEditorLocator) {
super(part, null, cellEditorLocator);
- diagramSupport = part.getConfigurationProvider().getDiagramSupport();
+ diagramBehavior = part.getConfigurationProvider().getDiagramBehavior();
}
public IDirectEditingContext getDirectEditingContext() {
@@ -299,7 +299,7 @@
mt.setSuppressText(false);
}
- diagramSupport.setDirectEditingActive(false);
+ diagramBehavior.setDirectEditingActive(false);
ZoomManager zoomMgr = (ZoomManager) getEditPart().getViewer().getProperty(ZoomManager.class.toString());
if (zoomMgr != null) {
@@ -316,7 +316,7 @@
actionBars = null;
}
- if (diagramSupport.isAlive()) {
+ if (diagramBehavior.isAlive()) {
super.bringDown();
disposeCellEditorFont();
GraphitiUiInternal.getWorkbenchService().getActiveStatusLineManager().setErrorMessage(null);
@@ -333,7 +333,7 @@
mt.setSuppressText(true);
}
- diagramSupport.setDirectEditingActive(true);
+ diagramBehavior.setDirectEditingActive(true);
// this is a bugfix
// celleditor not shown initially when figure has insets
// or mouse is not directly over control
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/policy/ConnectionBendpointEditPolicy.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/policy/ConnectionBendpointEditPolicy.java
index 4cccd6e..2869704 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/policy/ConnectionBendpointEditPolicy.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/policy/ConnectionBendpointEditPolicy.java
@@ -93,7 +93,7 @@
IAddBendpointFeature addBendpointFeature = getFeatureProvider().getAddBendpointFeature(context);
if (addBendpointFeature != null) {
ret = new GefCommandWrapper(new GenericFeatureCommandWithContext(addBendpointFeature, context),
- getConfigurationProvider().getDiagramSupport().getEditingDomain());
+ getConfigurationProvider().getDiagramBehavior().getEditingDomain());
}
}
// workaround: no snapping to original position
@@ -115,7 +115,7 @@
IRemoveBendpointFeature removeBendpointFeature = getFeatureProvider().getRemoveBendpointFeature(context);
if (removeBendpointFeature != null) {
ret = new GefCommandWrapper(new GenericFeatureCommandWithContext(removeBendpointFeature, context),
- getConfigurationProvider().getDiagramSupport().getEditingDomain());
+ getConfigurationProvider().getDiagramBehavior().getEditingDomain());
}
}
@@ -153,7 +153,7 @@
IMoveBendpointFeature moveBendpointFeature = getFeatureProvider().getMoveBendpointFeature(context);
if (moveBendpointFeature != null) {
ret = new GefCommandWrapper(new GenericFeatureCommandWithContext(moveBendpointFeature, context),
- getConfigurationProvider().getDiagramSupport().getEditingDomain());
+ getConfigurationProvider().getDiagramBehavior().getEditingDomain());
}
}
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/policy/DefaultConnectionEditPolicy.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/policy/DefaultConnectionEditPolicy.java
index eedd8df..7b8b950 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/policy/DefaultConnectionEditPolicy.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/policy/DefaultConnectionEditPolicy.java
@@ -119,7 +119,7 @@
IMoveShapeFeature layoutShapeFeature = featureProvider.getMoveShapeFeature(context);
if (layoutShapeFeature != null) {
result = new GefCommandWrapper(new MoveShapeFeatureCommandWithContext(layoutShapeFeature, context),
- getConfigurationProvider().getDiagramSupport().getEditingDomain());
+ getConfigurationProvider().getDiagramBehavior().getEditingDomain());
}
}
@@ -242,7 +242,7 @@
GenericFeatureCommandWithContext command = new GenericFeatureCommandWithContext(feature, context);
- return new GefCommandWrapper(command, getConfigurationProvider().getDiagramSupport().getEditingDomain());
+ return new GefCommandWrapper(command, getConfigurationProvider().getDiagramBehavior().getEditingDomain());
}
/**
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/policy/GFNodeEditPolicy.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/policy/GFNodeEditPolicy.java
index af07884..b117ce4 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/policy/GFNodeEditPolicy.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/policy/GFNodeEditPolicy.java
@@ -80,7 +80,7 @@
IFigure hostFigure = getHostFigure();
PolylineConnection c = new DummyPolylineConnection(hostFigure);
- c.setLineWidth((int) (2 * configurationProvider.getDiagramSupport().getZoomLevel()));
+ c.setLineWidth((int) (2 * configurationProvider.getDiagramBehavior().getZoomLevel()));
c.setForegroundColor(GFColorConstants.HANDLE_BG);
c.setLineStyle(SWT.LINE_DASH);
return c;
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/policy/ModelObjectDeleteEditPolicy.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/policy/ModelObjectDeleteEditPolicy.java
index a7b110b..5e1506a 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/policy/ModelObjectDeleteEditPolicy.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/policy/ModelObjectDeleteEditPolicy.java
@@ -83,7 +83,7 @@
GenericFeatureCommandWithContext command = new GenericFeatureCommandWithContext(feature, context);
- return new GefCommandWrapper(command, getConfigurationProvider().getDiagramSupport().getEditingDomain());
+ return new GefCommandWrapper(command, getConfigurationProvider().getDiagramBehavior().getEditingDomain());
}
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/policy/ShapeContainerAndXYLayoutEditPolicy.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/policy/ShapeContainerAndXYLayoutEditPolicy.java
index 68eb593..ea70f2b 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/policy/ShapeContainerAndXYLayoutEditPolicy.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/policy/ShapeContainerAndXYLayoutEditPolicy.java
@@ -59,7 +59,7 @@
IMoveShapeFeature layoutShapeFeature = featureProvider.getMoveShapeFeature(context);
if (layoutShapeFeature != null) {
result = new GefCommandWrapper(new MoveShapeFeatureCommandWithContext(layoutShapeFeature, context),
- getConfigurationProvider().getDiagramSupport().getEditingDomain());
+ getConfigurationProvider().getDiagramBehavior().getEditingDomain());
}
}
}
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/policy/ShapeXYLayoutEditPolicy.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/policy/ShapeXYLayoutEditPolicy.java
index f4ecea6..ad3e603 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/policy/ShapeXYLayoutEditPolicy.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/policy/ShapeXYLayoutEditPolicy.java
@@ -77,7 +77,7 @@
import org.eclipse.graphiti.mm.pictograms.PictogramElement;
import org.eclipse.graphiti.mm.pictograms.Shape;
import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.ui.editor.DiagramSupport;
+import org.eclipse.graphiti.ui.editor.DiagramBehavior;
import org.eclipse.graphiti.ui.internal.command.AddModelObjectCommand;
import org.eclipse.graphiti.ui.internal.command.CreateModelObjectCommand;
import org.eclipse.graphiti.ui.internal.command.GefCommandWrapper;
@@ -136,7 +136,7 @@
rectangle.x, rectangle.y);
if (cmd != null) {
IConfigurationProvider configurationProvider = getConfigurationProvider();
- return new GefCommandWrapper(cmd, configurationProvider.getDiagramSupport().getEditingDomain());
+ return new GefCommandWrapper(cmd, configurationProvider.getDiagramBehavior().getEditingDomain());
}
}
return null;
@@ -281,8 +281,8 @@
IContextButtonManager contextButtonManager = getConfigurationProvider().getContextButtonManager();
contextButtonManager.hideContextButtonsInstantly();
- DiagramSupport diagramSupport = getConfigurationProvider().getDiagramSupport();
- return new GefCommandWrapper(ret, diagramSupport.getEditingDomain());
+ DiagramBehavior diagramBehavior = getConfigurationProvider().getDiagramBehavior();
+ return new GefCommandWrapper(ret, diagramBehavior.getEditingDomain());
} else {
return null;
}
@@ -492,7 +492,7 @@
* not in the selection of moved objects
*/
boolean isExecuteAllowed = true;
- PictogramElement[] selectedPictogramElements = getConfigurationProvider().getDiagramSupport()
+ PictogramElement[] selectedPictogramElements = getConfigurationProvider().getDiagramBehavior()
.getSelectedPictogramElements();
List<PictogramElement> pes = Arrays.asList(selectedPictogramElements);
if (pes.size() > 1) {
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/platform/IConfigurationProvider.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/platform/IConfigurationProvider.java
index 7aa0a35..1b5985f 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/platform/IConfigurationProvider.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/platform/IConfigurationProvider.java
@@ -20,7 +20,7 @@
import org.eclipse.graphiti.dt.IDiagramTypeProvider;
import org.eclipse.graphiti.features.IFeatureProviderHolder;
import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.ui.editor.DiagramSupport;
+import org.eclipse.graphiti.ui.editor.DiagramBehavior;
import org.eclipse.graphiti.ui.editor.IDiagramContainerUI;
import org.eclipse.ui.IWorkbenchPart;
@@ -108,5 +108,10 @@
*/
public IDiagramContainerUI getDiagramContainer();
- public DiagramSupport getDiagramSupport();
+ /**
+ * Returns the associated behavior object.
+ *
+ * @return The associated instance of {@link DiagramBehavior}.
+ */
+ public DiagramBehavior getDiagramBehavior();
}
diff --git a/plugins/org.eclipse.graphiti/src/org/eclipse/graphiti/dt/AbstractDiagramTypeProvider.java b/plugins/org.eclipse.graphiti/src/org/eclipse/graphiti/dt/AbstractDiagramTypeProvider.java
index f746531..99b6370 100644
--- a/plugins/org.eclipse.graphiti/src/org/eclipse/graphiti/dt/AbstractDiagramTypeProvider.java
+++ b/plugins/org.eclipse.graphiti/src/org/eclipse/graphiti/dt/AbstractDiagramTypeProvider.java
@@ -150,7 +150,7 @@
public void init(Diagram diagram, IDiagramEditor diagramEditor) {
setDiagram(diagram);
GraphitiInternal.getEmfService().wireDTPToDiagram(diagram, this);
- setDiagramBehavior(((IDiagramContainer) diagramEditor).getDiagramSupport());
+ setDiagramBehavior(((IDiagramContainer) diagramEditor).getDiagramBehavior());
}
/**
@@ -236,4 +236,4 @@
public void resourcesSaved(Diagram diagram, Resource[] savedResources) {
}
-}
\ No newline at end of file
+}
diff --git a/plugins/org.eclipse.graphiti/src/org/eclipse/graphiti/platform/IDiagramContainer.java b/plugins/org.eclipse.graphiti/src/org/eclipse/graphiti/platform/IDiagramContainer.java
index 34727f8..c3d138c 100644
--- a/plugins/org.eclipse.graphiti/src/org/eclipse/graphiti/platform/IDiagramContainer.java
+++ b/plugins/org.eclipse.graphiti/src/org/eclipse/graphiti/platform/IDiagramContainer.java
@@ -151,5 +151,5 @@
*
* @return The associated instance of {@link IDiagramBehavior}.
*/
- public IDiagramBehavior getDiagramSupport();
+ public IDiagramBehavior getDiagramBehavior();
}
diff --git a/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/pageobjects/PoDiagramEditor.java b/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/pageobjects/PoDiagramEditor.java
index 3b1e1c8..cb54350 100644
--- a/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/pageobjects/PoDiagramEditor.java
+++ b/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/pageobjects/PoDiagramEditor.java
@@ -51,7 +51,7 @@
public void dirtify() {
final IDiagramContainerUI diagramEditor = getActiveDiagramEditor();
- AbstractGFTests.executeInRecordingCommandInUIThread(diagramEditor.getDiagramSupport(), new Runnable() {
+ AbstractGFTests.executeInRecordingCommandInUIThread(diagramEditor.getDiagramBehavior(), new Runnable() {
public void run() {
ContainerShape cs1 = Graphiti.getPeService()
.createContainerShape(diagramEditor.getDiagramTypeProvider().getDiagram(), true);
diff --git a/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/AbstractGFTests.java b/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/AbstractGFTests.java
index 1b2035f..39b3b66 100644
--- a/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/AbstractGFTests.java
+++ b/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/AbstractGFTests.java
@@ -455,7 +455,7 @@
IConfigurationProvider configurationProviderMock = createNiceMock(IConfigurationProviderInternal.class);
expect(configurationProviderMock.getDiagramTypeProvider()).andReturn(dtp).anyTimes();
expect(configurationProviderMock.getDiagramEditor()).andReturn(ed).anyTimes();
- expect(configurationProviderMock.getDiagramSupport()).andReturn(ed.getDiagramSupport()).anyTimes();
+ expect(configurationProviderMock.getDiagramBehavior()).andReturn(ed.getDiagramBehavior()).anyTimes();
replay(configurationProviderMock);
return configurationProviderMock;
}
diff --git a/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/GFInteractionComponentTests.java b/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/GFInteractionComponentTests.java
index 87b96c6..16d65cd 100644
--- a/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/GFInteractionComponentTests.java
+++ b/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/GFInteractionComponentTests.java
@@ -154,14 +154,14 @@
public void testLineSelectionWidth() throws Exception {
final IDiagramContainerUI diagramEditor = openDiagramEditor(ITestConstants.DIAGRAM_TYPE_ID_ECORE);
final ICreateService createService = Graphiti.getCreateService();
- executeInRecordingCommand(diagramEditor.getDiagramSupport(), new Runnable() {
+ executeInRecordingCommand(diagramEditor.getDiagramBehavior(), new Runnable() {
public void run() {
ContainerShape containerShape = createService.createContainerShape(diagramEditor
.getDiagramTypeProvider().getDiagram(), true);
createService.createPolyline(containerShape, new int[] { 0, 0, 10, 0 });
}
});
- diagramEditor.getDiagramSupport().refresh();
+ diagramEditor.getDiagramBehavior().refresh();
assertTrue(TestToolBehavior.lineSelectionWidthCalled);
page.getGefEditor().saveAndClose();
}
@@ -223,7 +223,7 @@
IDiagramTypeProvider diagramTypeProvider = diagramEditor.getDiagramTypeProvider();
final IFeatureProvider fp = diagramTypeProvider.getFeatureProvider();
final Diagram currentDiagram = diagramTypeProvider.getDiagram();
- executeInRecordingCommand(diagramEditor.getDiagramSupport(), new Runnable() {
+ executeInRecordingCommand(diagramEditor.getDiagramBehavior(), new Runnable() {
public void run() {
// add a class to the diagram
addClassToDiagram(fp, currentDiagram, x, y, SHAPE_NAME);
@@ -320,7 +320,7 @@
IDiagramTypeProvider diagramTypeProvider = diagramEditor.getDiagramTypeProvider();
final IFeatureProvider fp = diagramTypeProvider.getFeatureProvider();
final Diagram currentDiagram = diagramTypeProvider.getDiagram();
- executeInRecordingCommand(diagramEditor.getDiagramSupport(), new Runnable() {
+ executeInRecordingCommand(diagramEditor.getDiagramBehavior(), new Runnable() {
public void run() {
// add a class to the diagram
addClassToDiagram(fp, currentDiagram, x, y, SHAPE_NAME);
@@ -369,8 +369,8 @@
GraphicsAlgorithm containerShapeGa = pictogramElement.getGraphicsAlgorithm();
Rectangle rectangle = new Rectangle(containerShapeGa.getX(), containerShapeGa.getY(),
containerShapeGa.getWidth(), containerShapeGa.getHeight());
- org.eclipse.draw2d.geometry.Point mouseLocation = diagramEditor.getDiagramSupport()
- .calculateRealMouseLocation(diagramEditor.getDiagramSupport().getMouseLocation());
+ org.eclipse.draw2d.geometry.Point mouseLocation = diagramEditor.getDiagramBehavior()
+ .calculateRealMouseLocation(diagramEditor.getDiagramBehavior().getMouseLocation());
boolean mouseIsInsideShape = rectangle.contains(mouseLocation);
assertEquals(" Wrong mouse coordinates : ", true, mouseIsInsideShape);
break;
@@ -394,7 +394,7 @@
IDiagramTypeProvider diagramTypeProvider = diagramEditor.getDiagramTypeProvider();
final IFeatureProvider fp = diagramTypeProvider.getFeatureProvider();
final Diagram currentDiagram = diagramTypeProvider.getDiagram();
- executeInRecordingCommand(diagramEditor.getDiagramSupport(), new Runnable() {
+ executeInRecordingCommand(diagramEditor.getDiagramBehavior(), new Runnable() {
public void run() {
addClassToDiagram(fp, currentDiagram, x, y, SHAPE_NAME);
}
@@ -540,7 +540,7 @@
IDiagramTypeProvider diagramTypeProvider = diagramEditor.getDiagramTypeProvider();
final IFeatureProvider fp = diagramTypeProvider.getFeatureProvider();
final Diagram currentDiagram = diagramTypeProvider.getDiagram();
- executeInRecordingCommand(diagramEditor.getDiagramSupport(), new Runnable() {
+ executeInRecordingCommand(diagramEditor.getDiagramBehavior(), new Runnable() {
public void run() {
addClassToDiagram(fp, currentDiagram, x, y, SHAPE_NAME);
}
@@ -682,7 +682,7 @@
IDiagramTypeProvider diagramTypeProvider = diagramEditor.getDiagramTypeProvider();
final IFeatureProvider fp = diagramTypeProvider.getFeatureProvider();
final Diagram currentDiagram = diagramTypeProvider.getDiagram();
- executeInRecordingCommand(diagramEditor.getDiagramSupport(), new Runnable() {
+ executeInRecordingCommand(diagramEditor.getDiagramBehavior(), new Runnable() {
public void run() {
addClassToDiagram(fp, currentDiagram, x, y, SHAPE_NAME);
}
@@ -882,8 +882,8 @@
syncExec(new VoidResult() {
public void run() {
- diagramEditor.getDiagramSupport().getMouseLocation().x = 150;
- diagramEditor.getDiagramSupport().getMouseLocation().y = 150;
+ diagramEditor.getDiagramBehavior().getMouseLocation().x = 150;
+ diagramEditor.getDiagramBehavior().getMouseLocation().y = 150;
SWTBotGefEditPart ep = ed.getGefEditor().mainEditPart().children().get(0);
ep.activateDirectEdit();
}
@@ -928,8 +928,8 @@
syncExec(new VoidResult() {
public void run() {
- diagramEditor.getDiagramSupport().getMouseLocation().x = 150;
- diagramEditor.getDiagramSupport().getMouseLocation().y = 150;
+ diagramEditor.getDiagramBehavior().getMouseLocation().x = 150;
+ diagramEditor.getDiagramBehavior().getMouseLocation().y = 150;
SWTBotGefEditPart ep = ed.getGefEditor().mainEditPart().children().get(0);
ep.activateDirectEdit();
}
@@ -1228,7 +1228,7 @@
IDiagramTypeProvider diagramTypeProvider = diagramEditor.getDiagramTypeProvider();
final IFeatureProvider fp = diagramTypeProvider.getFeatureProvider();
final Diagram currentDiagram = diagramTypeProvider.getDiagram();
- executeInRecordingCommand(diagramEditor.getDiagramSupport(), new Runnable() {
+ executeInRecordingCommand(diagramEditor.getDiagramBehavior(), new Runnable() {
public void run() {
addClassToDiagram(fp, currentDiagram, x, y, SHAPE_NAME);
}
@@ -1345,7 +1345,7 @@
final CreateConnectionContext ccc = new CreateConnectionContext();
ccc.setSourceAnchor(sourceAnchor);
ccc.setTargetAnchor(targetAnchor);
- executeInRecordingCommand(diagramEditor.getDiagramSupport(), new Runnable() {
+ executeInRecordingCommand(diagramEditor.getDiagramBehavior(), new Runnable() {
public void run() {
for (ICreateConnectionFeature ccf : ccfs) {
if (ccf.canCreate(ccc)) {
@@ -1454,7 +1454,7 @@
final CreateConnectionContext ccc = new CreateConnectionContext();
ccc.setSourceAnchor(sourceAnchor);
ccc.setTargetAnchor(targetAnchor);
- executeInRecordingCommand(diagramEditor.getDiagramSupport(), new Runnable() {
+ executeInRecordingCommand(diagramEditor.getDiagramBehavior(), new Runnable() {
public void run() {
for (ICreateConnectionFeature ccf : ccfs) {
if (ccf.canCreate(ccc)) {
@@ -1525,7 +1525,7 @@
CustomContext context = new CustomContext(new PictogramElement[] { shape1 });
DisplayDecoratorFeature feature = new DisplayDecoratorFeature(fp, context,
DisplayDecoratorFeature.TYPE_IMAGE);
- diagramEditor.getDiagramSupport().executeFeature(feature, context);
+ diagramEditor.getDiagramBehavior().executeFeature(feature, context);
}
// Add border decorator to two
@@ -1533,7 +1533,7 @@
CustomContext context = new CustomContext(new PictogramElement[] { shape2 });
DisplayDecoratorFeature feature = new DisplayDecoratorFeature(fp, context,
DisplayDecoratorFeature.TYPE_BORDER);
- diagramEditor.getDiagramSupport().executeFeature(feature, context);
+ diagramEditor.getDiagramBehavior().executeFeature(feature, context);
}
// Add color decorator to three
@@ -1541,12 +1541,12 @@
CustomContext context = new CustomContext(new PictogramElement[] { shape3 });
DisplayDecoratorFeature feature = new DisplayDecoratorFeature(fp, context,
DisplayDecoratorFeature.TYPE_COLOR);
- diagramEditor.getDiagramSupport().executeFeature(feature, context);
+ diagramEditor.getDiagramBehavior().executeFeature(feature, context);
}
// Check if image is shown
{
- GraphicalEditPart shape1EditPart = diagramEditor.getDiagramSupport()
+ GraphicalEditPart shape1EditPart = diagramEditor.getDiagramBehavior()
.getEditPartForPictogramElement(shape1);
IPictogramElementDelegate delegate = ((ContainerShapeEditPart) shape1EditPart)
.getPictogramElementDelegate();
@@ -1567,7 +1567,7 @@
// Check if border is shown
{
- GraphicalEditPart shape2EditPart = diagramEditor.getDiagramSupport()
+ GraphicalEditPart shape2EditPart = diagramEditor.getDiagramBehavior()
.getEditPartForPictogramElement(shape2);
Color color = ((LineBorder) shape2EditPart.getFigure().getBorder()).getColor();
assertEquals(IColorConstant.ORANGE.getBlue(), color.getBlue());
@@ -1577,7 +1577,7 @@
// Check if color is shown
{
- GraphicalEditPart shape3EditPart = diagramEditor.getDiagramSupport()
+ GraphicalEditPart shape3EditPart = diagramEditor.getDiagramBehavior()
.getEditPartForPictogramElement(shape3);
Color foregroundColor = shape3EditPart.getFigure().getForegroundColor();
assertEquals(IColorConstant.DARK_GREEN.getBlue(), foregroundColor.getBlue());
@@ -1640,7 +1640,7 @@
final CreateConnectionContext ccc = new CreateConnectionContext();
ccc.setSourceAnchor(sourceAnchor);
ccc.setTargetAnchor(targetAnchor);
- executeInRecordingCommand(diagramEditor.getDiagramSupport(), new Runnable() {
+ executeInRecordingCommand(diagramEditor.getDiagramBehavior(), new Runnable() {
public void run() {
for (ICreateConnectionFeature ccf : ccfs) {
if (ccf.canCreate(ccc)) {
diff --git a/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/GFOtherTests.java b/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/GFOtherTests.java
index 21aceb2..5b0dbd4 100644
--- a/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/GFOtherTests.java
+++ b/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/GFOtherTests.java
@@ -179,7 +179,7 @@
final IDiagramTypeProvider diagramTypeProvider = diagramEditor.getDiagramTypeProvider();
final IFeatureProvider fp = diagramTypeProvider.getFeatureProvider();
final Diagram currentDiagram = diagramTypeProvider.getDiagram();
- executeInRecordingCommand(diagramEditor.getDiagramSupport(), new Runnable() {
+ executeInRecordingCommand(diagramEditor.getDiagramBehavior(), new Runnable() {
public void run() {
addClassesAndReferenceToDiagram(fp, currentDiagram, 100, 100, "Connection", 700, 200, "ConnectionDecorator");
}
@@ -195,7 +195,7 @@
final Shape shape = findShapeForEClass(currentDiagram, "Connection");
// waitForRefresh();
diagramEditor.selectPictogramElements(new PictogramElement[] { shape });
- executeInRecordingCommand(diagramEditor.getDiagramSupport(), new Runnable() {
+ executeInRecordingCommand(diagramEditor.getDiagramBehavior(), new Runnable() {
public void run() {
moveClassShape(fp, currentDiagram, 10, 30, "Connection");
removeClassShape(fp, currentDiagram, "ConnectionDecorator");
@@ -203,9 +203,9 @@
});
// Test refreshes
- diagramEditor.getDiagramSupport().refreshContent();
- diagramEditor.getDiagramSupport().refreshPalette();
- diagramEditor.getDiagramSupport().refreshRenderingDecorators(shape);
+ diagramEditor.getDiagramBehavior().refreshContent();
+ diagramEditor.getDiagramBehavior().refreshPalette();
+ diagramEditor.getDiagramBehavior().refreshRenderingDecorators(shape);
diagramEditor.refreshTitleToolTip();
}
@@ -234,7 +234,7 @@
final IDiagramTypeProvider diagramTypeProvider = diagramEditor.getDiagramTypeProvider();
final IFeatureProvider fp = diagramTypeProvider.getFeatureProvider();
final Diagram currentDiagram = diagramTypeProvider.getDiagram();
- executeInRecordingCommandInUIThread(diagramEditor.getDiagramSupport(), new Runnable() {
+ executeInRecordingCommandInUIThread(diagramEditor.getDiagramBehavior(), new Runnable() {
public void run() {
/*
* Reuse of functionality originally written to add classes for
@@ -263,7 +263,7 @@
if (bo instanceof EClass) {
final EClass eClass = (EClass) bo;
// Change the tooltip to something else and check it
- executeInRecordingCommandInUIThread(diagramEditor.getDiagramSupport(), new Runnable() {
+ executeInRecordingCommandInUIThread(diagramEditor.getDiagramBehavior(), new Runnable() {
public void run() {
eClass.setName("Changed");
Text text = (Text) tooltipShape.getChildren().get(1).getGraphicsAlgorithm();
@@ -293,7 +293,7 @@
bo = diagramTypeProvider.getFeatureProvider().getBusinessObjectForPictogramElement(tooltipShape3);
if (bo instanceof EClass) {
final EClass eClass = (EClass) bo;
- executeInRecordingCommandInUIThread(diagramEditor.getDiagramSupport(), new Runnable() {
+ executeInRecordingCommandInUIThread(diagramEditor.getDiagramBehavior(), new Runnable() {
public void run() {
// Change the tooltip to null and check it
eClass.setName(""); // Empty name means no tooltip
@@ -322,7 +322,7 @@
final Diagram diagram = diagramTypeProvider.getDiagram();
syncExec(new VoidResult() {
public void run() {
- executeInRecordingCommand(diagramEditor.getDiagramSupport(), new Runnable() {
+ executeInRecordingCommand(diagramEditor.getDiagramBehavior(), new Runnable() {
public void run() {
addClassToDiagram(fp, diagram, 500, 500, "Shape");
addClassToDiagram(fp, diagram, 100, 100, "ContainerShape");
@@ -333,7 +333,7 @@
});
// get UnDoStack
- TransactionalEditingDomain editingDomain = diagramEditor.getDiagramSupport().getEditingDomain();
+ TransactionalEditingDomain editingDomain = diagramEditor.getDiagramBehavior().getEditingDomain();
org.eclipse.emf.common.command.CommandStack cmdStack = editingDomain.getCommandStack();
// process "undo" until UnDoStack is empty
@@ -360,7 +360,7 @@
final IDiagramContainerUI diagramEditor = openDiagramEditor(ITestConstants.DIAGRAM_TYPE_ID_ECORE);
final IFeatureProvider fp = diagramEditor.getDiagramTypeProvider().getFeatureProvider();
final Diagram diagram = fp.getDiagramTypeProvider().getDiagram();
- executeInRecordingCommand(diagramEditor.getDiagramSupport(), new Runnable() {
+ executeInRecordingCommand(diagramEditor.getDiagramBehavior(), new Runnable() {
public void run() {
addClassToDiagram(fp, diagram, 500, 500, "Shape");
// enforce roll-back
@@ -1129,7 +1129,7 @@
final IFeatureProvider fp = diagramTypeProvider.getFeatureProvider();
final Diagram diagram = diagramEditor.getDiagramTypeProvider().getDiagram();
- executeInRecordingCommand(diagramEditor.getDiagramSupport(), new Runnable() {
+ executeInRecordingCommand(diagramEditor.getDiagramBehavior(), new Runnable() {
public void run() {
EClass eClass = createEClass(diagram, "Class1");
diff --git a/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/GFPackageTests.java b/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/GFPackageTests.java
index ad0eafd..4d88e95 100644
--- a/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/GFPackageTests.java
+++ b/tests/org.eclipse.graphiti.bot.tests/src/org/eclipse/graphiti/bot/tests/GFPackageTests.java
@@ -322,7 +322,7 @@
if (linkForPictogramElement != null) {
final EList<EObject> businessObject = linkForPictogramElement.getBusinessObjects();
if (businessObject != null && !businessObject.isEmpty()) {
- executeInRecordingCommandInUIThread(diagramEditor.getDiagramSupport(), new Runnable() {
+ executeInRecordingCommandInUIThread(diagramEditor.getDiagramBehavior(), new Runnable() {
public void run() {
businessObject.removeAll(businessObject);
}
@@ -411,7 +411,7 @@
IDiagramTypeProvider diagramTypeProvider = diagramEditor.getDiagramTypeProvider();
final IFeatureProvider fp = diagramTypeProvider.getFeatureProvider();
final Diagram currentDiagram = diagramTypeProvider.getDiagram();
- executeInRecordingCommand(diagramEditor.getDiagramSupport(), new Runnable() {
+ executeInRecordingCommand(diagramEditor.getDiagramBehavior(), new Runnable() {
public void run() {
addClassesAndReferenceToDiagram(fp, currentDiagram, -100, -100, "Connection", -700, -200,
"ConnectionDecorator");
@@ -525,7 +525,7 @@
IDiagramTypeProvider diagramTypeProvider = diagramEditor.getDiagramTypeProvider();
final IFeatureProvider fp = diagramTypeProvider.getFeatureProvider();
final Diagram currentDiagram = diagramTypeProvider.getDiagram();
- executeInRecordingCommandInUIThread(diagramEditor.getDiagramSupport(), new Runnable() {
+ executeInRecordingCommandInUIThread(diagramEditor.getDiagramBehavior(), new Runnable() {
public void run() {
addClassesAndReferenceToDiagram(fp, currentDiagram, -100, -100, "Connection", -700, -200,
"ConnectionDecorator");
diff --git a/tests/org.eclipse.graphiti.tests/src/org/eclipse/graphiti/tests/cases/FeatureParametersTest.java b/tests/org.eclipse.graphiti.tests/src/org/eclipse/graphiti/tests/cases/FeatureParametersTest.java
index 5092fa0..c3ed412 100644
--- a/tests/org.eclipse.graphiti.tests/src/org/eclipse/graphiti/tests/cases/FeatureParametersTest.java
+++ b/tests/org.eclipse.graphiti.tests/src/org/eclipse/graphiti/tests/cases/FeatureParametersTest.java
@@ -172,7 +172,7 @@
public void close() {
}
- public IDiagramBehavior getDiagramSupport() {
+ public IDiagramBehavior getDiagramBehavior() {
return diagramBehavior;
}
};