Commit 62263a95 authored by Alexander Diewald's avatar Alexander Diewald

Merge remote-tracking branch 'origin/master' into 3767

Conflicts:
	org.fortiss.tooling.base.ui/META-INF/MANIFEST.MF
	org.fortiss.tooling.base/META-INF/MANIFEST.MF
	org.fortiss.tooling.graphicsGL.ui/META-INF/MANIFEST.MF
	org.fortiss.tooling.graphicsGL/META-INF/MANIFEST.MF
	org.fortiss.tooling.kernel/META-INF/MANIFEST.MF
	org.fortiss.tooling.spiderchart.ui/META-INF/MANIFEST.MF
Signed-off-by: Alexander Diewald's avatarAlexander Diewald <diewald@fortiss.org>
parents 03117b77 8bba4e87
......@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Tooling Base UI
Bundle-SymbolicName: org.fortiss.tooling.base.ui;singleton:=true
Bundle-Version: 2.16.0.qualifier
Bundle-Version: 2.17.0.qualifier
Bundle-Activator: org.fortiss.tooling.base.ui.ToolingBaseUIActivator
Require-Bundle: org.fortiss.tooling.base;visibility:=reexport,
org.fortiss.tooling.kernel.ui;visibility:=reexport,
......
......@@ -6,7 +6,7 @@ LayoutedEllipticContentVisualBase.java 6f3daf386d5120793b90ce4569dd9bea33dd2a0f
LayoutedLineLinkVisual.java 5fc26086e2f63afee403379ba8f09f5113d4c025 GREEN
LayoutedRectangularContentVisualBase.java 61698ffd771ee2ad798025df8195d1bc09c2c765 GREEN
NamedLayoutedCircularAnchorageContentVisual.java 5ba0b5d133998eac47425696ef0a02b575418c2d GREEN
NamedLayoutedCircularAnchorageDiagramVisual.java 94eccb7bb03c5518ae875e9972f062ddd0e1f62d GREEN
NamedLayoutedCircularAnchorageDiagramVisual.java eb1e736d7715b86dbc3ca0551bb754157f71cc5f GREEN
NamedLayoutedCurveLinkVisual.java 7945b2f550d5e4804f44891294ee60cc8ffcbf1e GREEN
NamedLayoutedEllipticContentVisual.java f96a956c2f71b675eee56cfc613684397545da68 GREEN
NamedLayoutedLineLinkVisual.java 4fc48616000516dc90ba22b7069ffdabadc9c377 GREEN
......
......@@ -65,6 +65,15 @@ public class NamedLayoutedCircularAnchorageDiagramVisual<T extends ILayoutedMode
}
}
/** {@inheritDoc} */
@Override
public void removeAllVisuals(DiagramLayers layers) {
super.removeAllVisuals(layers);
if(nameText.getParent() != null) {
layers.getVisualFeedbackLayer().remove(nameText);
}
}
/** Returns whether the name label should be enabled. */
public boolean enableName() {
return !freeConnectorHasVisibleConnections(getModelElement());
......
......@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.fortiss.tooling.base;singleton:=true
Bundle-Version: 2.16.0.qualifier
Bundle-Version: 2.17.0.qualifier
Bundle-ClassPath: .
Bundle-Vendor: %providerName
Bundle-Localization: plugin
......
......@@ -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.16.0.qualifier
Bundle-Version: 2.17.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-11
Require-Bundle: org.fortiss.tooling.common;visibility:=reexport,
org.eclipse.core.resources;visibility:=reexport,
......
......@@ -5,7 +5,8 @@ bin.includes = .,\
lib/org.conqat.ide.commons.gef.jar,\
lib/org.conqat.ide.commons.ui.jar,\
lib/swt-grouplayout.jar,\
res/
res/,\
icons/
jars.compile.order = .
source.. = src/,\
res/,\
......
DiagramCoordinate.java 6b00aec99054d4cd19003a72bd4e5e774ac6a641 GREEN
DiagramLayers.java 155cbb47a5f0aaa0025320ae607e6777f3a2d2e8 GREEN
DiagramViewer.java 82a70a1bb673b455ebc430bbc2cffc71ab9f3140 GREEN
DiagramViewer.java 920bb0f4ee6dd9ac6b607e44c01f04a413b2e2ed GREEN
DiagramViewerDefaultTags.java 6230763252409c60009ab8887b4ef582cf883229 GREEN
DiagramViewerFeatures.java 31e3fb61f915b0d8695005b083c47ce1c5be0b05 GREEN
DiagramViewerFeatures.java 44f5315505d76ef8cb0b61b5a37d7d2501195788 GREEN
DiagramViewerSelection.java e833f592543bc97077907d980a39b123fc4044e6 GREEN
EDragGesture.java 5cfa098d3877db11981c2750e5e103156d62fc5e GREEN
FeedbackChange.java b088fa89af648f1674f2f9c1f7f99d585ce801ca GREEN
......
......@@ -14,19 +14,23 @@ import static java.lang.Math.ceil;
import static java.lang.Math.max;
import static java.lang.Math.min;
import static java.util.Objects.requireNonNull;
import static javafx.geometry.VPos.TOP;
import static javafx.scene.layout.GridPane.setHgrow;
import static javafx.scene.layout.GridPane.setVgrow;
import static javafx.scene.layout.Priority.ALWAYS;
import static javafx.scene.paint.Color.ORANGERED;
import static javafx.scene.paint.Color.grayRgb;
import static org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramViewerDefaultTags.LINK_TARGET_ALLOWED_TAG;
import static org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramViewerDefaultTags.LINK_TARGET_DENIED_TAG;
import static org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramViewerDefaultTags.LINK_TARGET_MAYBE_TAG;
import static org.fortiss.tooling.common.ui.javafx.util.GraphicUtils.getFXImage;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
import org.fortiss.tooling.common.ui.ToolingCommonUIActivator;
import org.fortiss.tooling.common.ui.javafx.lwfxef.change.Change;
import org.fortiss.tooling.common.ui.javafx.lwfxef.change.ChangeSet;
import org.fortiss.tooling.common.ui.javafx.lwfxef.change.DefaultModelModifier;
......@@ -54,6 +58,8 @@ import javafx.scene.control.ContextMenu;
import javafx.scene.control.Label;
import javafx.scene.control.MenuItem;
import javafx.scene.control.ScrollBar;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.input.KeyEvent;
import javafx.scene.input.ScrollEvent;
import javafx.scene.layout.GridPane;
......@@ -62,6 +68,7 @@ import javafx.scene.paint.Color;
import javafx.scene.paint.Paint;
import javafx.scene.shape.Line;
import javafx.scene.shape.Rectangle;
import javafx.scene.text.Text;
/**
* This class represents the diagram viewer node, which manages the grid
......@@ -87,6 +94,12 @@ public class DiagramViewer {
private final DiagramLayers layers;
/** The viewer main pane. */
private final Pane viewerPane;
/** The help label. */
private final Label helpLabel = new Label("");
/** The help display. */
private Text helpText = null;
/** The help shadowed background. */
private final Rectangle helpShadow = new Rectangle(0, 0);
/** The mouse drag multi-selection feedback rectangle. */
private final Rectangle mouseDragRectangle = new Rectangle(0, 0);
/** The initial location where the selection rectangle was started. */
......@@ -178,12 +191,24 @@ public class DiagramViewer {
debugLabel.setLayoutY(20);
debugLabel.setTextFill(ORANGERED);
viewerPane.getChildren().add(helpLabel);
Image helpImage = getFXImage(ToolingCommonUIActivator.PLUGIN_ID, "/icons/help.png");
ImageView view = new ImageView(helpImage);
helpLabel.setGraphic(view);
helpLabel.setLayoutX(viewerPane.getWidth() - helpLabel.getWidth());
helpLabel.setLayoutY(0);
helpLabel.setOnMouseClicked(evt -> {
toggleHelp();
});
// clipping rectangle for the viewer pane
Rectangle viewerClip = new Rectangle();
viewerPane.setClip(viewerClip);
viewerPane.layoutBoundsProperty().addListener((obs, ov, nv) -> {
viewerClip.setWidth(nv.getWidth());
double width = nv.getWidth();
viewerClip.setWidth(width);
viewerClip.setHeight(nv.getHeight());
helpLabel.setLayoutX(width - helpLabel.getWidth());
});
// update the viewer content
......@@ -676,6 +701,41 @@ public class DiagramViewer {
return getLayers().getMouseState().getDragExtent();
}
/** Toggles the in-place help. */
private void toggleHelp() {
if(helpText == null) {
// enable help
String txt = features.getHelpText();
if(txt == null || "".equals(txt)) {
txt = "No in-place help available.";
}
helpText = new Text(txt);
helpText.setFill(Color.WHITE);
helpText.setLayoutY(0);
double lw = viewerPane.getWidth() - helpLabel.getWidth();
// 20% of the width with 3 pixel inset
helpText.setLayoutX(lw * .2 + 3);
helpText.setLayoutY(3);
helpText.setTextOrigin(TOP);
helpText.setWrappingWidth(lw * .8 - 6);
helpText.setOnMouseClicked(evt -> toggleHelp());
helpShadow.setX(lw * .2);
helpShadow.setY(0);
helpShadow.setWidth(lw * .8);
helpShadow.setHeight(viewerPane.getHeight());
helpShadow.setFill(grayRgb(32, .66));
helpShadow.setOnMouseClicked(evt -> toggleHelp());
viewerPane.getChildren().add(helpShadow);
viewerPane.getChildren().add(helpText);
} else {
// disable help
viewerPane.getChildren().remove(helpText);
viewerPane.getChildren().remove(helpShadow);
helpText = null;
}
}
/**
* Creates a drag controller for the given bundle, gesture, mouse location and source node also
* considering the current selection.
......
......@@ -47,6 +47,8 @@ public final class DiagramViewerFeatures {
private IndicatorType indicatorType = IndicatorType.CROSS;
/** The background color. */
private Color backgroundColor = LIGHTGRAY;
/** The help text for the diagram viewer in-place help */
private String helpText = null;
/** Constructor. */
public DiagramViewerFeatures(DiagramViewer diagramViewer) {
......@@ -280,4 +282,14 @@ public final class DiagramViewerFeatures {
public double getMaximumSpacing() {
return max(getVerticalSpacing(), getHorizontalSpacing());
}
/** Returns the help text. */
public String getHelpText() {
return helpText;
}
/** Sets help text. */
public void setHelpText(String helpText) {
this.helpText = helpText;
}
}
......@@ -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.16.0.qualifier
Bundle-Version: 2.17.0.qualifier
Require-Bundle: org.eclipse.core.runtime;visibility:=reexport,
com.ibm.icu;visibility:=reexport,
org.junit;visibility:=reexport
......
......@@ -2,7 +2,7 @@ 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.16.0.qualifier
Bundle-Version: 2.17.0.qualifier
Bundle-Activator: org.fortiss.tooling.graphicsGL.ui.ToolingGraphicsGLUIActivator
Require-Bundle: org.fortiss.tooling.graphicsGL;visibility:=reexport,
org.fortiss.tooling.base.ui;visibility:=reexport
......
......@@ -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.16.0.qualifier
Bundle-Version: 2.17.0.qualifier
Bundle-ClassPath: .
Bundle-Vendor: %providerName
Bundle-Localization: plugin
......
......@@ -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.16.0.qualifier
Bundle-Version: 2.17.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,
......
......@@ -2,12 +2,12 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.fortiss.tooling.kernel;singleton:=true
Bundle-Version: 2.16.0.qualifier
Bundle-Version: 2.17.0.qualifier
Bundle-ClassPath: .
Bundle-Activator: org.fortiss.tooling.kernel.ToolingKernelActivator
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Require-Bundle: org.fortiss.tooling.common;bundle-version="2.16.0";visibility:=reexport,
Require-Bundle: org.fortiss.tooling.common;visibility:=reexport,
org.eclipse.emf.transaction;bundle-version="1.4.0";visibility:=reexport,
org.eclipse.emf.ecore.xmi;bundle-version="2.7.0";visibility:=reexport
Bundle-RequiredExecutionEnvironment: JavaSE-11
......
......@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Spider Chart
Bundle-SymbolicName: org.fortiss.tooling.spiderchart.ui
Bundle-Version: 2.16.0.qualifier
Bundle-Version: 2.17.0.qualifier
Bundle-Vendor: fortiss GmbH
Bundle-RequiredExecutionEnvironment: JavaSE-11
Bundle-Developer: Amit Kumar Mondal (admin@amitinside.com)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment