Skip to content
Snippets Groups Projects
Commit 1ffc3e9f authored by Simon Barner's avatar Simon Barner
Browse files

RED

parent 15d00362
No related branches found
No related tags found
1 merge request!88[3873] Ellipses and Bezier curves
Showing
with 33 additions and 16 deletions
DiagramCoordinate.java 6b00aec99054d4cd19003a72bd4e5e774ac6a641 GREEN
DiagramLayers.java 155cbb47a5f0aaa0025320ae607e6777f3a2d2e8 GREEN
DiagramViewer.java d5ba3f45ddc619132434f9cbefd36f65cce18b65 YELLOW
DiagramViewer.java e7c550be6443f798ba9399a35ab3059033a33e59 RED
DiagramViewerDefaultTags.java 6230763252409c60009ab8887b4ef582cf883229 GREEN
DiagramViewerFeatures.java 31e3fb61f915b0d8695005b083c47ce1c5be0b05 GREEN
DiagramViewerSelection.java e833f592543bc97077907d980a39b123fc4044e6 GREEN
......
......@@ -9,6 +9,7 @@
*******************************************************************************/
package org.fortiss.tooling.common.ui.javafx.lwfxef;
import static java.lang.Math.abs;
import static java.lang.Math.ceil;
import static java.lang.Math.max;
import static java.lang.Math.min;
......@@ -117,6 +118,7 @@ public class DiagramViewer {
// selection feedback rectangle
mouseDragRectangle.setFill(Color.TRANSPARENT);
mouseDragRectangle.setStroke(Color.ORANGERED);
// TODO (SB): Magic constant
mouseDragRectangle.getStrokeDashArray().addAll(15.0, 5.0);
mouseDragRectangle.setMouseTransparent(true);
// viewer pane
......@@ -556,13 +558,13 @@ public class DiagramViewer {
return;
}
Point2D location = locationInDiagram;
double x = Math.min(mouseDragRectangleStartLocation.getX(), location.getX());
double x = min(mouseDragRectangleStartLocation.getX(), location.getX());
mouseDragRectangle.setX(x);
double w = Math.abs(mouseDragRectangleStartLocation.getX() - location.getX());
double w = abs(mouseDragRectangleStartLocation.getX() - location.getX());
mouseDragRectangle.setWidth(w);
double y = Math.min(mouseDragRectangleStartLocation.getY(), location.getY());
double y = min(mouseDragRectangleStartLocation.getY(), location.getY());
mouseDragRectangle.setY(y);
double h = Math.abs(mouseDragRectangleStartLocation.getY() - location.getY());
double h = abs(mouseDragRectangleStartLocation.getY() - location.getY());
mouseDragRectangle.setHeight(h);
}
......@@ -572,10 +574,10 @@ public class DiagramViewer {
return;
}
Point2D location = locationInDiagram;
double x = Math.min(mouseDragRectangleStartLocation.getX(), location.getX());
double w = Math.abs(mouseDragRectangleStartLocation.getX() - location.getX());
double y = Math.min(mouseDragRectangleStartLocation.getY(), location.getY());
double h = Math.abs(mouseDragRectangleStartLocation.getY() - location.getY());
double x = min(mouseDragRectangleStartLocation.getX(), location.getX());
double w = abs(mouseDragRectangleStartLocation.getX() - location.getX());
double y = min(mouseDragRectangleStartLocation.getY(), location.getY());
double h = abs(mouseDragRectangleStartLocation.getY() - location.getY());
layers.getVisualFeedbackLayer().remove(mouseDragRectangle);
Rectangle2D selectionRect = new Rectangle2D(x, y, w, h);
// remove old selection
......
ContentAnchorageVisualBase.java 6722629a940e9f8d973d2176bc3855932d7fa35a GREEN
ContentVisualBase.java b061d42fc27e980023980d070961d0814702237d YELLOW
ContentVisualBase.java d232c6cb7bc54b2430379379eb2985f5a2e12cd3 RED
DiagramAnchorageVisualBase.java 05c235152bc79187f0fc9b041435da7968654a78 GREEN
LinkVisualBase.java 909b933b38b7651cac901d767115e173983bef26 GREEN
MVCBundlePartWithEffectsBase.java 6f6fbbb065950ad3acd4dc1fbfdd1348874e51d2 GREEN
VisualBase.java a2daf2d8f8450559450ddf5bbc93d3f948c189dd YELLOW
VisualBase.java 8d6e74d5c74703dad12847cd5c913fa72707a84a RED
......@@ -41,6 +41,7 @@ public abstract class ContentVisualBase extends VisualBase implements IContentVi
protected final Text text = new Text();
/** The icon of this visual. */
protected final ImageView icon = new ImageView();
// TODO (SB): Magic constant
/** The expanded / collapsed indicator widget. */
protected final ExpandCollapseWidget expandCollapseWidget =
new ExpandCollapseWidget(0, 0, 20, 20, 3);
......@@ -79,6 +80,7 @@ public abstract class ContentVisualBase extends VisualBase implements IContentVi
/** Returns the insets of the text label. */
protected Insets getTextInsets() {
// TODO (SB): Magic constant
return new Insets(10, 10, 10, 10);
}
......@@ -250,12 +252,14 @@ public abstract class ContentVisualBase extends VisualBase implements IContentVi
/** Returns the inset for the plus/minus sign of the expand/collapse widget. */
protected double getExpandCollapseWidgetInset() {
// TODO (SB): Magic constant
return 3;
}
/** Returns the location for the expand/collapse widget. */
protected Rectangle2D getExpandCollapseWidgetRectangle() {
Rectangle2D b = getCurrentBounds();
// TODO (SB): Magic constant
return new Rectangle2D(b.getWidth() - 20, 6, 14, 14);
}
......
......@@ -85,6 +85,7 @@ public abstract class VisualBase extends MVCBundlePartWithEffectsBase implements
protected void createHoverEffect(DiagramLayers layers) {
Color shadow = getHoverShadowColor();
if(shadow != null && visualShape != null) {
// TODO (SB): Magic constant
visualShape.setEffect(new DropShadow(10, 3, 3, shadow));
}
// handle hover text
......@@ -280,6 +281,7 @@ public abstract class VisualBase extends MVCBundlePartWithEffectsBase implements
/** Returns the opacity of the content visual. */
protected double getOpacity() {
// TODO (SB): Magic constant
return 0.8;
}
......@@ -290,6 +292,7 @@ public abstract class VisualBase extends MVCBundlePartWithEffectsBase implements
/** Returns the width of the border. */
protected double getBorderWidth() {
// TODO (SB): Magic constant
return 2;
}
......@@ -320,6 +323,7 @@ public abstract class VisualBase extends MVCBundlePartWithEffectsBase implements
/** Returns the size of the hit area as an outset of the visible rectangle. */
protected double getHitAreaOutset() {
// TODO (SB): Magic constant
return 10;
}
......
CircularContentAnchorageVisualBase.java de227ce8a2a14eb4df7bdcf43b82d98f6ff17045 YELLOW
CircularContentAnchorageVisualBase.java e1d3f982239beb38120c7eda6ecf319ab2779f9c RED
CircularContentVisualBase.java cc3caea328e36e90069b915e413c8e7e9522a939 GREEN
CircularDiagramAnchorageVisualBase.java 7a3b92fb1b135c218b9a5e16506acfc74a6b5468 YELLOW
CurveLinkVisualBase.java 5ce3086769004a9eb6800d7eb58379d831ff74b1 GREEN
......
......@@ -84,6 +84,7 @@ public abstract class CircularContentAnchorageVisualBase extends ContentAnchorag
/** Returns the insets of the filled circle subtracted from {@link #getDimensions()}. */
protected double getInset() {
// TODO (SB): Magic constant
return 2;
}
......
DiamondContentVisualBase.java 214dc886dba3f26a6404db5c521715466ce85522 YELLOW
DiamondContentVisualBase.java de349d41b84b2063f74c03ff5ad7290855e997f7 RED
LineLinkGraph.java 85a06a553f88f7b9fb4bd9c06411725d9fb160fc GREEN
LineLinkVisualBase.java 41cee7c8258cb65080bfce2a5d785772305a8119 YELLOW
LineLinkVisualBase.java 5529031f89a96ad0322f011e89dad1ece785bc03 RED
LineSegment.java a8658ec5bcd930d417a148861831b9ebb70bb37d GREEN
RectangularBorderLocation.java 824472c353534d1094ae4f735a30a231b885f050 GREEN
RectangularContentAnchorageVisualBase.java 39981dc29cac42d77c6ffe855ecc8ccad1689230 GREEN
RectangularContentVisualBase.java ccd23400a7ac47573127a39bc68c55c82baa44ad YELLOW
RectangularContentVisualBase.java aee9ac3dbd53ce89539252d9984ed103d955be2f RED
RectangularDiagramAnchorageVisualBase.java 1259d6d110becca9ae02c754036c6693f00de683 GREEN
RhomboidContentVisualBase.java 7a91e401034acc629179fb1a45416cd519f617d7 YELLOW
RhomboidContentVisualBase.java 0c3820cbfd3763c3cb6b1a0cba5cc71d8eecea73 RED
......@@ -190,6 +190,7 @@ public abstract class DiamondContentVisualBase extends ContentVisualBase {
@Override
protected DiagramCoordinate getTextAnchorLocation() {
DiagramCoordinate textAnchorLocation = super.getTextAnchorLocation();
// TODO (SB): Magic constant
return textAnchorLocation.add(getCurrentBounds().getWidth() / 5, 0);
}
}
......@@ -339,6 +339,7 @@ public abstract class LineLinkVisualBase extends LinkVisualBase {
/** Returns the length of the arrow. */
protected double getArrowLength() {
// TODO (SB): Magic constant
return 10;
}
......
......@@ -28,6 +28,7 @@ import javafx.scene.Node;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
// TODO (SB): Check potential code duplication with RectangularContentVisualBase (dragGestureHitTest)
/** Base class for {@link ContentVisualBase content visuals} depicted by rectangles. */
public abstract class RectangularContentVisualBase extends ContentVisualBase {
/** Constructor. */
......@@ -98,6 +99,7 @@ public abstract class RectangularContentVisualBase extends ContentVisualBase {
/** Returns the dimensions of the corner arcs. */
protected Dimension2D getCornerArcDimensions() {
// TODO (SB): Magic constant
return new Dimension2D(15, 15);
}
......
......@@ -86,6 +86,7 @@ public abstract class RhomboidContentVisualBase extends ContentVisualBase {
/** Returns the offset of the upper and lower rhomboid line (0 = rectangle). */
public double getOffset() {
// TODO (SB): Magic constant
return 3.0 * getViewer().getFeatures().getHorizontalSpacing();
}
......@@ -123,6 +124,7 @@ public abstract class RhomboidContentVisualBase extends ContentVisualBase {
/** Returns the dimensions of the corner arcs. */
protected Dimension2D getCornerArcDimensions() {
// TODO (SB): Magic constant
return new Dimension2D(15, 15);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment