From 80b90c91196892f35d36eb77cf452e356673a592 Mon Sep 17 00:00:00 2001 From: Filip Reaboi <reaboi@fortiss.org> Date: Thu, 8 Feb 2018 14:55:54 +0000 Subject: [PATCH] refs 3240 --- ...nnectionCompositionDropTargetListener.java | 1 - .../ElementCompositionDropTargetListener.java | 1 - .../ViewerElementCompositionDropAdapter.java | 5 +- .../editor/AdvancedTreeViewerEditorBase.java | 209 ----------- .../base/ui/editor/TreeViewerEditorBase.java | 60 ---- .../ui/editpart/SubDiagramEditPartBase.java | 172 ---------- .../IAllocationPositionService.java | 1 - .../anchor/InsetChopBoxConnectionAnchor.java | 46 --- .../extension/base/ConnectorHandlerBase.java | 60 ---- .../ui/utils/AbstractNameEditingSupport.java | 98 ------ .../base/ui/utils/TableViewerUtils.java | 57 --- .../ui/editor/Graphical3DViewBase.java | 258 -------------- .../ui/objects/CompositeViewObject.java | 50 --- .../ui/objects/Object3DViewObject.java | 45 --- .../ui/objects/PickableObjectBase.java | 53 --- .../graphicsGL/ui/objects/RotatedObject.java | 56 --- .../graphicsGL/ui/objects/ScaledObject.java | 52 --- .../ui/objects/WrappedViewObjectBase.java | 48 --- ...onnectionCompositionDropTargetAdapter.java | 71 ---- .../ElementCompositionDropTargetAdapter.java | 70 ---- .../ContextMenuSubMenuContributorBase.java | 324 ------------------ .../ui/extension/base/EObjectActionBase.java | 6 - .../internal/MarkerServiceLabelDecorator.java | 59 ---- .../ElementWithURIPropertySection.java | 61 ---- .../extension/base/ElementCompositorBase.java | 64 ---- .../base/TutorialBlacklistAllProvider.java | 33 -- .../base/TutorialWhitelistAllProvider.java | 33 -- .../data/LogMessageWithException.java | 46 --- .../items/IntrospectionItemBase.java | 51 --- 29 files changed, 2 insertions(+), 2088 deletions(-) delete mode 100644 org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/AdvancedTreeViewerEditorBase.java delete mode 100644 org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/SubDiagramEditPartBase.java delete mode 100644 org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/anchor/InsetChopBoxConnectionAnchor.java delete mode 100644 org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/extension/base/ConnectorHandlerBase.java delete mode 100644 org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/utils/AbstractNameEditingSupport.java delete mode 100644 org.fortiss.tooling.graphicsGL.ui/trunk/src/org/fortiss/tooling/graphicsGL/ui/editor/Graphical3DViewBase.java delete mode 100644 org.fortiss.tooling.graphicsGL.ui/trunk/src/org/fortiss/tooling/graphicsGL/ui/objects/CompositeViewObject.java delete mode 100644 org.fortiss.tooling.graphicsGL.ui/trunk/src/org/fortiss/tooling/graphicsGL/ui/objects/Object3DViewObject.java delete mode 100644 org.fortiss.tooling.graphicsGL.ui/trunk/src/org/fortiss/tooling/graphicsGL/ui/objects/PickableObjectBase.java delete mode 100644 org.fortiss.tooling.graphicsGL.ui/trunk/src/org/fortiss/tooling/graphicsGL/ui/objects/RotatedObject.java delete mode 100644 org.fortiss.tooling.graphicsGL.ui/trunk/src/org/fortiss/tooling/graphicsGL/ui/objects/ScaledObject.java delete mode 100644 org.fortiss.tooling.graphicsGL.ui/trunk/src/org/fortiss/tooling/graphicsGL/ui/objects/WrappedViewObjectBase.java delete mode 100644 org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ConnectionCompositionDropTargetAdapter.java delete mode 100644 org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ElementCompositionDropTargetAdapter.java delete mode 100644 org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/extension/base/ContextMenuSubMenuContributorBase.java delete mode 100644 org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/MarkerServiceLabelDecorator.java delete mode 100644 org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/properties/ElementWithURIPropertySection.java delete mode 100644 org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/base/ElementCompositorBase.java delete mode 100644 org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/base/TutorialBlacklistAllProvider.java delete mode 100644 org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/base/TutorialWhitelistAllProvider.java delete mode 100644 org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/LogMessageWithException.java delete mode 100644 org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/introspection/items/IntrospectionItemBase.java diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/dnd/gef/ConnectionCompositionDropTargetListener.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/dnd/gef/ConnectionCompositionDropTargetListener.java index 1c4d504b4..7ac307a00 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/dnd/gef/ConnectionCompositionDropTargetListener.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/dnd/gef/ConnectionCompositionDropTargetListener.java @@ -23,7 +23,6 @@ import org.fortiss.tooling.base.ui.editpart.policy.RelayCreateCommandEditPolicyB import org.fortiss.tooling.base.ui.editpart.request.CreateConnectionCompositionRequest; import org.fortiss.tooling.kernel.service.IConnectionCompositorService; import org.fortiss.tooling.kernel.ui.dnd.CompositionServiceLocalDNDTransfer; -import org.fortiss.tooling.kernel.ui.dnd.ConnectionCompositionDropTargetAdapter; import org.fortiss.tooling.kernel.ui.dnd.ConnectionCompositionSource; /** diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/dnd/gef/ElementCompositionDropTargetListener.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/dnd/gef/ElementCompositionDropTargetListener.java index fcfbadb4e..0982ad4ed 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/dnd/gef/ElementCompositionDropTargetListener.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/dnd/gef/ElementCompositionDropTargetListener.java @@ -23,7 +23,6 @@ import org.fortiss.tooling.base.ui.editpart.policy.RelayCreateCommandEditPolicyB import org.fortiss.tooling.base.ui.editpart.request.CreateElementCompositionRequest; import org.fortiss.tooling.kernel.service.IElementCompositorService; import org.fortiss.tooling.kernel.ui.dnd.CompositionServiceLocalDNDTransfer; -import org.fortiss.tooling.kernel.ui.dnd.ElementCompositionDropTargetAdapter; import org.fortiss.tooling.kernel.ui.dnd.ElementCompositionSource; /** diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/dnd/jface/ViewerElementCompositionDropAdapter.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/dnd/jface/ViewerElementCompositionDropAdapter.java index 8f68e57be..1d90a20f7 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/dnd/jface/ViewerElementCompositionDropAdapter.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/dnd/jface/ViewerElementCompositionDropAdapter.java @@ -30,7 +30,6 @@ import org.eclipse.swt.dnd.Transfer; import org.eclipse.swt.dnd.TransferData; import org.fortiss.tooling.kernel.service.IElementCompositorService; import org.fortiss.tooling.kernel.ui.dnd.CompositionServiceLocalDNDTransfer; -import org.fortiss.tooling.kernel.ui.dnd.ElementCompositionDropTargetAdapter; import org.fortiss.tooling.kernel.ui.util.DragAndDropUtils; /** @@ -66,8 +65,8 @@ public class ViewerElementCompositionDropAdapter extends ViewerDropAdapter { extractDroppedEObject(CompositionServiceLocalDNDTransfer.getInstance() .getObject()); - return IElementCompositorService.getInstance() - .canCompose((EObject)lastTarget, dropped, null); + return IElementCompositorService.getInstance().canCompose((EObject)lastTarget, dropped, + null); } return false; } diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/AdvancedTreeViewerEditorBase.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/AdvancedTreeViewerEditorBase.java deleted file mode 100644 index e05c33abc..000000000 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/AdvancedTreeViewerEditorBase.java +++ /dev/null @@ -1,209 +0,0 @@ -/*-------------------------------------------------------------------------+ -| Copyright 2017 fortiss GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.tooling.base.ui.editor; - -import static org.eclipse.jface.viewers.AbstractTreeViewer.ALL_LEVELS; -import static org.eclipse.swt.SWT.NONE; -import static org.fortiss.tooling.kernel.ui.util.EObjectSelectionUtils.getEObjectElements; -import static org.fortiss.tooling.kernel.ui.util.EObjectSelectionUtils.getFirstElement; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.util.EContentAdapter; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.viewers.ColumnViewerToolTipSupport; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.KeyAdapter; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Menu; -import org.fortiss.tooling.base.ui.dnd.jface.ViewerElementCompositionDropAdapter; -import org.fortiss.tooling.kernel.ui.extension.base.EditorBase; -import org.fortiss.tooling.kernel.ui.extension.data.ContextMenuContextProvider; -import org.fortiss.tooling.kernel.ui.service.IActionService; -import org.fortiss.tooling.kernel.ui.service.IContextMenuService; - -/** - * Customization of {@link TreeViewerEditorBase} which provide keyboard shortcuts on the tree. - * - * @author aravantinos - */ -@Deprecated //ucd -public class AdvancedTreeViewerEditorBase<T extends EObject> extends EditorBase<T> implements - ContextMenuContextProvider { - - /** Stores the {@link TreeViewer}. */ - protected TreeViewer treeViewer; - - /** Menu manager for an element in tree viewer */ - protected MenuManager menuManager; - - /** The root composite for the editor controls. */ - protected Composite rootComposite; - - /** The adapter used for dealing with changes of the content. */ - protected final Adapter editedObjectChanged = new EContentAdapter() { - @Override - public void notifyChanged(Notification notification) { - // super.notifyChanged(notification); - if(notification.getEventType() != Notification.REMOVING_ADAPTER && - !treeViewer.getTree().isDisposed()) { - treeViewer.refresh(true); - } - } - }; - - /** {@inheritDoc} */ - @Override - public void createPartControl(Composite parent) { - rootComposite = new Composite(parent, NONE); - rootComposite.setLayout(new GridLayout(1, false)); - rootComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); - - treeViewer = createTreeViewer(rootComposite); - treeViewer.getTree().setHeaderVisible(true); - treeViewer.getTree().setLinesVisible(true); - treeViewer.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); - treeViewer.setAutoExpandLevel(ALL_LEVELS); - setupTreeViewer(treeViewer); - - ViewerElementCompositionDropAdapter dndAdapter = - new ViewerElementCompositionDropAdapter(treeViewer); - treeViewer.addDropSupport(dndAdapter.getSupportedDNDOperations(), - dndAdapter.getPreferredTransfers(), dndAdapter); - - setTreeViewerInput(); - - getEditorSite().setSelectionProvider(treeViewer); - - ColumnViewerToolTipSupport.enableFor(treeViewer); - - getEditorSite().setSelectionProvider(treeViewer); - } - - /** Sets the input and adapter for {@link #treeViewer}. */ - protected void setTreeViewerInput() { - treeViewer.setInput(editedObject); - editedObject.eAdapters().add(editedObjectChanged); - } - - /** - * Creates the {@link TreeViewer} instance. - * - * @param parent - * The parent, in which the {@link TreeViewer} is supposed to be embedded in. - * @return The new {@link TreeViewer}. - */ - protected TreeViewer createTreeViewer(Composite parent) { - return new TreeViewer(parent); - } - - /** {@inheritDoc} */ - @Override - public void dispose() { - editedObject.eAdapters().remove(editedObjectChanged); - super.dispose(); - } - - /** Returns the elements currently selected in the tree. */ - protected Collection<EObject> getTreeSelection() { - List<EObject> result = getEObjectElements(treeViewer.getSelection()); - if(result.isEmpty()) { - result.add(editedObject); - } - return result; - } - - /** {@inheritDoc} */ - @Override - public void setFocus() { - treeViewer.getTree().setFocus(); - } - - /** Returns treeViewer. */ - public TreeViewer getTreeViewer() { - return treeViewer; - } - - /** - * This method is used to configure the tree viewer, e.g. set the content - * provider, and the label provider. - */ - protected void setupTreeViewer(TreeViewer treeViewer) { - - menuManager = IContextMenuService.getInstance().createDefaultContextMenu(this); - - Menu contextMenu = menuManager.createContextMenu(treeViewer.getControl()); - - treeViewer.getControl().setMenu(contextMenu); - - getSite().registerContextMenu(menuManager, treeViewer); - - treeViewer.getControl().addKeyListener(new ViewerKeyAdapter()); - - treeViewer.expandAll(); - } - - /** Key adapter to deal with copy/paste/delete/... done through the keyboard. */ - private class ViewerKeyAdapter extends KeyAdapter { - /** Constructor. */ - public ViewerKeyAdapter() { - } - - /** {@inheritDoc} */ - @Override - public void keyReleased(KeyEvent e) { - if((e.stateMask & SWT.CTRL) != 0 && e.keyCode == 0x63) { - IActionService.getInstance().runGlobalCopyAction(); - } else if((e.stateMask & SWT.CTRL) != 0 && e.keyCode == 0x76) { - IActionService.getInstance().runGlobalPasteAction(); - } else if(e.keyCode == SWT.DEL) { - IActionService.getInstance().runGlobalDeleteAction(); - } else if((e.stateMask & SWT.CTRL) != 0 && e.keyCode == 0x78) { - IActionService.getInstance().runGlobalCutAction(); - } else if((e.stateMask & SWT.CTRL) != 0 && e.keyCode == 0x7A) { - IActionService.getInstance().runGlobalUndoAction(); - } else if((e.stateMask & SWT.CTRL) != 0 && e.keyCode == 0x79) { - IActionService.getInstance().runGlobalRedoAction(); - } - } - } - - /** {@inheritDoc} */ - @Override - public EObject getSelectedModelElement() { - if(getSite().getSelectionProvider() != null) { - return getFirstElement(getSite().getSelectionProvider().getSelection()); - } - return null; - } - - /** {@inheritDoc} */ - @Override - public List<EObject> getSelectedModelElementList() { - if(getSite().getSelectionProvider() != null) { - return getEObjectElements(getSite().getSelectionProvider().getSelection()); - } - return null; - } -} diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/TreeViewerEditorBase.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/TreeViewerEditorBase.java index e42ffd868..57835acf4 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/TreeViewerEditorBase.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/TreeViewerEditorBase.java @@ -15,7 +15,6 @@ +--------------------------------------------------------------------------*/ package org.fortiss.tooling.base.ui.editor; -import static org.eclipse.jface.viewers.AbstractTreeViewer.ALL_LEVELS; import static org.fortiss.tooling.kernel.ui.util.EObjectSelectionUtils.getEObjectElements; import java.util.Collection; @@ -25,16 +24,12 @@ import org.eclipse.emf.common.notify.Adapter; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.util.EContentAdapter; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.TreeViewer; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; import org.fortiss.tooling.base.ui.dnd.jface.ViewerElementCompositionDropAdapter; import org.fortiss.tooling.kernel.ui.extension.base.EditorBase; -import org.fortiss.tooling.kernel.ui.util.EObjectSelectionUtils; /** * An editor which only consists of a tree viewer. It uses {@link TreeViewer}, @@ -145,59 +140,4 @@ public abstract class TreeViewerEditorBase<T extends EObject> extends EditorBase return redraw; } - /** Expands the selected sub-tree in a {@link TreeViewerEditorBase}. */ - @Deprecated //ucd - public class ExpandSubTreeAction extends Action { - - /** Editor in which a sub-tree should be expanded by this action. */ - private TreeViewerEditorBase<?> editor; - - /** Constructor. */ - public ExpandSubTreeAction(TreeViewerEditorBase<?> editor) { - super("Expand"); - setToolTipText("Expands the selected (sub-tree)"); - this.editor = editor; - } - - /** {@inheritDoc} */ - @Override - public void run() { - ISelection selection = EObjectSelectionUtils.getCurrentSelection(); - - if(selection instanceof IStructuredSelection && !selection.isEmpty()) { - Object object = ((IStructuredSelection)selection).getFirstElement(); - if(object != null) { - editor.getTreeViewer().expandToLevel(object, ALL_LEVELS); - } - } - } - } - - /** Collapses the selected sub-tree in a {@link TreeViewerEditorBase}. */ - @Deprecated //ucd - public class CollapseSubTreeAction extends Action { - - /** Editor in which a sub-tree should be expanded by this action. */ - private TreeViewerEditorBase<?> editor; - - /** Constructor. */ - public CollapseSubTreeAction(TreeViewerEditorBase<?> editor) { - super("Collapse"); - setToolTipText("Collapses the selected (sub-tree)"); - this.editor = editor; - } - - /** {@inheritDoc} */ - @Override - public void run() { - ISelection selection = EObjectSelectionUtils.getCurrentSelection(); - - if(selection instanceof IStructuredSelection && !selection.isEmpty()) { - Object object = ((IStructuredSelection)selection).getFirstElement(); - if(object != null) { - editor.getTreeViewer().collapseToLevel(object, ALL_LEVELS); - } - } - } - } } diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/SubDiagramEditPartBase.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/SubDiagramEditPartBase.java deleted file mode 100644 index babd6e705..000000000 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/SubDiagramEditPartBase.java +++ /dev/null @@ -1,172 +0,0 @@ -/*-------------------------------------------------------------------------+ -| Copyright 2011 fortiss GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.tooling.base.ui.editpart; - -import static org.fortiss.tooling.base.layout.DefaultLayoutConstants.DEFAULT_GRID_SIZE; -import static org.fortiss.tooling.base.layout.DefaultLayoutConstants.DEFAULT_SHAPE_INSETS; -import static org.fortiss.tooling.base.ui.utils.LayoutDataUIUtils.getNodeBounds; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.draw2d.Figure; -import org.eclipse.draw2d.IFigure; -import org.eclipse.draw2d.Label; -import org.eclipse.draw2d.PositionConstants; -import org.eclipse.draw2d.TreeSearch; -import org.eclipse.draw2d.XYLayout; -import org.eclipse.draw2d.geometry.Insets; -import org.eclipse.draw2d.geometry.Rectangle; -import org.fortiss.tooling.base.layout.DefaultLayoutConstants; -import org.fortiss.tooling.base.model.layout.ILayoutedModelElement; -import org.fortiss.tooling.base.ui.editpart.figure.PrettyRoundedRectangle; -import org.fortiss.tooling.kernel.model.INamedCommentedElement; - -/** - * The base class for a (partial) diagram edit part, which is intended to be part of another - * diagram. - * - * @param <T> - * the type of the model element wrapped. - * - * @author mou - */ -@Deprecated //ucd -public abstract class SubDiagramEditPartBase<T extends ILayoutedModelElement & INamedCommentedElement> - extends ElementEditPartBase<T> { - - /** The label layer for internal labels. */ - private Figure labelFigureLayer; - - /** Constructor. */ - protected SubDiagramEditPartBase(T modelObject) { - super(modelObject); - } - - /** - * <p> - * {@inheritDoc} - * </p> - * <p> - * Returns the connectors as children. - * </p> - */ - @Override - protected List<?> getModelChildren() { - List<Object> result = new ArrayList<Object>(modelElementHandler.getSubnodes(getModel())); - result.addAll(modelElementHandler.getConnectors(getModel())); - return result; - } - - /** {@inheritDoc} */ - @Override - protected IFigure createBaseFigure() { - return new PrettyRoundedRectangle(0, new Insets( - DefaultLayoutConstants.DEFAULT_CONNECTOR_SIZE / 2 - 2)) { - /** {@inheritDoc} */ - @Override - protected boolean useLocalCoordinates() { - return true; - } - }; - } - - /** {@inheritDoc} */ - @Override - protected Rectangle determineBaseFigureBounds() { - Rectangle result = new Rectangle(); - for(Object o : getModelChildren()) { - if(o instanceof ILayoutedModelElement) { - Rectangle p = getLayoutedElementBounds((ILayoutedModelElement)o); - result.union(p); - } - } - result.resize(DEFAULT_GRID_SIZE, DEFAULT_GRID_SIZE); - return result; - } - - /** - * Determines the boundaries for a given {@link ILayoutedModelElement} in the context of this - * EditPart. - * - * @param layouted - * The {@link ILayoutedModelElement} to determine the boundaries for. - * @return {@link Rectangle} describing the boundaries. - */ - protected Rectangle getLayoutedElementBounds(ILayoutedModelElement layouted) { - return getNodeBounds(layouted); - } - - /** {@inheritDoc} */ - @Override - protected Rectangle determineLabelFigureBounds() { - Rectangle textBounds = labelFigure.getTextBounds(); - textBounds.y = DEFAULT_SHAPE_INSETS / 2; - textBounds.x = DEFAULT_SHAPE_INSETS; - textBounds.width = textBounds.width + 4 * DEFAULT_SHAPE_INSETS; - textBounds.height = textBounds.height * 2; - return textBounds; - } - - /** {@inheritDoc} */ - @Override - public Label createLabelFigure() { - Label label = super.createLabelFigure(); - label.setLabelAlignment(PositionConstants.LEFT); - return label; - } - - /** {@inheritDoc} */ - @Override - protected void registerLabelFigure(IFigure figure) { - if(labelFigureLayer == null) { - labelFigureLayer = new Figure() { - /** {@inheritDoc} */ - @Override - protected boolean useLocalCoordinates() { - return true; - } - - /** {@inheritDoc} */ - @Override - public IFigure findFigureAt(int x, int y, TreeSearch search) { - // transparent - return null; - } - - /** {@inheritDoc} */ - @Override - public boolean isOpaque() { - // transparent - return false; - } - }; - labelFigureLayer.setLayoutManager(new XYLayout()); - super.registerLabelFigure(labelFigureLayer); - } - labelFigureLayer.add(figure); - } - - /** {@inheritDoc} */ - @Override - protected void refreshVisuals() { - Rectangle r = determineBaseFigureBounds(); - labelFigureLayer.setBounds(r); - labelFigureLayer.getParent().setConstraint(labelFigureLayer, r); - - super.refreshVisuals(); - } -} diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/allocation/IAllocationPositionService.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/allocation/IAllocationPositionService.java index 0a3bc4bf2..5eb404ca5 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/allocation/IAllocationPositionService.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/allocation/IAllocationPositionService.java @@ -18,7 +18,6 @@ package org.fortiss.tooling.base.ui.editpart.allocation; import org.eclipse.draw2d.geometry.Point; import org.eclipse.draw2d.geometry.Rectangle; import org.eclipse.gef.RootEditPart; -import org.fortiss.tooling.base.ui.editpart.SubDiagramEditPartBase; /** * Interface for allocation target elements. diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/anchor/InsetChopBoxConnectionAnchor.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/anchor/InsetChopBoxConnectionAnchor.java deleted file mode 100644 index 0496fbd00..000000000 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/anchor/InsetChopBoxConnectionAnchor.java +++ /dev/null @@ -1,46 +0,0 @@ -/*-------------------------------------------------------------------------+ -| Copyright 2011 fortiss GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.tooling.base.ui.editpart.anchor; - -import org.eclipse.draw2d.ChopboxAnchor; -import org.eclipse.draw2d.IFigure; -import org.eclipse.draw2d.geometry.Point; - -/** - * An extension to {@link ChopboxAnchor} using insets of half bounding box. - * - * @author doebber - * @author hoelzl - */ -@Deprecated //ucd -public class InsetChopBoxConnectionAnchor extends ChopboxAnchor { - - /** Constructor */ - public InsetChopBoxConnectionAnchor(IFigure owner) { - super(owner); - } - - /** {@inheritDoc} */ - @Override - public Point getLocation(Point reference) { - Point edge = super.getLocation(reference); - Point ref = getReferencePoint(); - Point anchor = new Point(); - anchor.x = ref.x + (edge.x - ref.x) / 2; - anchor.y = ref.y + (edge.y - ref.y) / 2; - return anchor; - } -} diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/extension/base/ConnectorHandlerBase.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/extension/base/ConnectorHandlerBase.java deleted file mode 100644 index aba1b439e..000000000 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/extension/base/ConnectorHandlerBase.java +++ /dev/null @@ -1,60 +0,0 @@ -/*-------------------------------------------------------------------------+ -| Copyright 2011 fortiss GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.tooling.base.ui.extension.base; - -import java.util.List; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.resource.ImageDescriptor; -import org.fortiss.tooling.base.model.base.ConnectorBase; -import org.fortiss.tooling.base.model.element.IConnector; -import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler; -import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase; - -/** - * {@link IModelElementHandler} base implementation for {@link IConnector}s. - * - * @author mou - */ -@SuppressWarnings({"rawtypes", "unchecked"}) -@Deprecated //ucd -public class ConnectorHandlerBase<T extends ConnectorBase> extends - NamedCommentedModelElementHandlerBase<T> { - - /** {@inheritDoc} */ - @Override - public List<EObject> getSpecifications(T element) { - return (List)element.getSpecifications(); - } - - /** {@inheritDoc} */ - @Override - public List<EObject> getIncomingConnections(T element) { - return (List)element.getIncoming(); - } - - /** {@inheritDoc} */ - @Override - public List<EObject> getOutgoingConnections(T element) { - return (List)element.getOutgoing(); - } - - /** {@inheritDoc} */ - @Override - public ImageDescriptor getIconImageDescriptor() { - return null; - } -} diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/utils/AbstractNameEditingSupport.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/utils/AbstractNameEditingSupport.java deleted file mode 100644 index e49bf3a1f..000000000 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/utils/AbstractNameEditingSupport.java +++ /dev/null @@ -1,98 +0,0 @@ -/*-------------------------------------------------------------------------+ -| Copyright 2015 fortiss GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.tooling.base.ui.utils; - -import static org.eclipse.jface.dialogs.MessageDialog.openInformation; -import static org.eclipse.ui.PlatformUI.getWorkbench; - -import org.eclipse.jface.viewers.CellEditor; -import org.eclipse.jface.viewers.ColumnViewer; -import org.eclipse.jface.viewers.EditingSupport; -import org.eclipse.jface.viewers.TextCellEditor; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Shell; -import org.fortiss.tooling.kernel.model.INamedElement; -import org.fortiss.tooling.kernel.service.ICommandStackService; - -/** - * {@link EditingSupport} for name of {@link INamedElement}. - * - * @author bayha - */ -@Deprecated //ucd -public abstract class AbstractNameEditingSupport extends EditingSupport { - - /** Constructor. */ - public AbstractNameEditingSupport(ColumnViewer viewer) { - super(viewer); - } - - /** - * For a given {@link INamedElement} 'element', retrieves all siblings, among which 'element' is - * supposed to have a unique name. - * - * @param element - * {@link INamedElement} which shall have a unique name. - * @return An array of {@link INamedElement}, which contains all siblings for the - * unique name contraint. - */ - protected abstract INamedElement[] getSiblingsForUniqueNameCheck(INamedElement element); - - /** {@inheritDoc} */ - @Override - protected void setValue(Object element, final Object value) { - final INamedElement elt = (INamedElement)element; - if(value != null && !(value.toString().equals(elt.getName()))) { - for(INamedElement child : getSiblingsForUniqueNameCheck(elt)) { - if(child != element && value.equals(child.getName())) { - Shell shell = getWorkbench().getActiveWorkbenchWindow().getShell(); - openInformation(shell, "Information", - "This name already exists, please choose another one."); - return; - } - } - ICommandStackService.getInstance().runAsCommand(elt, new Runnable() { - @Override - public void run() { - setValueInternal(value, elt); - } - }); - } - } - - /** Performs the actual setName(...) call. */ - protected void setValueInternal(final Object value, final INamedElement elt) { - elt.setName(value.toString()); - } - - /** {@inheritDoc} */ - @Override - protected Object getValue(Object element) { - return ((INamedElement)element).getName(); - } - - /** {@inheritDoc} */ - @Override - protected CellEditor getCellEditor(Object element) { - return new TextCellEditor((Composite)getViewer().getControl()); - } - - /** {@inheritDoc} */ - @Override - protected boolean canEdit(Object element) { - return element instanceof INamedElement; - } -} diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/utils/TableViewerUtils.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/utils/TableViewerUtils.java index d56688cc6..f78812fd6 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/utils/TableViewerUtils.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/utils/TableViewerUtils.java @@ -190,63 +190,6 @@ public class TableViewerUtils { } } - /** Editing support for numbers. */ - @Deprecated //ucd - public static abstract class NumberEditingSupport extends EditingSupport { - - /** The parent where the editing support is needed. */ - private Composite parent; - - /** Constructor. */ - public NumberEditingSupport(ColumnViewer viewer, Composite parent) { - super(viewer); - this.parent = parent; - } - - /** {@inheritDoc} */ - @Override - protected CellEditor getCellEditor(Object element) { - CellEditor ce = new TextCellEditor(parent); - ce.setValidator(new ICellEditorValidator() { - - /** {@inheritDoc} */ - @Override - public String isValid(Object value) { - if(getNumberFromString(value.toString()) == null) { - return "Not a valid number"; - } - return null; - } - }); - return ce; - } - - /** {@inheritDoc} */ - @Override - protected boolean canEdit(Object element) { - return true; - } - - /** - * Parses a number from a string and returns it or null if parse error - * occurred. - */ - protected Number getNumberFromString(String numAsString) { - try { - Number num = Integer.parseInt(numAsString); - return num; - } catch(NumberFormatException nfe) { - try { - Number num = Double.parseDouble(numAsString); - return num; - } catch(NumberFormatException e) { - e.printStackTrace(); - } - } - return null; - } - } - /** Allows to move between the columns of the table by pressing TAB. */ public static void allowTabing(TableViewer table) { TableViewerFocusCellManager focusCellManager = diff --git a/org.fortiss.tooling.graphicsGL.ui/trunk/src/org/fortiss/tooling/graphicsGL/ui/editor/Graphical3DViewBase.java b/org.fortiss.tooling.graphicsGL.ui/trunk/src/org/fortiss/tooling/graphicsGL/ui/editor/Graphical3DViewBase.java deleted file mode 100644 index c42883cea..000000000 --- a/org.fortiss.tooling.graphicsGL.ui/trunk/src/org/fortiss/tooling/graphicsGL/ui/editor/Graphical3DViewBase.java +++ /dev/null @@ -1,258 +0,0 @@ -/*-------------------------------------------------------------------------+ -| Copyright 2012 fortiss GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.tooling.graphicsGL.ui.editor; - -import static org.fortiss.tooling.graphicsGL.ui.ToolingGraphicsGLUIActivator.getDefault; -import static org.fortiss.tooling.graphicsGL.ui.util.GLPrimitives.clearCanvasAndLoadIdentity; -import static org.fortiss.tooling.kernel.utils.LoggingUtils.error; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.events.KeyListener; -import org.eclipse.swt.events.MouseEvent; -import org.eclipse.swt.events.MouseListener; -import org.eclipse.swt.events.MouseMoveListener; -import org.eclipse.swt.events.MouseTrackListener; -import org.eclipse.swt.events.MouseWheelListener; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.ui.part.ViewPart; -import org.fortiss.tooling.graphicsGL.ui.camera.Camera; -import org.fortiss.tooling.graphicsGL.ui.draw.LwjglCanvas; -import org.fortiss.tooling.graphicsGL.ui.draw.LwjglRenderThread; -import org.fortiss.tooling.graphicsGL.ui.objects.ViewObjectBase; -import org.fortiss.tooling.graphicsGL.ui.picker.ModelObjectPicker; -import org.lwjglx.util.vector.Vector3f; -import org.newdawn.slick.Color; - -/** - * Base class for 3D graphics views. Sub-classes must provide a {@link Camera} and a - * {@link ViewObjectBase}, which are used to render the view content. Sub-classes may react on - * mouse and key events by overriding the respective methods. - * <P> - * The rendering process is started by calling {@link #beginRenderLoop()}, which allows sub-classes - * to apply additional GL setup commands. Sub-classes may change the perspective by overriding - * {@link #getPerspective()} and return a vector with the field of view, Z near distance, and Z far - * distance. Note that all three must be greater zero. - * <P> - * After the rendering is done the picking process starts if both {@link #pickX} and {@link #pickY} - * are greater or equal to zero and smaller than the widget width and height, respectively. - * Sub-classes should update these variables when they want to pick an object from the scene. The - * {@link #pickTargetChanged()} method is called whenever the picked object changes. - * - * @see Graphical3DEditorBase - * Implementation of the 3D Editor in a view as opposed to the implement in a composite - * (Graphical3DCompositeBase) or editor (Graphical3DEditorBase) in order to be used out of the - * box as a view. - * - * @author mondal - */ -public abstract class Graphical3DViewBase<T extends EObject> extends ViewPart implements - MouseListener, MouseTrackListener, MouseMoveListener, MouseWheelListener, KeyListener, - Listener { // NO_UCD - - /** The 3D canvas. */ - protected LwjglCanvas canvas; - - /** The render thread. */ - private LwjglRenderThread renderThread; - - /** The object picker. */ - private ModelObjectPicker picker = new ModelObjectPicker(); - - /** The current X position to be used during picking. */ - protected int pickX = -1; - - /** The current Y position to be used during picking. */ - protected int pickY = -1; - - /** The current picked object or {@code null} if no pickable object is at the picking location. */ - protected Object pickTarget; - - /** {@inheritDoc} */ - @Override - public final void handleEvent(Event event) { - Rectangle b = canvas.getBounds(); - Vector3f p = getPerspective(); - canvas.setViewportAndPerspective(b.width, b.height, p.x, p.y, p.z); - } - - /** Callback from render thread. */ - private Runnable renderCallback = new Runnable() { - @Override - public void run() { - try { - performRendering(); - performPicking(getCamera()); - } catch(Exception ex) { - error(getDefault(), ex.getMessage(), ex); - } - } - }; - - /** - * Called when the render loop starts, but after the camera was applied for rendering. - * Sub-classes should make GL calls to setup rendering. The default does nothing. - */ - protected void beginRenderLoop() { - // do nothing - } - - /** Returns the current camera to be used. */ - protected abstract Camera getCamera(); - - /** - * Sub-classes should provide the scene object here. The model object will be used for rendering - * and picking using {@link ViewObjectBase}'s respective methods. - */ - protected abstract ViewObjectBase getSceneModelObject(); - - /** Notification about the change of the pick target. The default does nothing. */ - protected void pickTargetChanged() { - // do nothing - } - - /** - * Returns the perspective projection (field of view, near distance, far distance). The default - * uses {@code 45.0f, 0.5f, 400.0f}. - */ - protected Vector3f getPerspective() { - return new Vector3f(45.0f, 0.5f, 400.0f); - } - - /** Performs the object picking operation. */ - private void performPicking(Camera c) { - // avoid unnecessary picking if mouse is outside the canvas - if(pickX < 0 || pickX > canvas.getBounds().width || pickY < 0 || - pickY > canvas.getBounds().height) { - return; - } - Object p = picker.pickModelObject(pickX, pickY, getPerspective(), getSceneModelObject(), c); - if(pickTarget != p) { - pickTarget = p; - pickTargetChanged(); - } - } - - /** Performs the object rendering operation. */ - private void performRendering() { - clearCanvasAndLoadIdentity(new Color(0.95f, 0.95f, 0.95f, 1.0f)); - getCamera().applyForRendering(); - beginRenderLoop(); - getSceneModelObject().renderObject(getCamera()); - } - - /** {@inheritDoc} */ - @Override - public void createPartControl(Composite parent) { - Composite c = new Composite(parent, SWT.NONE); - c.setLayout(new FillLayout()); - - GridData gd = new GridData(GridData.FILL, GridData.FILL, true, true); - c.setLayoutData(gd); - - canvas = new LwjglCanvas(c); - canvas.addResizeHandler(this); - canvas.addMouseListener(this); - canvas.addMouseMoveListener(this); - canvas.addMouseTrackListener(this); - canvas.addMouseWheelListener(this); - canvas.addKeyListener(this); - - Rectangle b = canvas.getBounds(); - Vector3f p = getPerspective(); - canvas.setViewportAndPerspective(b.width, b.height, p.x, p.y, p.z); - - renderThread = new LwjglRenderThread(canvas, renderCallback); - renderThread.start(); - } - - /** {@inheritDoc} */ - @Override - public void setFocus() { - canvas.setFocus(); - } - - /** {@inheritDoc} */ - @Override - public void mouseDoubleClick(MouseEvent e) { - // ignore - } - - /** {@inheritDoc} */ - @Override - public void mouseDown(MouseEvent e) { - // ignore - } - - /** {@inheritDoc} */ - @Override - public void mouseUp(MouseEvent e) { - // ignore - } - - /** {@inheritDoc} */ - @Override - public void mouseEnter(MouseEvent e) { - // ignore - } - - /** - * {@inheritDoc} - * <P> - * Resets the picking position to (-1, -1). - */ - @Override - public void mouseExit(MouseEvent e) { - pickX = -1; - pickY = -1; - } - - /** {@inheritDoc} */ - @Override - public void mouseHover(MouseEvent e) { - // ignore - } - - /** {@inheritDoc} */ - @Override - public void mouseMove(MouseEvent e) { - // ignore - } - - /** {@inheritDoc} */ - @Override - public void mouseScrolled(MouseEvent e) { - // ignore - } - - /** {@inheritDoc} */ - @Override - public void keyPressed(KeyEvent e) { - // ignore - } - - /** {@inheritDoc} */ - @Override - public void keyReleased(KeyEvent e) { - // ignore - } -} diff --git a/org.fortiss.tooling.graphicsGL.ui/trunk/src/org/fortiss/tooling/graphicsGL/ui/objects/CompositeViewObject.java b/org.fortiss.tooling.graphicsGL.ui/trunk/src/org/fortiss/tooling/graphicsGL/ui/objects/CompositeViewObject.java deleted file mode 100644 index e507a16cb..000000000 --- a/org.fortiss.tooling.graphicsGL.ui/trunk/src/org/fortiss/tooling/graphicsGL/ui/objects/CompositeViewObject.java +++ /dev/null @@ -1,50 +0,0 @@ -/*-------------------------------------------------------------------------+ -| Copyright 2012 fortiss GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.tooling.graphicsGL.ui.objects; - -import java.util.ArrayList; -import java.util.List; - -import org.fortiss.tooling.graphicsGL.ui.camera.Camera; -import org.fortiss.tooling.graphicsGL.ui.picker.ModelObjectPicker; - -/** - * Composite for {@link ViewObjectBase model objects} forwarding rendering and picking calls to - * component objects. - * - * @author hoelzl - */ -@Deprecated //ucd -public class CompositeViewObject extends ViewObjectBase { - /** The component objects. */ - private final List<ViewObjectBase> objects = new ArrayList<ViewObjectBase>(); - - /** {@inheritDoc} */ - @Override - public void renderObject(Camera c) { - for(ViewObjectBase o : objects) { - o.renderObject(c); - } - } - - /** {@inheritDoc} */ - @Override - public void renderObjectForPicking(ModelObjectPicker picker, Camera c) { - for(ViewObjectBase o : objects) { - o.renderObjectForPicking(picker, c); - } - } -} diff --git a/org.fortiss.tooling.graphicsGL.ui/trunk/src/org/fortiss/tooling/graphicsGL/ui/objects/Object3DViewObject.java b/org.fortiss.tooling.graphicsGL.ui/trunk/src/org/fortiss/tooling/graphicsGL/ui/objects/Object3DViewObject.java deleted file mode 100644 index c12a49bbd..000000000 --- a/org.fortiss.tooling.graphicsGL.ui/trunk/src/org/fortiss/tooling/graphicsGL/ui/objects/Object3DViewObject.java +++ /dev/null @@ -1,45 +0,0 @@ -/*-------------------------------------------------------------------------+ -| Copyright 2012 fortiss GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.tooling.graphicsGL.ui.objects; - -import static org.fortiss.tooling.graphicsGL.ui.util.GLPrimitives.drawMaterialGroups; - -import org.fortiss.tooling.graphicsGL.model.scene.Object3D; -import org.fortiss.tooling.graphicsGL.ui.camera.Camera; - -/** - * {@link ViewObjectBase} instance for {@link Object3D} models. - * - * @author hoelzl - */ -@Deprecated //ucd -public class Object3DViewObject extends ViewObjectBase { - /** The model object. */ - private final Object3D model; - - /** Constructor. */ - public Object3DViewObject(Object3D model) { - this.model = model; - } - - /** {@inheritDoc} */ - @Override - public void renderObject(Camera c) { - if(model != null && model.getMesh() != null) { - drawMaterialGroups(model.getMesh().getMaterialGroups()); - } - } -} diff --git a/org.fortiss.tooling.graphicsGL.ui/trunk/src/org/fortiss/tooling/graphicsGL/ui/objects/PickableObjectBase.java b/org.fortiss.tooling.graphicsGL.ui/trunk/src/org/fortiss/tooling/graphicsGL/ui/objects/PickableObjectBase.java deleted file mode 100644 index 510674d7b..000000000 --- a/org.fortiss.tooling.graphicsGL.ui/trunk/src/org/fortiss/tooling/graphicsGL/ui/objects/PickableObjectBase.java +++ /dev/null @@ -1,53 +0,0 @@ -/*-------------------------------------------------------------------------+ -| Copyright 2012 fortiss GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.tooling.graphicsGL.ui.objects; - -import static org.lwjgl.opengl.GL11.glPopName; -import static org.lwjgl.opengl.GL11.glPushName; - - -import org.fortiss.tooling.graphicsGL.ui.camera.Camera; -import org.fortiss.tooling.graphicsGL.ui.picker.ModelObjectPicker; - -/** - * Base class for {@link ViewObjectBase view objects}, which become pickable by the - * {@link ModelObjectPicker}. Sub-classes may override - * {@link #renderSimplifiedPickableObject(Camera)} to - * provide a simpler shape during the picking render process. The default renders the same object as - * {@link #renderObject(Camera)}. - * - * @author hoelzl - */ -@Deprecated //ucd -public abstract class PickableObjectBase extends ViewObjectBase { - - /** {@inheritDoc} */ - @Override - public final void renderObjectForPicking(ModelObjectPicker picker, Camera c) { - int name = picker.registerPickableObject(this); - glPushName(name); - renderSimplifiedPickableObject(c); - glPopName(); - } - - /** - * Renders this object in a simplified version for picking. The default just renders the object - * as usual. Sub-classes may override to provide simpler shapes. - */ - protected void renderSimplifiedPickableObject(Camera c) { - renderObject(c); - } -} diff --git a/org.fortiss.tooling.graphicsGL.ui/trunk/src/org/fortiss/tooling/graphicsGL/ui/objects/RotatedObject.java b/org.fortiss.tooling.graphicsGL.ui/trunk/src/org/fortiss/tooling/graphicsGL/ui/objects/RotatedObject.java deleted file mode 100644 index c5ee59648..000000000 --- a/org.fortiss.tooling.graphicsGL.ui/trunk/src/org/fortiss/tooling/graphicsGL/ui/objects/RotatedObject.java +++ /dev/null @@ -1,56 +0,0 @@ -/*-------------------------------------------------------------------------+ -| Copyright 2012 fortiss GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.tooling.graphicsGL.ui.objects; - -import static org.fortiss.tooling.graphicsGL.ui.util.GLPrimitives.restoreMatrix; -import static org.fortiss.tooling.graphicsGL.ui.util.GLPrimitives.rotate; -import static org.fortiss.tooling.graphicsGL.ui.util.GLPrimitives.saveMatrix; - -import org.lwjglx.util.vector.Vector3f; - -/** - * Rotates the wrapped object by the given angle at the origin. - * - * @author hoelzl - */ -@Deprecated //ucd -public class RotatedObject extends WrappedViewObjectBase { - /** The rotation angle. */ - private float angle; - - /** The rotation axis. */ - private final Vector3f axis; - - /** Constructor. */ - public RotatedObject(ViewObjectBase wrapped, float angle, Vector3f axis) { - super(wrapped); - this.angle = angle; - this.axis = axis; - } - - /** {@inheritDoc} */ - @Override - protected void preRendering() { - saveMatrix(); - rotate(angle, axis); - } - - /** {@inheritDoc} */ - @Override - protected void postRendering() { - restoreMatrix(); - } -} diff --git a/org.fortiss.tooling.graphicsGL.ui/trunk/src/org/fortiss/tooling/graphicsGL/ui/objects/ScaledObject.java b/org.fortiss.tooling.graphicsGL.ui/trunk/src/org/fortiss/tooling/graphicsGL/ui/objects/ScaledObject.java deleted file mode 100644 index 5f6878b5b..000000000 --- a/org.fortiss.tooling.graphicsGL.ui/trunk/src/org/fortiss/tooling/graphicsGL/ui/objects/ScaledObject.java +++ /dev/null @@ -1,52 +0,0 @@ -/*-------------------------------------------------------------------------+ -| Copyright 2012 fortiss GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.tooling.graphicsGL.ui.objects; - -import static org.fortiss.tooling.graphicsGL.ui.util.GLPrimitives.restoreMatrix; -import static org.fortiss.tooling.graphicsGL.ui.util.GLPrimitives.saveMatrix; -import static org.fortiss.tooling.graphicsGL.ui.util.GLPrimitives.scale; - -import org.lwjglx.util.vector.Vector3f; - -/** - * Scales the wrapped object by the given factor. - * - * @author hoelzl - */ -@Deprecated //ucd -public class ScaledObject extends WrappedViewObjectBase { - /** The scale factor. */ - private Vector3f scaleFactor; - - /** Constructor. */ - public ScaledObject(ViewObjectBase wrapped, Vector3f factor) { - super(wrapped); - this.scaleFactor = factor; - } - - /** {@inheritDoc} */ - @Override - protected void preRendering() { - saveMatrix(); - scale(scaleFactor); - } - - /** {@inheritDoc} */ - @Override - protected void postRendering() { - restoreMatrix(); - } -} diff --git a/org.fortiss.tooling.graphicsGL.ui/trunk/src/org/fortiss/tooling/graphicsGL/ui/objects/WrappedViewObjectBase.java b/org.fortiss.tooling.graphicsGL.ui/trunk/src/org/fortiss/tooling/graphicsGL/ui/objects/WrappedViewObjectBase.java deleted file mode 100644 index bca22080a..000000000 --- a/org.fortiss.tooling.graphicsGL.ui/trunk/src/org/fortiss/tooling/graphicsGL/ui/objects/WrappedViewObjectBase.java +++ /dev/null @@ -1,48 +0,0 @@ -/*-------------------------------------------------------------------------+ -| Copyright 2012 fortiss GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.tooling.graphicsGL.ui.objects; - -import org.fortiss.tooling.graphicsGL.ui.camera.Camera; - -/** - * View object that wraps another object and can provide pre- and post-processing. - * - * @author hoelzl - */ -public abstract class WrappedViewObjectBase extends ViewObjectBase { - - /** The wrapped model object. */ - protected final ViewObjectBase wrapped; - - /** Constructor. */ - public WrappedViewObjectBase(ViewObjectBase wrapped) { - this.wrapped = wrapped; - } - - /** Called before rendering the wrapped object. */ - protected abstract void preRendering(); - - /** Called after rendering the wrapped object. */ - protected abstract void postRendering(); - - /** {@inheritDoc} */ - @Override - public final void renderObject(Camera c) { - preRendering(); - wrapped.renderObject(c); - postRendering(); - } -} diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ConnectionCompositionDropTargetAdapter.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ConnectionCompositionDropTargetAdapter.java deleted file mode 100644 index f08241447..000000000 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ConnectionCompositionDropTargetAdapter.java +++ /dev/null @@ -1,71 +0,0 @@ -/*-------------------------------------------------------------------------+ -| Copyright 2011 fortiss GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.tooling.kernel.ui.dnd; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.swt.dnd.DND; -import org.eclipse.swt.dnd.DropTargetAdapter; -import org.eclipse.swt.dnd.DropTargetEvent; -import org.eclipse.swt.widgets.Widget; -import org.fortiss.tooling.kernel.service.IConnectionCompositorService; - -/** - * {@link DropTargetAdapter} for completing an EObject connection via a drop - * gesture. If the {@link IConnectionCompositorService} allows the composition - * the {@link DND#DROP_LINK} detail is set as user feedback. - * <p> - * This implementation uses the raw SWT DND mechanism. - * - * @author hoelzl - */ -@Deprecated //ucd -public abstract class ConnectionCompositionDropTargetAdapter extends DropTargetAdapter { - - /** {@inheritDoc} */ - @Override - public void drop(DropTargetEvent event) { - ConnectionCompositionSource dragSource = getDragSourceFromTransfer(); - EObject target = getTargetModel(event.item); - IConnectionCompositorService.getInstance().connect(dragSource.getDesignatedElement(), - target, dragSource.getDesignatedParentElement(), null); - } - - /** {@inheritDoc} */ - @Override - public void dragOver(DropTargetEvent event) { - ConnectionCompositionSource dragSource = getDragSourceFromTransfer(); - EObject target = getTargetModel(event.item); - if(target == null || dragSource.getDesignatedElement() == null) { - event.detail = DND.DROP_NONE; - return; - } - if(IConnectionCompositorService.getInstance().canConnect(dragSource.getDesignatedElement(), - target, dragSource.getDesignatedParentElement(), null)) { - event.detail = DND.DROP_LINK; - return; - } - event.detail = DND.DROP_NONE; - } - - /** Returns the current target element. */ - protected abstract EObject getTargetModel(Widget dropTarget); - - /** Returns the transfered object. */ - private ConnectionCompositionSource getDragSourceFromTransfer() { - return (ConnectionCompositionSource)CompositionServiceLocalDNDTransfer.getInstance() - .getObject(); - } -} diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ElementCompositionDropTargetAdapter.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ElementCompositionDropTargetAdapter.java deleted file mode 100644 index b43f9894b..000000000 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ElementCompositionDropTargetAdapter.java +++ /dev/null @@ -1,70 +0,0 @@ -/*-------------------------------------------------------------------------+ -| Copyright 2011 fortiss GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.tooling.kernel.ui.dnd; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.swt.dnd.DND; -import org.eclipse.swt.dnd.DropTargetAdapter; -import org.eclipse.swt.dnd.DropTargetEvent; -import org.eclipse.swt.widgets.Widget; -import org.fortiss.tooling.kernel.service.IElementCompositorService; - -/** - * {@link DropTargetAdapter} for completing an EObject composition via a drop - * gesture. If the {@link IElementCompositorService} allows the composition the - * {@link DND#DROP_COPY} detail is set as user feedback. - * <p> - * This implementation uses the raw SWT DND mechanism. - * - * @author hoelzl - */ -@Deprecated //ucd -public abstract class ElementCompositionDropTargetAdapter extends DropTargetAdapter { - /** {@inheritDoc} */ - @Override - public void drop(DropTargetEvent event) { - ElementCompositionSource dragSource = getDragSourceFromTransfer(); - EObject target = getTargetModel(event.item); - EObject designatedElt = dragSource.getDesignatedElement(); - IElementCompositorService.getInstance().compose(target, designatedElt, null); - } - - /** {@inheritDoc} */ - @Override - public void dragOver(DropTargetEvent event) { - ElementCompositionSource dragSource = getDragSourceFromTransfer(); - EObject target = getTargetModel(event.item); - EObject designatedElt = dragSource.getDesignatedElement(); - if(target == null || designatedElt == null) { - event.detail = DND.DROP_NONE; - return; - } - if(IElementCompositorService.getInstance().canCompose(target, designatedElt, null)) { - event.detail = DND.DROP_COPY; - return; - } - event.detail = DND.DROP_NONE; - } - - /** Returns the current target element. */ - protected abstract EObject getTargetModel(Widget dropTarget); - - /** Returns the transfered object. */ - private ElementCompositionSource getDragSourceFromTransfer() { - return (ElementCompositionSource)CompositionServiceLocalDNDTransfer.getInstance() - .getObject(); - } -} diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/extension/base/ContextMenuSubMenuContributorBase.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/extension/base/ContextMenuSubMenuContributorBase.java deleted file mode 100644 index 6e7154321..000000000 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/extension/base/ContextMenuSubMenuContributorBase.java +++ /dev/null @@ -1,324 +0,0 @@ -/*-------------------------------------------------------------------------+ -| Copyright 2012 fortiss GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.tooling.kernel.ui.extension.base; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IContributionItem; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.jface.resource.ImageDescriptor; -import org.fortiss.tooling.kernel.ui.extension.IContextMenuContributor; -import org.fortiss.tooling.kernel.ui.extension.base.EObjectActionBase.EObjectActionFactory; -import org.fortiss.tooling.kernel.ui.extension.data.ContextMenuContextProvider; -import org.fortiss.tooling.kernel.ui.service.IContextMenuService; - -/** - * Base class for context menu contributors creating a sub-menu {@link IMenuManager} with actions - * provided by actions factories {@link EObjectActionFactory} returned by - * {@link #getActionFactories()}. - * <p> - * The menu can be additionally structured using {@link #getMenuStructureHintItems()}: currently - * menu separators and one-level sub-menus supported. - * <p> - * The class implements interface methods {@link #getMenuIcon()} and {@link #getMenuId()} returning - * {@code null} by default. Classes providing an own icon or id should override them. - * <p> - * A usage example can be found in org.fortiss.af3.time.ui plug-in. - * - * @param <T> - * Indicates the type of selection elements. - * - * @author trachtenherz - */ -@Deprecated //ucd -public abstract class ContextMenuSubMenuContributorBase<T extends EObject> implements - IContextMenuContributor { - - /** {@inheritDoc} */ - @SuppressWarnings("unchecked") - @Override - public final List<IContributionItem> getContributedItems(EObject selection, - ContextMenuContextProvider contextProvider) { - if(acceptSelection(selection, contextProvider)) { - List<IContributionItem> contributionItems = new ArrayList<IContributionItem>(); - contributionItems.add(createMenu(createActionsForElement((T)selection))); - return contributionItems; - } - return Collections.emptyList(); - } - - /** Creates action instances for the given selection. */ - protected Collection<Action> createActionsForElement(T selection) { - ArrayList<Action> list = new ArrayList<Action>(); - for(EObjectActionFactory<? super T> factory : getActionFactories()) { - list.add(factory.createAction(selection)); - } - return list; - } - - /** - * Creates a sub-menu {@link IMenuManager} containing specified actions. - */ - protected IMenuManager createMenu(Collection<Action> actions) { - IMenuManager menu = new MenuManager(getMenuName(), getMenuIcon(), getMenuId()); - IMenuManager subMenu = null; - // Points to the currently used menu, which is either {@code menu} or {@code subMenu} - IMenuManager currentMenu = menu; - // Prepare menu structure hint items - MenuStructureHintItem[] hintItems; - if(getMenuStructureHintItems() != null) { - hintItems = Arrays.copyOf(getMenuStructureHintItems(), actions.size()); - } else { - hintItems = new MenuStructureHint[actions.size()]; - Arrays.fill(hintItems, null); - } - /* - * Now the hint items array contains all elements from getMenuStructureHintItems(). It also - * has at least as many elements as the actions collection. If getMenuStructureHintItems() - * has less elements (or is null), than all other elements of the hint items array are null. - */ - int i = 0; - for(Action a : actions) { - if(hintItems[i] != null && - (hintItems[i].getHint() == MenuStructureHint.SUBMENU_START_BEFORE || hintItems[i] - .getHint() == MenuStructureHint.SUBMENU_START_BEFORE_SEPARATOR_BEFORE)) { - if(subMenu != null) { - // If there is a previously opened sub-menu then finish processing it because we - // use one-level sub-menus. - menu.add(subMenu); - } - if(hintItems[i].getHint() == MenuStructureHint.SUBMENU_START_BEFORE_SEPARATOR_BEFORE) { - menu.add(new Separator()); - } - final String subMenuLabel; - if(hintItems[i] instanceof MenuStructureHintSubMenuStart) { - subMenuLabel = ((MenuStructureHintSubMenuStart)hintItems[i]).getSubMenuLabel(); - } else { - subMenuLabel = MenuStructureHintSubMenuStart.DEFAULT_SUB_MENU_LABEL; - } - // Open new sub-menu - currentMenu = subMenu = new MenuManager(subMenuLabel); - } - - if(hintItems[i] != null && hintItems[i].getHint() == MenuStructureHint.SEPARATOR_BEFORE) { - currentMenu.add(new Separator()); - } - - // Add the action to menu - currentMenu.add(a); - - if(hintItems[i] != null && - hintItems[i].getHint() == MenuStructureHint.SUBMENU_END_AFTER) { - if(subMenu != null) { - menu.add(subMenu); - subMenu = null; - // Return to top-level menu - currentMenu = menu; - } - } - - if(hintItems[i] != null && hintItems[i].getHint() == MenuStructureHint.SEPARATOR_AFTER) { - currentMenu.add(new Separator()); - } - - ++i; - } - return menu; - } - - /** {@inheritDoc} */ - @Override - public String getMenuSectionID() { - return IContextMenuService.BOTTOM_MOST_MENU_SECTION_ID; - } - - /** - * Returns {@code true} if the selected element is acceptable. This method - * must also ensure that {@code selection} is an instance of {@code T} - */ - protected abstract boolean acceptSelection(EObject selection, - ContextMenuContextProvider contextProvider); - - /** The name of the sub-menu */ - protected abstract String getMenuName(); - - /** Returns the action factories for the actions to be shown in the menu */ - protected abstract Collection<EObjectActionFactory<? super T>> getActionFactories(); - - /** Interface for menu structure hints. */ - public static interface MenuStructureHintItem { - /** Returns the hint represented by this item. */ - MenuStructureHint getHint(); - - /** - * Returns hints represented by this item. If it represents one hint, than a one-element - * array is returned containing the result of {@link #getHint()}. - */ - MenuStructureHint[] getHints(); - } - - /** - * Constants for menu structure hints. - * - * @see ContextMenuSubMenuContributorBase#getMenuStructureHintItems() - */ - public static enum MenuStructureHint implements MenuStructureHintItem { - /** Insert a separator before current menu item. */ - SEPARATOR_BEFORE, - /** Insert a separator after current menu item. */ - SEPARATOR_AFTER, - /** - * Begin sub-menu before current item. - * <p> - * NOTE: Only one-level sub-menus are supported, so if there was a sub-menu previously - * started, then starting another will automatically end the previous one. - */ - SUBMENU_START_BEFORE, - /** End sub-menu after current item. */ - SUBMENU_END_AFTER, - /** - * Insert separator and begin sub-menu before current. - * - * @see #SEPARATOR_BEFORE - * @see #SUBMENU_START_BEFORE - */ - SUBMENU_START_BEFORE_SEPARATOR_BEFORE; - - /** {@inheritDoc} */ - @Override - public MenuStructureHint getHint() { - return this; - } - - /** {@inheritDoc} */ - @Override - public MenuStructureHint[] getHints() { - return new MenuStructureHint[] {getHint()}; - } - } - - /** - * {@link MenuStructureHintItem} wrapping a {@link MenuStructureHint#SUBMENU_START_BEFORE} hint - * and providing additional information for the sub-menu. - */ - public static class MenuStructureHintSubMenuStart implements MenuStructureHintItem { - /** Default sub-menu item label. */ - public static final String DEFAULT_SUB_MENU_LABEL = "Sub menu"; - /** @see #getSubMenuLabel() */ - private String subMenuLabel; - - /** - * @see #getHint() - */ - private MenuStructureHint menuStructureHint; - - /** - * Creates a {@link MenuStructureHintSubMenuStart} with default sub-menu label text. - * - * @see #DEFAULT_SUB_MENU_LABEL - */ - public MenuStructureHintSubMenuStart() { - this(DEFAULT_SUB_MENU_LABEL); - } - - /** - * Creates a {@link MenuStructureHintSubMenuStart} with given sub-menu label text. - */ - public MenuStructureHintSubMenuStart(String subMenuLabel) { - this(subMenuLabel, false); - } - - /** - * Creates a {@link MenuStructureHintSubMenuStart} with given sub-menu label text. - * If {@code separatorBefore} is true than {@link #getHint()} will later return - * {@link MenuStructureHint#SUBMENU_START_BEFORE_SEPARATOR_BEFORE} otherwise - * {@link MenuStructureHint#SUBMENU_START_BEFORE}. - */ - public MenuStructureHintSubMenuStart(String subMenuLabel, boolean separatorBefore) { - this.subMenuLabel = subMenuLabel; - if(separatorBefore) { - menuStructureHint = MenuStructureHint.SUBMENU_START_BEFORE_SEPARATOR_BEFORE; - } else { - menuStructureHint = MenuStructureHint.SUBMENU_START_BEFORE; - } - } - - /** Returns the sub-menu label text. */ - public String getSubMenuLabel() { - return subMenuLabel; - } - - /** - * {@inheritDoc} - * - * @return {@link MenuStructureHint#SUBMENU_START_BEFORE} or - * {@link MenuStructureHint#SUBMENU_START_BEFORE_SEPARATOR_BEFORE}, depending on the - * initialization parameters used for the constructor (see - * {@link #MenuStructureHintSubMenuStart(String, boolean)}. - */ - @Override - public MenuStructureHint getHint() { - return this.menuStructureHint; - } - - /** {@inheritDoc} */ - @Override - public MenuStructureHint[] getHints() { - return new MenuStructureHint[] {getHint()}; - } - } - - /** - * Returns additional informations about the structure of the menu to be used in - * {@link #createMenu(Collection)}. Each array element at position {@code i} corresponds to the - * menu action at position @{@code i} in {@link #getActionFactories()}. - * <p> - * A {@code null} element means that there is no additional information for the corresponding - * action. If the array itself is {@code null} then this is equivalent to an array filled with - * {@code null} elements: in this case all actions are linearly shown in the menu. - * <p> - * If the array is smaller than the number of menu actions returned by - * {@link #getActionFactories()} then missing structure hints are assumed {@code null} (which is - * equivalent to padding the array with {@code null} till the length of - * {@link #getActionFactories()}). - * - * @see MenuStructureHintItem - * @see MenuStructureHint - * @see #getActionFactories() - * @see #createMenu(Collection) - */ - protected MenuStructureHintItem[] getMenuStructureHintItems() { - return null; - } - - /** The image for the sub-menu */ - protected ImageDescriptor getMenuIcon() { - return null; - } - - /** The Id for the sub-menu */ - protected String getMenuId() { - return null; - } -} diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/extension/base/EObjectActionBase.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/extension/base/EObjectActionBase.java index 4ef9f8be5..0f784ea46 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/extension/base/EObjectActionBase.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/extension/base/EObjectActionBase.java @@ -35,12 +35,6 @@ import org.fortiss.tooling.kernel.ui.service.ITutorialUIService; */ public abstract class EObjectActionBase<T extends EObject> extends Action { - /** Factory interface for action instances. */ - public static interface EObjectActionFactory<T extends EObject> { - /** Creates and returns an action instance for the given target. */ - EObjectActionBase<T> createAction(T target); - } - /** Stores the target elements. */ private EList<T> targets; diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/MarkerServiceLabelDecorator.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/MarkerServiceLabelDecorator.java deleted file mode 100644 index acbae2d05..000000000 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/MarkerServiceLabelDecorator.java +++ /dev/null @@ -1,59 +0,0 @@ -/*-------------------------------------------------------------------------+ -| Copyright 2016 fortiss GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.tooling.kernel.ui.internal; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.viewers.BaseLabelProvider; -import org.eclipse.jface.viewers.IDecoration; -import org.eclipse.jface.viewers.ILightweightLabelDecorator; -import org.fortiss.tooling.kernel.extension.data.IConstraintViolation.ESeverity; -import org.fortiss.tooling.kernel.ui.ESharedImages; -import org.fortiss.tooling.kernel.ui.service.IMarkerService; - -/** - * Label decorator for the {@link IMarkerService} decorations: errors, warnings, etc. - * - * @author hoelzl - */ -@Deprecated //ucd -public final class MarkerServiceLabelDecorator extends BaseLabelProvider implements - ILightweightLabelDecorator { - - /** {@inheritDoc} */ - @Override - public void decorate(Object element, IDecoration decoration) { - if(element instanceof EObject) { - EObject modelElement = (EObject)element; - ESeverity highest = - IMarkerService.getInstance().getHighestViolationSeverity(modelElement); - // TODO (FH): https://af3.fortiss.org/issues/388 - // use preferences settings here - switch(highest) { - case FATAL: - decoration.addOverlay(ESharedImages.FATAL_OVERLAY.getImageDescriptor()); - break; - case ERROR: - decoration.addOverlay(ESharedImages.ERROR_OVERLAY.getImageDescriptor()); - break; - case WARNING: - decoration.addOverlay(ESharedImages.WARNING_OVERLAY.getImageDescriptor()); - break; - default: - // ignore info and debug - } - } - } -} diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/properties/ElementWithURIPropertySection.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/properties/ElementWithURIPropertySection.java deleted file mode 100644 index ac647f1d8..000000000 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/properties/ElementWithURIPropertySection.java +++ /dev/null @@ -1,61 +0,0 @@ -/*-------------------------------------------------------------------------+ -| Copyright 2011 fortiss GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.tooling.kernel.ui.internal.properties; - -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; -import org.fortiss.tooling.kernel.model.IElementWithURI; -import org.fortiss.tooling.kernel.ui.extension.base.PropertySectionBase; - -/** - * Property section for {@link IElementWithURI}s. - * - * @author ratiu - */ -@Deprecated //ucd -public class ElementWithURIPropertySection extends PropertySectionBase { - - /** URI edit widget. */ - private Text uriText; - - /** Stores the current input. */ - private IElementWithURI elementWithURI; - - /** {@inheritDoc} */ - @Override - public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage) { - super.createControls(parent, aTabbedPropertySheetPage); - uriText = createFormText("URI"); - uriText.setEnabled(false); - } - - /** {@inheritDoc} */ - @Override - protected void setSectionInput(Object input) { - if(input instanceof IElementWithURI) { - elementWithURI = (IElementWithURI)input; - } - } - - /** {@inheritDoc} */ - @Override - public void refresh() { - super.refresh(); - - uriText.setText(elementWithURI.getURI()); - } -} diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/base/ElementCompositorBase.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/base/ElementCompositorBase.java deleted file mode 100644 index 21c78b65a..000000000 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/base/ElementCompositorBase.java +++ /dev/null @@ -1,64 +0,0 @@ -/*-------------------------------------------------------------------------+ -| Copyright 2014 fortiss GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.tooling.kernel.extension.base; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.fortiss.tooling.kernel.extension.IElementCompositor; -import org.fortiss.tooling.kernel.extension.data.IElementCompositionContext; -import org.fortiss.tooling.kernel.extension.data.Prototype; - -/** - * Base implementation for supporting composition of {@link IElementCompositor}. - * - * @author moudy - */ -@Deprecated //ucd -public abstract class ElementCompositorBase<C extends EObject> implements IElementCompositor<C> { - - /** {@inheritDoc} */ - @Override - public boolean canCompose(C container, EObject contained, IElementCompositionContext context) { - return isCorrectClass(contained); - } - - /** {@inheritDoc} */ - @Override - public boolean canComposePrototype(Prototype prototype) { - return isCorrectClass(prototype.getPrototype()); - } - - /** Returns true if the contained object is an instance of an acceptable class. */ - protected abstract boolean isCorrectClass(EObject contained); - - /** {@inheritDoc} */ - @Override - abstract public boolean compose(C container, EObject contained, - IElementCompositionContext context); - - /** {@inheritDoc} */ - @Override - public boolean canDecompose(EObject contained) { - return isCorrectClass(contained); - } - - /** {@inheritDoc} */ - @Override - public boolean decompose(EObject contained) { - EcoreUtil.delete(contained, true); - return true; - } -} diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/base/TutorialBlacklistAllProvider.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/base/TutorialBlacklistAllProvider.java deleted file mode 100644 index 487d6a1da..000000000 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/base/TutorialBlacklistAllProvider.java +++ /dev/null @@ -1,33 +0,0 @@ -/*-------------------------------------------------------------------------+ -| Copyright 2016 fortiss GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.tooling.kernel.extension.base; - -import org.fortiss.tooling.kernel.extension.ITutorialWhitelistProvider; -import org.fortiss.tooling.kernel.extension.data.Prototype; - -/** - * An {@link ITutorialWhitelistProvider} that blacklists everything. - * - * @author hoelzl - */ -@Deprecated //ucd -public class TutorialBlacklistAllProvider implements ITutorialWhitelistProvider { - /** {@inheritDoc} */ - @Override - public boolean prototypeActive(Prototype prototype) { - return false; - } -} diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/base/TutorialWhitelistAllProvider.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/base/TutorialWhitelistAllProvider.java deleted file mode 100644 index 0d06e3a02..000000000 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/base/TutorialWhitelistAllProvider.java +++ /dev/null @@ -1,33 +0,0 @@ -/*-------------------------------------------------------------------------+ -| Copyright 2016 fortiss GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.tooling.kernel.extension.base; - -import org.fortiss.tooling.kernel.extension.ITutorialWhitelistProvider; -import org.fortiss.tooling.kernel.extension.data.Prototype; - -/** - * An {@link ITutorialWhitelistProvider} that whitelists everything. - * - * @author hoelzl - */ -@Deprecated //ucd -public class TutorialWhitelistAllProvider implements ITutorialWhitelistProvider { - /** {@inheritDoc} */ - @Override - public boolean prototypeActive(Prototype prototype) { - return true; - } -} diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/LogMessageWithException.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/LogMessageWithException.java deleted file mode 100644 index 5e871a132..000000000 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/LogMessageWithException.java +++ /dev/null @@ -1,46 +0,0 @@ -/*-------------------------------------------------------------------------+ -| Copyright 2015 fortiss GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.tooling.kernel.extension.data; - -/** - * {@link LogMessage} that additionally transports an Exception that can be processed by matching - * handlers. - * - * @author diewald - */ -@Deprecated //ucd -public class LogMessageWithException extends LogMessage { - /** The transported Exception. */ - protected final Exception exception; - - /** - * Constructor. - * - * @param messageString - * Message String that is transported by this {@link LogMessage}. - * @param e - * Exception that is transported by this {@link LogMessage}.. - */ - public LogMessageWithException(String messageString, Exception e) { - super(messageString); - this.exception = e; - } - - /** Returns the Exception transported by this {@link LogMessage}. */ - public final Exception getException() { - return exception; - } -} diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/introspection/items/IntrospectionItemBase.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/introspection/items/IntrospectionItemBase.java deleted file mode 100644 index b114e045a..000000000 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/introspection/items/IntrospectionItemBase.java +++ /dev/null @@ -1,51 +0,0 @@ -/*-------------------------------------------------------------------------+ -| Copyright 2016 fortiss GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.tooling.kernel.introspection.items; - -import static java.util.Collections.emptyList; - -import java.util.List; - -import org.fortiss.tooling.kernel.introspection.IIntrospectionItem; - -/** - * Base class implementing {@link IIntrospectionItem}. - * - * @author hoelzl - */ -@Deprecated //ucd -public abstract class IntrospectionItemBase implements IIntrospectionItem { - - /** The item label. */ - private final String label; - - /** Constructor. */ - public IntrospectionItemBase(String label) { - this.label = label; - } - - /** {@inheritDoc} */ - @Override - public final String getIntrospectionLabel() { - return label; - } - - /** {@inheritDoc} */ - @Override - public List<IIntrospectionItem> getIntrospectionItems() { - return emptyList(); - } -} -- GitLab