|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
com.tensegrity.gui.swt.graph.SwtGraphPanel
This class represents the drawing-area swt-component for graphs.
It is derived from the SWT
and implements the following interfaces:
Composite
GraphPanel
Observer.
MouseListener.
MouseMoveListener.
MouseTrackListener.
For information a contains the
following components:
SwtGraphPanel
These two
instances are wrappers around the SWT TENSlider
and are used in order to provide advance scrolling facilities to the panel.
One could also refer to the documentation of Slider
for a better understanding of the scrolling functionality provided by the
panel.
Finally note that the layout of these components is herein encapsulated and
hidden to the user (the method ViewScrollingController
is overridden to do nothing).
Composite.setLayout(Layout)
As an attempt to extract generic code used by both
and SwingGraphPanel, this class delegates some of its
implementation to SwtGraphPanel.
At a later stage the GraphPanelUtility
might make also use of this utility class,
SwingGraphPanel
This class is not meant to be extended (it is declared as final),
nor serialized.
A holds resources it must release or
containers from which it must remove/unregister itself. If a SwtGraphPanel
is no longer needed, the application must invoke its SwtGraphPanel
method.
dispose()
| Field Summary | |
boolean |
DEBUG_REPAINTMANAGER
Global flag to disable/enable debugging feature for the RepaintManager. |
InplaceEditor |
inplaceEditor
The inplace editor |
| Fields inherited from class org.eclipse.swt.widgets.Control |
handle |
| Fields inherited from interface com.tensegrity.gui.graphdocument.GraphPanel |
DRAG_TOLERANCE |
| Constructor Summary | |
SwtGraphPanel(ApplicationFrame applicationFrame,
org.eclipse.swt.widgets.Composite parentContainer,
DragContext dragContext,
JPopupMenuSourceWithUpdateUI popupmenusource)
Generic constructor for the . |
|
SwtGraphPanel(ApplicationFrame applicationFrame,
GraphDocument graphdocument,
org.eclipse.swt.widgets.Composite parentContainer,
DragContext dragContext,
JPopupMenuSourceWithUpdateUI popupmenusource)
Generic constructor for the .
|
|
SwtGraphPanel(org.eclipse.swt.widgets.Composite parentContainer)
This is the simplest constructor of a SwtGraphPanelinstance.
|
|
SwtGraphPanel(GraphApplication graphapplication,
org.eclipse.swt.widgets.Composite parentContainer,
DragContext dragContext,
JPopupMenuSourceWithUpdateUI popupmenusource)
Generic constructor for the . |
|
SwtGraphPanel(GraphApplication graphapplication,
GraphDocument graphdocument,
org.eclipse.swt.widgets.Composite parentContainer,
DragContext dragContext,
JPopupMenuSourceWithUpdateUI popupmenusource)
Generic constructor for the .
|
|
| Method Summary | |
void |
addDragListener(GraphPanelDragListener listener)
Adds a listener that will react on drag events like start, enter, exit, move and drop. |
void |
addGraphPanelListener(GraphPanelListener listener)
Adds a GraphPanelListener to this instance. |
void |
addModifyListener(ModifiedVisualGraphListener listener)
The method addModifyListener lets users to keep track on current changes of the represented VisualGraph. |
void |
applyEvList()
Tells the component to apply its UIItemEvaluationList. |
protected void |
cacheBitmapsAndValidate()
This method performs all caching for the repaint-manager. |
void |
copy()
Copy the selection into the internal clipboard. |
void |
cut()
Cut the selection into the internal clipboard. |
void |
deleteSelection()
Deletes the currently selected objects. |
void |
disableKeyboardSupport(org.eclipse.swt.widgets.Composite component)
This method disables the keyboard support for this SwingGraphPanel. |
void |
disableMode(int modemask)
Disables the given mode(s) on this instance. |
void |
dispose()
This method is used in order to destroy the popupmenusource as well as to dispose swt resources held within this class. |
void |
drag(VisualGraphObject visualgraphobject,
VisualGraphObject[] additional_vgos,
BaseComposite dragRepresentation,
double scalefactor,
int x,
int y)
Invoked by the DropListener during dragging, if the infrastructure is configured to draw during dragging. |
void |
drag(VisualGraphObject visualgraphobject,
VisualGraphObject[] additional_vgos,
double scalefactor,
int x,
int y)
Invoked by the DropListener during dragging, if the infrastructure is configured to draw during dragging. |
void |
drop(VisualGraphObject vgo,
VisualGraphObject[] additional_vgos,
int x,
int y)
Invoked by the DropListener to let the panel handle the dropped VisualGraphObject. |
void |
enableKeyboardSupport(org.eclipse.swt.widgets.Composite component)
This method enables the keyboard support for this SwingGraphPanel. |
void |
enableMode(int modemask)
Enables the given mode(s) on this instance. |
void |
enableStrokeZooming(boolean enabled)
Enables/disables the zooming of the strokes |
void |
firePostAction()
Called by and ,
this method informs the s that
an action just occured.
|
ApplicationFrame |
getApplicationFrame()
Returns the application frame reference. |
AttributableOnSetDelegate |
getAttributableOnSetDelegate()
The method getAttributableOnSetDelegate returns the previously set AttributableOnSet instance of this GraphPanel or null,if no
such object has been set. |
org.eclipse.swt.widgets.Canvas |
getCanvas()
Returns the . |
VisualNode |
getDeepestVisualNodeAt(int x,
int y)
This method delegates its implementation to |
VisualNode |
getDeepestVisualNodeAt(int x,
int y,
boolean traverseFoldedGroups)
This method delegates its implementation to |
GraphApplication |
getGraphApplication()
Returns the application reference. |
GraphController |
getGraphController()
Returns a GraphController. |
GraphDocument |
getGraphDocument()
Returns the enclosing GraphDocument instance. |
java.util.HashSet |
getGraphPanelListeners()
Returns the graphPanelListeners |
int |
getHeight()
Returns the height of the component in pixels. |
BasicComponent |
getParentComponent()
Returns the parent Component of this instance. |
JPopupMenuSourceWithUpdateUI |
getPopupMenuSource()
Returns the local instance. |
Coordinate |
getRecentPopupMenuMouseCoordinate()
Returns the most recent meaningful mouse-coordinate of this instance. |
RendererConfiguration |
getRendererConfiguration()
Returns the RendererConfiguration that is used for drawing
contents of this instance. |
static AttributeSet |
getRendererConfigurationLowDetail()
Returns the AttributeSet that can be used to configure
the low-detail rendering settings that used by all instances of
SwingGraphPanel during user-interaction. |
ToolTipGenerator |
getToolTipGenerator()
Returns the currently used tooltip generator |
int |
getViewportHeight()
Computes the sizes of the client area that corresponds to the viewport width in PIXELS. |
int |
getViewportWidth()
Computes the sizes of the client area that corresponds to the viewport width in PIXELS. |
VisualGraphView |
getVisualGraph()
Gets the visual graph instance that is currently displayed in the graphpanel. |
java.awt.Image |
getVisualGraphIcon(int width,
int height)
Renders an icon for the VisualGraph. |
java.awt.Image |
getVisualGraphIcon(int width,
int height,
boolean visibleRegion)
Renders an icon for the VisualGraph.
|
int |
getWidth()
Returns the width of the component in pixels. |
double |
getZoomX()
Returns the zoom factor for the VisualGraphView in x
direction. |
double |
getZoomY()
Returns the zoom factor for the VisualGraphView in y
direction. |
void |
handleDocumentResize()
This method is called by the method if it was
informed that the graph panel size had changed. |
void |
installEvList()
Tells the component to setup its internal state. |
boolean |
isAntialiasing()
Returns true is anti-aliasing is enabled,
otherwise false |
boolean |
isAutoScale()
Gets the auto-scale flag, if true then the drawing area is automatically scaled to fit its gui space. |
protected boolean |
isDragAccepted()
Returns true if the the given flavor is supported. |
boolean |
isDrawDuringDrag()
Returns the drawDuringDrag flag, if true then composites are drawn during dragging (in drag'n'drop). |
protected boolean |
isDropAccepted()
Returns true if the the given flavor is supported. |
boolean |
isEditable()
Returns whether the document is editable or not. |
boolean |
isInplaceEditEnabled()
Returns a boolean that indicates whether inplace editing of
text is enabled for an instance of the SwingGraphPanel or
not. |
boolean |
isModified()
Returns whether the document needs saving or not. |
boolean |
isStrokeZoomingEnabled()
Returns the state of the stroke zooming |
void |
mouseDoubleClick(org.eclipse.swt.events.MouseEvent event)
Sent when a mouse button is pressed twice within the (operating system specified) double click period. |
void |
mouseDown(org.eclipse.swt.events.MouseEvent event)
Sent when a mouse button is pressed. |
void |
mouseEnter(org.eclipse.swt.events.MouseEvent arg0)
Sent when the mouse pointer passes into the area of the screen covered by a control. |
void |
mouseExit(org.eclipse.swt.events.MouseEvent arg0)
Sent when the mouse pointer passes out of the area of the screen covered by a control. |
void |
mouseHover(org.eclipse.swt.events.MouseEvent event)
Sent when the mouse pointer hovers (that is, stops moving for an (operating system specified) period of time) over a control. |
void |
mouseMove(org.eclipse.swt.events.MouseEvent event)
Sent when the mouse moves. |
void |
mouseUp(org.eclipse.swt.events.MouseEvent event)
Sent when a mouse button is released. |
void |
paste()
Paste the contents of the internal clipboard into the GraphPanel. |
void |
paste(Coordinate coordinate)
Paste the contents of the internal clipboard into the GraphPanel at the specified
Coordinate. |
void |
pasteBefore(VisualNode visualnode)
Paste the contents of the internal clipboard into the GraphPanel. |
void |
pasteBehind(VisualNode visualnode)
Paste the contents of the internal clipboard into the GraphPanel. |
void |
pasteStart()
Paste the contents of the internal clipboard into the GraphPanel. |
void |
pasteStop()
Paste the contents of the internal clipboard into the GraphPanel. |
void |
postSelect()
This method should handle all necessary actions to be done whenever you modify the selection of the encapsulated VisualGraphView and its not implicitly propagated to the enclosing GraphPanel. |
void |
redo()
Redo the last undone change. |
void |
removeDragListener(GraphPanelDragListener listener)
Removed a listener that will react on drag events like start, enter, exit, move and drop. |
void |
removeGraphPanelListener(GraphPanelListener listener)
Removes a GraphPanelListener from this instance. |
void |
removeModifyListener(ModifiedVisualGraphListener listener)
Removes the modifiy listener that checks for the first initial modification from a VisualGraph. |
void |
repaint()
Triggers a repaint on the local |
void |
repaint(int arg0,
int arg1,
int arg2,
int arg3,
boolean arg4)
Triggers a repaint on the local
|
void |
resetDragAndDropState()
After rejecting a drop or after the cancellation of a drag'n'operation by the client, this method should be invoked to perform clean-up actions internally. |
void |
setAntialiasing(boolean antialiasing)
Enables anti-aliasing if the argument is true,
otherwise anti-aliasing is disabled. |
void |
setAttributableOnSetDelegate(AttributableOnSetDelegate delegate)
The method setAttributableOnSetDelegate sets the delegate object to be used to create, fetch or retrieve the AttributableOnSet from to be displayed when a selection or similar occurs. |
void |
setAutoScale(boolean autoScale)
Sets the auto-scale flag, if true then the drawing area is automatically scaled to fit its gui space. |
void |
setDrawDuringDrag(boolean drawDuringDrag)
Sets the drawDuringDrag flag, if true then composites are drawn during dragging (in drag'n'drop). |
void |
setGraphController(GraphController graphcontroller,
VisualGraphView vgv)
Sets a visualgraph to display along with a controller. |
void |
setInplaceEditEnabled(boolean enableInplaceEdit)
Sets the inplace edit enabled flag to the value given by enableInplaceEdit. |
void |
setLayout(org.eclipse.swt.widgets.Layout layout)
Volontarily do nothing. |
void |
setLowDetailForInteraction(boolean lowDetailForInteraction)
Gets the low-detail-during interaction flag, if true then the selected composites are drawn with minimum detail only during interaction. |
void |
setModified()
Sets the modified state of the document. |
void |
setPopupMenuSource(JPopupMenuSourceWithUpdateUI popupmenusource)
Sets the
to use for displaying popup menus.
|
void |
setToolTipGenerator(ToolTipGenerator generator)
Sets the tooltip generator to generate the tooltips for this component |
void |
setUnmodified()
Clears the modified state of the document. |
void |
setVisualGraph(VisualGraphView vgv)
Sets the VisualGraph to display in the graphpanel. |
void |
setVisualGraphBackground(org.eclipse.swt.graphics.Color color)
Sets the color given by color as the background color as
the VisualGraphView. |
void |
setVisualGraphDisabledBackground(org.eclipse.swt.graphics.Color color)
Sets the color given by color as the background color
as the VisualGraphViewwhen it is
not editable. |
void |
setVisualGraphObjectDragSource(DragContext vgoDragSource)
Sets the DragContext that this instance should use. |
void |
setZoom(double scaleX,
double scaleY)
sets the zoom factors for the graph view. |
void |
setZoom(double scaleX,
double scaleY,
boolean smartzoom)
sets the zoom factors for the graph view. |
void |
setZoomToFit()
sets the zoom factors for the graph view so that all visible items fit into the visible region. |
void |
switchLowDetail(boolean isLowDetail)
internal worker function that toggles low-detail modes |
void |
undo()
Undo the last undoable change. |
void |
update(Observable o,
java.lang.Object arg)
This method is called by the observable that registered this instance as observers. |
| Methods inherited from class org.eclipse.swt.widgets.Composite |
checkSubclass, computeSize, getChildren, getLayout, getTabList, layout, layout, setFocus, setTabList |
| Methods inherited from class org.eclipse.swt.widgets.Scrollable |
computeTrim, getClientArea, getHorizontalBar, getVerticalBar |
| Methods inherited from class org.eclipse.swt.widgets.Control |
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBounds, setBounds, setCapture, setCursor, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update |
| Methods inherited from class org.eclipse.swt.widgets.Widget |
addDisposeListener, addListener, checkWidget, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public boolean DEBUG_REPAINTMANAGER
public InplaceEditor inplaceEditor
| Constructor Detail |
public SwtGraphPanel(org.eclipse.swt.widgets.Composite parentContainer)
This is the simplest constructor of a SwtGraphPanelinstance.
The created instance won't have any DragContext,
JPopupMenuSourceWithUpdateUI,GraphApplication, nor
GraphDocumentassociated to it.
parentContainer - the parent "SWT" container for this
Composite
public SwtGraphPanel(GraphApplication graphapplication,
GraphDocument graphdocument,
org.eclipse.swt.widgets.Composite parentContainer,
DragContext dragContext,
JPopupMenuSourceWithUpdateUI popupmenusource)
Generic constructor for the .
SwtGraphPanel
graphapplication - reference to the application's main frame.graphdocument - the graphdocument this panel is embedded in.parentContainer - the parent "SWT" container for this
CompositedragContext - the drag context that can be used for meaningful drawing
during the drag operation.popupmenusource - the source class for the popupmenu.
public SwtGraphPanel(ApplicationFrame applicationFrame,
GraphDocument graphdocument,
org.eclipse.swt.widgets.Composite parentContainer,
DragContext dragContext,
JPopupMenuSourceWithUpdateUI popupmenusource)
Generic constructor for the .
SwtGraphPanel
applicationFrame - reference to the application's main frame.graphdocument - the graphdocument this panel is embedded in.parentContainer - the parent "SWT" container for this
CompositedragContext - the drag context that can be used for meaningful drawing
during the drag operation.popupmenusource - the source class for the popupmenu.
public SwtGraphPanel(GraphApplication graphapplication,
org.eclipse.swt.widgets.Composite parentContainer,
DragContext dragContext,
JPopupMenuSourceWithUpdateUI popupmenusource)
Generic constructor for the . To be
used if the instance is not embedded into a SwtGraphPanel.
GraphDocument
graphapplication - reference to the application's main frame.parentContainer - the parent "SWT" container for this
CompositedragContext - the drag context that can be used for meaningful drawing
during the drag operation.popupmenusource - the source class for the popupmenu.
public SwtGraphPanel(ApplicationFrame applicationFrame,
org.eclipse.swt.widgets.Composite parentContainer,
DragContext dragContext,
JPopupMenuSourceWithUpdateUI popupmenusource)
Generic constructor for the . To be
used if the instance is not embedded into a SwtGraphPanel.
GraphDocument
applicationFrame - reference to the application's main frame.parentContainer - the parent "SWT" container for this
CompositedragContext - the drag context that can be used for meaningful drawing
during the drag operation.popupmenusource - the source class for the popupmenu.| Method Detail |
public void setVisualGraphBackground(org.eclipse.swt.graphics.Color color)
color as the background color as
the VisualGraphView.
color - the new background color for the
VisualGraphView.public void setVisualGraphDisabledBackground(org.eclipse.swt.graphics.Color color)
color as the background color
as the VisualGraphViewwhen it is
not editable.
color - the new background color for the
VisualGraphView.public void addGraphPanelListener(GraphPanelListener listener)
GraphPanelGraphPanelListener to this instance.
addGraphPanelListener in interface GraphPanellistener - the listener instance to add.public void removeGraphPanelListener(GraphPanelListener listener)
GraphPanelGraphPanelListener from this instance.
removeGraphPanelListener in interface GraphPanellistener - the listener instance to remove.public final java.util.HashSet getGraphPanelListeners()
public void deleteSelection()
GraphPanel
deleteSelection in interface GraphPanel
public void update(Observable o,
java.lang.Object arg)
GraphPanel
update in interface GraphPanelo - observable that invoked this methodarg - additional arguments from the observable.public BasicComponent getParentComponent()
BasicComponent
getParentComponent in interface BasicComponentnull if no parent exists.public int getWidth()
BasicComponent
getWidth in interface BasicComponentpublic int getHeight()
BasicComponent
getHeight in interface BasicComponentpublic void repaint()
Canvas
repaint in interface BasicComponent
public void repaint(int arg0,
int arg1,
int arg2,
int arg3,
boolean arg4)
Triggers a repaint on the local Canvas
arg0 - the x coordinate of the area to drawarg1 - the y coordinate of the area to drawarg2 - the width of the area to drawarg3 - the height of the area to drawarg4 - true if children should redraw, and false
otherwisepublic boolean isEditable()
GraphPanel
isEditable in interface GraphPanelpublic final void enableMode(int modemask)
GraphPanel
enableMode in interface GraphPanelmodemask - the mode(s) to enable.public final void disableMode(int modemask)
GraphPanel
disableMode in interface GraphPanelmodemask - the mode(s) to disable.public final boolean isModified()
GraphPanel
isModified in interface GraphPanelpublic final void setUnmodified()
GraphPanel
setUnmodified in interface GraphPanelpublic GraphApplication getGraphApplication()
GraphPanel
getGraphApplication in interface GraphPanelpublic ApplicationFrame getApplicationFrame()
GraphPanel
getApplicationFrame in interface GraphPanel
public final java.awt.Image getVisualGraphIcon(int width,
int height)
GraphPanel
getVisualGraphIcon in interface GraphPanelwidth - the desired image width.height - the desired image height.
public final java.awt.Image getVisualGraphIcon(int width,
int height,
boolean visibleRegion)
VisualGraph.
The current display contents
are rendered into a standard RGB image (true-color) of the specified
width and height and returned as an image. Use this method to generate
a thumbnail image of the current graphpanel display area.
width - the desired image width.height - the desired image height.visibleRegion - whether to compute the icon for the visible region
or for the entire graph.
public GraphController getGraphController()
GraphPanel
getGraphController in interface GraphPanel
public void setGraphController(GraphController graphcontroller,
VisualGraphView vgv)
GraphPanel
setGraphController in interface GraphPanelgraphcontroller - the controller for the visualgraphvgv - the visualgraph to be displayed.public VisualGraphView getVisualGraph()
GraphPanel
getVisualGraph in interface GraphPanelpublic void setVisualGraph(VisualGraphView vgv)
GraphPanel
setVisualGraph in interface GraphPanelvgv - the visualgraph to display in the graphpanelpublic int getViewportWidth()
getViewportWidth in interface GraphPanelpublic int getViewportHeight()
getViewportHeight in interface GraphPanelpublic void applyEvList()
EvaluableUIItemEvaluationList.
applyEvList in interface Evaluablepublic void installEvList()
Evaluable
installEvList in interface Evaluablepublic void undo()
GraphPanel
undo in interface GraphPanelpublic void redo()
GraphPanel
redo in interface GraphPanelpublic void cut()
GraphPanel
cut in interface GraphPanelpublic void setAttributableOnSetDelegate(AttributableOnSetDelegate delegate)
GraphPanel
setAttributableOnSetDelegate in interface GraphPaneldelegate - the delegate object to delegate determineAttributableOnSet calls to.public AttributableOnSetDelegate getAttributableOnSetDelegate()
GraphPanelnull,if no
such object has been set.
getAttributableOnSetDelegate in interface GraphPanelpublic void copy()
GraphPanel
copy in interface GraphPanelpublic void paste()
GraphPanelGraphPanel.
paste in interface GraphPanelpublic void pasteStart()
GraphPanelGraphPanel.
pasteStart in interface GraphPanelpublic void pasteStop()
GraphPanelGraphPanel.
pasteStop in interface GraphPanelpublic void pasteBefore(VisualNode visualnode)
GraphPanelGraphPanel.
pasteBefore in interface GraphPanelvisualnode - the VisualNode to paste before.public void pasteBehind(VisualNode visualnode)
GraphPanelGraphPanel.
pasteBehind in interface GraphPanelvisualnode - the VisualNode to paste behind.public void paste(Coordinate coordinate)
GraphPanel at the specified
Coordinate.
coordinate - the position where to paste.public void postSelect()
GraphPanel
postSelect in interface GraphPanelpublic final boolean isAutoScale()
public final void setAutoScale(boolean autoScale)
autoScale - true if autoscale mode is enabled.public final void setModified()
GraphPanel
setModified in interface GraphPanelpublic void removeModifyListener(ModifiedVisualGraphListener listener)
VisualGraph.
removeModifyListener in interface GraphPanellistener - the ModifiedVisualGraphListenerto remove.public void addModifyListener(ModifiedVisualGraphListener listener)
GraphPanelListener of the contained VisualGraphView.
addModifyListener in interface GraphPanellistener - the ModifiedVisualGraphListener to add.public final void handleDocumentResize()
This method is called by the
method if it was
informed that the graph panel size had changed. It initializes the
coordinate system if required and sets the local
#draw(GC, Transform2D, Rectangle)'s bounding box.
VisualGraphView
#initCoordinateSystem(VisualGraphView, int, int)public final double getZoomX()
VisualGraphView in x
direction.
public final double getZoomY()
VisualGraphView in y
direction.
public final void setZoom(double scaleX,
double scaleY)
GraphPanel
setZoom in interface GraphPanelscaleX - the zoom factor for the x axisscaleY - the zoom factor for the y axispublic final void setZoomToFit()
GraphPanel
setZoomToFit in interface GraphPanel
public final void setZoom(double scaleX,
double scaleY,
boolean smartzoom)
GraphPanel
setZoom in interface GraphPanelscaleX - the zoom factor for the x axisscaleY - the zoom factor for the y axissmartzoom - if true then zooming is done around the center
of the currently visible region or if a selection exists, then
the zooming is around the center of the current selection.public void mouseEnter(org.eclipse.swt.events.MouseEvent arg0)
mouseEnter in interface org.eclipse.swt.events.MouseTrackListenerarg0 - an event containing information about the mouse enterMouseTrackListener.mouseEnter(org.eclipse.swt.events.MouseEvent)public void mouseExit(org.eclipse.swt.events.MouseEvent arg0)
mouseExit in interface org.eclipse.swt.events.MouseTrackListenerarg0 - an event containing information about the mouse exitMouseTrackListener.mouseExit(org.eclipse.swt.events.MouseEvent)public void mouseHover(org.eclipse.swt.events.MouseEvent event)
mouseHover in interface org.eclipse.swt.events.MouseTrackListenerevent - an event containing information about the hoverMouseTrackListener.mouseHover(org.eclipse.swt.events.MouseEvent)public void mouseDoubleClick(org.eclipse.swt.events.MouseEvent event)
mouseDoubleClick in interface org.eclipse.swt.events.MouseListenerevent - an event containing information about the mouse double clickMouseListener.mouseDoubleClick(org.eclipse.swt.events.MouseEvent)public void mouseDown(org.eclipse.swt.events.MouseEvent event)
mouseDown in interface org.eclipse.swt.events.MouseListenerevent - an event containing information about the mouse button pressMouseListener.mouseDown(org.eclipse.swt.events.MouseEvent)public void mouseUp(org.eclipse.swt.events.MouseEvent event)
mouseUp in interface org.eclipse.swt.events.MouseListenerevent - an event containing information about the mouse button
releaseMouseListener.mouseUp(org.eclipse.swt.events.MouseEvent)public void mouseMove(org.eclipse.swt.events.MouseEvent event)
mouseMove in interface org.eclipse.swt.events.MouseMoveListenerevent - an event containing information about the mouse moveMouseMoveListener.mouseMove(org.eclipse.swt.events.MouseEvent)public final boolean isDrawDuringDrag()
public final void setDrawDuringDrag(boolean drawDuringDrag)
drawDuringDrag - true if composites are drawn during dragging.
public final void drag(VisualGraphObject visualgraphobject,
VisualGraphObject[] additional_vgos,
double scalefactor,
int x,
int y)
visualgraphobject - the visual object.additional_vgos - visual graph objects appearing to be dragged along with
the representation of visualgraphobjectscalefactor - the scale factor.x - the x component of the mouse position.y - the y component of the mouse position.
public final void drag(VisualGraphObject visualgraphobject,
VisualGraphObject[] additional_vgos,
BaseComposite dragRepresentation,
double scalefactor,
int x,
int y)
Invoked by the DropListener during dragging, if the infrastructure is configured to draw during dragging.
visualgraphobject - the VisualGraphObject being draggedadditional_vgos - visual graph objects appearing to be dragged along with
dragRepresentationdragRepresentation - the representation of the VisualGraphObject
being draggedscalefactor - the current scale factorx - the x component of the mouse position.y - the y component of the mouse position.
public final void drop(VisualGraphObject vgo,
VisualGraphObject[] additional_vgos,
int x,
int y)
GraphPanelVisualGraphObject.
drop in interface GraphPanelvgo - users dropped VisualGraphObject.additional_vgos - The objects that have been droppedx - the x coordinate of the point where the drop occurred.y - the y coordinate of the point where the drop occurred.public final void firePostAction()
Called by and mouseDown(MouseEvent),
this method informs the mouseUp(MouseEvent) s that
an action just occured.
GraphPanelListener
public final org.eclipse.swt.widgets.Canvas getCanvas()
Canvas.
protected final void cacheBitmapsAndValidate()
public final void resetDragAndDropState()
public final void switchLowDetail(boolean isLowDetail)
isLowDetail - true to enable low detail, otherwise
false.public static final AttributeSet getRendererConfigurationLowDetail()
AttributeSet that can be used to configure
the low-detail rendering settings that used by all instances of
SwingGraphPanel during user-interaction.
AttributeSet for user-interaction rendering configuration.RendererConfiguration
public final VisualNode getDeepestVisualNodeAt(int x,
int y)
GraphPanelUtility.getDeepestVisualNodeAt(VisualGraphView, int, int)
x - the x component of the coordinate to check fory - the y component of the coordinate to check for
VisualNode found or null
public final VisualNode getDeepestVisualNodeAt(int x,
int y,
boolean traverseFoldedGroups)
GraphPanelUtility.getDeepestVisualNodeAt(VisualGraphView, int, int, boolean)
x - the x component of the coordinate to check fory - the y component of the coordinate to check fortraverseFoldedGroups - set to false if VisualNode s inside a folded
CompositeGroup should be ignored.
VisualNode found or nullpublic ToolTipGenerator getToolTipGenerator()
GraphPanel
getToolTipGenerator in interface GraphPanelToolTipGenerator currently in use.public void setToolTipGenerator(ToolTipGenerator generator)
GraphPanel
setToolTipGenerator in interface GraphPanelgenerator - The ToolTipGenerator to use.public void dispose()
Widget.dispose()protected boolean isDragAccepted()
true if the flavor is supported, otherwise
falseprotected boolean isDropAccepted()
true if the flavor is supported, otherwise
false-public final void setPopupMenuSource(JPopupMenuSourceWithUpdateUI popupmenusource)
JPopupMenuSourceWithUpdateUI
to use for displaying popup menus.
A popupmenusource is a source for a popupmenu and can be asked to recreate the popupmenu on demand. This is needed for ui-switches during runtime, since popupmenus do not get updated if an ui-switch occurs.
Setting a new popupmenusource will invoke the destroy()
method on a previously set popupmenusource.
popupmenusource - the popupmenu source for the graphpanel.public JPopupMenuSourceWithUpdateUI getPopupMenuSource()
JPopupMenuSourceWithUpdateUI instance.
JPopupMenuSourceWithUpdateUI instance.public void enableKeyboardSupport(org.eclipse.swt.widgets.Composite component)
SwingGraphPanel. This is done by adding
a key listener on the specified Component.
Calling this method more than once will not have any effect.
component - the Component to use for
adding a keyboard listener.public void disableKeyboardSupport(org.eclipse.swt.widgets.Composite component)
SwingGraphPanel. This is done by removing
a key listener from the specified Component.
Invoking this method many times will not have any effect.
component - the Component to use for
adding a keyboard listener.public void setLayout(org.eclipse.swt.widgets.Layout layout)
#performGraphContainerInitialization()
layout - the receiver's new layout or nullComposite.setLayout(org.eclipse.swt.widgets.Layout)public final Coordinate getRecentPopupMenuMouseCoordinate()
public GraphDocument getGraphDocument()
GraphDocument instance.
GraphDocument instancepublic final void enableStrokeZooming(boolean enabled)
enabled - true, to enable the zoomingpublic boolean isStrokeZoomingEnabled()
public final void setAntialiasing(boolean antialiasing)
true,
otherwise anti-aliasing is disabled.
setAntialiasing in interface GraphPanelantialiasing - true for enabling antialiasing otherwise
false.public final RendererConfiguration getRendererConfiguration()
RendererConfiguration that is used for drawing
contents of this instance.
getRendererConfiguration in interface GraphPanelRendererConfiguration that is used for drawing
contents of this instance.public boolean isAntialiasing()
GraphPaneltrue is anti-aliasing is enabled,
otherwise false
isAntialiasing in interface GraphPaneltrue is anti-aliasing is enabled,
otherwise falsepublic void addDragListener(GraphPanelDragListener listener)
GraphPanel
addDragListener in interface GraphPanellistener - The listener for the eventspublic void removeDragListener(GraphPanelDragListener listener)
GraphPanel
removeDragListener in interface GraphPanellistener - The listener for the eventspublic final void setLowDetailForInteraction(boolean lowDetailForInteraction)
lowDetailForInteraction - flag that indicates whether to use
low-detail drawing mode for selected composites.public void setVisualGraphObjectDragSource(DragContext vgoDragSource)
DragContext that this instance should use.
vgoDragSource - the DragContext that this
instance should use.public boolean isInplaceEditEnabled()
boolean that indicates whether inplace editing of
text is enabled for an instance of the SwingGraphPanel or
not.
public void setInplaceEditEnabled(boolean enableInplaceEdit)
enableInplaceEdit.
enableInplaceEdit - the new value for the inplace edit enabled flag
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||