org.eclipse.graphiti.tb
Interface IToolBehaviorProvider

All Known Implementing Classes:
DefaultToolBehaviorProvider

public interface IToolBehaviorProvider

The Interface IToolBehaviorProvider.


Method Summary
 void dispose()
          Dispose.
 java.lang.Object getAdapter(java.lang.Class<?> type)
          Returns the adapter for the specified key.
 GraphicsAlgorithm getChopboxAnchorArea(PictogramElement pe)
          Provides the graphics algorithm that defines the outline for the given pictogram element's chopbox Anchor.
 GraphicsAlgorithm[] getClickArea(PictogramElement pe)
          The returned graphics algorithm's define the area where the user can click to select the shape.
 GraphicsAlgorithm getContentArea(ContainerShape cs)
          The returned graphics algorithm defines the technical container for active children.
 IContextButtonPadData getContextButtonPad(IPictogramElementContext context)
          Returns the context button pad data for the given pictogram element context.
 IContextMenuEntry[] getContextMenu(ICustomContext context)
          Returns the context menu for the current mouse location.
 java.lang.String getContributorId()
          Returns the contributor ID for the tabbed property sheet page.
 IDecorator[] getDecorators(PictogramElement pe)
          Returns decorators which will be used at rendering time to decorate the graphical representation of the given pictogram element.
Currently only decorators of type IImageDecorator are supported.
 DiagramScrollingBehavior getDiagramScrollingBehavior()
          Deprecated. Scroll bar based infinite canvas is a workaround for GEF limitations.
 ICustomFeature getDoubleClickFeature(IDoubleClickContext context)
          Returns a feature which will be executed at at double click.
 ILocationInfo getLocationInfo(PictogramElement pe, ILocationInfo currentLocationInfo)
          Returns the location info which will be used for direct editing if the framework cannot decide this.
 IPaletteCompartmentEntry[] getPalette()
          Return the palette entries for the palette of the graphical editor.
 PictogramElement getSelection(PictogramElement originalPe, PictogramElement[] oldSelection)
          Override this method if you want to change the default selection on mouse click.
 GraphicsAlgorithm getSelectionBorder(PictogramElement pe)
          The returned graphics algorithm defines the selection border and the rectangle where the context buttons appear at.
 ISelectionInfo getSelectionInfoForConnection(Connection connection)
          Return the selection info for the given connection.
 ISelectionInfo getSelectionInfoForShape(Shape shape)
          Return the selection info for the given shape.
 java.lang.String getTitleToolTip()
          Returns a tooltip for the workbench titlebar.
 java.lang.String getToolTip(GraphicsAlgorithm graphicsAlgorithm)
          Returns the tooltip to be attached to the graphical representation of the given graphics algorithm.
 double[] getZoomLevels()
          Gets the zoom levels.
 boolean isConnectionSelectionEnabled()
          Indicates if the selection of connections is enabled.
 boolean isMultiSelectionEnabled()
          Indicates if the selection of multiple elements is enabled.
 boolean isShowGuides()
          Indicates whether guides will be shown or not.
 void postExecute(IExecutionInfo executionInfo)
          Called after execution on stack.
 void preExecute(IExecutionInfo executionInfo)
          Called before execution on stack.
 

Method Detail

getContextButtonPad

IContextButtonPadData getContextButtonPad(IPictogramElementContext context)
Returns the context button pad data for the given pictogram element context. The context button pad data defines, which context buttons to show for a given pictogram element. Can return null, if no there is no context button pad for the given pictogram element.

Parameters:
context - The pictogram element context, for which to return the context button pad data.
Returns:
The context button pad data for the given pictogram element context.

getContextMenu

IContextMenuEntry[] getContextMenu(ICustomContext context)
Returns the context menu for the current mouse location.

Parameters:
context - the custom context which contains the info about the location where the context menu appears.
Returns:
the context menu

getPalette

IPaletteCompartmentEntry[] getPalette()
Return the palette entries for the palette of the graphical editor. Typically these entries are a subset of CreateFeatures and CreateConnectionFeatures which are provided by the feature provider.

Returns:
the palette entries

getDoubleClickFeature

ICustomFeature getDoubleClickFeature(IDoubleClickContext context)
Returns a feature which will be executed at at double click. For that purpose a custom feature is used, because custom features appear in the context menu and the double click feature should also appear in the context menu (usual UI guideline).

Parameters:
context - contains information where the double click gesture has happened
Returns:
the feature to execute

getDecorators

IDecorator[] getDecorators(PictogramElement pe)
Returns decorators which will be used at rendering time to decorate the graphical representation of the given pictogram element.
Currently only decorators of type IImageDecorator are supported.

Parameters:
pe - the pictogram element
Returns:
the decorators

getAdapter

java.lang.Object getAdapter(java.lang.Class<?> type)
Returns the adapter for the specified key. This method will be called in the getAdapter() method of the graphical editor.

Parameters:
type - the type
Returns:
the adapter

getSelection

PictogramElement getSelection(PictogramElement originalPe,
                              PictogramElement[] oldSelection)
Override this method if you want to change the default selection on mouse click.

Parameters:
originalPe - the original pictogram element
oldSelection - the old selection
Returns:
an active pictogram element to be selected instead; return null if there should not be a special selection behavior; if there should not be a selection simply return the diagram

getDiagramScrollingBehavior

@Deprecated
DiagramScrollingBehavior getDiagramScrollingBehavior()
Deprecated. Scroll bar based infinite canvas is a workaround for GEF limitations.

Override this method if you want to change the default scrolling behavior of the diagram. The default is DiagramScrollingBehavior.GEF_DEFAULT: the empty diagram comes up without scroll bars. The scroll bars start to appear when objects are moved to the outside of the currently visible area. For permanently visible scroll bars, return the value DiagramScrollingBehavior.SCROLLBARS_PERMANENTLY_VISIBLE.

Returns:
The DiagramScrollingBehavior
See Also:
DefaultToolBehaviorProvider.getDiagramScrollingBehavior()

getZoomLevels

double[] getZoomLevels()
Gets the zoom levels.

Returns:
the zoom levels

dispose

void dispose()
Dispose.


getSelectionInfoForShape

ISelectionInfo getSelectionInfoForShape(Shape shape)
Return the selection info for the given shape.

Parameters:
shape - the shape
Returns:
the shape selection info

getSelectionInfoForConnection

ISelectionInfo getSelectionInfoForConnection(Connection connection)
Return the selection info for the given connection.

Parameters:
connection - the connection
Returns:
the connection selection info

getLocationInfo

ILocationInfo getLocationInfo(PictogramElement pe,
                              ILocationInfo currentLocationInfo)
Returns the location info which will be used for direct editing if the framework cannot decide this. E.g. a shape is selected and the user presses F2 but the mouse is outside the shape.

Parameters:
pe - the active and selected pictogram element
currentLocationInfo - the current location info determined by the framework
Returns:
the location info for the given selected pictogram element

preExecute

void preExecute(IExecutionInfo executionInfo)
Called before execution on stack. Overriding this method can be necessary if any additional actions have to be processed before the stack will be executed.

Parameters:
executionInfo - info about content to be executed

postExecute

void postExecute(IExecutionInfo executionInfo)
Called after execution on stack. Overriding this method can be necessary if any additional actions have to be processed after the stack will be executed. As example a tool could process an automatic layout of the diagram after each diagram modification.

Parameters:
executionInfo - info about content to be executed

getToolTip

java.lang.String getToolTip(GraphicsAlgorithm graphicsAlgorithm)
Returns the tooltip to be attached to the graphical representation of the given graphics algorithm.

Parameters:
graphicsAlgorithm - the graphics algorithm
Returns:
the tooltip

getSelectionBorder

GraphicsAlgorithm getSelectionBorder(PictogramElement pe)
The returned graphics algorithm defines the selection border and the rectangle where the context buttons appear at.

Parameters:
pe - the pictogram element
Returns:
the graphics algorithm which defines the selection border

getContentArea

GraphicsAlgorithm getContentArea(ContainerShape cs)
The returned graphics algorithm defines the technical container for active children. Currently implementers have to secure to deliver a (Rounded)Rectangle. Does not make sense for other types of graphics algorithm.

Parameters:
cs - the container shape
Returns:
the graphics algorithm acting as technical container

getClickArea

GraphicsAlgorithm[] getClickArea(PictogramElement pe)
The returned graphics algorithm's define the area where the user can click to select the shape.

Parameters:
pe - the pictogram element
Returns:
the click area

getChopboxAnchorArea

GraphicsAlgorithm getChopboxAnchorArea(PictogramElement pe)
Provides the graphics algorithm that defines the outline for the given pictogram element's chopbox Anchor.

Parameters:
pe - the given pictogram element
Returns:
the graphics algorithm that defines the outline for connections from or to the shape's chopbox anchor

getTitleToolTip

java.lang.String getTitleToolTip()
Returns a tooltip for the workbench titlebar.

Returns:
a tooltip or null to indicate that the default from the graphics framework will be used

isShowGuides

boolean isShowGuides()
Indicates whether guides will be shown or not.

Returns:
true, if guides should be shown

isMultiSelectionEnabled

boolean isMultiSelectionEnabled()
Indicates if the selection of multiple elements is enabled. Override this method and return false if an editor with single selection behavior is needed.

Returns:
false, if single selection is enforced

isConnectionSelectionEnabled

boolean isConnectionSelectionEnabled()
Indicates if the selection of connections is enabled.

Returns:
true, if selection of connections is enabled

getContributorId

java.lang.String getContributorId()
Returns the contributor ID for the tabbed property sheet page.

Returns:
the contributor ID for the tabbed property sheet page.


Copyright (c) SAP AG 2005, 2010.