diff --git a/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/control/treetableview/.ratings b/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/control/treetableview/.ratings index 9915c0fead5ae7a4dff9f36f10b9b4a24845f501..e3a97d52ba827fa99f31034194e9bd0c20278bc8 100644 --- a/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/control/treetableview/.ratings +++ b/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/control/treetableview/.ratings @@ -1,7 +1,7 @@ DynamicTreeContentProviderBase.java 6760a6dc5721175b1dada8f30fd9da05f7bcc4b3 GREEN DynamicTreeItem.java 75dc5534b119ffdb3c10a65810c2a0f330b7955e GREEN DynamicTreeTableUIProviderBase.java f78c0f8b52fbc939166b3f94f7f6006cc0f4d32b GREEN -DynamicTreeTableViewer.java 5e58a31a63f8e56d8c8e69e2c4d095809bc46bf1 GREEN +DynamicTreeTableViewer.java 9eb192873acf4f08ab3570c195d8828224a61934 GREEN DynamicTreeUIProviderBase.java e9b68607683de279d0cb8712a28dc131c5c33ece GREEN DynamicTreeViewer.java 725f41f4fb4b6bfa813f010fb9083ab02eea164a GREEN DynamicTreeViewerBase.java a2013538b62d86f6a09efdf2cd78babac2072484 GREEN diff --git a/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/control/treetableview/DynamicTreeTableViewer.java b/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/control/treetableview/DynamicTreeTableViewer.java index 5e58a31a63f8e56d8c8e69e2c4d095809bc46bf1..9eb192873acf4f08ab3570c195d8828224a61934 100644 --- a/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/control/treetableview/DynamicTreeTableViewer.java +++ b/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/control/treetableview/DynamicTreeTableViewer.java @@ -119,14 +119,19 @@ public final class DynamicTreeTableViewer<T> extends DynamicTreeViewerBase<T> { } } - /** Expands all items on all levels. */ - public void expandAllItems() { + /** Expand all items to the given level. */ + public void expandToLevel(int revealLevel) { TreeItem<T> root = view.getRoot(); if(root == null) { return; } - expandItem(root, MAX_VALUE); + expandItem(root, revealLevel); + } + + /** Expands all items on all levels. */ + public void expandAllItems() { + expandToLevel(MAX_VALUE); } /** diff --git a/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/lwfxef/visual/rectangular/.ratings b/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/lwfxef/visual/rectangular/.ratings index b2bd51c666f1d44fe1c509afafc7d3663c9faebd..96bd7fd61d7ceb3a34b8052c8dfd2a341ee94206 100644 --- a/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/lwfxef/visual/rectangular/.ratings +++ b/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/lwfxef/visual/rectangular/.ratings @@ -1,7 +1,7 @@ DiamondContentVisualBase.java a81e76e85706ad38b6c22bbcd1cc5a5696737e3d GREEN LineLinkGraph.java 85a06a553f88f7b9fb4bd9c06411725d9fb160fc GREEN -LineLinkVisualBase.java 74968c18bb68859bc795ed9a3b0693d1787e0806 GREEN -LineSegment.java a8658ec5bcd930d417a148861831b9ebb70bb37d GREEN +LineLinkVisualBase.java 876d6872b1844568f055809b975d2471330f719f GREEN +LineSegment.java 9ab1b97ad372db763654ef783747fa0733bec55c GREEN RectangularBorderLocation.java 824472c353534d1094ae4f735a30a231b885f050 GREEN RectangularContentAnchorageVisualBase.java 39981dc29cac42d77c6ffe855ecc8ccad1689230 GREEN RectangularContentVisualBase.java aeeda282f330180b1f339e3230810eccea2e7e7b GREEN diff --git a/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/lwfxef/visual/rectangular/LineLinkVisualBase.java b/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/lwfxef/visual/rectangular/LineLinkVisualBase.java index 74968c18bb68859bc795ed9a3b0693d1787e0806..876d6872b1844568f055809b975d2471330f719f 100644 --- a/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/lwfxef/visual/rectangular/LineLinkVisualBase.java +++ b/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/lwfxef/visual/rectangular/LineLinkVisualBase.java @@ -70,7 +70,8 @@ public abstract class LineLinkVisualBase extends LinkVisualBase { double nx = bp.getX() + chg.getDeltaX(); double ny = bp.getY() + chg.getDeltaY(); segments.add(new LineSegment(bpModel, sx, sy, nx, ny, getInvisibleSelectionLineWidth(), - feedbackSize, false, false, 0, getLabelText(i, pts + 1))); + feedbackSize, false, false, 0, getLabelText(i, pts + 1), + getSimulationLabelText(i, pts + 1))); sx = nx; sy = ny; bpModel = getBendPointModel(i); @@ -80,7 +81,8 @@ public abstract class LineLinkVisualBase extends LinkVisualBase { .applyToPoint(getEndAnchorPoint()); segments.add(new LineSegment(bpModel, sx, sy, endPoint.getX(), endPoint.getY(), getInvisibleSelectionLineWidth(), 0, showArrowOnLastSegment(), useLineArrow(), - getArrowLength(), getLabelText(pts, pts + 1))); + getArrowLength(), getLabelText(pts, pts + 1), + getSimulationLabelText(pts, pts + 1))); endFeedbackHandle.setX(endPoint.getX() - fs2); endFeedbackHandle.setY(endPoint.getY() - fs2); endFeedbackHandle.setWidth(feedbackSize); @@ -90,7 +92,8 @@ public abstract class LineLinkVisualBase extends LinkVisualBase { int numberOfSegs = segments.size(); for(int i = 0; i < numberOfSegs; i++) { LineSegment ls = segments.get(i); - ls.addLinkNodes(layers, bundle, getLabelText(i, numberOfSegs)); + ls.addLinkNodes(layers, bundle, getLabelText(i, numberOfSegs), + getSimulationLabelText(i, numberOfSegs)); } linesAddedToSceneGraph = true; } @@ -156,14 +159,16 @@ public abstract class LineLinkVisualBase extends LinkVisualBase { // handle bend points for(int i = 0; i < pts; i++) { Point2D ep = getFeedbackChangeForBendPoint(i).applyToPoint(getBendPointLocation(i)); - segments.get(segIndex).update(sp, ep, feedbackSize, 0, getLabelText(i, pts)); + segments.get(segIndex).update(sp, ep, feedbackSize, 0, getLabelText(i, pts), + getSimulationLabelText(i, pts)); sp = ep; segIndex++; } // end point Point2D ep = getFeedbackChangeForBendPoint(END_OF_LINK_BEND_POINT_INDEX) .applyToPoint(getEndAnchorPoint()); - segments.get(segIndex).update(sp, ep, 0, getArrowLength(), getLabelText(pts, pts)); + segments.get(segIndex).update(sp, ep, 0, getArrowLength(), getLabelText(pts, pts), + getSimulationLabelText(pts, pts)); endFeedbackHandle.setX(ep.getX() - fs2); endFeedbackHandle.setY(ep.getY() - fs2); endFeedbackHandle.setWidth(feedbackSize); @@ -360,6 +365,19 @@ public abstract class LineLinkVisualBase extends LinkVisualBase { return null; } + /** + * Returns the simulation label text. + * + * @param currentSegment + * the current segment + * @param lastSegment + * the last index of a segment + * @return the label text for the current segment or null for no label + */ + protected String getSimulationLabelText(int currentSegment, int lastSegment) { + return null; + } + /** Returns the {@link LinkMVCBundle}. */ private LinkMVCBundle getLinkBundle() { return (LinkMVCBundle)getMVCBundle(); diff --git a/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/lwfxef/visual/rectangular/LineSegment.java b/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/lwfxef/visual/rectangular/LineSegment.java index a8658ec5bcd930d417a148861831b9ebb70bb37d..9ab1b97ad372db763654ef783747fa0733bec55c 100644 --- a/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/lwfxef/visual/rectangular/LineSegment.java +++ b/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/lwfxef/visual/rectangular/LineSegment.java @@ -47,19 +47,23 @@ final class LineSegment { private final LinkArrowWidget arrowWidget; /** Stores the label. */ private Text label; + /** Stores the simulation label */ + private Text simulationLabel; + /** Offset of simulation label in y direction. */ + private final int SIMULATION_OFFSET = 1; /** Constructor. */ public LineSegment(double sx, double sy, double ex, double ey, double clickableWidth, double markerSize, boolean showArrow, boolean useLineArrow, double arrowLength, - String labelText) { + String labelText, String simulationLabelText) { this(null, sx, sy, ex, ey, clickableWidth, markerSize, showArrow, useLineArrow, arrowLength, - labelText); + labelText, simulationLabelText); } /** Constructor. */ public LineSegment(Object bendPointModel, double sx, double sy, double ex, double ey, double clickableWidth, double feedbackSize, boolean showArrow, boolean useLineArrow, - double arrowLength, String labelText) { + double arrowLength, String labelText, String simulationLabelText) { this.bendPointModel = bendPointModel; this.visibleLine = new Line(sx, sy, ex, ey); @@ -85,6 +89,14 @@ final class LineSegment { } else { label = null; } + if(simulationLabelText != null) { + simulationLabel = new Text(simulationLabelText); + simulationLabel.setTextAlignment(TextAlignment.CENTER); + simulationLabel.setTextOrigin(VPos.TOP); + simulationLabel.setFill(Color.RED); + } else { + simulationLabel = null; + } } /** Returns the bend point model. */ @@ -108,12 +120,14 @@ final class LineSegment { } /** Adds the link nodes of this segment to the link layer node. */ - public void addLinkNodes(DiagramLayers layers, ILinkMVCBundle bundle, String labelText) { + public void addLinkNodes(DiagramLayers layers, ILinkMVCBundle bundle, String labelText, + String simulationLabelText) { ILayer visualLayer = layers.getLinkLayer(); visualLayer.add(visibleLine, bundle); if(arrowWidget != null) { visualLayer.add(arrowWidget, bundle); } + if(label != null) { label.setText(labelText); double lx = (visibleLine.getStartX() + visibleLine.getEndX() - @@ -122,11 +136,26 @@ final class LineSegment { label.setX(lx); label.setY(ly); layers.getTextLayer().add(label, bundle); + if(simulationLabel != null) { + setSimulationLabel(simulationLabelText, lx, ly, + label.getBoundsInLocal().getHeight()); + layers.getTextLayer().add(simulationLabel, bundle); + } } ILayer interactionLayer = layers.getLinkInteractionLayer(); interactionLayer.add(clickableLine, bundle); } + /** + * Sets the text of the simulation label below the label of the line. + */ + private void setSimulationLabel(String simulationLabelText, double lx, double ly, + double yOffset) { + simulationLabel.setText(simulationLabelText); + simulationLabel.setX(lx); + simulationLabel.setY(ly + yOffset + SIMULATION_OFFSET); + } + /** Removes the link nodes of this segment from the link layer node. */ public void removeLinkNodes(DiagramLayers layers) { ILayer visualLayer = layers.getLinkLayer(); @@ -137,6 +166,9 @@ final class LineSegment { if(label != null) { layers.getTextLayer().remove(label); } + if(simulationLabel != null) { + layers.getTextLayer().remove(simulationLabel); + } ILayer interactionLayer = layers.getLinkInteractionLayer(); interactionLayer.remove(clickableLine); } @@ -166,7 +198,7 @@ final class LineSegment { /** Updates the line segment. */ public void update(Point2D sp, Point2D ep, double feedbackSize, double arrowLength, - String labelText) { + String labelText, String simulationLabelText) { double sx = sp.getX(); double sy = sp.getY(); visibleLine.setStartX(sx); @@ -196,6 +228,10 @@ final class LineSegment { double ly = (sy + ey) / 2; label.setX(lx); label.setY(ly); + if(simulationLabel != null) { + setSimulationLabel(simulationLabelText, lx, ly, + label.getBoundsInLocal().getHeight()); + } } } @@ -210,5 +246,8 @@ final class LineSegment { if(label != null) { label.setMouseTransparent(transparent); } + if(simulationLabel != null) { + simulationLabel.setMouseTransparent(transparent); + } } }