Class PrintAlgorithm
java.lang.Object
org.graffiti.plugin.algorithm.AbstractAlgorithm
de.ipk_gatersleben.ag_nw.graffiti.plugins.misc.print.printer.PrintAlgorithm
- All Implemented Interfaces:
UndoableEdit
,Algorithm
public class PrintAlgorithm extends AbstractAlgorithm
The print algorithm.
- Version:
- $Revision$
- Author:
- Burkhard Sell
-
Constructor Summary
Constructors Constructor Description PrintAlgorithm()
-
Method Summary
Modifier and Type Method Description void
attach(Graph g, Selection s)
Unused for this plugin.void
check()
Checks whether all preconditions of the current graph are satisfied.void
execute()
This method is invoked by the plugin environment to start the action this plugin is for.KeyStroke
getAcceleratorKeyStroke()
Default: no accelerator for the menu item, created for this algorithm.String
getCategory()
Returns the category an algorithm should assigned to.String
getName()
Returns the name (ID) of the algorithm.Set<Category>
getSetCategory()
Returns a set of categories to classify this algorithm .boolean
isLayoutAlgorithm()
A LayoutAlgorithm should return true.void
reset()
Resets the algorithm state.void
setActiveSession(Session session)
Sets the active session.Methods inherited from class org.graffiti.plugin.algorithm.AbstractAlgorithm
addEdit, canRedo, canUndo, die, doesUndo, getActionEvent, getDescription, getMenuCategory, getParameters, getPresentationName, getRedoPresentationName, getUndoPresentationName, isAlwaysExecutable, isSignificant, markExecutionDone, markRedoDone, markUndoDone, mayWorkOnMultipleGraphs, redo, replaceEdit, setActionEvent, setParameters, showMenuIcon, undo
-
Constructor Details
-
PrintAlgorithm
public PrintAlgorithm()
-
-
Method Details
-
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.
-
getName
Description copied from interface:Algorithm
Returns the name (ID) of the algorithm.- Returns:
- DOCUMENT ME!
-
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.
-
attach
Unused for this plugin.- Specified by:
attach
in interfaceAlgorithm
- Overrides:
attach
in classAbstractAlgorithm
- Parameters:
g
- the graph to attach.s
- the selection to attach.- See Also:
org.graffiti.plugin.algorithm.Algorithm#attach(org.graffiti.graph.Graph)
-
check
Description copied from interface:Algorithm
Checks whether all preconditions of the current graph are satisfied.- Specified by:
check
in interfaceAlgorithm
- Overrides:
check
in classAbstractAlgorithm
- Throws:
PreconditionException
- if the preconditions of the current graph are not satisfied.
-
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.
-
execute
public void execute()This method is invoked by the plugin environment to start the action this plugin is for.This method starts the printprocess
*This method needs the activeSession set by the
setActiveSession(Session)
Method. Make shure, thatsetActiveSession(Session)
is called BEFOREexecute()
method!!!- Throws:
IllegalStateException
- if activeSession is null- See Also:
Algorithm.execute()
,setActiveSession(Session)
-
reset
public void reset()Resets the algorithm state.Active session will be invalidated.
ATTENTION: After calling this method
setActiveSession(Session)
have to be called again BEFORE callingexecute()
- Specified by:
reset
in interfaceAlgorithm
- Overrides:
reset
in classAbstractAlgorithm
- See Also:
Algorithm.reset()
,setActiveSession(Session)
-
setActiveSession
Sets the active session.This session is uses by
execute()
Method. Make shure, that this method is called BEFOREexecute()
!!!- See Also:
org.graffiti.plugin.algorithm.Algorithm#setActiveSession(org.graffiti.session.Session)
,execute()
-
isLayoutAlgorithm
public boolean isLayoutAlgorithm()Description copied from interface:Algorithm
A LayoutAlgorithm should return true. All other types of algorithms should return false.- Specified by:
isLayoutAlgorithm
in interfaceAlgorithm
- Overrides:
isLayoutAlgorithm
in classAbstractAlgorithm
- Returns:
-