java.lang.Object
com.marginallyclever.nodegraphcore.Node
com.marginallyclever.nodegraphcore.Subgraph
All Implemented Interfaces:
PrintWithGraphics, SupergraphInput, SupergraphOutput

public class Subgraph
extends Node
implements SupergraphInput, SupergraphOutput, PrintWithGraphics
A Subgraph is a Node which contains another graph.
  • Constructor Details

    • Subgraph

      public Subgraph()
      Constructor for subclasses to call.
    • Subgraph

      public Subgraph​(NodeGraph graph)
      Constructor for subclasses to call.
      Parameters:
      graph - the contents of this subgraph.
  • Method Details

    • setGraph

      public void setGraph​(NodeGraph graph)
      Stores a deep copy of the given graph and exposes the SupergraphInputs and SupergraphOutputs to the supergraph.
      Parameters:
      graph - the NodeGraph to store.
    • getGraph

      public NodeGraph getGraph()
      Returns the NodeGraph within this Subgraph
      Returns:
      the NodeGraph within this Subgraph
    • create

      public Node create()
      Description copied from class: Node
      Return one new instance of this type of Node. Override this method in derived classes.
      Specified by:
      create in class Node
      Returns:
      One new instance of this type of Node.
    • update

      public void update()
      Description copied from class: Node
      Override this method to provide the custom behavior of this node. Runs regardless of dirty inputs or outputs.
      Specified by:
      update in class Node
    • print

      public void print​(java.awt.Graphics g)
      Description copied from interface: PrintWithGraphics
      Called when the implementing class should paint.
      Specified by:
      print in interface PrintWithGraphics
      Parameters:
      g - the Graphics context.