org.graffiti.plugins.modes.advanced
Interface FunctionComponent

All Known Implementing Classes:
AbstractEditingTool, CreateTool, LabelTool, NodeResizeTool, SelectionTool, ToolPlugin

public interface FunctionComponent

A (GUI-)component which supports the concept of functions. FunctionComponents are organized in a hierarchical structure, like civquest.quadmap.fieldview


Method Summary
 void afterEvent(Point position)
          Is called by the FunctionManager each time after an input-event was processed.
 void beforeEvent(Point position)
          Is called by the FunctionManager each time before an input-event is processed.
 FunctionAction getFunctionAction(String functionName)
          Returns a reference to a NEW Action-object assigned to the given function-name, if this FunctionComponent knows about such a function itself, null otherwise.
 PositionInfo getPositionInfo()
          Returns an object with some position-information, including the last mouse-position.
 FunctionComponent getSubComponent(String name)
          Returns the direct sub-FunctionComponent with the given name (relative to this FunctionComponent), if it exists, null otherwise.
 

Method Detail

getFunctionAction

FunctionAction getFunctionAction(String functionName)
Returns a reference to a NEW Action-object assigned to the given function-name, if this FunctionComponent knows about such a function itself, null otherwise.

Note that subsequent calls to this function must return different Action-objects!!! NOTE: If only a sub-function-component knows that function, returning something != null is not required. However, in some cases (field-views in CivQuest), a value != null will be returned in that case.

Parameters:
functionName - name of the function
Returns:
reference to an appropriate Action-object as described, null in certain cases (see above)

getPositionInfo

PositionInfo getPositionInfo()
Returns an object with some position-information, including the last mouse-position. Used for feeding FunctionActionEvents with position-information.

Returns:
object with position-information as described

getSubComponent

FunctionComponent getSubComponent(String name)
Returns the direct sub-FunctionComponent with the given name (relative to this FunctionComponent), if it exists, null otherwise. NOTE: The given String may ONLY contain the subcomponent-prefix, not the whole function-name ("civquest" vs. "civquest.quit").

Parameters:
name - name of the sub-function-component to be returned
Returns:
searched FunctionComponent if it exists, null otherwise

afterEvent

void afterEvent(Point position)
Is called by the FunctionManager each time after an input-event was processed. Processing means that all functions assigned to the event are executed.

Parameters:
position - DOCUMENT ME!

beforeEvent

void beforeEvent(Point position)
Is called by the FunctionManager each time before an input-event is processed. Processing means, that all functions assigned to the event are executed.

Parameters:
position - DOCUMENT ME!


Generated at 2012-05-30 11:01:25 PM CEST