public abstract class GNodeSkin
extends java.lang.Object
GNode. Responsible for visualizing nodes in the graph editor.
A custom node skin must extend this class. It must also provide a constructor taking exactly one GNode
parameter.
The node skin is responsible for adding its connectors to the scene graph and laying them out.
The root JavaFX node of this skin is a ResizableBox.
| Type | Property and Description |
|---|---|
javafx.beans.property.BooleanProperty |
selected
The property that determines whether the node is selected or not.
|
| Constructor and Description |
|---|
GNodeSkin(de.tesis.dynaware.grapheditor.model.GNode node)
Creates a new
GNodeSkin. |
| Modifier and Type | Method and Description |
|---|---|
abstract javafx.geometry.Point2D |
getConnectorPosition(GConnectorSkin connectorSkin)
Gets the position of the center of a connector relative to the node region.
|
GraphEditor |
getGraphEditor()
Gets the graph editor instance that this skin is a part of.
|
de.tesis.dynaware.grapheditor.model.GNode |
getNode()
Gets the node model element represented by the skin.
|
ResizableBox |
getRoot()
Gets the root JavaFX node of the skin.
|
void |
initialize()
Initializes the node skin.
|
boolean |
isSelected()
Gets whether the node is selected or not.
|
abstract void |
layoutConnectors()
Lays out the node's connectors.
|
javafx.beans.property.BooleanProperty |
selectedProperty()
The property that determines whether the node is selected or not.
|
abstract void |
setConnectorSkins(java.util.List<GConnectorSkin> connectorSkins)
Sets the node's connector skins.
|
void |
setGraphEditor(GraphEditor graphEditor)
Sets the graph editor instance that this skin is a part of.
|
void |
setSelected(boolean isSelected)
Sets whether the node is selected or not.
|
public javafx.beans.property.BooleanProperty selectedProperty
isSelected(),
setSelected(boolean)public GNodeSkin(de.tesis.dynaware.grapheditor.model.GNode node)
GNodeSkin.node - the GNode represented by the skinpublic de.tesis.dynaware.grapheditor.model.GNode getNode()
GNode represented by the skinpublic ResizableBox getRoot()
ResizableBox containing the skin's root JavaFX nodepublic 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 boolean isSelected()
true if the node is selected, false if notpublic void setSelected(boolean isSelected)
isSelected - true if the node is selected, false if notpublic javafx.beans.property.BooleanProperty selectedProperty()
isSelected(),
setSelected(boolean)public void initialize()
The skin's layout values, e.g. its x and y position, are loaded from the GNode at this point.
public abstract void setConnectorSkins(java.util.List<GConnectorSkin> connectorSkins)
This will be called as the node is created, or if a connector is added or removed. The connector skin's regions should be added to the scene graph.
connectorSkins - a list of GConnectorSkin objects for each of the node's connectorspublic abstract void layoutConnectors()
public abstract javafx.geometry.Point2D getConnectorPosition(GConnectorSkin connectorSkin)
This will be the point where a connection will attach to.
connectorSkin - a GConnectorSkin instanceCopyright © 2014 TESIS DYNAware. All Rights Reserved.