Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • af3/kernel
  • diewald/kernel
2 results
Show changes
Commits on Source (33)
Showing
with 131 additions and 82 deletions
downstream-job:
variables:
BUILD_BRANCH: "$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME"
only:
- merge_requests
trigger:
project: af3/maven-releng
strategy: depend
......@@ -2,10 +2,10 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Tooling Base UI
Bundle-SymbolicName: org.fortiss.tooling.base.ui;singleton:=true
Bundle-Version: 2.18.0.qualifier
Bundle-Version: 2.19.0.qualifier
Bundle-Activator: org.fortiss.tooling.base.ui.ToolingBaseUIActivator
Require-Bundle: org.fortiss.tooling.base;bundle-version="2.18.0";visibility:=reexport,
org.fortiss.tooling.kernel.ui;bundle-version="2.18.0";visibility:=reexport,
Require-Bundle: org.fortiss.tooling.base;bundle-version="2.19.0";visibility:=reexport,
org.fortiss.tooling.kernel.ui;bundle-version="2.19.0";visibility:=reexport,
org.eclipse.swt,
org.fortiss.tooling.common.ui
Bundle-ActivationPolicy: lazy
......
CurvedLinkLayoutedContentAnchorangeController.java e22faedbe98c3dab660b5d2df8ebd004e116c5ba GREEN
CurvedLinkLayoutedDiagramAnchorangeController.java f2e5e2a7cc9b6a070871e200e57371286bb15222 GREEN
EObjectDiagramController.java ccccc925eb7966b274aa7354f4e9d4c534b250c5 GREEN
EObjectDiagramController.java 7fe2cd69ee8449b0ecaeb42e4fe2b65fffd9b6c3 GREEN
EObjectEllipticResizableContentControllerBase.java f12e8f5a646a23fe428ed4768bf041c8b885ec81 GREEN
EObjectModelChangeProvider.java f4b60cebb088a5c81ca92a41614e1a5d40030502 GREEN
EObjectRectangularResizableContentControllerBase.java cde6c13659611d927691c03ecd2621cff2414b03 GREEN
......
......@@ -16,7 +16,6 @@ package org.fortiss.tooling.base.ui.editor.fx.controller;
import static java.lang.Math.max;
import static java.util.Objects.requireNonNull;
import static org.fortiss.tooling.base.ui.utils.ContextMenuUtils.createAutoLayoutMenu;
import static org.fortiss.tooling.base.ui.utils.ContextMenuUtils.createDisplayMenu;
import static org.fortiss.tooling.base.ui.utils.ContextMenuUtils.createElementCompositionContext;
import static org.fortiss.tooling.base.ui.utils.ContextMenuUtils.createPrototypeMenu;
import static org.fortiss.tooling.base.ui.utils.FXDNDUtils.canCompose;
......@@ -86,7 +85,8 @@ public class EObjectDiagramController<T extends EObject> extends DefaultDiagramC
IElementCompositionContext edc = createElementCompositionContext(modelParent, x, y, true,
getViewer().getFeatures().getCurrentZoomFactor());
List<MenuItem> result = createPrototypeMenu(modelParent, edc);
result.add(createDisplayMenu(getViewer()));
// Adds "Display" menu
result.addAll(super.contextMenuContributions(node, diagramLocation));
if(modelParent instanceof IHierarchicElement && enableAutoLayout()) {
result.add(createAutoLayoutMenu((IHierarchicElement)modelParent));
}
......
DynamicTreeTableNameProvider.java 3ca45f24b94e97b02313e80b16ba8b370f541541 GREEN
ModelElementTreeViewer.java b541376d1b21d38dec80ae6dd5357fe289dcb643 GREEN
ModelElementTreeViewer.java c27c57ae21b32de790c6fb5a86695dd5952fcf32 GREEN
......@@ -135,6 +135,12 @@ public class ModelElementTreeViewer<T extends INamedElement> {
dynTreeViewer.expandItem(item);
}
/** Collapses the given item. */
public void collapseItem(T value) {
DynamicTreeItemBase<T> item = findItem(value);
dynTreeViewer.collapseItem(item);
}
/** Returns the {@link DynamicTreeItemBase} of the given {@code value} if it exists. */
public DynamicTreeItemBase<T> findItem(T value) {
return dynTreeViewer.findItem(value);
......
AbstractNameEditingSupport.java c57336a0e0da18711a1610ca667dfea76728807f GREEN
ActionUtils.java 322f43d4f92f992daef8ac88eb0f9197c840c89b GREEN
ContextMenuUtils.java 434d6b7aad095ce726caa4de42913391ed6e6832 GREEN
ContextMenuUtils.java 7fbc7e303c42510063841e8ec097563d2c235c0e GREEN
DragAndDropBaseUtils.java d375377f9124f6113b2a295e6b0e09ac8966e564 GREEN
EllipseLayoutUIUtils.java 4dd9dbd96a45e8c455c019caa19e4a50f18336af GREEN
FXDNDUtils.java 6ce94e239e68f9e2b3cc0524b072606f4a120076 GREEN
......
......@@ -22,17 +22,18 @@ import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.tooling.base.dnd.ElementDropContext;
import org.fortiss.tooling.base.model.element.IConnector;
import org.fortiss.tooling.base.model.element.IHierarchicElement;
import org.fortiss.tooling.base.model.layout.Point;
import org.fortiss.tooling.base.ui.layout.auto.IAutoLayouter;
import org.fortiss.tooling.base.ui.layout.auto.KielerAutoLayouter;
import org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramViewer;
import org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramViewerFeatures;
import org.fortiss.tooling.kernel.extension.data.IElementCompositionContext;
import org.fortiss.tooling.kernel.extension.data.Prototype;
import org.fortiss.tooling.kernel.service.ICommandStackService;
import org.fortiss.tooling.kernel.service.IElementCompositorService;
import org.fortiss.tooling.kernel.service.IPrototypeService;
import org.fortiss.tooling.kernel.ui.extension.IModelEditor;
import org.fortiss.tooling.kernel.ui.service.IModelEditorBindingService;
import javafx.scene.control.Menu;
import javafx.scene.control.MenuItem;
......@@ -49,12 +50,21 @@ public final class ContextMenuUtils {
IPrototypeService pers = IPrototypeService.getInstance();
IElementCompositorService ecs = IElementCompositorService.getInstance();
ICommandStackService css = ICommandStackService.getInstance();
IModelEditor<EObject> activeEditor =
IModelEditorBindingService.getInstance().getActiveEditor();
boolean isMenuForEditedObject =
activeEditor != null && target == activeEditor.getEditedObject();
List<MenuItem> result = new ArrayList<>();
Menu newMenu = new Menu("New ...");
List<Prototype> protos = pers.getComposablePrototypes(target.getClass());
for(Prototype p : protos) {
EObject prototypeCopy = p.getPrototypeCopy();
if(ecs.canCompose(target, prototypeCopy, context)) {
// If the context menu is created for the currently edited object, offer all composable
// elements. Otherwise (i.e., if context menu is created for a structural element within
// the currently edited object), offer only (composable) connectors.
if((isMenuForEditedObject || prototypeCopy instanceof IConnector) &&
ecs.canCompose(target, prototypeCopy, context)) {
MenuItem mi = new MenuItem(p.getName());
mi.setOnAction(evt -> {
css.runAsCommand(target, () -> {
......@@ -105,39 +115,4 @@ public final class ContextMenuUtils {
Point loc = createPoint((int)x, (int)y, "CompositionPoint");
return new ElementDropContext(target, loc, isRoot, zoom);
}
/** Returns the default display menu for interaction with diagram viewer features. */
public static Menu createDisplayMenu(DiagramViewer viewer) {
Menu menu = new Menu("Display ...");
DiagramViewerFeatures features = viewer.getFeatures();
// link highlighting
if(features.isLinkHighlightingEnabled()) {
MenuItem disableLinkHighlighting = new MenuItem("Disable Link Highlighting");
disableLinkHighlighting.setOnAction(evt -> {
features.setLinkHighlightingEnabled(false);
});
menu.getItems().add(disableLinkHighlighting);
} else {
MenuItem enableLinkHighlighting = new MenuItem("Enable Link Highlighting");
enableLinkHighlighting.setOnAction(evt -> {
features.setLinkHighlightingEnabled(true);
});
menu.getItems().add(enableLinkHighlighting);
}
// interaction area shading
if(features.isInteractionAreaShadingEnabled()) {
MenuItem disableInteractionShading = new MenuItem("Disable Interactive Area Shading");
disableInteractionShading.setOnAction(evt -> {
features.setInteractionAreaShadingEnabled(false);
});
menu.getItems().add(disableInteractionShading);
} else {
MenuItem enableInteractionShading = new MenuItem("Enable Interactive Area Shading");
enableInteractionShading.setOnAction(evt -> {
features.setInteractionAreaShadingEnabled(true);
});
menu.getItems().add(enableInteractionShading);
}
return menu;
}
}
......@@ -2,14 +2,14 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.fortiss.tooling.base;singleton:=true
Bundle-Version: 2.18.0.qualifier
Bundle-Version: 2.19.0.qualifier
Bundle-ClassPath: .
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-11
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.ecore;visibility:=reexport,
org.fortiss.tooling.kernel;visibility:=reexport;bundle-version="2.18.0"
org.fortiss.tooling.kernel;visibility:=reexport;bundle-version="2.19.0"
Bundle-ActivationPolicy: lazy
Export-Package: org.fortiss.tooling.base,
org.fortiss.tooling.base.annotation,
......
......@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Tooling Commons UI
Bundle-SymbolicName: org.fortiss.tooling.common.ui;singleton:=true
Bundle-Version: 2.18.0.qualifier
Bundle-Version: 2.19.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-11
Require-Bundle: org.fortiss.tooling.common;visibility:=reexport,
org.eclipse.core.resources;visibility:=reexport,
......
......@@ -8,7 +8,7 @@ DynamicTreeItemBase.java d883066ecc181120302ca32f328538de7a45b093 GREEN
DynamicTreeTableUIProviderBase.java a4cd60795d114984f7fd255f273fc39937889f22 GREEN
DynamicTreeTableViewer.java ead6f6671e9cb6b14632940bf440cba7e81fcd98 GREEN
DynamicTreeUIProviderBase.java 82d3c051213f0147f4c67ad247a08696cee73110 GREEN
DynamicTreeViewer.java e58d2cf7239e45f1b790ce9770a8a8649b1b5fb9 GREEN
DynamicTreeViewer.java 545f1ca10b7b3cad171b294a4b447875da45c9ed GREEN
DynamicTreeViewerBase.java a2013538b62d86f6a09efdf2cd78babac2072484 GREEN
EmptyChildrenContentProvider.java 51b4468f9df8423abeea5ac6aa2f6cf99c2eb512 GREEN
IDoubleClickHandler.java 447f7769dead9a106b3ea3139ef0da51eb0b9a89 GREEN
......
......@@ -173,6 +173,7 @@ public final class DynamicTreeViewer<T> extends DynamicTreeViewerBase<T> {
} else {
this.setText(null);
this.setGraphic(null);
this.setStyle(null);
}
this.setContextMenu(menu);
}
......@@ -225,6 +226,16 @@ public final class DynamicTreeViewer<T> extends DynamicTreeViewerBase<T> {
uiProvider.dropClipboardContent(item, evt.getDragboard());
}
/** Collapses the given item. */
public void collapseItem(TreeItem<T> item) {
item.setExpanded(false);
}
/** Collapses all items. */
public void collapseAllItems() {
collapseItem(rootItem);
}
/** Expands the tree to the given item. */
public void expandItem(TreeItem<T> item) {
while(item.getParent() != null) {
......
......@@ -2,7 +2,7 @@ AnchorageContentControllerBase.java da56b10cbf2711b5da69f0b59f43eacbe54f4eea GRE
ClickControllerBase.java 8e5861ed5f9318008ad0fdd5497ed320cd5bd647 GREEN
ContentAnchorageMoveControllerBase.java c18e7915ce23e124757f5b736086ecc46694800a GREEN
ControllerBase.java 9311521b252e46640e26d409610e527fd5ed6922 GREEN
DefaultDiagramController.java 0e083b89a08f63967102a384d66ebc1d64d203af GREEN
DefaultDiagramController.java 3a0c4c4c28e6306dcaf70c5c1c7f8ad22bb86d73 GREEN
DelegatingContentAnchorageController.java 1889628a346a2183082ffe213978f9d15a949494 GREEN
DragControllerBase.java b15ff874304f679fe494d85f57cc8cbe4d0d1d15 GREEN
DraggingUtils.java 95117e2ea4c36b6c6a31f8088bb95b484e0e6612 GREEN
......
......@@ -9,17 +9,20 @@
*******************************************************************************/
package org.fortiss.tooling.common.ui.javafx.lwfxef.controller.base;
import java.util.LinkedList;
import static java.util.Arrays.asList;
import java.util.List;
import org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramCoordinate;
import org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramViewerFeatures;
import org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramViewerFeatures.IndicatorType;
import org.fortiss.tooling.common.ui.javafx.lwfxef.EDragGesture;
import org.fortiss.tooling.common.ui.javafx.lwfxef.change.Change;
import org.fortiss.tooling.common.ui.javafx.lwfxef.controller.IClickController;
import org.fortiss.tooling.common.ui.javafx.lwfxef.controller.IDragController;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IMVCBundle;
import javafx.collections.ObservableList;
import javafx.scene.Node;
import javafx.scene.control.Menu;
import javafx.scene.control.MenuItem;
......@@ -32,48 +35,86 @@ public class DefaultDiagramController extends ControllerBase {
/** Flag for ignoring mouse click event after dragging gesture. */
private boolean ignoreNextMouseClick = false;
/** Previous grid indicator type (to restore grid after it has been hidden). */
private IndicatorType previousGridIndicatorType = null;
/** Constructor. */
public DefaultDiagramController(IMVCBundle mvcb) {
super(mvcb);
}
/** {@inheritDoc} */
@Override
public List<MenuItem> contextMenuContributions(Node node, DiagramCoordinate diagramLocation) {
Menu menu = new Menu("Display ...");
DiagramViewerFeatures features = getViewer().getFeatures();
// link highlighting
/** Creates the {@link MenuItem} to enable/disable link highlighting. */
private MenuItem createLinkHighlightingMenuItem(DiagramViewerFeatures features) {
MenuItem linkHighLightingMenuItem;
if(features.isLinkHighlightingEnabled()) {
MenuItem disableLinkHighlighting = new MenuItem("Disable Link Highlighting");
disableLinkHighlighting.setOnAction(evt -> {
linkHighLightingMenuItem = new MenuItem("Disable Link Highlighting");
linkHighLightingMenuItem.setOnAction(evt -> {
features.setLinkHighlightingEnabled(false);
});
menu.getItems().add(disableLinkHighlighting);
} else {
MenuItem enableLinkHighlighting = new MenuItem("Enable Link Highlighting");
enableLinkHighlighting.setOnAction(evt -> {
linkHighLightingMenuItem = new MenuItem("Enable Link Highlighting");
linkHighLightingMenuItem.setOnAction(evt -> {
features.setLinkHighlightingEnabled(true);
});
menu.getItems().add(enableLinkHighlighting);
}
// interaction area shading
return linkHighLightingMenuItem;
}
/** Creates a {@link MenuItem} to enable/disable interaction shading. */
private MenuItem createInteractionAreaShadingMenuItem(DiagramViewerFeatures features) {
MenuItem interactionAreaShadingMenuItem;
if(features.isInteractionAreaShadingEnabled()) {
MenuItem disableInteractionShading = new MenuItem("Disable Interactive Area Shading");
disableInteractionShading.setOnAction(evt -> {
interactionAreaShadingMenuItem = new MenuItem("Disable Interactive Area Shading");
interactionAreaShadingMenuItem.setOnAction(evt -> {
features.setInteractionAreaShadingEnabled(false);
});
menu.getItems().add(disableInteractionShading);
} else {
MenuItem enableInteractionShading = new MenuItem("Enable Interactive Area Shading");
enableInteractionShading.setOnAction(evt -> {
interactionAreaShadingMenuItem = new MenuItem("Enable Interactive Area Shading");
interactionAreaShadingMenuItem.setOnAction(evt -> {
features.setInteractionAreaShadingEnabled(true);
});
menu.getItems().add(enableInteractionShading);
}
return interactionAreaShadingMenuItem;
}
/**
* Creates a {@link MenuItem} to hide/show the grid (returns {@code null} in case the diagram
* does not have a grid).
*/
private MenuItem createGridMenuItem(DiagramViewerFeatures features) {
MenuItem gridMenuItem = null;
if(features.getIndicatorType() == IndicatorType.INVISIBLE) {
if(previousGridIndicatorType != null) {
gridMenuItem = new MenuItem("Show Grid");
gridMenuItem.setOnAction(evt -> {
features.setIndicatorType(previousGridIndicatorType);
});
}
} else {
gridMenuItem = new MenuItem("Hide Grid");
gridMenuItem.setOnAction(evt -> {
previousGridIndicatorType = features.getIndicatorType();
features.setIndicatorType(IndicatorType.INVISIBLE);
});
}
return gridMenuItem;
}
/** {@inheritDoc} */
@Override
public List<MenuItem> contextMenuContributions(Node node, DiagramCoordinate diagramLocation) {
Menu menu = new Menu("Display ...");
ObservableList<MenuItem> menuItems = menu.getItems();
DiagramViewerFeatures features = getViewer().getFeatures();
menuItems.add(createLinkHighlightingMenuItem(features));
menuItems.add(createInteractionAreaShadingMenuItem(features));
MenuItem gridMenuItem = createGridMenuItem(features);
if(gridMenuItem != null) {
menuItems.add(gridMenuItem);
}
List<MenuItem> menuList = new LinkedList<>();
menuList.add(menu);
return menuList;
return asList(menu);
}
/** {@inheritDoc} */
......
ContentAnchorageVisualBase.java 6722629a940e9f8d973d2176bc3855932d7fa35a GREEN
ContentVisualBase.java 6c9c508803874db2f5ffffb723c1df5664827a5d GREEN
ContentVisualBase.java 938e37e98bb91917686d39d17e73efa265ec26df GREEN
DiagramAnchorageVisualBase.java 05c235152bc79187f0fc9b041435da7968654a78 GREEN
LinkVisualBase.java 909b933b38b7651cac901d767115e173983bef26 GREEN
MVCBundlePartWithEffectsBase.java 6f6fbbb065950ad3acd4dc1fbfdd1348874e51d2 GREEN
......
......@@ -31,6 +31,8 @@ import javafx.geometry.VPos;
import javafx.scene.Node;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.paint.Color;
import javafx.scene.paint.Paint;
import javafx.scene.shape.Shape;
import javafx.scene.text.Text;
import javafx.scene.text.TextAlignment;
......@@ -70,6 +72,11 @@ public abstract class ContentVisualBase extends VisualBase implements IContentVi
return "";
}
/** Returns the text color. */
protected Paint getTextColor() {
return Color.BLACK;
}
/** Returns the anchor location relative to the parent bounds. */
protected DiagramCoordinate getTextAnchorLocation() {
Insets i = getTextInsets();
......@@ -210,6 +217,7 @@ public abstract class ContentVisualBase extends VisualBase implements IContentVi
}
text.setX(anchorX);
text.setY(anchorY);
text.setFill(getTextColor());
text.setText(getName());
text.setWrappingWidth(rightX - anchorX - i.getRight());
text.setTextAlignment(getHorizontalTextAlignment());
......
......@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Tooling Commons
Bundle-SymbolicName: org.fortiss.tooling.common;singleton:=true
Bundle-Version: 2.18.0.qualifier
Bundle-Version: 2.19.0.qualifier
Require-Bundle: org.eclipse.core.runtime;visibility:=reexport,
com.ibm.icu;visibility:=reexport,
org.junit;visibility:=reexport
......
......@@ -2,10 +2,10 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Tooling Graphics GL UI
Bundle-SymbolicName: org.fortiss.tooling.graphicsGL.ui;singleton:=true
Bundle-Version: 2.18.0.qualifier
Bundle-Version: 2.19.0.qualifier
Bundle-Activator: org.fortiss.tooling.graphicsGL.ui.ToolingGraphicsGLUIActivator
Require-Bundle: org.fortiss.tooling.graphicsGL;bundle-version="2.18.0";visibility:=reexport,
org.fortiss.tooling.base.ui;bundle-version="2.18.0";visibility:=reexport
Require-Bundle: org.fortiss.tooling.graphicsGL;bundle-version="2.19.0";visibility:=reexport,
org.fortiss.tooling.base.ui;bundle-version="2.19.0";visibility:=reexport
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-11
Bundle-Vendor: fortiss GmbH
......
......@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.fortiss.tooling.graphicsGL;singleton:=true
Bundle-Version: 2.18.0.qualifier
Bundle-Version: 2.19.0.qualifier
Bundle-ClassPath: .
Bundle-Vendor: %providerName
Bundle-Localization: plugin
......@@ -23,5 +23,5 @@ Export-Package: org.fortiss.tooling.graphicsGL,
org.fortiss.tooling.graphicsGL.model.scene.util,
org.fortiss.tooling.graphicsGL.model.util,
org.fortiss.tooling.graphicsGL.util
Require-Bundle: org.fortiss.tooling.kernel;bundle-version="2.18.0";visibility:=reexport
Require-Bundle: org.fortiss.tooling.kernel;bundle-version="2.19.0";visibility:=reexport
Automatic-Module-Name: org.fortiss.tooling.graphicsGL
......@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Tooling Kernel UI
Bundle-SymbolicName: org.fortiss.tooling.kernel.ui;singleton:=true
Bundle-Version: 2.18.0.qualifier
Bundle-Version: 2.19.0.qualifier
Bundle-Activator: org.fortiss.tooling.kernel.ui.ToolingKernelUIActivator
Require-Bundle: org.fortiss.tooling.common.ui;visibility:=reexport,
org.fortiss.tooling.kernel;visibility:=reexport,
......