Class NodeEditor

java.lang.Object
imgui.extension.nodeditor.NodeEditor

public final class NodeEditor extends Object
Bindings for Imgui Node Editor (https://github.com/thedmd/imgui-node-editor) Original library author - Michał Cichoń (https://github.com/thedmd)

An implementation of node editor with ImGui-like API. Project purpose is to serve as a basis for more complex solutions like blueprint editors.

Refer to the library's Github page for examples and support

Before you can start drawing editor you have to create ImNodeEditorContext (either by invoking constructor directly or using ImNodeEditor.createEditor()) and switch current editor via ImNodeEditor.setCurrentEditor(NodeEditorContext)

Binding notice: instead of special types for ids of nodes, links and pins which used in native library we use longs to reduce boilerplate and garbage production

  • Method Details

    • setCurrentEditor

      public static void setCurrentEditor(NodeEditorContext ctx)
    • getCurrentEditor

      public static NodeEditorContext getCurrentEditor()
    • createEditor

      public static NodeEditorContext createEditor()
    • createEditor

      public static NodeEditorContext createEditor(NodeEditorConfig config)
    • destroyEditor

      public static void destroyEditor(NodeEditorContext ctx)
    • getStyle

      public static NodeEditorStyle getStyle()
    • getStyleColorName

      public static String getStyleColorName(int colorIndex)
    • pushStyleColor

      public static void pushStyleColor(int colorIndex, ImVec4 color)
    • pushStyleColor

      public static void pushStyleColor(int colorIndex, float colorX, float colorY, float colorZ, float colorW)
    • popStyleColor

      public static void popStyleColor()
    • popStyleColor

      public static void popStyleColor(int count)
    • pushStyleVar

      public static void pushStyleVar(int varIndex, float value)
    • pushStyleVar

      public static void pushStyleVar(int varIndex, ImVec2 value)
    • pushStyleVar

      public static void pushStyleVar(int varIndex, float valueX, float valueY)
    • pushStyleVar

      public static void pushStyleVar(int varIndex, ImVec4 value)
    • pushStyleVar

      public static void pushStyleVar(int varIndex, float valueX, float valueY, float valueZ, float valueW)
    • popStyleVar

      public static void popStyleVar()
    • popStyleVar

      public static void popStyleVar(int count)
    • begin

      public static void begin(String id)
    • begin

      public static void begin(String id, ImVec2 size)
    • begin

      public static void begin(String id, float sizeX, float sizeY)
    • end

      public static void end()
    • beginNode

      public static void beginNode(long id)
    • beginPin

      public static void beginPin(long id, int kind)
    • pinRect

      public static void pinRect(ImVec2 a, ImVec2 b)
    • pinRect

      public static void pinRect(float aX, float aY, float bX, float bY)
    • pinPivotRect

      public static void pinPivotRect(ImVec2 a, ImVec2 b)
    • pinPivotRect

      public static void pinPivotRect(float aX, float aY, float bX, float bY)
    • pinPivotSize

      public static void pinPivotSize(ImVec2 size)
    • pinPivotSize

      public static void pinPivotSize(float sizeX, float sizeY)
    • pinPivotScale

      public static void pinPivotScale(ImVec2 scale)
    • pinPivotScale

      public static void pinPivotScale(float scaleX, float scaleY)
    • pinPivotAlignment

      public static void pinPivotAlignment(ImVec2 alignment)
    • pinPivotAlignment

      public static void pinPivotAlignment(float alignmentX, float alignmentY)
    • endPin

      public static void endPin()
    • group

      public static void group(ImVec2 size)
    • group

      public static void group(float sizeX, float sizeY)
    • endNode

      public static void endNode()
    • beginGroupHint

      public static boolean beginGroupHint(long nodeId)
    • getGroupMin

      public static ImVec2 getGroupMin()
    • getGroupMinX

      public static float getGroupMinX()
    • getGroupMinY

      public static float getGroupMinY()
    • getGroupMin

      public static void getGroupMin(ImVec2 dst)
    • getGroupMax

      public static ImVec2 getGroupMax()
    • getGroupMaxX

      public static float getGroupMaxX()
    • getGroupMaxY

      public static float getGroupMaxY()
    • getGroupMax

      public static void getGroupMax(ImVec2 dst)
    • getHintForegroundDrawList

      public static ImDrawList getHintForegroundDrawList()
    • getHintBackgroundDrawList

      public static ImDrawList getHintBackgroundDrawList()
    • endGroupHint

      public static void endGroupHint()
    • getNodeBackgroundDrawList

      public static ImDrawList getNodeBackgroundDrawList(long nodeId)
    • link

      public static boolean link(long id, long startPinId, long endPinId)
    • link

      public static boolean link(long id, long startPinId, long endPinId, ImVec4 color)
    • link

      public static boolean link(long id, long startPinId, long endPinId, float colorX, float colorY, float colorZ, float colorW)
    • link

      public static boolean link(long id, long startPinId, long endPinId, ImVec4 color, float thickness)
    • link

      public static boolean link(long id, long startPinId, long endPinId, float colorX, float colorY, float colorZ, float colorW, float thickness)
    • link

      public static boolean link(long id, long startPinId, long endPinId, float thickness)
    • flow

      public static void flow(long linkId)
    • flow

      public static void flow(long linkId, int direction)
    • beginCreate

      public static boolean beginCreate()
    • beginCreate

      public static boolean beginCreate(ImVec4 color)
    • beginCreate

      public static boolean beginCreate(float colorX, float colorY, float colorZ, float colorW)
    • beginCreate

      public static boolean beginCreate(ImVec4 color, float thickness)
    • beginCreate

      public static boolean beginCreate(float colorX, float colorY, float colorZ, float colorW, float thickness)
    • beginCreate

      public static boolean beginCreate(float thickness)
    • queryNewLink

      public static boolean queryNewLink(ImLong startId, ImLong endId)
    • queryNewLink

      public static boolean queryNewLink(ImLong startId, ImLong endId, ImVec4 color)
    • queryNewLink

      public static boolean queryNewLink(ImLong startId, ImLong endId, float colorX, float colorY, float colorZ, float colorW)
    • queryNewLink

      public static boolean queryNewLink(ImLong startId, ImLong endId, ImVec4 color, float thickness)
    • queryNewLink

      public static boolean queryNewLink(ImLong startId, ImLong endId, float colorX, float colorY, float colorZ, float colorW, float thickness)
    • queryNewNode

      public static boolean queryNewNode(ImLong pinId)
    • queryNewNode

      public static boolean queryNewNode(ImLong pinId, ImVec4 color)
    • queryNewNode

      public static boolean queryNewNode(ImLong pinId, float colorX, float colorY, float colorZ, float colorW)
    • queryNewNode

      public static boolean queryNewNode(ImLong pinId, ImVec4 color, float thickness)
    • queryNewNode

      public static boolean queryNewNode(ImLong pinId, float colorX, float colorY, float colorZ, float colorW, float thickness)
    • acceptNewItem

      public static boolean acceptNewItem()
    • acceptNewItem

      public static boolean acceptNewItem(ImVec4 color)
    • acceptNewItem

      public static boolean acceptNewItem(float colorX, float colorY, float colorZ, float colorW)
    • acceptNewItem

      public static boolean acceptNewItem(ImVec4 color, float thickness)
    • acceptNewItem

      public static boolean acceptNewItem(float colorX, float colorY, float colorZ, float colorW, float thickness)
    • rejectNewItem

      public static void rejectNewItem()
    • rejectNewItem

      public static void rejectNewItem(ImVec4 color)
    • rejectNewItem

      public static void rejectNewItem(float colorX, float colorY, float colorZ, float colorW)
    • rejectNewItem

      public static void rejectNewItem(ImVec4 color, float thickness)
    • rejectNewItem

      public static void rejectNewItem(float colorX, float colorY, float colorZ, float colorW, float thickness)
    • endCreate

      public static void endCreate()
    • beginDelete

      public static boolean beginDelete()
    • queryDeletedLink

      public static boolean queryDeletedLink(ImLong linkId)
    • queryDeletedLink

      public static boolean queryDeletedLink(ImLong linkId, ImLong startId)
    • queryDeletedLink

      public static boolean queryDeletedLink(ImLong linkId, ImLong startId, ImLong endId)
    • queryDeletedNode

      public static boolean queryDeletedNode(ImLong nodeId)
    • acceptDeletedItem

      public static boolean acceptDeletedItem()
    • acceptDeletedItem

      public static boolean acceptDeletedItem(boolean deleteDependencies)
    • rejectDeletedItem

      public static void rejectDeletedItem()
    • endDelete

      public static void endDelete()
    • setNodePosition

      public static void setNodePosition(long nodeId, ImVec2 editorPosition)
    • setNodePosition

      public static void setNodePosition(long nodeId, float editorPositionX, float editorPositionY)
    • setGroupSize

      public static void setGroupSize(long nodeId, ImVec2 size)
    • setGroupSize

      public static void setGroupSize(long nodeId, float sizeX, float sizeY)
    • getNodePosition

      public static ImVec2 getNodePosition(long nodeId)
    • getNodePositionX

      public static float getNodePositionX(long nodeId)
    • getNodePositionY

      public static float getNodePositionY(long nodeId)
    • getNodePosition

      public static void getNodePosition(ImVec2 dst, long nodeId)
    • getNodeSize

      public static ImVec2 getNodeSize(long nodeId)
    • getNodeSizeX

      public static float getNodeSizeX(long nodeId)
    • getNodeSizeY

      public static float getNodeSizeY(long nodeId)
    • getNodeSize

      public static void getNodeSize(ImVec2 dst, long nodeId)
    • centerNodeOnScreen

      public static void centerNodeOnScreen(long nodeId)
    • setNodeZPosition

      public static void setNodeZPosition(long nodeId, float z)
    • getNodeZPosition

      public static float getNodeZPosition(long nodeId)
    • restoreNodeState

      public static void restoreNodeState(long nodeId)
    • suspend

      public static void suspend()
    • resume

      public static void resume()
    • isSuspended

      public static boolean isSuspended()
    • isActive

      public static boolean isActive()
    • hasSelectionChanged

      public static boolean hasSelectionChanged()
    • getSelectedObjectCount

      public static int getSelectedObjectCount()
    • getSelectedNodes

      public static int getSelectedNodes(long[] nodes, int size)
    • getSelectedLinks

      public static int getSelectedLinks(long[] links, int size)
    • isNodeSelected

      public static boolean isNodeSelected(long nodeId)
    • isLinkSelected

      public static boolean isLinkSelected(long linkId)
    • clearSelection

      public static void clearSelection()
    • selectNode

      public static void selectNode(long nodeId)
    • selectNode

      public static void selectNode(long nodeId, boolean append)
    • selectLink

      public static void selectLink(long linkId)
    • selectLink

      public static void selectLink(long linkId, boolean append)
    • deselectNode

      public static void deselectNode(long nodeId)
    • deselectLink

      public static void deselectLink(long linkId)
    • deleteNode

      public static boolean deleteNode(long nodeId)
    • deleteLink

      public static boolean deleteLink(long linkId)
    • hasAnyLinksNode

      public static boolean hasAnyLinksNode(long nodeId)
    • hasAnyLinksPin

      public static boolean hasAnyLinksPin(long pinId)
    • breakLinksNode

      public static int breakLinksNode(long nodeId)
    • breakLinksPin

      public static int breakLinksPin(long pinId)
    • showNodeContextMenu

      public static boolean showNodeContextMenu(ImLong nodeId)
    • showPinContextMenu

      public static boolean showPinContextMenu(ImLong pinId)
    • showLinkContextMenu

      public static boolean showLinkContextMenu(ImLong linkId)
    • getNodeWithContextMenu

      public static long getNodeWithContextMenu()
    • getPinWithContextMenu

      public static long getPinWithContextMenu()
    • getLinkWithContextMenu

      public static long getLinkWithContextMenu()
    • showBackgroundContextMenu

      public static boolean showBackgroundContextMenu()
    • enableShortcuts

      public static void enableShortcuts(boolean enable)
    • areShortcutsEnabled

      public static boolean areShortcutsEnabled()
    • beginShortcut

      public static boolean beginShortcut()
    • acceptCut

      public static boolean acceptCut()
    • acceptCopy

      public static boolean acceptCopy()
    • acceptPaste

      public static boolean acceptPaste()
    • acceptDuplicate

      public static boolean acceptDuplicate()
    • acceptCreateNode

      public static boolean acceptCreateNode()
    • getActionContextSize

      public static int getActionContextSize()
    • getActionContextNodes

      public static int getActionContextNodes(long[] nodes, int size)
    • getActionContextLinks

      public static int getActionContextLinks(long[] links, int size)
    • endShortcut

      public static void endShortcut()
    • getCurrentZoom

      public static float getCurrentZoom()
    • getHoveredNode

      public static long getHoveredNode()
    • getHoveredPin

      public static long getHoveredPin()
    • getHoveredLink

      public static long getHoveredLink()
    • getDoubleClickedNode

      public static long getDoubleClickedNode()
    • getDoubleClickedPin

      public static long getDoubleClickedPin()
    • getDoubleClickedLink

      public static long getDoubleClickedLink()
    • isBackgroundClicked

      public static boolean isBackgroundClicked()
    • isBackgroundDoubleClicked

      public static boolean isBackgroundDoubleClicked()
    • getLinkPins

      public static boolean getLinkPins(long linkId, ImLong startPinId, ImLong endPinId)
    • pinHadAnyLinks

      public static boolean pinHadAnyLinks(long pinId)
    • getScreenSize

      public static ImVec2 getScreenSize()
    • getScreenSizeX

      public static float getScreenSizeX()
    • getScreenSizeY

      public static float getScreenSizeY()
    • getScreenSize

      public static void getScreenSize(ImVec2 dst)
    • screenToCanvas

      public static ImVec2 screenToCanvas(ImVec2 pos)
    • screenToCanvas

      public static ImVec2 screenToCanvas(float posX, float posY)
    • screenToCanvasX

      public static float screenToCanvasX(ImVec2 pos)
    • screenToCanvasY

      public static float screenToCanvasY(ImVec2 pos)
    • screenToCanvas

      public static void screenToCanvas(ImVec2 dst, ImVec2 pos)
    • screenToCanvas

      public static void screenToCanvas(ImVec2 dst, float posX, float posY)
    • canvasToScreen

      public static ImVec2 canvasToScreen(ImVec2 pos)
    • canvasToScreen

      public static ImVec2 canvasToScreen(float posX, float posY)
    • canvasToScreenX

      public static float canvasToScreenX(ImVec2 pos)
    • canvasToScreenY

      public static float canvasToScreenY(ImVec2 pos)
    • canvasToScreen

      public static void canvasToScreen(ImVec2 dst, ImVec2 pos)
    • canvasToScreen

      public static void canvasToScreen(ImVec2 dst, float posX, float posY)
    • getNodeCount

      public static int getNodeCount()
    • getOrderedNodeIds

      public static int getOrderedNodeIds(long[] nodes, int size)