public abstract class GConnectionSkin
extends java.lang.Object
GConnection. Responsible for visualizing connections in the graph editor.
A custom connection skin must extend this class. It must also provide a constructor taking exactly one
GConnection parameter.
The root JavaFX node must be created by the skin implementation and returned in the getRoot() method. For
example, a very simple connection skin could use a Line whose start and end positions are set to those of the
source and target connectors.
| Constructor and Description |
|---|
GConnectionSkin(de.tesis.dynaware.grapheditor.model.GConnection connection)
Creates a new
GConnectionSkin. |
| Modifier and Type | Method and Description |
|---|---|
void |
applyConstraints(java.util.List<javafx.geometry.Point2D> points)
Applies constraints to the given set of points before any connections are drawn.
|
abstract void |
draw(java.util.List<javafx.geometry.Point2D> points,
java.util.Map<de.tesis.dynaware.grapheditor.model.GConnection,java.util.List<javafx.geometry.Point2D>> allConnections)
Draws the connection skin based on the given points.
|
de.tesis.dynaware.grapheditor.model.GConnection |
getConnection()
Gets the connection model element represented by 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.
|
void |
setGraphEditor(GraphEditor graphEditor)
Sets the graph editor instance that this skin is a part of.
|
abstract void |
setJointSkins(java.util.List<GJointSkin> jointSkins)
Sets the skin objects for all joints inside the connection.
|
public GConnectionSkin(de.tesis.dynaware.grapheditor.model.GConnection connection)
GConnectionSkin.connection - the GConnection represented by the skinpublic de.tesis.dynaware.grapheditor.model.GConnection getConnection()
GConnection represented by 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 setJointSkins(java.util.List<GJointSkin> jointSkins)
This will be called as the connection skin is created. The connection skin can manipulate its joint skins if it chooses. For example a 'rectangular' connection skin may restrict the movement of the first and last joints to the x direction only.
jointSkins - the list of all GJointSkin instances associated to the connectionpublic abstract void draw(java.util.List<javafx.geometry.Point2D> points,
java.util.Map<de.tesis.dynaware.grapheditor.model.GConnection,java.util.List<javafx.geometry.Point2D>> allConnections)
The order of the points is as follows:
GConnection.
A simple connection skin may ignore the second parameter. This parameter can for example be used to display a 'rerouting' effect when the connection passes over another connection.
points - all the Point2D instances that specify the connection positionallConnections - the lists of points for all connections (can be ignored in a simple skin)public void applyConstraints(java.util.List<javafx.geometry.Point2D> points)
This method is called on all connection skins before the draw method is called on any connection skin. It can safely be ignored by simple skin implementations.
Overriding this method allows the connection skin to apply constraints to its set of points, and these constraints will be taken into account during the draw methods of other connections, even if they are drawn before this connection.
Copyright © 2014 TESIS DYNAware. All Rights Reserved.