public abstract class GTailSkin
extends java.lang.Object
GConnector. Responsible for visualizing the tails that extend temporarily from
connectors during a drag gesture in the graph editor.
A custom tail skin must extend this class. It must also provide a constructor taking exactly one
GConnector parameter.
Tail skins can have similar logic to connection skins, but they do not have to worry about positionable joints.
| Constructor and Description |
|---|
GTailSkin(de.tesis.dynaware.grapheditor.model.GConnector connector)
Creates a new
GTailSkin. |
| Modifier and Type | Method and Description |
|---|---|
abstract java.util.List<javafx.geometry.Point2D> |
allocateJointPositions()
Allocates a list of joint positions for a new connection.
|
abstract void |
draw(javafx.geometry.Point2D start,
javafx.geometry.Point2D end)
Updates the position of the tail according to the specified start and end points.
|
abstract void |
draw(javafx.geometry.Point2D start,
javafx.geometry.Point2D end,
java.util.List<javafx.geometry.Point2D> jointPositions)
Updates the position of the tail according to the specified start and end points, and the specified list of joint
positions of a connection.
|
de.tesis.dynaware.grapheditor.model.GConnector |
getConnector()
Gets the connector model element associated to the skin.
|
GraphEditor |
getGraphEditor()
Gets the graph editor instance that this skin is a part of.
|
abstract javafx.scene.Node |
getRoot()
Gets the root JavaFX node of the skin.
|
abstract void |
setEndpointVisible(boolean visible)
Shows or hides the endpoint of the tail.
|
void |
setGraphEditor(GraphEditor graphEditor)
Sets the graph editor instance that this skin is a part of.
|
public GTailSkin(de.tesis.dynaware.grapheditor.model.GConnector connector)
GTailSkin.connector - the GConnector that the tail will extend frompublic de.tesis.dynaware.grapheditor.model.GConnector getConnector()
GConnector associated to the skinpublic void setGraphEditor(GraphEditor graphEditor)
graphEditor - a GraphEditor instancepublic GraphEditor getGraphEditor()
This is provided for advanced skin customisation purposes only. Use at your own risk.
GraphEditor instance that this skin is a part ofpublic abstract javafx.scene.Node getRoot()
Nodepublic abstract void draw(javafx.geometry.Point2D start,
javafx.geometry.Point2D end)
This method will be called when a 'fresh' tail is created from an unoccupied connector.
start - a Point2D containing the start x and y valuesend - a Point2D containing the end x and y valuespublic abstract void draw(javafx.geometry.Point2D start,
javafx.geometry.Point2D end,
java.util.List<javafx.geometry.Point2D> jointPositions)
This method will be called when an existing connection is repositioned. The tail skin may use the position of the old connection to decide how to position itself, or it may ignore this information.
start - a Point2D containing the start x and y valuesend - a Point2D containing the end x and y valuespublic abstract java.util.List<javafx.geometry.Point2D> allocateJointPositions()
When the tail is 'converted' into a connection during a successful drag-drop gesture, this method will be called so that the new connection's joint positions can be based on the final position of the tail.
Point2D objects containing x and y values for a newly-created connectionpublic abstract void setEndpointVisible(boolean visible)
This method exists so that, if the tail has an endpoint, it can be hidden when it is dragged over a target connector. If your custom tail has no endpoint, this method should do nothing.
visible - true if the endpoint should be visible, false if notCopyright © 2014 TESIS DYNAware. All Rights Reserved.