psdi.webclient.applet.wfcanvas.editor

Class WorkflowEditor

  • java.lang.Object
    • psdi.webclient.applet.wfcanvas.editor.WorkflowEditor


  • public class WorkflowEditor
    extends java.lang.Object

    This class handles the editing operations on a workflow

    • Constructor Summary

      Constructors 
      Constructor and Description
      WorkflowEditor()
      Constructs a workflow editor
      WorkflowEditor(psdi.webclient.applet.wfcanvas.Workflow workflow) 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void add(psdi.webclient.applet.wfcanvas.WorkflowEntity entity)
      Adds a node or relationship
      protected void addNode(psdi.webclient.applet.wfcanvas.WorkflowNode node)
      Adds the node
      protected void addRelationship(psdi.webclient.applet.wfcanvas.WorkflowRelationship rel)
      Adds the relationship
      void addWorkflowEditListener(WorkflowEditListener listener)
      Adds a listener to the editor
      void clearChanges()
      Sets the saved state
      void delete()
      Deletes the currently selected object
      void delete(psdi.webclient.applet.wfcanvas.WorkflowEntity entity)
      Deletes the entity
      protected void fireListeners(WorkflowEditEvent e)
      Fires an event for all the listeners
      psdi.webclient.applet.wfcanvas.WorkflowEntity getSelected()
      Gets the selected entity
      int getTimestamp()
      Gets the current timestamp - this is used by the undo code to restore a set of changes
      int getTopTimestamp()
      Returns the time stamp of the entry on the top of the stack or zero if no entries.
      boolean hasChanges()
      Tests the saved state
      boolean hasUndoEntries()
      Gets the state of the undo stack
      void move(int column, int row)
      Moves the currently selected object
      void move(psdi.webclient.applet.wfcanvas.WorkflowEntity entity, int column, int row)
      Moves the entity
      protected void moveNode(psdi.webclient.applet.wfcanvas.WorkflowNode node, int column, int row)
      Moves the node
      protected void removeNode(psdi.webclient.applet.wfcanvas.WorkflowNode node)
      Removes the node
      protected void removeRelationship(psdi.webclient.applet.wfcanvas.WorkflowRelationship rel)
      Removes the relationship
      void removeWorkflowEditListener(WorkflowEditListener listener)
      Removes a listener from the editor
      void setEditable(boolean editable)
      Constructs a workflow editor for a workflow
      void setSelected(psdi.webclient.applet.wfcanvas.WorkflowEntity selection, boolean user)
      Sets the selected entity - a node or a relationship
      protected void testUndoState()
      Tests the undo state
      boolean undo()
      Undo one frame on the stack
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • workflow

        protected psdi.webclient.applet.wfcanvas.Workflow workflow
      • selection

        protected psdi.webclient.applet.wfcanvas.WorkflowEntity selection
      • timestamp

        protected int timestamp
      • undoEmpty

        protected boolean undoEmpty
      • lastSaved

        protected int lastSaved
      • editable

        protected boolean editable
      • listeners

        protected java.util.Vector listeners
      • workflowID

        protected static int workflowID
    • Constructor Detail

      • WorkflowEditor

        public WorkflowEditor()
        Constructs a workflow editor
      • WorkflowEditor

        public WorkflowEditor(psdi.webclient.applet.wfcanvas.Workflow workflow)
    • Method Detail

      • setEditable

        public void setEditable(boolean editable)
        Constructs a workflow editor for a workflow
        Parameters:
        workflow - The workflow to edit
      • getTimestamp

        public int getTimestamp()
        Gets the current timestamp - this is used by the undo code to restore a set of changes
        Returns:
        the timestamp
      • hasUndoEntries

        public boolean hasUndoEntries()
        Gets the state of the undo stack
        Returns:
        True if there are items on the undo stack
      • undo

        public boolean undo()
        Undo one frame on the stack
        Returns:
        Return true if a frame is restored and false if not
      • getTopTimestamp

        public int getTopTimestamp()
        Returns the time stamp of the entry on the top of the stack or zero if no entries.
        Returns:
        Time stamp of top item
      • addWorkflowEditListener

        public void addWorkflowEditListener(WorkflowEditListener listener)
        Adds a listener to the editor
        Parameters:
        listener - The workflow edit listener
      • removeWorkflowEditListener

        public void removeWorkflowEditListener(WorkflowEditListener listener)
        Removes a listener from the editor
        Parameters:
        listener - The workflow edit listener
      • fireListeners

        protected void fireListeners(WorkflowEditEvent e)
        Fires an event for all the listeners
        Parameters:
        e - The workflow edit event
      • setSelected

        public void setSelected(psdi.webclient.applet.wfcanvas.WorkflowEntity selection,
                                boolean user)
        Sets the selected entity - a node or a relationship
        Parameters:
        o - The entity to selected
      • getSelected

        public psdi.webclient.applet.wfcanvas.WorkflowEntity getSelected()
        Gets the selected entity
        Returns:
        The selected entity
      • add

        public void add(psdi.webclient.applet.wfcanvas.WorkflowEntity entity)
        Adds a node or relationship
        Parameters:
        o - The object to add
      • delete

        public void delete()
        Deletes the currently selected object
      • delete

        public void delete(psdi.webclient.applet.wfcanvas.WorkflowEntity entity)
        Deletes the entity
        Parameters:
        entity - The entity to delete
      • move

        public void move(int column,
                         int row)
        Moves the currently selected object
        Parameters:
        row - The new row
        column - The new column
      • move

        public void move(psdi.webclient.applet.wfcanvas.WorkflowEntity entity,
                         int column,
                         int row)
        Moves the entity
        Parameters:
        entity - The entity to delete
        row - The new row
        column - The new column
      • moveNode

        protected void moveNode(psdi.webclient.applet.wfcanvas.WorkflowNode node,
                                int column,
                                int row)
        Moves the node
        Parameters:
        node - The node to move
        row - The new row
        column - The new column
      • addNode

        protected void addNode(psdi.webclient.applet.wfcanvas.WorkflowNode node)
        Adds the node
        Parameters:
        node - The node to add
      • removeNode

        protected void removeNode(psdi.webclient.applet.wfcanvas.WorkflowNode node)
        Removes the node
        Parameters:
        node - The node to remove
      • addRelationship

        protected void addRelationship(psdi.webclient.applet.wfcanvas.WorkflowRelationship rel)
        Adds the relationship
        Parameters:
        rel - The relationship to add
      • removeRelationship

        protected void removeRelationship(psdi.webclient.applet.wfcanvas.WorkflowRelationship rel)
        Removes the relationship
        Parameters:
        rel - The relationship to remove
      • testUndoState

        protected void testUndoState()
        Tests the undo state
      • hasChanges

        public boolean hasChanges()
        Tests the saved state
      • clearChanges

        public void clearChanges()
        Sets the saved state