public class WorkflowEditor
extends java.lang.Object
This class handles the editing operations on a workflow
Modifier and Type | Field and Description |
---|---|
protected boolean |
editable |
protected int |
lastSaved |
protected java.util.Vector |
listeners |
protected psdi.webclient.applet.wfcanvas.WorkflowEntity |
selection |
protected int |
timestamp |
protected WorkflowEditorUndo |
undo |
protected boolean |
undoEmpty |
protected psdi.webclient.applet.wfcanvas.Workflow |
workflow |
protected static int |
workflowID |
Constructor and Description |
---|
WorkflowEditor()
Constructs a workflow editor
|
WorkflowEditor(psdi.webclient.applet.wfcanvas.Workflow workflow) |
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
|
protected psdi.webclient.applet.wfcanvas.Workflow workflow
protected psdi.webclient.applet.wfcanvas.WorkflowEntity selection
protected int timestamp
protected WorkflowEditorUndo undo
protected boolean undoEmpty
protected int lastSaved
protected boolean editable
protected java.util.Vector listeners
protected static int workflowID
public WorkflowEditor()
public WorkflowEditor(psdi.webclient.applet.wfcanvas.Workflow workflow)
public void setEditable(boolean editable)
workflow
- The workflow to editpublic int getTimestamp()
public boolean hasUndoEntries()
public boolean undo()
public int getTopTimestamp()
public void addWorkflowEditListener(WorkflowEditListener listener)
listener
- The workflow edit listenerpublic void removeWorkflowEditListener(WorkflowEditListener listener)
listener
- The workflow edit listenerprotected void fireListeners(WorkflowEditEvent e)
e
- The workflow edit eventpublic void setSelected(psdi.webclient.applet.wfcanvas.WorkflowEntity selection, boolean user)
o
- The entity to selectedpublic psdi.webclient.applet.wfcanvas.WorkflowEntity getSelected()
public void add(psdi.webclient.applet.wfcanvas.WorkflowEntity entity)
o
- The object to addpublic void delete()
public void delete(psdi.webclient.applet.wfcanvas.WorkflowEntity entity)
entity
- The entity to deletepublic void move(int column, int row)
row
- The new rowcolumn
- The new columnpublic void move(psdi.webclient.applet.wfcanvas.WorkflowEntity entity, int column, int row)
entity
- The entity to deleterow
- The new rowcolumn
- The new columnprotected void moveNode(psdi.webclient.applet.wfcanvas.WorkflowNode node, int column, int row)
node
- The node to moverow
- The new rowcolumn
- The new columnprotected void addNode(psdi.webclient.applet.wfcanvas.WorkflowNode node)
node
- The node to addprotected void removeNode(psdi.webclient.applet.wfcanvas.WorkflowNode node)
node
- The node to removeprotected void addRelationship(psdi.webclient.applet.wfcanvas.WorkflowRelationship rel)
rel
- The relationship to addprotected void removeRelationship(psdi.webclient.applet.wfcanvas.WorkflowRelationship rel)
rel
- The relationship to removeprotected void testUndoState()
public boolean hasChanges()
public void clearChanges()