GraphLab Project

graphlab.plugins.main.core.actions.vertex
Class AddVertex

java.lang.Object
  extended by graphlab.platform.core.AbstractAction
      extended by graphlab.plugins.main.core.actions.vertex.AddVertex
All Implemented Interfaces:
Action, Listener, Undoable

public class AddVertex
extends AbstractAction
implements Undoable

Adds a vertex to the graph: listens for "graph select point" & ...

Author:
azin azadi

Field Summary
static java.lang.String DISABLE
           
protected  SubGraph sd
           
 
Fields inherited from class graphlab.platform.core.AbstractAction
blackboard
 
Constructor Summary
AddVertex(BlackBoard bb)
           
 
Method Summary
static VertexModel addVertexToRandomPosition(GraphModel g)
          adds a vertex to a random position of the graph return the added vertex
static VertexModel doJob(GraphModel g, GraphPoint position)
          adds a vertex to the given location of graph
static VertexModel doJob(GraphModel g, int x, int y)
          adds a vertex to the given location of graph
 void performAction(java.lang.String key, java.lang.Object value)
          like Action
 void redo(UndoableActionOccuredData uaod)
           
 void undo(UndoableActionOccuredData uaod)
           
 
Methods inherited from class graphlab.platform.core.AbstractAction
disable, enable, getBlackBoard, getLastListenedEventKey, isEnable, keyChanged, listen4Event, setBlackBoard, unListenEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DISABLE

public static final java.lang.String DISABLE
See Also:
Constant Field Values

sd

protected SubGraph sd
Constructor Detail

AddVertex

public AddVertex(BlackBoard bb)
Method Detail

performAction

public void performAction(java.lang.String key,
                          java.lang.Object value)
Description copied from class: AbstractAction
like Action

Specified by:
performAction in interface Action
Specified by:
performAction in class AbstractAction

doJob

public static VertexModel doJob(GraphModel g,
                                int x,
                                int y)
adds a vertex to the given location of graph

Returns:
the added vertex

doJob

public static VertexModel doJob(GraphModel g,
                                GraphPoint position)
adds a vertex to the given location of graph

Returns:
the added vertex

addVertexToRandomPosition

public static VertexModel addVertexToRandomPosition(GraphModel g)
adds a vertex to a random position of the graph return the added vertex


undo

public void undo(UndoableActionOccuredData uaod)
Specified by:
undo in interface Undoable

redo

public void redo(UndoableActionOccuredData uaod)
Specified by:
redo in interface Undoable

GraphLab Project