Class SubGraphRef

All Implemented Interfaces:
GraphObject, SubGraph, Manageable, Shareable, RegistryContext

public final class SubGraphRef extends ItemReference<SubGraph> implements SubGraph
  • Field Details

  • Constructor Details

    • SubGraphRef

      public SubGraphRef(String name)
  • Method Details

    • getManageableType

      public ManageableType getManageableType()
      Specified by:
      getManageableType in interface Manageable
    • get

      public static SubGraphRef get(String name)
    • resolve

      public SubGraph resolve()
    • toSubGraph

      public SubGraph toSubGraph()
    • createItem

      protected Item createItem(RegistryContext ctx, String directory, String name)
      If the ref do not exist, one is created based on SubGraphResource & a file is created (xeg by default)
      Overrides:
      createItem in class ItemReference<SubGraph>
    • setRootNode

      public void setRootNode(Node n)
      Description copied from interface: GraphObject
      Set the rootnode of a Subgraph object.
      Specified by:
      setRootNode in interface GraphObject
    • getRootNode

      public Node getRootNode()
      Description copied from interface: GraphObject
      Return the root node of the subgraph, i.e. the root of the object loaded
      Specified by:
      getRootNode in interface GraphObject
      Returns:
      a Node
    • cloneGraph

      public Node cloneGraph() throws CloneNotSupportedException
      Description copied from interface: GraphObject
      clone the graph of the rootnode and returns it
      Specified by:
      cloneGraph in interface GraphObject
      Returns:
      Throws:
      CloneNotSupportedException
    • write

      public void write()
      Description copied from interface: GraphObject
      Override the file subgraph in the project with its current version. Required on subgraph created in RGG to be saved
      Specified by:
      write in interface GraphObject
    • reload

      public void reload()
      Description copied from interface: GraphObject
      If the subgraph uses some modules defined in the project, reload forces the modules in the subgraph to be relinked after compilation
      Specified by:
      reload in interface GraphObject
    • clear

      public void clear()
      Description copied from interface: SubGraph
      removes all Nodes except the root
      Specified by:
      clear in interface SubGraph
    • describes

      public Object describes()
      Description copied from interface: GraphObject
      Gives an array of node types and number contained in the subgraph
      Specified by:
      describes in interface GraphObject
      Returns:
    • getRegistry

      public Registry getRegistry()
      Description copied from interface: RegistryContext
      Returns the Registry which is linked with this instance.
      Specified by:
      getRegistry in interface RegistryContext
      Returns:
      the registry linked with this instance
    • getGraph

      public GraphManager getGraph()
      Description copied from interface: GraphObject
      Return the graph manager of the subgraph. It is different from the graph manager of the project & workbench.
      Specified by:
      getGraph in interface GraphObject
      Returns:
    • getNode

      public Node getNode(String key)
      Description copied from interface: GraphObject
      Return a node of the given name
      Specified by:
      getNode in interface GraphObject
      Parameters:
      key - : the name of the type of node
    • apply

      public void apply(String name)
      Description copied from interface: SubGraph
      Apply a RGG function on the subgraph
      Specified by:
      apply in interface SubGraph
      Parameters:
      name - : name of the function
    • applyXL

      public void applyXL(String name)
      Description copied from interface: SubGraph
      Apply an XL Query on the SubGraph
      Specified by:
      applyXL in interface SubGraph
      Parameters:
      name - : the XL query
    • toMesh

      public Node toMesh()
      Description copied from interface: SubGraph
      creates a rendered Mesh of the subGraph
      Specified by:
      toMesh in interface SubGraph
      Returns:
      the Node holding teh mesh
    • toInstance

      public Node toInstance()
      Description copied from interface: SubGraph
      creates a Node holding a instanciation of teh SubGraph
      Specified by:
      toInstance in interface SubGraph
      Returns:
      the Node
    • setAutoRecreate

      public void setAutoRecreate(boolean b)
      Description copied from interface: SubGraph
      defines if the subgraph is automatically recreated if the model is saved
      Specified by:
      setAutoRecreate in interface SubGraph
      Parameters:
      b - sets if recreated or not
    • handleSaveEvent

      public void handleSaveEvent()
      Description copied from interface: SubGraph
      function triggered by the saving of the project
      Specified by:
      handleSaveEvent in interface SubGraph
    • producer$begin

      public SubGraphInitialProducer producer$begin()
    • getInitalProducer

      public Object getInitalProducer()
      Description copied from interface: SubGraph
      create a new producer to initialize the Graph
      Specified by:
      getInitalProducer in interface SubGraph
      Returns:
    • setCurrent

      public void setCurrent()
      Description copied from interface: SubGraph
      set this graph to be the currently used one
      Specified by:
      setCurrent in interface SubGraph
    • releaseCurrent

      public void releaseCurrent()
      Description copied from interface: SubGraph
      set the project graph to be teh current one
      Specified by:
      releaseCurrent in interface SubGraph