Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "GEF/GEF4/FX"

< GEF‎ | GEF4
(GeometryNode)
 
(38 intermediate revisions by 3 users not shown)
Line 4: Line 4:
  
 
== Introduction ==
 
== Introduction ==
The <span style="color:#4C6084">[[GEF/GEF4/FX|GEF4 FX]]</span> component provides useful additions around JavaFX as well as for integrating JavaFX with SWT. It is internally composed out of four modules, namely '''[[#FX|FX]]''', '''[[#FX.SWT|FX.SWT]]''', '''[[#FX.JFace|FX.JFace]]''', and '''[[#FX.UI|FX.UI]]'''. There are also a couple of undeployed [[GEF/GEF4/FX/Examples#Examples (undeployed)|FX Examples]] and [[GEF/GEF4/FX/Examples#Examples.SWT (undeployed)|FX SWT Examples]].
+
The <span style="color:#4C6084">[[GEF/GEF4/FX|GEF4 FX]]</span> component provides useful additions around JavaFX as well as for integrating JavaFX with SWT. It is internally composed out of three modules, namely '''[[#FX|FX]]''', '''[[#FX.SWT|FX.SWT]]''', and '''[[#FX.JFace|FX.JFace]]'''. There are also a couple of undeployed [[GEF/GEF4/FX/Examples#Examples (undeployed)|FX Examples]] and [[GEF/GEF4/FX/Examples#Examples.SWT (undeployed)|FX SWT Examples]].
  
 
[[Image:GEF4-Components-FX.png|600px]]
 
[[Image:GEF4-Components-FX.png|600px]]
Line 19: Line 19:
 
=== {Root} ===
 
=== {Root} ===
  
The [[#FX:Root|{Root}]] package provides only provides the bundle activator, [[#FxBundle|FxBundle]].
+
The [[#FX:Root|{Root}]] package only provides the bundle activator, [[#FxBundle|FxBundle]].
  
 
[[File:GEF4-FX-root.png|281px]]
 
[[File:GEF4-FX-root.png|281px]]
Line 32: Line 32:
 
*'''package: org.eclipse.gef4.fx.anchors'''
 
*'''package: org.eclipse.gef4.fx.anchors'''
  
The [[#Anchors|Anchors]] package provides a visual anchor abstraction ([[#IFXAnchor, AbstractFXAnchor, AnchorKey|IFXAnchor]]), a related abstract base implementation ([[#IFXAnchor, AbstractFXAnchor, AnchorKey|AbstractFXAnchor]]), as well as concrete anchor implementations ([[#FXStaticAnchor|FXStaticAnchor]], [[#FXChopBoxAnchor|FXChopBoxAnchor]]) to manage dynamic positioning of visuals in dependence of others.
+
The [[#Anchors|Anchors]] package provides a visual anchor abstraction ([[#IAnchor, AbstractAnchor, AnchorKey|IAnchor]]), a related abstract base implementation ([[#IAnchor, AbstractAnchor, AnchorKey|AbstractAnchor]]), as well as concrete anchor implementations ([[#StaticAnchor|StaticAnchor]], [[#DynamicAnchor, IComputationStrategy, ProjectionStrategy, OrthogonalProjectionStrategy, ChopBoxStrategy|DynamicAnchor]]) to manage dynamic positioning of visuals in dependence of others.
  
[[File:GEF4-FX-anchors.png|627px]]
+
[[File:GEF4-FX-anchors.png|960px]]
  
==== IFXAnchor, AbstractFXAnchor, AnchorKey ====
+
==== IAnchor, AbstractAnchor, AnchorKey ====
An <code>IFXAnchor</code> is associated with one ''anchorage'' visual and can provide positions for several ''anchored'' visuals. Every anchored visual, for which a position should be computed by the anchor, has to be ''attached'' to the anchor. In order to allow the computation of different positions for the same visual, the anchored is wrapped in an <code>AnchorKey</code>, which combines a [http://docs.oracle.com/javafx/2/api/index.html?javafx/scene/Node.html javafx.scene.Node] with a [http://docs.oracle.com/javase/7/docs/api/index.html?java/lang/String.html java.lang.String] role. For example, imagine a self-loop (an edge that connects a vertex to itself) where the same visual (the edge) is attached to one anchorage (the vertex) with two different roles: the start of the edge, and the end of the edge.
+
An <code>IAnchor</code> is associated with one ''anchorage'' visual and can provide positions for several ''anchored'' visuals. Every anchored visual, for which a position should be computed by the anchor, has to be ''attached'' to the anchor. In order to allow the computation of different positions for the same visual, the anchored is wrapped in an <code>AnchorKey</code>, which combines a [http://docs.oracle.com/javafx/2/api/index.html?javafx/scene/Node.html javafx.scene.Node] with a [http://docs.oracle.com/javase/7/docs/api/index.html?java/lang/String.html java.lang.String] role. For example, imagine a self-loop (an edge that connects a vertex to itself) where the same visual (the edge) is attached to one anchorage (the vertex) with two different roles: the start of the edge, and the end of the edge.
  
When attaching an <code>AnchorKey</code> to an <code>IFXAnchor</code>, you can pass-in an arbitrary <i>info</i> object. This object can be evaluated by anchor implementations, therefore, it is used to provide additional information about the anchored, where necessary (see [[#FXChopBoxAnchor|FXChopboxAnchor]] for an example).
+
The abstract base implementation <code>AbstractAnchor</code> triggers a re-computation for an attached <code>AnchorKey</code> when the anchorage visual changes relative to the anchored visual or vice versa. This is realized using a [[#VisualChangeListener|VisualChangeListener]]. When an <code>AnchorKey</code> is detached from an <code>IAnchor</code>, no further computations will be performed for that <code>AnchorKey</code>.
  
The abstract base implementation <code>AbstractFXAnchor</code> triggers a re-computation for an attached <code>AnchorKey</code> when the anchorage visual changes relative to the anchored visual or vice versa. This is realized using a [[#VisualChangeListener|VisualChangeListener]]. When an <code>AnchorKey</code> is detached from an <code>IFXAnchor</code>, no further computations will be performed for that <code>AnchorKey</code>.
+
The anchorage visual and the positions for the anchoreds are managed using JavaFX Properties ([http://docs.oracle.com/javafx/2/binding/jfxpub-binding.htm Using JavaFX Properties and Binding]), i.e. you can register change listeners and realize bindings based on those properties.
  
The anchorage visual and the positions for the anchoreds are managed using JavaFX Properties ([http://docs.oracle.com/javafx/2/binding/jfxpub-binding.htm|Using JavaFX Properties and Binding]), i.e. you can register change listeners and realize bindings based on those properties.
+
==== StaticAnchor ====
  
==== FXStaticAnchor ====
+
The <code>StaticAnchor</code> is, conceivably, the most simple anchor implementation. It provides an anchor position based on a static reference position (either scene-global, or relative to its anchorage visual). This type of anchor proved itself useful as a placeholder when a position currently does not depend on an anchorage visual, but eventually will.
  
The <code>FXStaticAnchor</code> is, conceivably, the most simple anchor implementation. It provides an anchor position based on a static reference position (either scene-global, or relative to its anchorage visual). This type of anchor proved itself useful as a placeholder when a position currently does not depend on an anchorage visual, but eventually will.
+
==== DynamicAnchor, IComputationStrategy, ProjectionStrategy, OrthogonalProjectionStrategy, ChopBoxStrategy ====
  
==== FXChopBoxAnchor ====
+
The <code>DynamicAnchor</code> support calculation of 'dynamic' positions for anchored visuals, delegating the calculation to a respective <code>IComputationStrategy</code>, which can be exchanged.
  
The <code>FXChopBoxAnchor</code> uses reference points to compute the anchor position for the anchored visuals. One reference point is referred to as the anchorage reference point. This point is the same for every anchored. It is computed based on the geometry of the anchorage. In addition, every anchored specifies one reference point. One anchor position is computed for each pair of (anchorage-reference-point, anchored-reference-point).  
+
[[File:GEF4-FX-anchors-chopbox.png|1191px]]
  
[[File:GEF4-FX-anchors-chopbox.png|765px]]
+
The <code>IComputationStrategy</code>'s position computation can be based on an arbitrary number of <code>Parameter</code>s, which may either depend on the anchorage visual (static) or on the anchored visual (dynamic). These parameters are maintained by the <code>DynamicAnchor</code> and need to be provided by clients. As they are implemented as object properties, their values may simply by provided through JavaFX bindings:
  
The following paragraphs describe the anchor computation in detail.
+
<source lang="java" style="border-style:solid;border-color:#f2f2f2;border-width:1px;padding:10px;margin-bottom:10px">
 +
  getComputationParameter(AnchorageReferenceGeometry.class).bind(new ObjectBinding<IGeometry>() {
 +
    {
 +
      bind(anchorage.layoutBoundsProperty());
 +
    }
 +
 
 +
    @Override
 +
    protected IGeometry computeValue() {
 +
      return NodeUtils.getShapeOutline(anchorage);
 +
    }
 +
  });
 +
</source>
  
[[Image:GEF4FX-FXChopBoxAnchor-000.png|300px|FXChopBoxAnchor]]
+
There are three concrete computation strategies, which may be used in different scenarios. The <code>ProjectionStrategy</code> computes the closest projection of a given anchored reference point to a reference anchorage geometry outline (usually the geometric or visual outline). The <code>ChopBoxStrategy</code> is a specific projection strategy that computes the intersection between a line through the center of the anchorage reference geometry and the given anchored reference point and the outline of the anchorage reference geometry. The <code>OrthogonalProjectionStrategy</code> is another specialization that computes the closest horizontal or vertical projection of the anchored reference point to the anchorage geometry outline.
 
+
Here you can see how a connection is rendered with the <code>FXChopBoxAnchor</code>. The E letter shape is the anchorage visual. The blue point is the anchored visual. The green line is the connection from the anchored to the anchorage. Note that the connection is not drawn inside of the anchorage, but ends on its outline. We will see how this is implemented.
+
 
+
[[Image:GEF4FX-FXChopBoxAnchor-001.png|300px|FXChopBoxAnchor]]
+
 
+
In addition to the previous screenshot, you can see the center point of the anchorage bounds here. When this point is inside of the anchorage, it is used as the anchorage reference point. If it would be used as the anchorage reference point in this case, then the connection would end at that point, i.e. in the middle of nowhere. That's why a better anchorage reference point has to be computed.
+
 
+
[[Image:GEF4FX-FXChopBoxAnchor-002.png|300px|FXChopBoxAnchor]]
+
 
+
In order to find an anchorage reference point that actually is inside of the anchorage, the shape vertices of the anchorage are taken into consideration. You can see that the connection ends at one of those vertices. You may wonder how the vertex to use as the anchorage reference point is determined.
+
 
+
[[Image:GEF4FX-FXChopBoxAnchor-003.png|300px|FXChopBoxAnchor]]
+
 
+
In addition to the vertices, you can see lines connecting the center of the bounds with each vertex. The lines indicate the distance of each vertex to the center. The vertex that is closest to the center is used as the anchorage reference point.
+
 
+
[[Image:GEF4FX-FXChopBoxAnchor-005.png|300px|FXChopBoxAnchor]]
+
 
+
Two of the lines are highlighted and their distance is shown. The anchorage reference point is now determined (orange).
+
 
+
[[Image:GEF4FX-FXChopBoxAnchor-006.png|300px|FXChopBoxAnchor]]
+
 
+
A second anchored reference point is added to demonstrate how the actual anchor position is determined. A line from each anchored reference point to the anchorage reference point is constructed and intersected with the anchorage's outline. The intersection point that is closest to the anchored reference point is used as the anchor position.
+
  
 
----
 
----
Line 87: Line 76:
 
*'''package: org.eclipse.gef4.fx.gestures'''
 
*'''package: org.eclipse.gef4.fx.gestures'''
  
The [[#Gestures|Gestures]] package provides abstractions to compose related atomic JavaFX events into gestures, i.e. [[#FXMouseDragGesture|FXMouseDragGesture]], [[#FXPinchSpreadGesture|FXPinchSpreadGesture]], and [[#FXRotateGesture|FXRotateGesture]]. A gesture is implemented as an abstract class, with different abstract methods for the various parts of the gesture, i.e. <code>press()</code>, <code>drag()</code>, and <code>release()</code> in the case of an [[#FXMouseDragGesture|FXMouseDragGesture]]. Besides, every gesture provides a <code>setScene()</code> method to register/unregister JavaFX event listeners.
+
The [[#Gestures|Gestures]] package provides abstractions to compose related atomic JavaFX events into gestures, i.e. [[#AbstractMouseDragGesture|AbstractMouseDragGesture]], [[#AbstractPinchSpreadGesture|AbstractPinchSpreadGesture]], [[#AbstractRotateGesture|AbstractRotateGesture]], and [[#AbstractScrollGesture|AbstractScrollGesture]]. A gesture is implemented as an abstract class, with different abstract methods for the various parts of the gesture, i.e. <code>press()</code>, <code>drag()</code>, and <code>release()</code> in the case of an [[#AbstractMouseDragGesture|AbstractMouseDragGesture]]. Besides, every gesture provides a <code>setScene()</code> method to register/unregister JavaFX event listeners.
  
 
[[File:GEF4-FX-gestures.png|842px]]
 
[[File:GEF4-FX-gestures.png|842px]]
  
==== FXMouseDragGesture ====
+
==== AbstractMouseDragGesture ====
 +
 
 +
This <code>AbstractMouseDragGesture</code> reports mouse press, drag, and release events.
 +
 
 +
==== AbstractPinchSpreadGesture ====
  
This <code>FXMouseDragGesture</code> reports mouse press, drag, and release events.
+
This <code>AbstractPinchSpreadGesture</code> reports touch pinch and spread events, i.e. moving two fingers towards each other or away from each other.
  
==== FXPinchSpreadGesture ====
+
==== AbstractRotateGesture ====
  
This <code>FXPinchSpreadGesture</code> reports touch pinch and spread events, i.e. moving two fingers towards each other or away from each other.
+
This <code>AbstractRotateGesture</code> reports touch rotate events, i.e. dragging two fingers around each other.
  
==== FXRotateGesture ====
+
==== AbstractScrollGesture ====
  
This <code>FXRotateGesture</code> reports touch rotate events, i.e. dragging two fingers around each other.
+
This <code>AbstractScrollGesture</code> reports scroll events.
  
 
----
 
----
Line 126: Line 119:
  
 
The [[#Nodes|Nodes]] package provides
 
The [[#Nodes|Nodes]] package provides
* an adaptation of an [[GEF/GEF4/Geometry#IGeometry, ICurve, IShape, IMultiShape|org.eclipse.gef4.geometry.planar.IGeometry]] to [http://docs.oracle.com/javafx/2/api/index.html?javafx/scene/Node.html javafx.scene.Node]: [[#FXGeometryNode|FXGeometryNode]]
+
* an adaptation of an [[GEF/GEF4/Geometry#IGeometry, ICurve, IShape, IMultiShape|org.eclipse.gef4.geometry.planar.IGeometry]] to [http://docs.oracle.com/javafx/2/api/index.html?javafx/scene/Node.html javafx.scene.Node]: [[#GeometryNode|GeometryNode]].
* a connection abstraction that is based on [[#IFXAnchor, AbstractFXAnchor, AnchorKey|IFXAnchor]]: [[#FXConnection, IFXDecoration, IFXConnectionRouter, FXPolyBezierConnectionRouter, FXPolylineConnectionRouter|FXConnection]]
+
* a connection abstraction that is based on [[#IAnchor, AbstractAnchor, AnchorKey|IAnchor]]: [[#Connection|Connection]] as well as related abstractions ([[#IConnectionRouter, StraightRouter, OrthogonalRouter |IConnectionRouter]] and [[#IConnectionInterpolator, PolylineInterpolator, PolyBezierInterpolator |IConnectionInterpolator]]).
* a grid layer implementation: [[#FXGridLayer|FXGridLayer]]
+
* a visual to display an image which is overlayed by another image on mouse hover: [[#HoverOverlayImageView|HoverOverlayImageView]].
* a visual to display an image which is overlayed by another image on mouse hover: [[#FXImageViewHoverOverlay|FXImageViewHoverOverlay]]
+
* a custom infinite canvas implementation: [[#InfiniteCanvas|InfiniteCanvas]].
* a custom ScrollPane implementation: [[#ScrollPaneEx|ScrollPaneEx]]
+
* utilities (picking nodes, querying the pointer location, transformations): [[#NodeUtils|NodeUtils]], [[#CursorUtils|CursorUtils]], [[#Geometry2Shape, Shape2Geometry | Geometry2Shape, Shape2Geometry]].
* utilities (picking nodes, querying the pointer location, transformations): [[#FXUtils|FXUtils]]
+
  
[[File:GEF4-FX-nodes.png|1023px]]
+
[[File:GEF4-FX-nodes.png|810px]]
  
[[File:GEF4-FX-nodes-connection.png|911px]]
+
[[File:GEF4-FX-nodes-connection.png|994px]]
  
==== FXGeometryNode ====
+
==== GeometryNode ====
  
The <code>FXGeometryNode</code> is a specific [http://docs.oracle.com/javafx/2/api/index.html?javafx/scene/shape/Path.html javafx.scene.shape.Path] that is capable of displaying an [[GEF/GEF4/Geometry#IGeometry, ICurve, IShape, IMultiShape|org.eclipse.gef4.geometry.planar.IGeometry]].
+
The <code>GeometryNode</code> is a specific [http://docs.oracle.com/javafx/2/api/index.html?javafx/scene/layout/Region.html javafx.scene.layout.Region] that is capable of displaying an [[GEF/GEF4/Geometry#IGeometry, ICurve, IShape, IMultiShape|org.eclipse.gef4.geometry.planar.IGeometry]]. In contrast to a [http://docs.oracle.com/javafx/2/api/index.html?javafx/scene/shape/Shape.html javafx.scene.shape.Shape] its resizable.
  
==== FXGridLayer ====
+
<source lang="java" style="border-style:solid;border-color:#f2f2f2;border-width:1px;padding:10px;margin-bottom:10px">
 +
  GeometryNode<RoundedRectangle> n = new GeometryNode<>();
 +
 
 +
  // A GeometryNode has the same visible properties like a javafx.scene.shape.Shape...
 +
  n.setFill(Color.RED);
 +
  n.setStrokeWidth(5);
 +
  n.setStrokeType(StrokeType.OUTSIDE);
 +
 
 +
  // ... but it can either be relocated/resized based on the geometry (excluding stroke) ...
 +
  n.setGeometry(new RoundedRectangle(30, 40, 30, 40, 20, 20));
 +
  n.relocateGeometry(50, 60);
 +
  n.resizeGeometry(50, 60);
 +
 
 +
  // ... or based on the layout bounds (including stroke)
 +
  n.relocate(50, 60);
 +
  n.resize(50, 60);
 +
</source>
  
The <code>FXGridLayer</code> is a specific [http://docs.oracle.com/javafx/2/api/index.html?javafx/scene/layout/Pane.html javafx.scene.layout.Pane], which displays a grid with constant spacing that can be used as a background grid.
+
==== InfiniteCanvas ====
  
==== ScrollPaneEx ====
+
The <code>InfiniteCanvas</code> is an alternative to the [http://docs.oracle.com/javafx/2/api/index.html?javafx/scene/control/ScrollPane.html javafx.scene.control.ScrollPane]. It consists of multiple layers: <i>underlay group</i>, <i>scrolled underlay group</i>, <i>content group</i>, <i>scrolled overlay group</i>, <i>overlay group</i>.
  
The <code>ScrollPaneEx</code> is an alternative to the [http://docs.oracle.com/javafx/2/api/index.html?javafx/scene/control/ScrollPane.html javafx.scene.control.ScrollPane]. It consists of two layers: 1) a <i>scrolled pane</i>, and 2) a <i>scrollbars group</i>. The scrollbars group contains the horizontal and vertical scrollbars. It is rendered above the scrolled pane. A <i>content group</i> is wrapped inside the scrolled pane and contains all content. A <i>viewport transformation</i> is applied to this content group, i.e. scrolling is separated from the viewport transformation.
+
The <code>InfiniteCanvas</code> determines <i>scrollable bounds</i> and <i>content bounds</i>. Scrollbars will be automatically shown in case the content bounds exceed the canvas bounds.
  
The <code>ScrollPaneEx</code> determines the <i>scrollable bounds</i> based on the <i>content bounds</i> and the <i>viewport bounds</i> (its size) and provides access to these bounds. It does also provide methods to compute a translation from a scrollbar ratio and vice versa.
+
==== HoverOverlayImageView ====
 +
The <code>HoverOverlayImageView</code> displays a <i>base image</i>, for which a mouse hover effect is realized that displays an <i>overlay image</i> instead of the base image during hovering. Transitioning from one image to the other is done by gradually changing the opacities of both images. In the given example, the base image is the grey X and the overlay image is the red X.
  
==== FXImageViewHoverOverlay ====
+
[[File:GEF4-FX-imageviewhoveroverlay-001.png|left|Base image (grey X)|104px]]
The <code>FXImageViewHoverOverlay</code> displays a <i>base image</i>, for which a mouse hover effect is realized that displays an <i>overlay image</i> instead of the base image during hovering. Transitioning from one image to the other is done by gradually changing the opacities of both images. In the given example, the base image is the grey X and the overlay image is the red X.
+
  
[[File:GEF4-FX-imageviewhoveroverlay-001.png|left|Base image (grey X)]]
+
[[File:GEF4-FX-imageviewhoveroverlay-002.png|Overlayed image (red X)|104px]]
  
[[File:GEF4-FX-imageviewhoveroverlay-002.png|Overlayed image (red X)]]
+
==== Connection ====
  
==== FXConnection, IFXDecoration, IFXConnectionRouter, FXPolyBezierConnectionRouter, FXPolylineConnectionRouter ====
+
The <code>Connection</code> is an implementation of a connection with two endpoints and an arbitrary number of way-/control-points. One of the endpoints is referred to as the <i>start point</i>, the other one is referred to as the <i>end point</i>. The positions for endpoints and waypoints are computed using anchors, i.e. an <code>Connection</code> provides one [[#IAnchor, AbstractAnchor, AnchorKey|AnchorKey]] per point and manages one [[#IAnchor, AbstractAnchor, AnchorKey|IAnchor]] per point. However, the API also allows directly specifying coordinates for each point, in which case a [[#StaticAnchor|StaticAnchor]] is created internally.
  
The <code>FXConnection</code> is an implementation of a connection with two endpoints and an arbitrary number of waypoints. One of the endpoints is referred to as the <i>start point</i>, the other one is referred to as the <i>end point</i>. The positions for endpoints and waypoints are computed using anchors, i.e. an <code>FXConnection</code> provides one [[#IFXAnchor, AbstractFXAnchor, AnchorKey|AnchorKey]] per point and manages one [[#IFXAnchor, AbstractFXAnchor, AnchorKey|IFXAnchor]] per point. However, the API also allows directly specifying coordinates for each point, in which case an [[#FXStaticAnchor|FXStaticAnchor]] is created internally. An <code>FXConnection</code> works out-of-the-box in combination with [[#FXChopBoxAnchor|FXChopBoxAnchor]], i.e. it provides a special ReferencePointProvider implementation.
+
A <code>Connection</code> can have a <i>start decoration</i> and an <i>end decoration</i> which are displayed at the start point, or end point, respectively. Decorations can be used to display an arrow at one end of a connection, for example.
  
An <code>FXConnection</code> can have a <i>start decoration</i> and an <i>end decoration</i> which are displayed at the start point, or end point, respectively. A decoration implements the <code>IFXDecoration</code> interface. Decorations can be used to display an arrow at one end of a connection, for example.
+
==== IConnectionRouter, StraightRouter, OrthogonalRouter ====
 +
An <code>IConnectionRouter</code> receives the coordinates of all points of the connection (start point, way points, end point) and may insert additional (implicit) points to satisfy certain routing constraints. Currently, two connection routers are provided: 1) the <code>StraightRouter</code> (default), and 2) the <code>OrthogonalRouter</code>.
  
An <code>FXConnection</code> manages an [[#FXGeometryNode|FXGeometryNode]], which is referred to as the <i>curve node</i>. The ICurve which is displayed by the curve node is computed by an <code>IFXConnectionRouter</code>. The router receives the coordinates of all points of the connection (start point, way points, end point). Currently, two connection routers are provided: 1) the <code>FXPolylineConnectionRouter</code> (default), and 2) the <code>FXPolyBezierConnectionRouter</code>. The first one computes a [[GEF/GEF4/Geometry#Polyline|org.eclipse.gef4.geometry.planar.Polyline]] (only straight line segments) from the given points while the second one computes a [[GEF/GEF4/Geometry#PolyBezier|org.eclipse.gef4.geometry.planar.PolyBezier]] (consecutive Bezier curves with smooth continuity) from the given points.
+
==== IConnectionInterpolator, PolylineInterpolator, PolyBezierInterpolator ====
 +
A <code>Connection</code> manages a [http://docs.oracle.com/javafx/2/api/index.html?javafx/scene/Node.html javafx.scene.Node] (a [[#GeometryNode|GeometryNode]] by default), which is referred to as the <i>curve node</i>. The updating of the curve node based on the curve's points is delegated to an <code>IConnectionInterpolator</code>. It is also responsible for placing the curve's decorations as well as for clipping the decorations. Currently two interpolators are provided: 1) the <code>PolylineInterpolator</code> and 2) the <code>PolyBezierInterpolator</code>. The first one computes a [[GEF/GEF4/Geometry#Polyline|org.eclipse.gef4.geometry.planar.Polyline]] (only straight line segments) from the given points while the second one computes a [[GEF/GEF4/Geometry#PolyBezier|org.eclipse.gef4.geometry.planar.PolyBezier]] (consecutive Bezier curves with smooth continuity) from the given points.
  
==== FXUtils ====
+
==== NodeUtils ====
The <code>FXUtils</code> class contains utility functionality, such as querying the current mouse pointer location, picking nodes at a current position on the scene graph, and performing local-to-parent, local-to-scene, parent-to-local, and scene-to-local transformations of geometries (GEF4 IGeometry).
+
The <code>NodeUtils</code> class contains utility functionality, such as picking nodes at a current position on the scene graph, and performing local-to-parent, local-to-scene, parent-to-local, and scene-to-local transformations of geometries (GEF4 Geometry).
 +
 
 +
==== CursorUtils ====
 +
The <code>CursorUtils</code> provides utility functions related to cursors. It can be used for querying the current mouse pointer location for for forcing a cursor update.
 +
 
 +
==== Geometry2Shape, Shape2Geometry====
 +
The <code>Geometry2Shape</code> and <code>Shape2Geometry</code> utility classes provide utilities to infer [[GEF/GEF4/Geometry | GEF4 Geometry]] abstractions from a [http://docs.oracle.com/javafx/2/api/javafx/scene/shape/Shape.html javafx.scene.shape.Shape] and vice versa.
  
 
----
 
----
Line 183: Line 199:
 
The [[#Canvas|Canvas]] package provides a replacement for the [http://docs.oracle.com/javafx/2/api/index.html?javafx/embed/swt/FXCanvas.html javafx.embed.swt.FXCanvas], adding support for various JavaFX/SWT integration functionality.
 
The [[#Canvas|Canvas]] package provides a replacement for the [http://docs.oracle.com/javafx/2/api/index.html?javafx/embed/swt/FXCanvas.html javafx.embed.swt.FXCanvas], adding support for various JavaFX/SWT integration functionality.
  
[[File:GEF4-FX-UI-canvas.png|280px]]
+
[[File:GEF4-FX-SWT-canvas.png|524px]]
  
 
==== FXCanvasEx ====
 
==== FXCanvasEx ====
  
 
The <code>FXCanvasEx</code> is a replacement for the [http://docs.oracle.com/javafx/2/api/index.html?javafx/embed/swt/FXCanvas.html javafx.embed.swt.FXCanvas], providing support for various functionality which is missing. The <code>FXCanvasEx</code> forwards SWT GestureEvents (touch events) to JavaFX, notifies all SWT FocusListeners (additional to forwarding them to JavaFX), and supports changing the SWT Cursor based on the [http://docs.oracle.com/javafx/2/api/index.html?javafx/scene/Cursor.html javafx.scene.Cursor].
 
The <code>FXCanvasEx</code> is a replacement for the [http://docs.oracle.com/javafx/2/api/index.html?javafx/embed/swt/FXCanvas.html javafx.embed.swt.FXCanvas], providing support for various functionality which is missing. The <code>FXCanvasEx</code> forwards SWT GestureEvents (touch events) to JavaFX, notifies all SWT FocusListeners (additional to forwarding them to JavaFX), and supports changing the SWT Cursor based on the [http://docs.oracle.com/javafx/2/api/index.html?javafx/scene/Cursor.html javafx.scene.Cursor].
 +
 +
==== IFXCanvasFactory ====
 +
 +
The <code>IFXCanvasFactory</code> handles the construction of an [http://docs.oracle.com/javafx/2/api/index.html?javafx/embed/swt/FXCanvas.html javafx.embed.swt.FXCanvas] to render the JavaFX scene graph.
  
 
----
 
----
Line 197: Line 217:
 
The [[#Controls|Controls]] package provides a counterpart to the JavaFX/SWT integration, i.e. embedding SWT Controls into a JavaFX scene graph.
 
The [[#Controls|Controls]] package provides a counterpart to the JavaFX/SWT integration, i.e. embedding SWT Controls into a JavaFX scene graph.
  
[[File:GEF4-FX-UI-controls.png|341px]]
+
[[File:GEF4-FX-SWT-controls.png|1022px]]
  
 
==== FXControlAdapter ====
 
==== FXControlAdapter ====
Line 215: Line 235:
 
[[File:GEF4-MVC-FX-UI-FXSimpleGradientPicker-control.jpg|75px]]
 
[[File:GEF4-MVC-FX-UI-FXSimpleGradientPicker-control.jpg|75px]]
  
<small>The <code>FXAdvancedLinearGradientPicker</code> provides an SWT control which displays/allows the manipulation of an advanced linear gradient (i.e. more than 2 stops).
+
The <code>FXAdvancedLinearGradientPicker</code> provides an SWT control which displays/allows the manipulation of an advanced linear gradient (i.e. more than 2 stops).
  
 
[[File:GEF4-MVC-FX-UI-FXAdvancedGradientPicker-control.jpg]]
 
[[File:GEF4-MVC-FX-UI-FXAdvancedGradientPicker-control.jpg]]
Line 229: Line 249:
 
The [[#FX.SWT:Gestures|Gestures]] package provides support for the conversion of SWT GestureEvent (touch events) to corresponding JavaFX events when embedding a JavaFX scene graph into an SWT application (via [http://docs.oracle.com/javafx/2/api/index.html?javafx/embed/swt/FXCanvas.html javafx.embed.swt.FXCanvas]).
 
The [[#FX.SWT:Gestures|Gestures]] package provides support for the conversion of SWT GestureEvent (touch events) to corresponding JavaFX events when embedding a JavaFX scene graph into an SWT application (via [http://docs.oracle.com/javafx/2/api/index.html?javafx/embed/swt/FXCanvas.html javafx.embed.swt.FXCanvas]).
  
[[File:GEF4-FX-UI-gestures.png|374px]]
+
[[File:GEF4-FX-SWT-gestures.png|374px]]
  
==== SwtToFXGestureConverter ====
+
==== SWTToFXGestureConverter ====
  
The <code>SwtToFXGestureConverter</code> can be used to register listeners on an [http://docs.oracle.com/javafx/2/api/index.html?javafx/embed/swt/FXCanvas.html javafx.embed.swt.FXCanvas] for an automatic conversion of SWT GestureEvents to corresponding JavaFX events ([http://docs.oracle.com/javafx/2/api/index.html?javafx/scene/input/RotateEvent.html javafx.scene.input.RotateEvent], [http://docs.oracle.com/javafx/2/api/index.html?javafx/scene/input/ScrollEvent.html javafx.scene.input.ScrollEvent], [http://docs.oracle.com/javafx/2/api/index.html?javafx/scene/input/SwipeEvent.html javafx.scene.input.SwipeEvent], [http://docs.oracle.com/javafx/2/api/index.html?javafx/scene/input/ZoomEvent.html javafx.scene.input.ZoomEvent]). It is internally used by [[#FXCanvasEx|FXCanvasEx]] to transfer gesture events from SWT to JavaFX.
+
The <code>SWTToFXGestureConverter</code> can be used to register listeners on an [http://docs.oracle.com/javafx/2/api/index.html?javafx/embed/swt/FXCanvas.html javafx.embed.swt.FXCanvas] for an automatic conversion of SWT GestureEvents to corresponding JavaFX events ([http://docs.oracle.com/javafx/2/api/index.html?javafx/scene/input/RotateEvent.html javafx.scene.input.RotateEvent], [http://docs.oracle.com/javafx/2/api/index.html?javafx/scene/input/ScrollEvent.html javafx.scene.input.ScrollEvent], [http://docs.oracle.com/javafx/2/api/index.html?javafx/scene/input/SwipeEvent.html javafx.scene.input.SwipeEvent], [http://docs.oracle.com/javafx/2/api/index.html?javafx/scene/input/ZoomEvent.html javafx.scene.input.ZoomEvent]). It is internally used by [[#FXCanvasEx|FXCanvasEx]] to transfer gesture events from SWT to JavaFX.
  
 
----
 
----
Line 241: Line 261:
 
The '''[[#FX.JFace|FX.JFace]]''' module of [[GEF/GEF4/FX|GEF4 FX]] provides enhanced support for integrating JavaFX with JFace.
 
The '''[[#FX.JFace|FX.JFace]]''' module of [[GEF/GEF4/FX|GEF4 FX]] provides enhanced support for integrating JavaFX with JFace.
  
==== FXPaintCellEditor, FXPaintSelectionDialog ====
+
<div id="FX.JFace:Root"></div>
 +
=== {Root} ===
  
The <code>FXPaintCellEditor</code> is a [http://help.eclipse.org/topic/org.eclipse.platform.doc.isv/reference/api/org.eclipse.jface.viewers.DialogCellEditor.html org.eclipse.jface.viewers.DialogCellEditor] extension, which displays a currently selected JavaFX Paint and offers a button to change if via an FXPaintSelectionDialog.
+
The [[#FX.JFace:Root|{Root}]] package provides cell editors and corresponding dialogs to specify JavaFX properties.
  
[[File:GEF4-MVC-FX-UI-FXFillCellEditor-control.jpg]]
+
[[File:GEF4-FX-JFace-root.png|757px]]
  
The <code>FXPaintSelectionDialog</code> is a [http://help.eclipse.org/topic/org.eclipse.platform.doc.isv/reference/api/org.eclipse.jface.dialogs.Dialog.html org.eclipse.jface.dialogs.Dialog] extension, which provides a menu to select a JavaFX Paint (color or gradient). It is used by the <code>FXPaintCellEditor</code>.
+
==== FXPaintCellEditor ====
 +
The <code>FXPaintCellEditor</code> is a [http://help.eclipse.org/topic/org.eclipse.platform.doc.isv/reference/api/org.eclipse.jface.viewers.DialogCellEditor.html org.eclipse.jface.viewers.DialogCellEditor] extension, which displays a currently selected JavaFX Paint and offers a button to change if via an [[#FXPaintSelectionDialog|FXPaintSelectionDialog]].
  
[[File:GEF4-MVC-FX-UI-FXFillSelectionDialog-advanced.png]]
+
[[File:GEF4-MVC-FX-UI-FXFillCellEditor-control.jpg]]
  
----
+
==== FXPaintLabelProvider ====
 +
The <code>FXPaintLabelProvider</code> is a [http://help.eclipse.org/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/jface/viewers/LabelProvider.html org.eclipse.jface.viewers.LabelProvider] extension, which can be used to display a JavaFX Paint (color or gradient) value. It is used by the [[GEF/GEF4/MVC#FXPaintPropertyDescriptor | FXPaintPropertyDescriptor]].
  
== FX.UI ==
+
[[File:GEF4-FX-JFace-FXPaintLabelProvider-control.jpg|400px]]
  
The '''[[#FX.UI|FX.UI]]''' module of [[GEF/GEF4/FX|GEF4 FX]] provides enhanced support for integrating JavaFX with the Eclipse UI.
+
==== FXPaintSelectionDialog ====
[[Category:GEF]]
+
The <code>FXPaintSelectionDialog</code> is a [http://help.eclipse.org/topic/org.eclipse.platform.doc.isv/reference/api/org.eclipse.jface.dialogs.Dialog.html org.eclipse.jface.dialogs.Dialog] extension, which provides a menu to select a JavaFX Paint (color or gradient). It is used by the <code>FXPaintCellEditor</code>.
  
 +
[[File:GEF4-MVC-FX-UI-FXFillSelectionDialog-advanced.png]]
  
 
----
 
----

Latest revision as of 11:19, 2 June 2016

Note to non-wiki readers: This documentation is generated from the Eclipse wiki - if you have corrections or additions it would be awesome if you added them in the original wiki page.


Introduction

The GEF4 FX component provides useful additions around JavaFX as well as for integrating JavaFX with SWT. It is internally composed out of three modules, namely FX, FX.SWT, and FX.JFace. There are also a couple of undeployed FX Examples and FX SWT Examples.

GEF4-Components-FX.png


FX

The FX module of GEF4 FX provides enhancements for JavaFX, which can also be used independent of the Eclipse UI, e.g. visual anchors, gesture listeners, a connection implementation, or an IGeometry-based shape implementation.


{Root}

The {Root} package only provides the bundle activator, FxBundle.

GEF4-FX-root.png

FxBundle

The FxBundle is the bundle activator.


Anchors

  • package: org.eclipse.gef4.fx.anchors

The Anchors package provides a visual anchor abstraction (IAnchor), a related abstract base implementation (AbstractAnchor), as well as concrete anchor implementations (StaticAnchor, DynamicAnchor) to manage dynamic positioning of visuals in dependence of others.

GEF4-FX-anchors.png

IAnchor, AbstractAnchor, AnchorKey

An IAnchor is associated with one anchorage visual and can provide positions for several anchored visuals. Every anchored visual, for which a position should be computed by the anchor, has to be attached to the anchor. In order to allow the computation of different positions for the same visual, the anchored is wrapped in an AnchorKey, which combines a javafx.scene.Node with a java.lang.String role. For example, imagine a self-loop (an edge that connects a vertex to itself) where the same visual (the edge) is attached to one anchorage (the vertex) with two different roles: the start of the edge, and the end of the edge.

The abstract base implementation AbstractAnchor triggers a re-computation for an attached AnchorKey when the anchorage visual changes relative to the anchored visual or vice versa. This is realized using a VisualChangeListener. When an AnchorKey is detached from an IAnchor, no further computations will be performed for that AnchorKey.

The anchorage visual and the positions for the anchoreds are managed using JavaFX Properties (Using JavaFX Properties and Binding), i.e. you can register change listeners and realize bindings based on those properties.

StaticAnchor

The StaticAnchor is, conceivably, the most simple anchor implementation. It provides an anchor position based on a static reference position (either scene-global, or relative to its anchorage visual). This type of anchor proved itself useful as a placeholder when a position currently does not depend on an anchorage visual, but eventually will.

DynamicAnchor, IComputationStrategy, ProjectionStrategy, OrthogonalProjectionStrategy, ChopBoxStrategy

The DynamicAnchor support calculation of 'dynamic' positions for anchored visuals, delegating the calculation to a respective IComputationStrategy, which can be exchanged.

GEF4-FX-anchors-chopbox.png

The IComputationStrategy's position computation can be based on an arbitrary number of Parameters, which may either depend on the anchorage visual (static) or on the anchored visual (dynamic). These parameters are maintained by the DynamicAnchor and need to be provided by clients. As they are implemented as object properties, their values may simply by provided through JavaFX bindings:

  getComputationParameter(AnchorageReferenceGeometry.class).bind(new ObjectBinding<IGeometry>() {
    {
      bind(anchorage.layoutBoundsProperty());
    }
 
    @Override
    protected IGeometry computeValue() {
      return NodeUtils.getShapeOutline(anchorage);
    }
  });

There are three concrete computation strategies, which may be used in different scenarios. The ProjectionStrategy computes the closest projection of a given anchored reference point to a reference anchorage geometry outline (usually the geometric or visual outline). The ChopBoxStrategy is a specific projection strategy that computes the intersection between a line through the center of the anchorage reference geometry and the given anchored reference point and the outline of the anchorage reference geometry. The OrthogonalProjectionStrategy is another specialization that computes the closest horizontal or vertical projection of the anchored reference point to the anchorage geometry outline.


Gestures

  • package: org.eclipse.gef4.fx.gestures

The Gestures package provides abstractions to compose related atomic JavaFX events into gestures, i.e. AbstractMouseDragGesture, AbstractPinchSpreadGesture, AbstractRotateGesture, and AbstractScrollGesture. A gesture is implemented as an abstract class, with different abstract methods for the various parts of the gesture, i.e. press(), drag(), and release() in the case of an AbstractMouseDragGesture. Besides, every gesture provides a setScene() method to register/unregister JavaFX event listeners.

GEF4-FX-gestures.png

AbstractMouseDragGesture

This AbstractMouseDragGesture reports mouse press, drag, and release events.

AbstractPinchSpreadGesture

This AbstractPinchSpreadGesture reports touch pinch and spread events, i.e. moving two fingers towards each other or away from each other.

AbstractRotateGesture

This AbstractRotateGesture reports touch rotate events, i.e. dragging two fingers around each other.

AbstractScrollGesture

This AbstractScrollGesture reports scroll events.


Listeners

  • package: org.eclipse.gef4.fx.listeners

The Listeners package provides a VisualChangeListener, which can be used to recognize visual changes of one observed javafx.scene.Node visual relative to an observer visual.

GEF4-FX-listeners.png

VisualChangeListener

A VisualChangeListener examines a visual's bounds-in-local and local-to-parent-transform properties (JavaFX Properties) and reports all related visual changes. A bounds-in-local change occurs when the observed visual's effect, clip, stroke, local transformations, or geometric bounds change. A local-to-parent-transform change occurs when the observed visual undergoes a transformation change. Transformation listeners are registered for all visuals in the hierarchy up to (but excluding) the common parent of observed and a respective observer visual, so that all changes relative to the observer visual are recognized.

The VisualChangeListener is realized as an abstract class (similar to the Gestures), which has to be subclassed by clients to provide concrete reactions to the visual changes.


Nodes

  • package: org.eclipse.gef4.fx.nodes

The Nodes package provides

GEF4-FX-nodes.png

GEF4-FX-nodes-connection.png

GeometryNode

The GeometryNode is a specific javafx.scene.layout.Region that is capable of displaying an org.eclipse.gef4.geometry.planar.IGeometry. In contrast to a javafx.scene.shape.Shape its resizable.

  GeometryNode<RoundedRectangle> n = new GeometryNode<>();
 
  // A GeometryNode has the same visible properties like a javafx.scene.shape.Shape...
  n.setFill(Color.RED);
  n.setStrokeWidth(5);
  n.setStrokeType(StrokeType.OUTSIDE);
 
  // ... but it can either be relocated/resized based on the geometry (excluding stroke) ...
  n.setGeometry(new RoundedRectangle(30, 40, 30, 40, 20, 20));
  n.relocateGeometry(50, 60);
  n.resizeGeometry(50, 60);
 
  // ... or based on the layout bounds (including stroke)
  n.relocate(50, 60);
  n.resize(50, 60);

InfiniteCanvas

The InfiniteCanvas is an alternative to the javafx.scene.control.ScrollPane. It consists of multiple layers: underlay group, scrolled underlay group, content group, scrolled overlay group, overlay group.

The InfiniteCanvas determines scrollable bounds and content bounds. Scrollbars will be automatically shown in case the content bounds exceed the canvas bounds.

HoverOverlayImageView

The HoverOverlayImageView displays a base image, for which a mouse hover effect is realized that displays an overlay image instead of the base image during hovering. Transitioning from one image to the other is done by gradually changing the opacities of both images. In the given example, the base image is the grey X and the overlay image is the red X.

Base image (grey X)

Overlayed image (red X)

Connection

The Connection is an implementation of a connection with two endpoints and an arbitrary number of way-/control-points. One of the endpoints is referred to as the start point, the other one is referred to as the end point. The positions for endpoints and waypoints are computed using anchors, i.e. an Connection provides one AnchorKey per point and manages one IAnchor per point. However, the API also allows directly specifying coordinates for each point, in which case a StaticAnchor is created internally.

A Connection can have a start decoration and an end decoration which are displayed at the start point, or end point, respectively. Decorations can be used to display an arrow at one end of a connection, for example.

IConnectionRouter, StraightRouter, OrthogonalRouter

An IConnectionRouter receives the coordinates of all points of the connection (start point, way points, end point) and may insert additional (implicit) points to satisfy certain routing constraints. Currently, two connection routers are provided: 1) the StraightRouter (default), and 2) the OrthogonalRouter.

IConnectionInterpolator, PolylineInterpolator, PolyBezierInterpolator

A Connection manages a javafx.scene.Node (a GeometryNode by default), which is referred to as the curve node. The updating of the curve node based on the curve's points is delegated to an IConnectionInterpolator. It is also responsible for placing the curve's decorations as well as for clipping the decorations. Currently two interpolators are provided: 1) the PolylineInterpolator and 2) the PolyBezierInterpolator. The first one computes a org.eclipse.gef4.geometry.planar.Polyline (only straight line segments) from the given points while the second one computes a org.eclipse.gef4.geometry.planar.PolyBezier (consecutive Bezier curves with smooth continuity) from the given points.

NodeUtils

The NodeUtils class contains utility functionality, such as picking nodes at a current position on the scene graph, and performing local-to-parent, local-to-scene, parent-to-local, and scene-to-local transformations of geometries (GEF4 Geometry).

CursorUtils

The CursorUtils provides utility functions related to cursors. It can be used for querying the current mouse pointer location for for forcing a cursor update.

Geometry2Shape, Shape2Geometry

The Geometry2Shape and Shape2Geometry utility classes provide utilities to infer GEF4 Geometry abstractions from a javafx.scene.shape.Shape and vice versa.


FX.SWT

The FX.SWT module of GEF4 FX provides enhanced support for integrating JavaFX with SWT.


Canvas

  • package: org.eclipse.gef4.fx.swt.canvas

The Canvas package provides a replacement for the javafx.embed.swt.FXCanvas, adding support for various JavaFX/SWT integration functionality.

GEF4-FX-SWT-canvas.png

FXCanvasEx

The FXCanvasEx is a replacement for the javafx.embed.swt.FXCanvas, providing support for various functionality which is missing. The FXCanvasEx forwards SWT GestureEvents (touch events) to JavaFX, notifies all SWT FocusListeners (additional to forwarding them to JavaFX), and supports changing the SWT Cursor based on the javafx.scene.Cursor.

IFXCanvasFactory

The IFXCanvasFactory handles the construction of an javafx.embed.swt.FXCanvas to render the JavaFX scene graph.


Controls

  • package: org.eclipse.gef4.fx.swt.controls

The Controls package provides a counterpart to the JavaFX/SWT integration, i.e. embedding SWT Controls into a JavaFX scene graph.

GEF4-FX-SWT-controls.png

FXControlAdapter

The FXControlAdapter extends javafx.scene.layout.Region and allows to embed an SWT Control into a JavaFX scene graph. The control will automatically be re-created using an IControlFactory whenever the JavaFX scene graph changes, and its bounds will be updated whenever the FXControlAdapter is resized or relocated.

IControlFactory

An IControlFactory is responsible for creating an SWT Control (for an FXControlAdapter).

FXColorPicker, FXSimpleLinearGradientPicker, FXAdvancedLinearGradientPicker

The FXColorPicker provides an SWT control which uses the system's org.eclipse.swt.widgets.ColorDialog to pick a new JavaFX color.

GEF4-MVC-FX-UI-FXColorPicker-control.jpg

The FXSimpleLinearGradientPicker provides an SWT control which displays two FXColorPicker to specify a simple JavaFX linear gradient.

GEF4-MVC-FX-UI-FXSimpleGradientPicker-control.jpg

The FXAdvancedLinearGradientPicker provides an SWT control which displays/allows the manipulation of an advanced linear gradient (i.e. more than 2 stops).

GEF4-MVC-FX-UI-FXAdvancedGradientPicker-control.jpg


Gestures

  • package: org.eclipse.gef4.fx.ui.gestures

The Gestures package provides support for the conversion of SWT GestureEvent (touch events) to corresponding JavaFX events when embedding a JavaFX scene graph into an SWT application (via javafx.embed.swt.FXCanvas).

GEF4-FX-SWT-gestures.png

SWTToFXGestureConverter

The SWTToFXGestureConverter can be used to register listeners on an javafx.embed.swt.FXCanvas for an automatic conversion of SWT GestureEvents to corresponding JavaFX events (javafx.scene.input.RotateEvent, javafx.scene.input.ScrollEvent, javafx.scene.input.SwipeEvent, javafx.scene.input.ZoomEvent). It is internally used by FXCanvasEx to transfer gesture events from SWT to JavaFX.


FX.JFace

The FX.JFace module of GEF4 FX provides enhanced support for integrating JavaFX with JFace.

{Root}

The {Root} package provides cell editors and corresponding dialogs to specify JavaFX properties.

GEF4-FX-JFace-root.png

FXPaintCellEditor

The FXPaintCellEditor is a org.eclipse.jface.viewers.DialogCellEditor extension, which displays a currently selected JavaFX Paint and offers a button to change if via an FXPaintSelectionDialog.

GEF4-MVC-FX-UI-FXFillCellEditor-control.jpg

FXPaintLabelProvider

The FXPaintLabelProvider is a org.eclipse.jface.viewers.LabelProvider extension, which can be used to display a JavaFX Paint (color or gradient) value. It is used by the FXPaintPropertyDescriptor.

GEF4-FX-JFace-FXPaintLabelProvider-control.jpg

FXPaintSelectionDialog

The FXPaintSelectionDialog is a org.eclipse.jface.dialogs.Dialog extension, which provides a menu to select a JavaFX Paint (color or gradient). It is used by the FXPaintCellEditor.

GEF4-MVC-FX-UI-FXFillSelectionDialog-advanced.png


Back to the top