Class RotateAlgorithm
java.lang.Object
org.graffiti.plugin.algorithm.ThreadSafeAlgorithm
de.ipk_gatersleben.ag_nw.graffiti.plugins.gui.rotate.RotateAlgorithm
- All Implemented Interfaces:
ActionListener,EventListener,Algorithm,ProvidesGeneralContextMenu
public class RotateAlgorithm extends ThreadSafeAlgorithm implements ProvidesGeneralContextMenu, ActionListener
- Author:
- Henning, Christian Klukas
-
Constructor Summary
Constructors Constructor Description RotateAlgorithm() -
Method Summary
Modifier and Type Method Description voidactionPerformed(ActionEvent e)voidattach(Graph g, Selection selection)Attaches the given graph to this algorithm.voidcheck()Checks whether all preconditions of the current graph are satisfied.voiddisableUndo()voidexecute()Executes the whole algorithm.voidexecuteThreadSafe(ThreadSafeOptions options)ActionEventgetActionEvent()StringgetCategory()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.StringgetDescription()StringgetMenuCategory()Returns a path to a menu category.StringgetName()Returns the name (ID) of the algorithm.Parameter[]getParameters()Returns a list ofParameterthat are set for this algorithm.Set<Category>getSetCategory()Returns a set of categories to classify this algorithm .booleanisLayoutAlgorithm()A LayoutAlgorithm should return true.voidreset()Resets the internal state of the algorithm.voidresetDataCache(ThreadSafeOptions options)voidsetActionEvent(ActionEvent a)booleansetControlInterface(ThreadSafeOptions options, JComponent jc)DOCUMENT ME!voidsetParameters(Parameter[] params)Sets the parameters for this algorithm.StringtoString()Methods inherited from class org.graffiti.plugin.algorithm.ThreadSafeAlgorithm
getAcceleratorKeyStroke, mayWorkOnMultipleGraphs, showMenuIcon
-
Constructor Details
-
RotateAlgorithm
public RotateAlgorithm()
-
-
Method Details
-
getName
Description copied from interface:AlgorithmReturns the name (ID) of the algorithm. -
getCategory
Description copied from interface:AlgorithmReturns the category an algorithm should assigned to. Return NULL if the algorithm should be sorted directly in the plugin menu.- Specified by:
getCategoryin interfaceAlgorithm- Returns:
- The category an algorithm should assigned to.
-
getSetCategory
Description copied from interface:AlgorithmReturns 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:
getSetCategoryin interfaceAlgorithm- Returns:
- Set of Category Enums that classify this algorithm.
-
getMenuCategory
Description copied from interface:AlgorithmReturns a path to a menu category. This is s '.' separated string which reflects the position of this Algorithm in the Menu Hierarchy e.g. "Network.Layout" would put this algorithm in the menu 'Network' and its submenu 'Layout' If this menu is not existent it will be created If this method returns 'null' the algorithm will not appear in the menu- Specified by:
getMenuCategoryin interfaceAlgorithm- Returns:
-
toString
-
getParameters
Description copied from interface:AlgorithmReturns a list ofParameterthat are set for this algorithm.- Specified by:
getParametersin interfaceAlgorithm- Returns:
- a collection of
Parameterthat are needed by theAlgorithm.
-
getActionEvent
- Specified by:
getActionEventin interfaceAlgorithm
-
setActionEvent
- Specified by:
setActionEventin interfaceAlgorithm
-
setParameters
Description copied from interface:AlgorithmSets the parameters for this algorithm. Must have the same types and order as the array returned bygetParameter.- Specified by:
setParametersin interfaceAlgorithm
-
check
public void check()Description copied from interface:AlgorithmChecks whether all preconditions of the current graph are satisfied. -
execute
public void execute()Description copied from interface:AlgorithmExecutes the whole algorithm. -
getCurrentContextMenuItem
Description copied from interface:ProvidesGeneralContextMenuThis 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 InterfaceSelectionListenerif the menu item should be variable to the current selection. You could also return a MenuItem that contains a subMenu.- Specified by:
getCurrentContextMenuItemin interfaceProvidesGeneralContextMenu- Returns:
MenuItemthe menu item for the context menu
-
actionPerformed
- Specified by:
actionPerformedin interfaceActionListener
-
setControlInterface
Description copied from class:ThreadSafeAlgorithmDOCUMENT ME!- Specified by:
setControlInterfacein classThreadSafeAlgorithm- Returns:
- true, if an GUI was set, false if no interface is needed
-
executeThreadSafe
- Specified by:
executeThreadSafein classThreadSafeAlgorithm
-
resetDataCache
- Specified by:
resetDataCachein classThreadSafeAlgorithm
-
reset
public void reset()Description copied from interface:AlgorithmResets the internal state of the algorithm. -
attach
Description copied from interface:AlgorithmAttaches the given graph to this algorithm. A ttaches the given Selection information to the algorithm. -
isLayoutAlgorithm
public boolean isLayoutAlgorithm()Description copied from interface:AlgorithmA LayoutAlgorithm should return true. All other types of algorithms should return false.- Specified by:
isLayoutAlgorithmin interfaceAlgorithm- Returns:
-
getDescription
- Specified by:
getDescriptionin interfaceAlgorithm
-
disableUndo
public void disableUndo()
-