|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.graphiti.tb.DefaultToolBehaviorProvider
public class DefaultToolBehaviorProvider
The Class DefaultToolBehaviorProvider.
Field Summary | |
---|---|
protected static int |
CONTEXT_BUTTON_DELETE
Identifier for a generic context button, used in setGenericContextButtons(IContextButtonPadData, PictogramElement, int)
. |
protected static int |
CONTEXT_BUTTON_REMOVE
Identifier for a generic context button, used in setGenericContextButtons(IContextButtonPadData, PictogramElement, int)
. |
protected static int |
CONTEXT_BUTTON_UPDATE
Identifier for a generic context button, used in setGenericContextButtons(IContextButtonPadData, PictogramElement, int)
. |
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. |
private static java.lang.String |
DIAGRAM_PROPERTY_CONTRIBUTOR_SUFFIX
|
private IDiagramTypeProvider |
diagramTypeProvider
|
protected static IContextMenuEntry[] |
NO_CONTEXT_MENU_ENTRIES
The Constant NO_CONTEXT_MENU_ENTRIES. |
private static IDecorator[] |
NO_RENDERING_DECORATORS
|
protected int |
THRESHOLD_FOR_LONG_RUNNING_OPERATION
|
private static double[] |
ZOOM_LEVELS
|
Constructor Summary | |
---|---|
DefaultToolBehaviorProvider(IDiagramTypeProvider diagramTypeProvider)
Creates a new DefaultToolBehaviorProvider . |
Method Summary | |
---|---|
void |
dispose()
Dispose. |
boolean |
equalsBusinessObjects(java.lang.Object o1,
java.lang.Object o2)
Default Implementation. |
protected ILocation |
getAbsoluteLocation(GraphicsAlgorithm ga)
Returns the location of the graphics algorithm in absolute coordinates. |
protected ILocation |
getAbsoluteLocation(PictogramElement pe)
Returns the location of the graphics algorithm associated to the pictogram element in absolute coordinates. |
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 Bug 195527 and can be harmed by GEF modifications. It will be removed then |
protected IDiagramTypeProvider |
getDiagramTypeProvider()
Gets the diagram type provider. |
ICustomFeature |
getDoubleClickFeature(IDoubleClickContext context)
Returns a feature which will be executed at at double click. |
protected IFeatureProvider |
getFeatureProvider()
Gets the feature provider. |
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. |
ISelectionInfo |
getSelectionInfoForAnchor(Anchor anchor)
Return the selection info for the given anchor. |
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 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()
IToolBehaviorProvider.isShowFlyoutPalette() . |
boolean |
isShowGuides()
Indicates whether guides will be shown or not. |
boolean |
isShowMarqueeTool()
IToolBehaviorProvider.isShowMarqueeTool() . |
boolean |
isShowSelectionTool()
IToolBehaviorProvider.isShowSelectionTool() . |
void |
postExecute(IExecutionInfo executionInfo)
Called after execution on stack. |
void |
preExecute(IExecutionInfo executionInfo)
Called before execution on stack. |
private void |
setDiagramTypeProvider(IDiagramTypeProvider diagramTypeProvider)
|
protected void |
setGenericContextButtons(IContextButtonPadData data,
PictogramElement pe,
int identifiers)
Sets the defined generic context buttons to the given IContextButtonPadData. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_LINE_SELECTION_WIDTH
Polyline
or Polygon
for
Shape
s and Connection
s) in the diagram. Is returned in
the default implementation of getLineSelectionWidth(Polyline)
.
protected int THRESHOLD_FOR_LONG_RUNNING_OPERATION
private static final IDecorator[] NO_RENDERING_DECORATORS
private static double[] ZOOM_LEVELS
private static final java.lang.String DIAGRAM_PROPERTY_CONTRIBUTOR_SUFFIX
protected static int CONTEXT_BUTTON_UPDATE
setGenericContextButtons(IContextButtonPadData, PictogramElement, int)
.
protected static int CONTEXT_BUTTON_REMOVE
setGenericContextButtons(IContextButtonPadData, PictogramElement, int)
.
protected static int CONTEXT_BUTTON_DELETE
setGenericContextButtons(IContextButtonPadData, PictogramElement, int)
.
protected static final IContextMenuEntry[] NO_CONTEXT_MENU_ENTRIES
private IDiagramTypeProvider diagramTypeProvider
Constructor Detail |
---|
public DefaultToolBehaviorProvider(IDiagramTypeProvider diagramTypeProvider)
DefaultToolBehaviorProvider
.
diagramTypeProvider
- the diagram type providerMethod Detail |
---|
public void dispose()
IToolBehaviorProvider
dispose
in interface IToolBehaviorProvider
public java.lang.Object getAdapter(java.lang.Class<?> type)
IToolBehaviorProvider
getAdapter
in interface IToolBehaviorProvider
type
- the type
public PictogramElement getSelection(PictogramElement originalPe, PictogramElement[] oldSelection)
IToolBehaviorProvider
getSelection
in interface IToolBehaviorProvider
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
diagrampublic ISelectionInfo getSelectionInfoForConnection(Connection connection)
IToolBehaviorProvider
getSelectionInfoForConnection
in interface IToolBehaviorProvider
connection
- the connection
public IContextButtonPadData getContextButtonPad(IPictogramElementContext context)
IToolBehaviorProvider
getContextButtonPad
in interface IToolBehaviorProvider
context
- The pictogram element context, for which to return the context
button pad data.
protected void setGenericContextButtons(IContextButtonPadData data, PictogramElement pe, int identifiers)
data
- The IContextButtonPadData to which to set the generic context
buttons.pe
- The pictogram element for which to get the underlying features
of the context buttons.identifiers
- The context button identifiers (e.g. "
CONTEXT_BUTTON_UPDATE
&
CONTEXT_BUTTON_REMOVE
")protected ILocation getAbsoluteLocation(PictogramElement pe)
getAbsoluteLocation(GraphicsAlgorithm)
.
pe
- The pictogram element, for which graphics algorithm to return
the location.
protected ILocation getAbsoluteLocation(GraphicsAlgorithm ga)
ga
- The graphics algorithm for which to return the location.
public IContextMenuEntry[] getContextMenu(ICustomContext context)
IToolBehaviorProvider
getContextMenu
in interface IToolBehaviorProvider
context
- the custom context which contains the info about the location
where the context menu appears.
public ILocationInfo getLocationInfo(PictogramElement pe, ILocationInfo locationInfo)
IToolBehaviorProvider
getLocationInfo
in interface IToolBehaviorProvider
pe
- the active and selected pictogram elementlocationInfo
- the current location info determined by the framework
public ICustomFeature getDoubleClickFeature(IDoubleClickContext context)
IToolBehaviorProvider
getDoubleClickFeature
in interface IToolBehaviorProvider
context
- contains information where the double click gesture has
happened
public IPaletteCompartmentEntry[] getPalette()
getPalette
in interface IToolBehaviorProvider
public IDecorator[] getDecorators(PictogramElement pe)
IToolBehaviorProvider
IImageDecorator
are supported.
getDecorators
in interface IToolBehaviorProvider
pe
- the pictogram element
public ISelectionInfo getSelectionInfoForShape(Shape shape)
IToolBehaviorProvider
getSelectionInfoForShape
in interface IToolBehaviorProvider
shape
- the shape
public ISelectionInfo getSelectionInfoForAnchor(Anchor anchor)
IToolBehaviorProvider
getSelectionInfoForAnchor
in interface IToolBehaviorProvider
anchor
- the anchor
public double[] getZoomLevels()
IToolBehaviorProvider
getZoomLevels
in interface IToolBehaviorProvider
@Deprecated public DiagramScrollingBehavior getDiagramScrollingBehavior()
IToolBehaviorProvider
getDiagramScrollingBehavior
in interface IToolBehaviorProvider
getDiagramScrollingBehavior()
private void setDiagramTypeProvider(IDiagramTypeProvider diagramTypeProvider)
protected IDiagramTypeProvider getDiagramTypeProvider()
protected IFeatureProvider getFeatureProvider()
public void preExecute(IExecutionInfo executionInfo)
IToolBehaviorProvider
preExecute
in interface IToolBehaviorProvider
executionInfo
- info about content to be executedpublic void postExecute(IExecutionInfo executionInfo)
IToolBehaviorProvider
postExecute
in interface IToolBehaviorProvider
executionInfo
- info about content to be executedpublic java.lang.String getToolTip(GraphicsAlgorithm ga)
IToolBehaviorProvider
getToolTip
in interface IToolBehaviorProvider
ga
- the graphics algorithm
public GraphicsAlgorithm getSelectionBorder(PictogramElement pe)
IToolBehaviorProvider
getSelectionBorder
in interface IToolBehaviorProvider
pe
- the pictogram element
public GraphicsAlgorithm[] getClickArea(PictogramElement pe)
IToolBehaviorProvider
getClickArea
in interface IToolBehaviorProvider
pe
- the pictogram element
public GraphicsAlgorithm getChopboxAnchorArea(PictogramElement pe)
IToolBehaviorProvider
getChopboxAnchorArea
in interface IToolBehaviorProvider
pe
- the given pictogram element
public java.lang.String getTitleToolTip()
IToolBehaviorProvider
getTitleToolTip
in interface IToolBehaviorProvider
null
to indicate that the default from
the graphics framework will be usedpublic boolean isShowGuides()
IToolBehaviorProvider
isShowGuides
in interface IToolBehaviorProvider
true
, if guides should be shownpublic GraphicsAlgorithm getContentArea(ContainerShape cs)
IToolBehaviorProvider
getContentArea
in interface IToolBehaviorProvider
cs
- the container shape
public java.lang.String getContributorId()
IToolBehaviorProvider
getContributorId
in interface IToolBehaviorProvider
public boolean isDefaultBendPointRenderingActive()
public boolean isMultiSelectionEnabled()
IToolBehaviorProvider
false
if an editor with single selection
behavior is needed.
isMultiSelectionEnabled
in interface IToolBehaviorProvider
false
, if single selection is enforcedpublic boolean isConnectionSelectionEnabled()
IToolBehaviorProvider
isConnectionSelectionEnabled
in interface IToolBehaviorProvider
true
, if selection of connections is enabledpublic boolean equalsBusinessObjects(java.lang.Object o1, java.lang.Object o2)
equalsBusinessObjects
in interface IToolBehaviorProvider
public boolean isShowFlyoutPalette()
IToolBehaviorProvider.isShowFlyoutPalette()
. This default
implementation returns true
and tells the framework to show
the palette.
isShowFlyoutPalette
in interface IToolBehaviorProvider
true
public 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 IToolBehaviorProvider
true
public 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 IToolBehaviorProvider
true
public 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).DEFAULT_LINE_SELECTION_WIDTH
with the value 5 for all shapes.
getLineSelectionWidth
in interface IToolBehaviorProvider
polyline
- the Polyline
object to get the selection width for
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |