Class SecGraphImpl

All Implemented Interfaces:
GraphContext, GraphManagerContext, GraphObject, SecGraph, ProducingNode, DisposableField, Manageable, Shareable, RegistryContext, Selectable, Cloneable

public class SecGraphImpl extends EmbeddedSharedObject implements SecGraph, Selectable
  • Field Details

  • Constructor Details

  • Method Details

    • getMimeType

      public MimeType getMimeType()
      Description copied from class: EmbeddedSharedObject
      Manage where the file should be stored
      Specified by:
      getMimeType in class EmbeddedSharedObject
    • getResourceDirectoryName

      public String getResourceDirectoryName()
      Specified by:
      getResourceDirectoryName in class EmbeddedSharedObject
    • getObjectType

      public String getObjectType()
      Description copied from class: EmbeddedSharedObject
      The java class name of the object type
      Specified by:
      getObjectType in class EmbeddedSharedObject
    • isAutoRecreate

      public boolean isAutoRecreate()
    • view2d

      public void view2d(Context ctx)
      Description copied from interface: GraphObject
      Opens the 2d view of the current graph
      Specified by:
      view2d in interface GraphObject
    • view3d

      public void view3d(Context ctx)
      Description copied from interface: GraphObject
      Opens the 3d view of the current graph
      Specified by:
      view3d in interface GraphObject
    • getGraph

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

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

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

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

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

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

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

      public void handleSaveEvent()
      Description copied from interface: SecGraph
      function triggered by the saving of the project
      Specified by:
      handleSaveEvent in interface SecGraph
    • setAutoRecreate

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

      public SecGraphInitialProducer producer$begin()
      Specified by:
      producer$begin in interface SecGraph
    • getInitalProducer

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

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

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

      public static void save(Registry r)
    • getRootNode

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

      public void setRootNode(Node root)
      Description copied from interface: GraphObject
      Set the rootnode of a GraphObject object.
      Specified by:
      setRootNode in interface GraphObject
    • 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
    • describes

      public Object describes()
      Description copied from interface: GraphObject
      Gives an array of node types and number contained in the GraphObject
      Specified by:
      describes 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
    • 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
    • includes

      public boolean includes(SecGraph sg) throws de.grogra.graph.object.sg.impl.exception.NoQueryGraphException
      Description copied from interface: SecGraph
      test if this SecGraph incldues the SecGraph SG
      Specified by:
      includes in interface SecGraph
      Returns:
      Throws:
      de.grogra.graph.object.sg.impl.exception.NoQueryGraphException
    • inProjectGraph

      public boolean inProjectGraph() throws de.grogra.graph.object.sg.impl.exception.NoQueryGraphException
      Description copied from interface: SecGraph
      test if this graph is included in the ProjectGraph
      Specified by:
      inProjectGraph in interface SecGraph
      Returns:
      Throws:
      de.grogra.graph.object.sg.impl.exception.NoQueryGraphException
    • includes

      public boolean includes(SecGraph sg, boolean asQuery) throws de.grogra.graph.object.sg.impl.exception.NoQueryGraphException
      Description copied from interface: SecGraph
      test if this SecGraph incldues the given SecGraph or if the query SecGraph of this graph is included in the given SecGraph
      Specified by:
      includes in interface SecGraph
      Returns:
      Throws:
      de.grogra.graph.object.sg.impl.exception.NoQueryGraphException
    • inProjectGraph

      public boolean inProjectGraph(boolean asQuery) throws de.grogra.graph.object.sg.impl.exception.NoQueryGraphException
      Description copied from interface: SecGraph
      test if this graph is included in the ProjectGraph or if the query SecGraph of this graph is included in the Project Graph
      Specified by:
      inProjectGraph in interface SecGraph
      Returns:
      Throws:
      de.grogra.graph.object.sg.impl.exception.NoQueryGraphException
    • execute

      public void execute() throws de.grogra.graph.object.sg.impl.exception.NoRuleGraphException
      Description copied from interface: SecGraph
      run this SecGraph as a rule on the MainGraph
      Specified by:
      execute in interface SecGraph
      Throws:
      de.grogra.graph.object.sg.impl.exception.NoRuleGraphException
    • execute

      public void execute(SecGraph sg) throws de.grogra.graph.object.sg.impl.exception.NoRuleGraphException
      Description copied from interface: SecGraph
      run this SecGraph as a rule on the given secGraph
      Specified by:
      execute in interface SecGraph
      Throws:
      de.grogra.graph.object.sg.impl.exception.NoRuleGraphException
    • apply

      public void apply(SecGraph rule) throws de.grogra.graph.object.sg.impl.exception.NoRuleGraphException
      Description copied from interface: SecGraph
      apply the given SecGraph on this SecGraph
      Specified by:
      apply in interface SecGraph
      Throws:
      de.grogra.graph.object.sg.impl.exception.NoRuleGraphException
    • getQueryRoot

      public Node getQueryRoot(boolean create)
      Specified by:
      getQueryRoot in interface SecGraph
    • getProductionRoot

      public Node getProductionRoot(boolean create)
      Specified by:
      getProductionRoot in interface SecGraph
    • query

      public Object query()
      Specified by:
      query in interface SecGraph
    • production

      public Object production()
      Specified by:
      production in interface SecGraph
    • isQueryGraph

      public boolean isQueryGraph()
      Description copied from interface: SecGraph
      check if the secgraph includes a queryRoot
      Specified by:
      isQueryGraph in interface SecGraph
      Returns:
    • isRuleGraph

      public boolean isRuleGraph()
      Description copied from interface: SecGraph
      check if the secgraph includes a QueryRoot and a ProductionRoot
      Specified by:
      isRuleGraph in interface SecGraph
      Returns:
    • getName

      public String getName()
      Description copied from interface: GraphObject
      Gives the name if one exists
      Specified by:
      getName in interface GraphObject
      Returns:
    • toSelection

      public Selection toSelection(Context ctx)
      Description copied from interface: Selectable
      Converts this object into a Selection.
      Specified by:
      toSelection in interface Selectable
      Parameters:
      ctx - the UI context
      Returns:
      a selection, or null if this is not possible
    • produceNode

      public Node produceNode()
      Specified by:
      produceNode in interface ProducingNode
    • resolve

      public SecGraph resolve()
      Description copied from interface: GraphObject
      Resolves the real object if a reference is used If the real object is used the function returns it self
      Specified by:
      resolve in interface GraphObject
      Returns:
    • manageableWriteReplace

      public Object manageableWriteReplace()
      Specified by:
      manageableWriteReplace in interface Manageable
      Overrides:
      manageableWriteReplace in class EmbeddedSharedObject
    • clone

      public Object clone() throws CloneNotSupportedException
      Specified by:
      clone in interface SecGraph
      Overrides:
      clone in class Object
      Throws:
      CloneNotSupportedException
    • add

      public void add(GraphContext inp)
      Specified by:
      add in interface SecGraph
    • disposeField

      public void disposeField()
      Specified by:
      disposeField in interface DisposableField
    • getExtension

      public String getExtension()
      Specified by:
      getExtension in class EmbeddedSharedObject
    • hasContent

      public boolean hasContent()
      Description copied from class: EmbeddedSharedObject
      True if the object is not "empty" as its persistence depends how the mimetype write content, a java object with some value could be defined as "empty"
      Specified by:
      hasContent in class EmbeddedSharedObject
    • getManageableType

      public ManageableType getManageableType()
      Specified by:
      getManageableType in interface Manageable
      Overrides:
      getManageableType in class EmbeddedSharedObject