|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IToolBehaviorProvider
The Interface IToolBehaviorProvider.
Method Summary | |
---|---|
void |
dispose()
Dispose. |
boolean |
equalsBusinessObjects(Object o1,
Object o2)
Decides if business objects are equal. |
Object |
getAdapter(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,
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. |
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 GEF limitations. |
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 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. |
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. |
ICustomFeature |
getSingleClickFeature(ISingleClickContext context)
Returns a feature which will be executed at at a single click on an already selected shape. |
String |
getTitleToolTip()
Returns a tooltip for the workbench titlebar. |
Object |
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 |
isShowFlyoutPalette()
Indicates whether flyout palette will be shown or not. |
boolean |
isShowGuides()
Indicates whether guides will be shown or not. |
boolean |
isShowMarqueeTool()
Indicates whether the marquee tool shall be added to the palette or not |
boolean |
isShowSelectionTool()
Indicates whether the selection tool shall be added to the palette or not |
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. |
Method Detail |
---|
IContextButtonPadData getContextButtonPad(IPictogramElementContext context)
context
- The pictogram element context, for which to return the context
button pad data.
IContextMenuEntry[] getContextMenu(ICustomContext context)
context
- the custom context which contains the info about the location
where the context menu appears.
IPaletteCompartmentEntry[] getPalette()
ICustomFeature getDoubleClickFeature(IDoubleClickContext context)
context
- contains information where the double click gesture has
happened
ICustomFeature getSingleClickFeature(ISingleClickContext context)
context
- contains information where the single click gesture has
happened
ICustomFeature getCommandFeature(CustomContext context, String hint)
context
- the contexthint
- the hint specified in the command binding
IDecorator[] getDecorators(PictogramElement pe)
IImageDecorator
, IColorDecorator
and
IBorderDecorator
are supported for Shape
s; for
Connection
s only IColorDecorator
s are supported and they
can only be used to change the foreground color of the Connection
.
pe
- the pictogram element
Object getAdapter(Class<?> type)
type
- the type
PictogramElement getSelection(PictogramElement originalPe, PictogramElement[] oldSelection)
originalPe
- the original pictogram elementoldSelection
- the old selection
null
if there should not be a special selection
behavior; if there should not be a selection simply return the
diagram@Deprecated DiagramScrollingBehavior getDiagramScrollingBehavior()
DefaultToolBehaviorProvider.getDiagramScrollingBehavior()
double[] getZoomLevels()
void dispose()
IShapeSelectionInfo getSelectionInfoForShape(Shape shape)
shape
- the shape
IAnchorSelectionInfo getSelectionInfoForAnchor(Anchor anchor)
anchor
- the anchor
IConnectionSelectionInfo getSelectionInfoForConnection(Connection connection)
connection
- the connection
ILocationInfo getLocationInfo(PictogramElement pe, ILocationInfo currentLocationInfo)
pe
- the active and selected pictogram elementcurrentLocationInfo
- the current location info determined by the framework
void preExecute(IExecutionInfo executionInfo)
executionInfo
- info about content to be executedvoid postExecute(IExecutionInfo executionInfo)
executionInfo
- info about content to be executedObject getToolTip(GraphicsAlgorithm graphicsAlgorithm)
It can either be a String, creating a simple tooltip, or an AbstractText.
In the latter case, a rich text label would be created, respecting the
contained TextStyle
s.
Since the pictogram element doesn't belong to the diagram, you have to be
careful with the Color
s and Font
s used in the
TextStyle
s within the AbstractText
. They should
be created and added to the diagram beforehand, preferably in
the add feature that created the given graphicsAlgorithm, i.e.:
Somewhere in the add method of the addFeature :
manageFont(diagram, "Verdana", 9, true, false);
Inside the getRichToolTip:
Font font = manageFont(getDiagramTypeProvider().getDiagram(), "Verdana", 9, true, false); textStyle.setFont(font);
This will ensure resource management for both fonts and colors, and prevent transaction read-only errors if trying to add a font o a color to the diagram without a write transaction.
Note: Be extremely careful when adding rich text
tooltips to an previously existing diagram. Since the pictograms may have
already been added to the diagram, the tooltip may cause an
IllegalStateException
if trying to use a resource that was not
previously added to the diagram.
graphicsAlgorithm
- the graphics algorithm
GraphicsAlgorithm getSelectionBorder(PictogramElement pe)
pe
- the pictogram element
GraphicsAlgorithm getContentArea(ContainerShape cs)
cs
- the container shape
GraphicsAlgorithm[] getClickArea(PictogramElement pe)
pe
- the pictogram element
GraphicsAlgorithm getChopboxAnchorArea(PictogramElement pe)
pe
- the given pictogram element
String getTitleToolTip()
null
to indicate that the default from
the graphics framework will be usedboolean isShowGuides()
true
, if guides should be shownboolean isShowFlyoutPalette()
true
, if flyout palette should be shownboolean isShowSelectionTool()
true
, if the selection tool shall be added,
false
otherwiseboolean isShowMarqueeTool()
true
, if the marquee tool shall be added,
false
otherwiseboolean isMultiSelectionEnabled()
false
if an editor with single selection
behavior is needed.
false
, if single selection is enforcedboolean isConnectionSelectionEnabled()
true
, if selection of connections is enabledString getContributorId()
boolean equalsBusinessObjects(Object o1, Object o2)
IIndependenceSolver
is responsible.
int getLineSelectionWidth(Polyline polyline)
Polyline
or
Polygon
for Shape
s and Connection
s) 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).
polyline
- the Polyline
object to get the selection width for
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 the default
implementation in
DefaultToolBehaviorProvider.isStayActiveAfterExecution(IConnectionCreationToolEntry)
. This method is queried by the framework when the tool is created from
the palette entry.
true
in case the tool should stay active after
execution, false
otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |