Module socketview

Class SocketView

All Implemented Interfaces:
ViewConfig3D, Manageable, SharedObjectReference, XAListener, Context, Panel, Disposable, EventListener, ModifiableMap.Producer, EventListener, TreeModelListener

public class SocketView extends View implements SharedObjectReference, ViewConfig3D, XAListener
An "invisible" view that manage a websocket server thread. The view link the ws server and the project graph.
  • Field Details

    • TOOL

      public static final UIProperty TOOL
    • isVisiting

      public boolean isVisiting
    • $TYPE

      public static final SocketView.Type $TYPE
  • Constructor Details

    • SocketView

      public SocketView()
  • Method Details

    • startVisiting

      public void startVisiting()
    • finishVisiting

      public void finishVisiting()
    • isIn

      public boolean isIn(de.grogra.socketview.shapes.SocketShape node)
    • getJsonData

      public org.json.JSONObject getJsonData()
      Return the current data in the view. If the data is empty -> sync with the graph
      Returns:
    • getJsonDataDiff

      public org.json.JSONObject getJsonDataDiff()
      Return only the current diff (i.e. the nodes added/ removed since the last derivation)
    • waitRenderer

      public boolean waitRenderer()
      Wait for the data to be ready
    • derive

      public void derive()
      Update the data with the remove set. TODO: also make the addition processed here
    • getSocketTransaction

      public SocketTransaction getSocketTransaction()
    • addNodes

      public void addNodes(Map<Long,de.grogra.socketview.shapes.SocketShape> l)
    • removeNodes

      public void removeNodes(Map<Long,de.grogra.socketview.shapes.SocketShape> l)
    • nodesChanged

      public void nodesChanged(Map<Long,de.grogra.socketview.shapes.SocketShape> l)
    • commit

      public void commit(org.json.JSONObject jo)
    • commitDataDiff

      public void commitDataDiff()
      If the "transaction" is empty nothing is send
    • commitSelection

      public void commitSelection()
    • initialize

      public Panel initialize(Panel panel, Map params)
      Specified by:
      initialize in interface Panel
      Overrides:
      initialize in class View
    • disposeViewComponent

      protected void disposeViewComponent()
      Overrides:
      disposeViewComponent in class View
    • installImpl

      protected void installImpl()
      Specified by:
      installImpl in class View
    • uninstallImpl

      protected void uninstallImpl()
      Specified by:
      uninstallImpl in class View
    • processRequest

      public void processRequest(String request, io.netty.channel.Channel ch)
      Process the request from the clients. A request is a registry path to an executable and a URL decoded map of parameters (?key1=value1invalid input: '&key2'=value2). If the executable is a ObjectMethod, the return value of this method is forwarded, otherwise only true is returned if the execution was done. If the path to the executable does not start with an "/" it's assumed the path starts at "/ui/socketTools/".
      Parameters:
      request - URL string with executable path and parameters
      wb -
    • wrapRequest

      public Command wrapRequest(StringMap sm, Executable c, io.netty.channel.Channel ch)
    • getToolProperty

      protected UIProperty getToolProperty()
      Specified by:
      getToolProperty in class View
    • createEventHandler

      protected ViewEventHandler createEventHandler()
      Specified by:
      createEventHandler in class View
    • transactionApplied

      public void transactionApplied(Transaction.Data xa, boolean rollback)
      Do not check the options at every computediff. Only at option changed.
      Specified by:
      transactionApplied in interface XAListener
    • updateOptions

      protected void updateOptions()
    • getViewEventFactoryProperty

      protected UIProperty getViewEventFactoryProperty()
      Specified by:
      getViewEventFactoryProperty in class View
    • getResolutionProperty

      public UIProperty getResolutionProperty()
      Specified by:
      getResolutionProperty in class View
    • getFlavor

      public IOFlavor getFlavor()
      Specified by:
      getFlavor in class View
    • pick

      public void pick(int x, int y, PickList list)
      Specified by:
      pick in class View
    • pickTool

      public void pickTool(int x, int y, PickList list)
      Specified by:
      pickTool in class View
    • isToolGraph

      public boolean isToolGraph(Graph graph)
      Specified by:
      isToolGraph in class View
    • sharedObjectModified

      public void sharedObjectModified(Shareable object, Transaction t)
      Specified by:
      sharedObjectModified in interface SharedObjectReference
    • getCamera

      public Camera getCamera()
      Specified by:
      getCamera in interface ViewConfig3D
    • getDefaultLight

      public Light getDefaultLight(Matrix4d lightToWorld)
      Description copied from interface: ViewConfig3D
      Computes a default light to use when a scene contains no lights.
      Specified by:
      getDefaultLight in interface ViewConfig3D
      Parameters:
      lightToWorld - the computed transformation for the light is placed in here
      Returns:
      a default light
    • getManageableType

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