Class CenterLayouterAlgorithm
java.lang.Object
org.graffiti.plugin.algorithm.AbstractAlgorithm
de.ipk_gatersleben.ag_nw.graffiti.plugins.layouters.graph_to_origin_mover.CenterLayouterAlgorithm
- All Implemented Interfaces:
ActionListener
,EventListener
,UndoableEdit
,Algorithm
,ProvidesGeneralContextMenu
public class CenterLayouterAlgorithm extends AbstractAlgorithm implements ProvidesGeneralContextMenu, ActionListener
DOCTODO: Include class header
-
Constructor Summary
Constructors Constructor Description CenterLayouterAlgorithm()
-
Method Summary
Modifier and Type Method Description void
actionPerformed(ActionEvent e)
void
check()
DOCTODO: Include method headervoid
execute()
DOCTODO: Include method headerKeyStroke
getAcceleratorKeyStroke()
Default: no accelerator for the menu item, created for this algorithm.String
getCategory()
Returns the category an algorithm should assigned to.JMenuItem[]
getCurrentContextMenuItem()
This method should be implemented, as that it returns the desired Context-MenuItem for the Plugin.String
getName()
The external name of this algorithm.Set<Category>
getSetCategory()
Returns a set of categories to classify this algorithm .static void
moveBends(Edge e, double moveX, double moveY, HashMap<CoordinateAttribute,Vector2d> bends2newPositions)
Deprecated.static void
moveGraph(Graph graph, String nameOfOperation, boolean moveToTop, double offX, double offY)
Methods inherited from class org.graffiti.plugin.algorithm.AbstractAlgorithm
addEdit, attach, canRedo, canUndo, die, doesUndo, getActionEvent, getDescription, getMenuCategory, getParameters, getPresentationName, getRedoPresentationName, getUndoPresentationName, isAlwaysExecutable, isLayoutAlgorithm, isSignificant, markExecutionDone, markRedoDone, markUndoDone, mayWorkOnMultipleGraphs, redo, replaceEdit, reset, setActionEvent, setParameters, showMenuIcon, undo
-
Constructor Details
-
CenterLayouterAlgorithm
public CenterLayouterAlgorithm()
-
-
Method Details
-
getName
The external name of this algorithm. -
getCategory
Description copied from interface:Algorithm
Returns the category an algorithm should assigned to. Return NULL if the algorithm should be sorted directly in the plugin menu.- Specified by:
getCategory
in interfaceAlgorithm
- Overrides:
getCategory
in classAbstractAlgorithm
- Returns:
- The category an algorithm should assigned to.
-
getSetCategory
Description copied from interface:Algorithm
Returns a set of categories to classify this algorithm . e.g. return new HashSet(Arrays.asList( Category.GRAPH, Category.NODE )); is an algorithm, working on graphs and more specific on nodes - Specified by:
getSetCategory
in interfaceAlgorithm
- Overrides:
getSetCategory
in classAbstractAlgorithm
- Returns:
- Set of Category Enums that classify this algorithm.
-
getAcceleratorKeyStroke
Description copied from class:AbstractAlgorithm
Default: no accelerator for the menu item, created for this algorithm.- Specified by:
getAcceleratorKeyStroke
in interfaceAlgorithm
- Overrides:
getAcceleratorKeyStroke
in classAbstractAlgorithm
- Returns:
- NULL (default) if no accelerator should be assigned for this algorithm.
-
check
DOCTODO: Include method header- Specified by:
check
in interfaceAlgorithm
- Overrides:
check
in classAbstractAlgorithm
- Throws:
PreconditionException
- DOCUMENT ME!
-
execute
public void execute()DOCTODO: Include method header -
moveGraph
-
moveBends
@Deprecated public static void moveBends(Edge e, double moveX, double moveY, HashMap<CoordinateAttribute,Vector2d> bends2newPositions)Deprecated. -
getCurrentContextMenuItem
Description copied from interface:ProvidesGeneralContextMenu
This method should be implemented, as that it returns the desired Context-MenuItem for the Plugin. It will be added on the fly to a newly created context menu, when the user right-clicks an EditorFrame. The plugin should implement the InterfaceSelectionListener
if the menu item should be variable to the current selection. You could also return a MenuItem that contains a subMenu.- Specified by:
getCurrentContextMenuItem
in interfaceProvidesGeneralContextMenu
- Returns:
MenuItem
the menu item for the context menu
-
actionPerformed
- Specified by:
actionPerformed
in interfaceActionListener
-
EdgeHelper.moveBends(Edge,double,double,HashMap<CoordinateAttribute, Vector2d>)
instead