Interface GraphNodeRenderer

All Known Implementing Classes:
DefaultGraphNodeRenderer

public interface GraphNodeRenderer

Paints a node. DefaultGraphNodeRenderer paints a card with a title, a description and the ports; implement this, or extend that, for nodes of your own design.

A renderer draws in screen pixels; the rectangle is the node's world rectangle at the current zoom. Below NodeGraph.getDetailZoom a renderer should draw no text, which would be unreadable and costs most of a frame in a large graph.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    paintNode(Graphics g, NodeGraph graph, GraphNode node, int x, int y, int w, int h, boolean selected)
    Paints node into the rectangle.
  • Method Details

    • paintNode

      void paintNode(Graphics g, NodeGraph graph, GraphNode node, int x, int y, int w, int h, boolean selected)

      Paints node into the rectangle.

      Parameters
      • g: the graphics, with the colour and alpha the renderer may change
      • graph: the component, for its zoom and its port geometry
      • node: the node
      • x, y, w, h: the node on screen
      • selected: true when the node is in the selection