scg.ac.ni.pmf.newgraph.action
Interface GraphAction


public interface GraphAction

Graph actions transform graphs some way. It can also change the related objects, such as the current selection of vertices and edges, and the position of the vertices and edges. They are shown in the menu "Transform", and on the right click on the graph.

A graph action should first provide the name and the description. Additionally, it should provide a method that tells is the graph action enabled on the current graph. Finally, if should provide a method that changes the graph. Actions could be parametrized.

Author:
Vladimir Brankov
See Also:
"Plug-in Developer Guide", Parametrizable

Method Summary
 void action(Graph graph, boolean ctrl, boolean shift)
          The method should perform the desired action on the graph.
 java.lang.String getDescription()
          Retrieves the description of the action.
 java.lang.String getName()
          Retrieves the name of the action.
 boolean isEnabled(GraphData graph)
          This method should tell is the action enabled for execution, depending on the current state of the graph.
 

Method Detail

getName

java.lang.String getName()
Retrieves the name of the action. The name can be of the form <group_name>.<action_name>. Grouping of actions is done on the menues where they are shown, groups are separated by menu separators.

Returns:
The name.

getDescription

java.lang.String getDescription()
Retrieves the description of the action.

Returns:
The description.

isEnabled

boolean isEnabled(GraphData graph)
This method should tell is the action enabled for execution, depending on the current state of the graph.

Parameters:
graph - The graph data.
Returns:
Indicates is the action enabled for execution.

action

void action(Graph graph,
            boolean ctrl,
            boolean shift)
The method should perform the desired action on the graph.

Parameters:
graph - The graph that could be modified.
ctrl - Indicates whether the CTRL button was pressed when the action was invoked.
shift - Indicates whether the SHIFT button was pressed when the action was invoked.


Copyright © 2004 Dragan Stevanovic, Vladimir Brankov.