public class DefaultToolBehaviorProvider extends java.lang.Object implements IToolBehaviorProvider
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_LINE_SELECTION_WIDTH
The default selection width (the tolerance area a user can click to still
select) a lathy object (e.g.
|
| Constructor and Description |
|---|
DefaultToolBehaviorProvider(IDiagramTypeProvider diagramTypeProvider)
Creates a new
DefaultToolBehaviorProvider. |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Dispose.
|
boolean |
equalsBusinessObjects(java.lang.Object o1,
java.lang.Object o2)
Default Implementation.
|
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.
|
ICustomFeature |
getCommandFeature(CustomContext context,
java.lang.String hint)
Command features can do anything, but they are tied to an external
command.
|
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.
|
DiagramScrollingBehavior |
getDiagramScrollingBehavior()
Deprecated.
Scroll bar based infinite canvas is a workaround for Bug
195527 and can be harmed by GEF modifications. It will be
removed then
|
java.lang.String |
getDirectEditingInvalidNotificationTitle(IDirectEditingFeature feature,
IDirectEditingContext context)
Returns the title of the popup that appears when a user provides an
invalid input for direct editing.
|
ICustomFeature |
getDoubleClickFeature(IDoubleClickContext context)
Returns a feature which will be executed at at double click.
|
int |
getLineSelectionWidth(Polyline polyline)
Is asked to return the selection width (the tolerance area a user can
click to still select) a lathy object (e.g.
|
ILocationInfo |
getLocationInfo(PictogramElement pe,
ILocationInfo locationInfo)
Returns the location info which will be used for direct editing if the
framework cannot decide this.
|
IPaletteCompartmentEntry[] |
getPalette()
Default implementation: creates a connection and an object compartment.
|
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.
|
IAnchorSelectionInfo |
getSelectionInfoForAnchor(Anchor anchor)
Return the selection info for the given anchor.
|
IConnectionSelectionInfo |
getSelectionInfoForConnection(Connection connection)
Return the selection info for the given connection.
|
IShapeSelectionInfo |
getSelectionInfoForShape(Shape shape)
Return the selection info for the given shape.
|
PictogramElement[] |
getSelections(PictogramElement selection) |
ICustomFeature |
getSingleClickFeature(ISingleClickContext context)
Returns a feature which will be executed at at a single click on an
already selected shape.
|
java.lang.String |
getTitleToolTip()
Returns a tooltip for the workbench titlebar.
|
java.lang.Object |
getToolTip(GraphicsAlgorithm ga)
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 |
isDefaultBendPointRenderingActive() |
boolean |
isMultiSelectionEnabled()
Indicates if the selection of multiple elements is enabled.
|
boolean |
isShowFlyoutPalette()
|
boolean |
isShowGuides()
Indicates whether guides will be shown or not.
|
boolean |
isShowMarqueeTool()
|
boolean |
isShowSelectionTool()
|
boolean |
isStayActiveAfterExecution(IConnectionCreationToolEntry connectionCreationToolEntry)
Defines if the tool created for the given
IConnectionCreationToolEntry stays active after a connection has
been created or not. |
void |
postExecute(IExecutionInfo executionInfo)
Called after execution on stack.
|
void |
preExecute(IExecutionInfo executionInfo)
Called before execution on stack.
|
public static final int DEFAULT_LINE_SELECTION_WIDTH
Polyline or Polygon for
Shapes and Connections) in the diagram. Is returned in
the default implementation of getLineSelectionWidth(Polyline).public DefaultToolBehaviorProvider(IDiagramTypeProvider diagramTypeProvider)
DefaultToolBehaviorProvider.diagramTypeProvider - the diagram type providerpublic void dispose()
IToolBehaviorProviderdispose in interface IToolBehaviorProviderpublic java.lang.Object getAdapter(java.lang.Class<?> type)
IToolBehaviorProvidergetAdapter in interface IToolBehaviorProvidertype - the typepublic PictogramElement getSelection(PictogramElement originalPe, PictogramElement[] oldSelection)
IToolBehaviorProvidergetSelection in interface IToolBehaviorProvideroriginalPe - the original pictogram elementoldSelection - the old selectionnull if there should not be a special selection
behavior; if there should not be a selection simply return the
diagrampublic PictogramElement[] getSelections(PictogramElement selection)
getSelections in interface IToolBehaviorProviderpublic IConnectionSelectionInfo getSelectionInfoForConnection(Connection connection)
IToolBehaviorProvidergetSelectionInfoForConnection in interface IToolBehaviorProviderconnection - the connectionpublic IContextButtonPadData getContextButtonPad(IPictogramElementContext context)
IToolBehaviorProvidergetContextButtonPad in interface IToolBehaviorProvidercontext - The pictogram element context, for which to return the context
button pad data.public IContextMenuEntry[] getContextMenu(ICustomContext context)
IToolBehaviorProvidergetContextMenu in interface IToolBehaviorProvidercontext - the custom context which contains the info about the location
where the context menu appears.public ILocationInfo getLocationInfo(PictogramElement pe, ILocationInfo locationInfo)
IToolBehaviorProvidergetLocationInfo in interface IToolBehaviorProviderpe - the active and selected pictogram elementlocationInfo - the current location info determined by the frameworkpublic ICustomFeature getDoubleClickFeature(IDoubleClickContext context)
IToolBehaviorProvidergetDoubleClickFeature in interface IToolBehaviorProvidercontext - contains information where the double click gesture has
happenedpublic ICustomFeature getSingleClickFeature(ISingleClickContext context)
IToolBehaviorProvidergetSingleClickFeature in interface IToolBehaviorProvidercontext - contains information where the single click gesture has
happenedpublic ICustomFeature getCommandFeature(CustomContext context, java.lang.String hint)
IToolBehaviorProvidergetCommandFeature in interface IToolBehaviorProvidercontext - the contexthint - the hint specified in the command bindingpublic IPaletteCompartmentEntry[] getPalette()
getPalette in interface IToolBehaviorProviderpublic IDecorator[] getDecorators(PictogramElement pe)
IToolBehaviorProviderIImageDecorator, IColorDecorator and
IBorderDecorator are supported for Shapes; for
Connections only IColorDecorators are supported and they
can only be used to change the foreground color of the Connection
.getDecorators in interface IToolBehaviorProviderpe - the pictogram elementpublic IShapeSelectionInfo getSelectionInfoForShape(Shape shape)
IToolBehaviorProvidergetSelectionInfoForShape in interface IToolBehaviorProvidershape - the shapepublic IAnchorSelectionInfo getSelectionInfoForAnchor(Anchor anchor)
IToolBehaviorProvidergetSelectionInfoForAnchor in interface IToolBehaviorProvideranchor - the anchorpublic double[] getZoomLevels()
IToolBehaviorProvidergetZoomLevels in interface IToolBehaviorProvider@Deprecated public DiagramScrollingBehavior getDiagramScrollingBehavior()
IToolBehaviorProvidergetDiagramScrollingBehavior in interface IToolBehaviorProvidergetDiagramScrollingBehavior()public void preExecute(IExecutionInfo executionInfo)
IToolBehaviorProviderpreExecute in interface IToolBehaviorProviderexecutionInfo - info about content to be executedpublic void postExecute(IExecutionInfo executionInfo)
IToolBehaviorProviderpostExecute in interface IToolBehaviorProviderexecutionInfo - info about content to be executedpublic java.lang.Object getToolTip(GraphicsAlgorithm ga)
getToolTip in interface IToolBehaviorProvidergraphicsAlgorithm - the graphics algorithmpublic GraphicsAlgorithm getSelectionBorder(PictogramElement pe)
IToolBehaviorProvidergetSelectionBorder in interface IToolBehaviorProviderpe - the pictogram elementpublic GraphicsAlgorithm[] getClickArea(PictogramElement pe)
IToolBehaviorProvidergetClickArea in interface IToolBehaviorProviderpe - the pictogram elementpublic GraphicsAlgorithm getChopboxAnchorArea(PictogramElement pe)
IToolBehaviorProvidergetChopboxAnchorArea in interface IToolBehaviorProviderpe - the given pictogram elementpublic java.lang.String getTitleToolTip()
IToolBehaviorProvidergetTitleToolTip in interface IToolBehaviorProvidernull to indicate that the default from
the graphics framework will be usedpublic boolean isShowGuides()
IToolBehaviorProviderisShowGuides in interface IToolBehaviorProvidertrue, if guides should be shownpublic GraphicsAlgorithm getContentArea(ContainerShape cs)
IToolBehaviorProvidergetContentArea in interface IToolBehaviorProvidercs - the container shapepublic java.lang.String getContributorId()
IToolBehaviorProvidergetContributorId in interface IToolBehaviorProviderpublic boolean isDefaultBendPointRenderingActive()
public boolean isMultiSelectionEnabled()
IToolBehaviorProviderfalse if an editor with single selection
behavior is needed.isMultiSelectionEnabled in interface IToolBehaviorProviderfalse, if single selection is enforcedpublic boolean isConnectionSelectionEnabled()
IToolBehaviorProviderisConnectionSelectionEnabled in interface IToolBehaviorProvidertrue, if selection of connections is enabledpublic boolean equalsBusinessObjects(java.lang.Object o1,
java.lang.Object o2)
equalsBusinessObjects in interface IToolBehaviorProviderpublic boolean isShowFlyoutPalette()
IToolBehaviorProvider.isShowFlyoutPalette(). This default
implementation returns true and tells the framework to show
the palette.isShowFlyoutPalette in interface IToolBehaviorProvidertruepublic boolean isShowSelectionTool()
IToolBehaviorProvider.isShowSelectionTool(). This default
implementation returns true and tells the framework to show
the selection tool entry in the palette.isShowSelectionTool in interface IToolBehaviorProvidertruepublic boolean isShowMarqueeTool()
IToolBehaviorProvider.isShowMarqueeTool(). This default
implementation returns true and tells the framework to show
the marquee tool entry in the palette.isShowMarqueeTool in interface IToolBehaviorProvidertruepublic int getLineSelectionWidth(Polyline polyline)
Polyline or
Polygon for Shapes and Connections) in the
diagram. The method is called when a new object is drawn for the first
time onto a diagram (on creation of the object or on opening the
diagram).DEFAULT_LINE_SELECTION_WIDTH
with the value 5 for all shapes.getLineSelectionWidth in interface IToolBehaviorProviderpolyline - the Polyline object to get the selection width forpublic boolean isStayActiveAfterExecution(IConnectionCreationToolEntry connectionCreationToolEntry)
IConnectionCreationToolEntry stays active after a connection has
been created or not. The default behavior in the GEF framework is
true, which is also the return value of this default
implementation.isStayActiveAfterExecution in interface IToolBehaviorProvidertrue in case the tool should stay active after
execution, false otherwise.public java.lang.String getDirectEditingInvalidNotificationTitle(IDirectEditingFeature feature, IDirectEditingContext context)
getDirectEditingInvalidNotificationTitle in interface IToolBehaviorProviderfeature - The IDirectEditingFeature that was invokedcontext - The IDirectEditingContext that was used.String representing the title of the popup to present
to the user.