NodeGraphItem
Node item container placed in a NodeGraph canvas hosting a content widget and pin ports.
Overview
Node item container placed in a NodeGraph canvas hosting a content widget and pin ports. Provides extensive layout configuration and interaction capabilities.
API
NodeGraphItem(String, Widget)
Constructs a NodeGraphItem with unique ID and content widget.
| Parameter | Type | Description |
|---|---|---|
id |
String |
The unique identifier. |
content |
Widget |
The content widget. |
NodeGraphItem(String, Widget, float, float)
Constructs a NodeGraphItem with unique ID, content widget, and initial coordinates.
| Parameter | Type | Description |
|---|---|---|
id |
String |
The unique identifier. |
content |
Widget |
The content widget. |
x |
float |
The X coordinate position. |
y |
float |
The Y coordinate position. |
NodeGraphItem::addPort(NodeGraphPort)
Attaches an existing port instance to this node.
| Parameter | Type | Description |
|---|---|---|
port |
NodeGraphPort |
The port parameter. |
Returns NodeGraphItem: This instance for chaining..
NodeGraphItem::addPort(String, NodeGraphPortKind, NodeGraphPortSide, float)
Creates and attaches a port with specified ID, direction kind, side, and offset.
| Parameter | Type | Description |
|---|---|---|
id |
String |
The unique identifier. |
kind |
NodeGraphPortKind |
The port connection direction kind. |
side |
NodeGraphPortSide |
The port edge side. |
offset |
float |
The port offset along the node edge in pixels. |
Returns NodeGraphPort: The created port instance..
NodeGraphItem::arrangedHeight()
Returns the actual arranged layout height.
Returns float: The arranged height in pixels..
NodeGraphItem::arrangedWidth()
Returns the actual arranged layout width.
Returns float: The arranged width in pixels..
NodeGraphItem::autoHeight()
Returns true if height is determined automatically by content layout.
Returns boolean: True if height is automatically sized..
NodeGraphItem::autoSize()
Resets width and height to automatic sizing based on content.
Returns NodeGraphItem: This instance for chaining..
NodeGraphItem::autoWidth()
Returns true if width is determined automatically by content layout.
Returns boolean: True if width is automatically sized..
NodeGraphItem::content()
Returns the content widget hosted inside this node.
Returns Widget: The content widget..
NodeGraphItem::height()
Returns the explicit configured height of this node, or <= 0 for auto-sizing.
Returns float: The height in pixels..
NodeGraphItem::id()
Returns the unique identifier of this node item.
Returns String: The unique identifier string..
NodeGraphItem::movable()
Returns true if this node can be dragged to move across the canvas.
Returns boolean: True if dragging is enabled..
NodeGraphItem::movable(boolean)
Sets whether this node can be dragged to move.
| Parameter | Type | Description |
|---|---|---|
movable |
boolean |
Whether dragging and movement are allowed. |
Returns NodeGraphItem: This instance for chaining..
NodeGraphItem::port(String)
Returns the port with the specified ID, or null if not found.
| Parameter | Type | Description |
|---|---|---|
id |
String |
The unique identifier. |
Returns NodeGraphPort: The port instance, or null if not found..
NodeGraphItem::ports()
Returns an unmodifiable list of all ports attached to this node.
Returns List: An unmodifiable list of ports..
NodeGraphItem::position(float, float)
Sets the (X, Y) world position of this node on the canvas.
| Parameter | Type | Description |
|---|---|---|
x |
float |
The X coordinate position. |
y |
float |
The Y coordinate position. |
Returns NodeGraphItem: This instance for chaining..
NodeGraphItem::removePort(String)
Removes the port with the specified ID.
| Parameter | Type | Description |
|---|---|---|
id |
String |
The unique identifier. |
Returns NodeGraphItem: This instance for chaining..
NodeGraphItem::resizable()
Returns true if this node displays resize handles and can be interactively resized.
Returns boolean: True if resizing is enabled..
NodeGraphItem::resizable(boolean)
Sets whether this node can be resized by dragging corner handles.
| Parameter | Type | Description |
|---|---|---|
resizable |
boolean |
Whether resizing is allowed. |
Returns NodeGraphItem: This instance for chaining..
NodeGraphItem::selectable()
Returns true if this node can be selected by clicks or lasso selection.
Returns boolean: True if selection is enabled..
NodeGraphItem::selectable(boolean)
Sets whether this node can be selected.
| Parameter | Type | Description |
|---|---|---|
selectable |
boolean |
Whether selection is allowed. |
Returns NodeGraphItem: This instance for chaining..
NodeGraphItem::selected()
Returns true if this node is currently selected.
Returns boolean: True if currently selected; false otherwise..
NodeGraphItem::size(float, float)
Sets explicit width and height dimensions for this node.
| Parameter | Type | Description |
|---|---|---|
width |
float |
The width in pixels. |
height |
float |
The height in pixels. |
Returns NodeGraphItem: This instance for chaining..
NodeGraphItem::visible()
Returns true if this node is visible.
Returns boolean: True if visible; false otherwise..
NodeGraphItem::visible(boolean)
Sets whether this node is visible.
| Parameter | Type | Description |
|---|---|---|
visible |
boolean |
Whether the item is visible. |
Returns NodeGraphItem: This instance for chaining..
NodeGraphItem::width()
Returns the explicit configured width of this node, or <= 0 for auto-sizing.
Returns float: The width in pixels..
NodeGraphItem::x()
Returns the X position of this node in canvas world coordinates.
Returns float: The X coordinate position..
NodeGraphItem::y()
Returns the Y position of this node in canvas world coordinates.
Returns float: The Y coordinate position..