Skip to content

Commit

Permalink
[481748] Remove 'FX' prefix from classes provided by FX bundle.
Browse files Browse the repository at this point in the history
- Renamed IFXAnchor to IAnchor, AbstractFXAnchor to AbstractAnchor,
FXChopBoxAnchor to ChopBoxAnchor and FXStaticAnchor to StaticAnchor.
- Renamed FXGeometryNode to GeometryNode.
- Renamed FXConnection to Connection, IFXDecoration to
IConnectionDecoration, and IFXConnectionRouter to IConnectionRouter,
FXPolyBezierConnectionRouter to PolyBezierConnectionRouter, and
FXPolylineConnectionRouter to PolylineConnectionRouter.
- Renamed AbstractFXGesture to AbstractGesture,
AbstractFXMouseDragGesture to AbstractMouseDragGesture,
AbstractFXPinchSpreadGesture to AbstractPinchSpreadGesture, and
AbstractFXRotateGesture to AbstractRotateGesture.
- Split FXUtils into NodeUtils and CursorUtils and moved it into
o.e.g4.fx.utils package.
- Renamed ImageViewHoverOverlay to HoverOverlayImageView.
  • Loading branch information
nyssen committed Nov 9, 2015
1 parent 39e7e5c commit 8aa3d58
Show file tree
Hide file tree
Showing 68 changed files with 843 additions and 798 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
import org.eclipse.gef4.common.adapt.AdapterKey;
import org.eclipse.gef4.common.adapt.AdapterStore;
import org.eclipse.gef4.fx.anchors.AnchorKey;
import org.eclipse.gef4.fx.anchors.FXChopBoxAnchor;
import org.eclipse.gef4.fx.anchors.FXChopBoxAnchor.ReferencePointProvider;
import org.eclipse.gef4.fx.examples.AbstractFXExample;
import org.eclipse.gef4.fx.anchors.ChopBoxAnchor;
import org.eclipse.gef4.fx.anchors.ChopBoxAnchor.IReferencePointProvider;
import org.eclipse.gef4.fx.examples.AbstractFxExample;
import org.eclipse.gef4.geometry.planar.Point;

import javafx.beans.value.ChangeListener;
Expand All @@ -30,7 +30,7 @@
import javafx.scene.shape.Line;
import javafx.scene.shape.Rectangle;

public class FXChopBoxSnippet extends AbstractFXExample {
public class ChopBoxAnchorSnippet extends AbstractFxExample {

public static void main(String[] args) {
launch();
Expand All @@ -39,8 +39,8 @@ public static void main(String[] args) {
private Rectangle r1;
private Rectangle r2;

public FXChopBoxSnippet() {
super("FXChopBoxSnippet");
public ChopBoxAnchorSnippet() {
super("ChopBoxAnchorSnippet");
}

@Override
Expand All @@ -56,8 +56,8 @@ public Scene createScene() {
r2.relocate(200, 200);
final Line l = new Line();

FXChopBoxAnchor startAnchor = new FXChopBoxAnchor(r1);
FXChopBoxAnchor endAnchor = new FXChopBoxAnchor(r2);
ChopBoxAnchor startAnchor = new ChopBoxAnchor(r1);
ChopBoxAnchor endAnchor = new ChopBoxAnchor(r2);
final AnchorKey startKey = new AnchorKey(l, "start");
final AnchorKey endKey = new AnchorKey(l, "end");

Expand Down Expand Up @@ -94,15 +94,15 @@ public void changed(
+ r2.getHeight() / 2);

// use static values for chopbox anchor reference points
ReferencePointProvider.Impl referencePointProvider = new ReferencePointProvider.Impl();
IReferencePointProvider.Impl referencePointProvider = new IReferencePointProvider.Impl();
referencePointProvider.put(startKey, r2Center);
referencePointProvider.put(endKey, r1Center);

startAnchor.attach(startKey,
new AdapterStore(AdapterKey.get(ReferencePointProvider.class),
new AdapterStore(AdapterKey.get(IReferencePointProvider.class),
referencePointProvider));
endAnchor.attach(endKey,
new AdapterStore(AdapterKey.get(ReferencePointProvider.class),
new AdapterStore(AdapterKey.get(IReferencePointProvider.class),
referencePointProvider));

Group g = new Group(r1, r2, l);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
*******************************************************************************/
package org.eclipse.gef4.fx.examples.snippets;

import org.eclipse.gef4.fx.anchors.FXChopBoxAnchor;
import org.eclipse.gef4.fx.examples.AbstractFXExample;
import org.eclipse.gef4.fx.nodes.FXConnection;
import org.eclipse.gef4.fx.anchors.ChopBoxAnchor;
import org.eclipse.gef4.fx.examples.AbstractFxExample;
import org.eclipse.gef4.fx.nodes.Connection;

import javafx.event.ActionEvent;
import javafx.event.EventHandler;
Expand All @@ -26,7 +26,7 @@
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;

public class FXChopBoxConnectionSnippet extends AbstractFXExample {
public class ChopBoxConnectionSnippet extends AbstractFxExample {

public static void main(String[] args) {
launch();
Expand All @@ -36,12 +36,12 @@ public static void main(String[] args) {

private Rectangle nodeB;
private Rectangle nodeC;
private FXChopBoxAnchor anchorA;
private FXChopBoxAnchor anchorB;
private FXChopBoxAnchor anchorC;
private ChopBoxAnchor anchorA;
private ChopBoxAnchor anchorB;
private ChopBoxAnchor anchorC;

public FXChopBoxConnectionSnippet() {
super("FXChopBoxConnectionSnippet");
public ChopBoxConnectionSnippet() {
super("ChopBoxConnectionSnippet");
}

private EventHandler<ActionEvent> createMoveHandler(final String label,
Expand Down Expand Up @@ -83,16 +83,16 @@ public Scene createScene() {
btnC.setOnAction(createMoveHandler("C", nodeC, 200, 200, 300));
btnC.relocate(140, 0);

FXConnection connectionAB = new FXConnection();
FXConnection connectionBC = new FXConnection();
Connection connectionAB = new Connection();
Connection connectionBC = new Connection();

Group group = new Group(nodeA, nodeB, nodeC, connectionAB, connectionBC,
btnA, btnB, btnC);
root.getChildren().add(group);

anchorA = new FXChopBoxAnchor(nodeA);
anchorB = new FXChopBoxAnchor(nodeB);
anchorC = new FXChopBoxAnchor(nodeC);
anchorA = new ChopBoxAnchor(nodeA);
anchorB = new ChopBoxAnchor(nodeB);
anchorC = new ChopBoxAnchor(nodeC);
connectionAB.setStartAnchor(anchorA);
connectionAB.setEndAnchor(anchorB);
connectionBC.setStartAnchor(anchorB);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.gef4.fx.examples.snippets;

import org.eclipse.gef4.fx.examples.AbstractFXExample;
import org.eclipse.gef4.fx.examples.AbstractFxExample;

import javafx.event.EventHandler;
import javafx.geometry.Pos;
Expand All @@ -22,7 +22,7 @@
import javafx.scene.input.ZoomEvent;
import javafx.scene.layout.VBox;

public class GesturesSnippet extends AbstractFXExample {
public class GesturesSnippet extends AbstractFxExample {

public static void main(String[] args) {
launch();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*******************************************************************************/
package org.eclipse.gef4.fx.examples.snippets;

import org.eclipse.gef4.fx.examples.AbstractFXExample;
import org.eclipse.gef4.fx.examples.AbstractFxExample;
import org.eclipse.gef4.fx.nodes.InfiniteCanvas;
import org.eclipse.gef4.geometry.convert.fx.JavaFX2Geometry;
import org.eclipse.gef4.geometry.planar.AffineTransform;
Expand All @@ -32,7 +32,7 @@
import javafx.scene.transform.Affine;
import javafx.scene.transform.Transform;

public class InifinteCanvasSnippet extends AbstractFXExample {
public class InifinteCanvasSnippet extends AbstractFxExample {

public static void main(String[] args) {
launch();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*******************************************************************************/
package org.eclipse.gef4.fx.examples.snippets;

import org.eclipse.gef4.fx.examples.AbstractFXExample;
import org.eclipse.gef4.fx.examples.AbstractFxExample;
import org.eclipse.gef4.geometry.convert.fx.JavaFX2Geometry;
import org.eclipse.gef4.geometry.planar.AffineTransform;

Expand Down Expand Up @@ -46,7 +46,7 @@
import javafx.scene.transform.Shear;
import javafx.scene.transform.Transform;

public class FXLayoutSnippet extends AbstractFXExample {
public class LayoutSnippet extends AbstractFxExample {

public static void main(String[] args) {
launch();
Expand All @@ -61,8 +61,8 @@ public static void main(String[] args) {
private double initialHeight;
private Affine affine;

public FXLayoutSnippet() {
super("FXLayoutSnippet");
public LayoutSnippet() {
super("LayoutSnippet");
}

private void applyTransform(Affine dst, Transform transform) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
import javafx.scene.Scene;
import javafx.stage.Stage;

public abstract class AbstractFXExample extends Application {
public abstract class AbstractFxExample extends Application {

private String title;

public AbstractFXExample(String title) {
public AbstractFxExample(String title) {
this.title = title;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
import org.eclipse.gef4.common.adapt.AdapterKey;
import org.eclipse.gef4.common.adapt.AdapterStore;
import org.eclipse.gef4.fx.anchors.AnchorKey;
import org.eclipse.gef4.fx.anchors.FXChopBoxAnchor;
import org.eclipse.gef4.fx.gestures.AbstractFXMouseDragGesture;
import org.eclipse.gef4.fx.nodes.FXGeometryNode;
import org.eclipse.gef4.fx.nodes.FXUtils;
import org.eclipse.gef4.fx.anchors.ChopBoxAnchor;
import org.eclipse.gef4.fx.gestures.AbstractMouseDragGesture;
import org.eclipse.gef4.fx.nodes.GeometryNode;
import org.eclipse.gef4.fx.utils.NodeUtils;
import org.eclipse.gef4.geometry.convert.fx.JavaFX2Geometry;
import org.eclipse.gef4.geometry.euclidean.Vector;
import org.eclipse.gef4.geometry.internal.utils.PrecisionUtils;
Expand Down Expand Up @@ -53,10 +53,10 @@
import javafx.scene.shape.StrokeLineCap;
import javafx.scene.text.Text;

public class FXChopBoxELetterSnippet extends AbstractFXExample {
public class ChopBoxELetterSnippet extends AbstractFxExample {

private static class ComputationStrategy
extends FXChopBoxAnchor.ComputationStrategy.Impl {
extends ChopBoxAnchor.IComputationStrategy.Impl {

@Override
protected Point computeAnchorageReferencePointInScene(Node node,
Expand All @@ -71,7 +71,7 @@ protected ICurve getOutline(IGeometry geometry) {
}
}

private abstract static class OnDrag extends AbstractFXMouseDragGesture {
private abstract static class OnDrag extends AbstractMouseDragGesture {
private Node target;

public OnDrag(Node target) {
Expand Down Expand Up @@ -170,8 +170,8 @@ public static void main(String[] args) {
private Group markerLayer; // between shape and intersections
private Group intersectionLayer; // between markers and interaction elements
private Group interactionLayer; // always on top
private FXGeometryNode<CurvedPolygon> eLetterShape;
private FXChopBoxAnchor chopBoxAnchor;
private GeometryNode<CurvedPolygon> eLetterShape;
private ChopBoxAnchor chopBoxAnchor;
private ReadOnlyMapWrapper<AnchorKey, Point> referencePointProperty;
private Map<AnchorKey, Circle> chopBoxPoints = new HashMap<AnchorKey, Circle>();
private Map<AnchorKey, Line> chopBoxLinesReal = new HashMap<AnchorKey, Line>();
Expand All @@ -195,16 +195,16 @@ public void onChanged(
}
};

public FXChopBoxELetterSnippet() {
public ChopBoxELetterSnippet() {
super("FX ChopBox E-Letter Snippet");
}

private void attachToChopBoxAnchor(final AnchorKey ak,
final ReadOnlyMapWrapper<AnchorKey, Point> referencePointProperty) {
AdapterStore as = new AdapterStore();
as.setAdapter(
AdapterKey.get(FXChopBoxAnchor.ReferencePointProvider.class),
new FXChopBoxAnchor.ReferencePointProvider() {
AdapterKey.get(ChopBoxAnchor.IReferencePointProvider.class),
new ChopBoxAnchor.IReferencePointProvider() {
@Override
public ReadOnlyMapWrapper<AnchorKey, Point> referencePointProperty() {
return referencePointProperty;
Expand Down Expand Up @@ -279,9 +279,9 @@ private Node createELetterReferenceNode() {
return node;
}

private FXGeometryNode<CurvedPolygon> createELetterShape() {
FXGeometryNode<CurvedPolygon> eLetterShape = new FXGeometryNode<CurvedPolygon>(
FXGeometryNodeSnippet.createEShapeGeometry());
private GeometryNode<CurvedPolygon> createELetterShape() {
GeometryNode<CurvedPolygon> eLetterShape = new GeometryNode<CurvedPolygon>(
GeometryNodeSnippet.createEShapeGeometry());
eLetterShape.relocate(PAD, PAD);
eLetterShape.resize(WIDTH - PAD - PAD, HEIGHT - PAD - PAD);
return eLetterShape;
Expand Down Expand Up @@ -345,7 +345,7 @@ private Circle createReferencePointNode(final double x, final double y) {
referencePointNode.setCenterX(x);
referencePointNode.setCenterY(y);
referencePointNode
.setEffect(FXGeometryNodeSnippet.createShadowEffect());
.setEffect(GeometryNodeSnippet.createShadowEffect());
return referencePointNode;
}

Expand All @@ -357,7 +357,7 @@ public Scene createScene() {

// description (what is demonstrated)
Label descriptionLabel = new Label(
"This example demonstrates the chop box anchor position computation. An FXChopBoxAnchor is associated with the E letter shape (anchorage). The computation uses 2 reference points: the anchorage reference point (orange) and the anchored reference point (blue). The red point is the resulting anchor position.");
"This example demonstrates the chop box anchor position computation. An ChopBoxAnchor is associated with the E letter shape (anchorage). The computation uses 2 reference points: the anchorage reference point (orange) and the anchored reference point (blue). The red point is the resulting anchor position.");
descriptionLabel.setStyle("-fx-font-size: 10pt");
descriptionLabel.setWrapText(true);
descriptionLabel.resizeRelocate(10, 10, WIDTH - 20, PAD - 20);
Expand Down Expand Up @@ -392,7 +392,7 @@ public Scene createScene() {

// create chop box anchor and reference point property (so we can access
// the reference points easily)
chopBoxAnchor = new FXChopBoxAnchor(eLetterShape);
chopBoxAnchor = new ChopBoxAnchor(eLetterShape);
chopBoxAnchor.positionProperty().addListener(anchorPositionListener);
referencePointProperty = new ReadOnlyMapWrapper<AnchorKey, Point>(
FXCollections.observableMap(new HashMap<AnchorKey, Point>()));
Expand Down Expand Up @@ -575,7 +575,7 @@ private void styleELetterShape(boolean fillVisible) {
eLetterShape.setFill(
fillVisible ? Color.rgb(135, 150, 220) : Color.TRANSPARENT);
eLetterShape.setEffect(fillVisible
? FXGeometryNodeSnippet.createShadowEffect() : null);
? GeometryNodeSnippet.createShadowEffect() : null);
for (Line l : chopBoxLinesImaginary.values()) {
if (fillVisible) {
l.setStroke(CHOP_BOX_LINE_STROKE_IMAGINARY_WITH_FILL);
Expand Down Expand Up @@ -616,7 +616,7 @@ private void updateChopBoxLines(AnchorKey ak) {
intersectionLayer.getChildren().removeAll(toRemove);
}
List<Node> intersectionNodes = new ArrayList<Node>();
ICurve eLetterOutline = (ICurve) FXUtils.localToScene(eLetterShape,
ICurve eLetterOutline = (ICurve) NodeUtils.localToScene(eLetterShape,
computationStrategy.getOutline(eLetterShape.getGeometry()));
org.eclipse.gef4.geometry.planar.Line referenceLine = new org.eclipse.gef4.geometry.planar.Line(
referencePosition, eLetterReferencePoint);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
*******************************************************************************/
package org.eclipse.gef4.fx.examples;

import org.eclipse.gef4.fx.anchors.FXChopBoxAnchor;
import org.eclipse.gef4.fx.nodes.FXConnection;
import org.eclipse.gef4.fx.nodes.FXGeometryNode;
import org.eclipse.gef4.fx.nodes.IFXDecoration;
import org.eclipse.gef4.fx.anchors.ChopBoxAnchor;
import org.eclipse.gef4.fx.nodes.Connection;
import org.eclipse.gef4.fx.nodes.GeometryNode;
import org.eclipse.gef4.fx.nodes.IConnectionDecoration;
import org.eclipse.gef4.geometry.planar.Point;
import org.eclipse.gef4.geometry.planar.RoundedRectangle;

Expand All @@ -30,9 +30,9 @@
import javafx.scene.shape.Polyline;
import javafx.scene.shape.StrokeLineJoin;

public class FXConnectionSnippet extends AbstractFXExample {
public class ConnectionSnippet extends AbstractFxExample {

public static class ArrowHead extends Polyline implements IFXDecoration {
public static class ArrowHead extends Polyline implements IConnectionDecoration {
public ArrowHead() {
super(15.0, 0.0, 10.0, 0.0, 10.0, 3.0, 0.0, 0.0, 10.0, -3.0, 10.0,
0.0);
Expand Down Expand Up @@ -60,25 +60,25 @@ public static void main(String[] args) {
launch();
}

public FXConnectionSnippet() {
super("FXConnection Snippet");
public ConnectionSnippet() {
super("Connection Snippet");
}

@Override
public Scene createScene() {
FXGeometryNode<RoundedRectangle> end = new FXGeometryNode<RoundedRectangle>(
GeometryNode<RoundedRectangle> end = new GeometryNode<RoundedRectangle>(
new RoundedRectangle(0, 0, 30, 30, 10, 10));
end.setFill(Color.RED);
end.relocate(50, 50);
makeDraggable(end);

// create connection, provide decoration
FXConnection connection = new FXConnection();
Connection connection = new Connection();
connection.setEndDecoration(new ArrowHead());

// set start point and end anchor
connection.setStartPoint(new Point(150, 150));
connection.setEndAnchor(new FXChopBoxAnchor(end));
connection.setEndAnchor(new ChopBoxAnchor(end));

Group root = new Group();
root.getChildren().addAll(end, connection);
Expand Down
Loading

0 comments on commit 8aa3d58

Please sign in to comment.