public final class ImNodes
extends java.lang.Object
Refer to the library's Github page for examples and support
Modifier and Type | Method and Description |
---|---|
static void |
beginInputAttribute(int id)
Create an input attribute block.
|
static void |
beginInputAttribute(int id,
int shape)
Create an input attribute block.
|
static void |
beginNode(int node) |
static void |
beginNodeEditor()
The top-level function call.
|
static void |
beginNodeTitleBar()
Place your node title bar content (such as the node title, using ImGui::Text) between the
following function calls.
|
static void |
beginOutputAttribute(int id)
Create an output attribute block.
|
static void |
beginOutputAttribute(int id,
int shape)
Create an output attribute block.
|
static void |
beginStaticAttribute(int id)
Create a static attribute block.
|
static void |
clearLinkSelection()
Clears the list of selected nodes/links.
|
static void |
clearLinkSelection(int linkId) |
static void |
clearNodeSelection()
Clears the list of selected nodes/links.
|
static void |
clearNodeSelection(int nodeId) |
static ImNodesContext |
createContext() |
static void |
destroyContext() |
static void |
destroyContext(ImNodesContext ctx) |
static ImNodesEditorContext |
editorContextCreate() |
static void |
editorContextFree(ImNodesEditorContext context) |
static ImVec2 |
editorContextGetPanning() |
static void |
editorContextGetPanning(ImVec2 dst) |
static float |
editorContextGetPanningX() |
static float |
editorContextGetPanningY() |
static void |
editorContextMoveToNode(int nodeId) |
static void |
editorContextResetPanning(float posX,
float posY) |
static void |
editorContextResetPanning(ImVec2 pos) |
static void |
editorContextSet(ImNodesEditorContext context) |
static void |
endInputAttribute() |
static void |
endNode() |
static void |
endNodeEditor() |
static void |
endNodeTitleBar() |
static void |
endOutputAttribute() |
static void |
endStaticAttribute() |
static int |
getActiveAttribute()
Binding notice: getActiveAttribute() returns id the active attribute.
|
static ImNodesContext |
getCurrentContext() |
static int |
getHoveredLink() |
static int |
getHoveredNode() |
static int |
getHoveredPin() |
static ImNodesIO |
getIO() |
static void |
getNodeDimensions(ImVec2 dst,
int id) |
static ImVec2 |
getNodeDimensions(int id) |
static float |
getNodeDimensionsX(int id) |
static float |
getNodeDimensionsY(int id) |
static void |
getNodeEditorSpacePos(int nodeId) |
static void |
getNodeGridSpacePos(int nodeId) |
static void |
getNodeScreenSpacePos(int nodeId) |
static void |
getSelectedLinks(int[] linkIds)
Get the selected node/link ids.
|
static void |
getSelectedNodes(int[] nodeIds)
Get the selected node/link ids.
|
static ImNodesStyle |
getStyle()
Returns the global style struct.
|
static boolean |
isAnyAttributeActive() |
static boolean |
isAnyAttributeActive(ImInt attributeId) |
static boolean |
isAttributeActive()
Was the previous attribute active? This will continuously return true while the left mouse button
is being pressed over the UI content of the attribute.
|
static boolean |
isEditorHovered()
Returns true if the current node editor canvas is being hovered over by the mouse, and is not
blocked by any other windows.
|
static boolean |
isLinkCreated(ImInt startedAtAttributeId,
ImInt endedAtAttributeId)
Did the user finish creating a new link?
|
static boolean |
isLinkCreated(ImInt startedAtAttributeId,
ImInt endedAtAttributeId,
ImBoolean createdFromSnap)
Did the user finish creating a new link?
|
static boolean |
isLinkCreated(ImInt startedAtNodeId,
ImInt startedAtAttributeId,
ImInt endedAtNodeId,
ImInt endedAtAttributeId)
Did the user finish creating a new link?
|
static boolean |
isLinkCreated(ImInt startedAtNodeId,
ImInt startedAtAttributeId,
ImInt endedAtNodeId,
ImInt endedAtAttributeId,
ImBoolean createdFromSnap)
Did the user finish creating a new link?
|
static boolean |
isLinkDestroyed(ImInt linkId)
Was an existing link detached from a pin by the user? The detached link's id is assigned to the
output argument link_id.
|
static boolean |
isLinkDropped()
Did the user drop the dragged link before attaching it to a pin?
There are two different kinds of situations to consider when handling this event:
1) a link which is created at a pin and then dropped
2) an existing link which is detached from a pin and then dropped
Use the including_detached_links flag to control whether this function triggers when the user
detaches a link and drops it.
|
static boolean |
isLinkDropped(boolean includingDetachedLinks)
Did the user drop the dragged link before attaching it to a pin?
There are two different kinds of situations to consider when handling this event:
1) a link which is created at a pin and then dropped
2) an existing link which is detached from a pin and then dropped
Use the including_detached_links flag to control whether this function triggers when the user
detaches a link and drops it.
|
static boolean |
isLinkDropped(ImInt startedAtAttributeId)
Did the user drop the dragged link before attaching it to a pin?
There are two different kinds of situations to consider when handling this event:
1) a link which is created at a pin and then dropped
2) an existing link which is detached from a pin and then dropped
Use the including_detached_links flag to control whether this function triggers when the user
detaches a link and drops it.
|
static boolean |
isLinkDropped(ImInt startedAtAttributeId,
boolean includingDetachedLinks)
Did the user drop the dragged link before attaching it to a pin?
There are two different kinds of situations to consider when handling this event:
1) a link which is created at a pin and then dropped
2) an existing link which is detached from a pin and then dropped
Use the including_detached_links flag to control whether this function triggers when the user
detaches a link and drops it.
|
static boolean |
isLinkHovered(ImInt linkId) |
static boolean |
isLinkSelected(int linkId) |
static boolean |
isLinkStarted(ImInt startedAtAttributeId)
Did the user start dragging a new link from a pin?
|
static boolean |
isNodeHovered(ImInt nodeId) |
static boolean |
isNodeSelected(int nodeId) |
static boolean |
isPinHovered(ImInt attributeId) |
static void |
link(int id,
int source,
int target)
Render a link between attributes.
|
static void |
loadCurrentEditorStateFromIniFile(java.lang.String fileName) |
static void |
loadCurrentEditorStateFromIniString(java.lang.String data,
int dataSize) |
static void |
loadEditorStateFromIniFile(ImNodesEditorContext editor,
java.lang.String fileName) |
static void |
loadEditorStateFromIniString(ImNodesEditorContext editor,
java.lang.String data,
int dataSize) |
static void |
miniMap()
Add a navigable minimap to the editor; call before EndNodeEditor after all nodes and links have been specified
// TODO: add callback
|
static void |
miniMap(float miniMapSizeFraction)
Add a navigable minimap to the editor; call before EndNodeEditor after all nodes and links have been specified
// TODO: add callback
|
static void |
miniMap(float miniMapSizeFraction,
int miniMapLocation)
Add a navigable minimap to the editor; call before EndNodeEditor after all nodes and links have been specified
// TODO: add callback
|
static int |
numSelectedLinks() |
static int |
numSelectedNodes()
Use The following two functions to query the number of selected nodes or links in the current
editor.
|
static void |
popAttributeFlag() |
static void |
popColorStyle() |
static void |
popStyleVar() |
static void |
pushAttributeFlag(int flag)
Push a single AttributeFlags value.
|
static void |
pushColorStyle(int item,
int color)
Use PushColorStyle and PopColorStyle to modify ImNodesColorStyle mid-frame.
|
static void |
pushStyleVar(int styleItem,
float value) |
static void |
pushStyleVar(int styleItem,
float valueX,
float valueY) |
static void |
pushStyleVar(int styleItem,
ImVec2 value) |
static void |
saveCurrentEditorStateToIniFile(java.lang.String fileName) |
static java.lang.String |
saveCurrentEditorStateToIniString() |
static void |
saveEditorStateToIniFile(ImNodesEditorContext editor,
java.lang.String fileName) |
static java.lang.String |
saveEditorStateToIniString(ImNodesEditorContext editor) |
static void |
selectLink(int linkId) |
static void |
selectNode(int nodeId)
Manually select a node or link.
|
static void |
setCurrentContext(ImNodesContext ctx) |
static void |
setImGuiContext(ImGuiContext ctx) |
static void |
setNodeDraggable(int nodeId,
boolean draggable)
Enable or disable the ability to click and drag a specific node.
|
static void |
setNodeEditorSpacePos(int nodeId,
float editorSpacePosX,
float editorSpacePosY) |
static void |
setNodeEditorSpacePos(int nodeId,
ImVec2 editorSpacePos) |
static void |
setNodeGridSpacePos(int nodeId,
float gridPosX,
float gridPosY) |
static void |
setNodeGridSpacePos(int nodeId,
ImVec2 gridPos) |
static void |
setNodeScreenSpacePos(int nodeId,
float screenSpacePosX,
float screenSpacePosY) |
static void |
setNodeScreenSpacePos(int nodeId,
ImVec2 screenSpacePos) |
static void |
styleColorsClassic() |
static void |
styleColorsDark() |
static void |
styleColorsLight() |
public static void setImGuiContext(ImGuiContext ctx)
public static ImNodesContext createContext()
public static void destroyContext()
public static void destroyContext(ImNodesContext ctx)
public static ImNodesContext getCurrentContext()
public static void setCurrentContext(ImNodesContext ctx)
public static ImNodesEditorContext editorContextCreate()
public static void editorContextFree(ImNodesEditorContext context)
public static void editorContextSet(ImNodesEditorContext context)
public static ImVec2 editorContextGetPanning()
public static float editorContextGetPanningX()
public static float editorContextGetPanningY()
public static void editorContextGetPanning(ImVec2 dst)
public static void editorContextResetPanning(ImVec2 pos)
public static void editorContextResetPanning(float posX, float posY)
public static void editorContextMoveToNode(int nodeId)
public static ImNodesIO getIO()
public static ImNodesStyle getStyle()
public static void styleColorsDark()
public static void styleColorsClassic()
public static void styleColorsLight()
public static void beginNodeEditor()
public static void endNodeEditor()
public static void miniMap()
public static void miniMap(float miniMapSizeFraction)
public static void miniMap(float miniMapSizeFraction, int miniMapLocation)
public static void pushColorStyle(int item, int color)
public static void popColorStyle()
public static void pushStyleVar(int styleItem, float value)
public static void pushStyleVar(int styleItem, ImVec2 value)
public static void pushStyleVar(int styleItem, float valueX, float valueY)
public static void popStyleVar()
public static void beginNode(int node)
public static void endNode()
public static ImVec2 getNodeDimensions(int id)
public static float getNodeDimensionsX(int id)
public static float getNodeDimensionsY(int id)
public static void getNodeDimensions(ImVec2 dst, int id)
public static void beginNodeTitleBar()
public static void endNodeTitleBar()
public static void beginInputAttribute(int id)
public static void beginInputAttribute(int id, int shape)
public static void endInputAttribute()
public static void beginOutputAttribute(int id)
public static void beginOutputAttribute(int id, int shape)
public static void endOutputAttribute()
public static void beginStaticAttribute(int id)
public static void endStaticAttribute()
public static void pushAttributeFlag(int flag)
public static void popAttributeFlag()
public static void link(int id, int source, int target)
public static void setNodeDraggable(int nodeId, boolean draggable)
public static void setNodeScreenSpacePos(int nodeId, ImVec2 screenSpacePos)
public static void setNodeScreenSpacePos(int nodeId, float screenSpacePosX, float screenSpacePosY)
public static void setNodeEditorSpacePos(int nodeId, ImVec2 editorSpacePos)
public static void setNodeEditorSpacePos(int nodeId, float editorSpacePosX, float editorSpacePosY)
public static void setNodeGridSpacePos(int nodeId, ImVec2 gridPos)
public static void setNodeGridSpacePos(int nodeId, float gridPosX, float gridPosY)
public static void getNodeScreenSpacePos(int nodeId)
public static void getNodeEditorSpacePos(int nodeId)
public static void getNodeGridSpacePos(int nodeId)
public static boolean isEditorHovered()
public static boolean isNodeHovered(ImInt nodeId)
public static boolean isLinkHovered(ImInt linkId)
public static boolean isPinHovered(ImInt attributeId)
public static int getHoveredNode()
public static int getHoveredLink()
public static int getHoveredPin()
public static int numSelectedNodes()
public static int numSelectedLinks()
public static void getSelectedNodes(int[] nodeIds)
public static void getSelectedLinks(int[] linkIds)
public static void clearNodeSelection()
public static void clearLinkSelection()
public static void selectNode(int nodeId)
public static void clearNodeSelection(int nodeId)
public static boolean isNodeSelected(int nodeId)
public static void selectLink(int linkId)
public static void clearLinkSelection(int linkId)
public static boolean isLinkSelected(int linkId)
public static boolean isAttributeActive()
public static boolean isAnyAttributeActive()
public static boolean isAnyAttributeActive(ImInt attributeId)
public static int getActiveAttribute()
This method implemented instead of the original bool ImNodes::IsAnyAttributeActive(int* attribute_id) for convenience.
public static boolean isLinkStarted(ImInt startedAtAttributeId)
public static boolean isLinkDropped()
public static boolean isLinkDropped(ImInt startedAtAttributeId)
public static boolean isLinkDropped(ImInt startedAtAttributeId, boolean includingDetachedLinks)
public static boolean isLinkDropped(boolean includingDetachedLinks)
public static boolean isLinkCreated(ImInt startedAtAttributeId, ImInt endedAtAttributeId)
public static boolean isLinkCreated(ImInt startedAtAttributeId, ImInt endedAtAttributeId, ImBoolean createdFromSnap)
public static boolean isLinkCreated(ImInt startedAtNodeId, ImInt startedAtAttributeId, ImInt endedAtNodeId, ImInt endedAtAttributeId)
public static boolean isLinkCreated(ImInt startedAtNodeId, ImInt startedAtAttributeId, ImInt endedAtNodeId, ImInt endedAtAttributeId, ImBoolean createdFromSnap)
public static boolean isLinkDestroyed(ImInt linkId)
public static java.lang.String saveCurrentEditorStateToIniString()
public static java.lang.String saveEditorStateToIniString(ImNodesEditorContext editor)
public static void loadCurrentEditorStateFromIniString(java.lang.String data, int dataSize)
public static void loadEditorStateFromIniString(ImNodesEditorContext editor, java.lang.String data, int dataSize)
public static void saveCurrentEditorStateToIniFile(java.lang.String fileName)
public static void saveEditorStateToIniFile(ImNodesEditorContext editor, java.lang.String fileName)
public static void loadCurrentEditorStateFromIniFile(java.lang.String fileName)
public static void loadEditorStateFromIniFile(ImNodesEditorContext editor, java.lang.String fileName)