com.tensegrity.gui.swing.graph
Class SwingGraphPanel

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended bycom.tensegrity.gui.swing.graph.SwingGraphPanel
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.AdjustmentListener, BasicComponent, Evaluable, java.util.EventListener, GraphPanel, java.awt.image.ImageObserver, java.awt.MenuContainer, Observer, java.io.Serializable

public final class SwingGraphPanel
extends javax.swing.JPanel
implements GraphPanel, java.awt.event.AdjustmentListener, Observer

This class represents the drawing-area swing component for graphs.

It is derived from JPanel and supports most of its functionality.

The SwingGraphPanel always uses its own internal layout. and thus differs from regular swing-components that settings a layout manager on it, does not make any sense.

This class is the embedded in each document that shows a graph. In this class the instances to the GraphController and the displayed VisualGraphView are kept.

A swinggraphpanel has resources it must release or containers from which it must remove/unregister itself. If a swinggraphpanel is no longer needed by its applications, the application must invoked destroy() on the graphpanel.

This class is not meant to be extended (its declared final), nor serialized.

There are a number of object references that must be supplied to the constructors of a swinggraphpanel. They are needed to allow the swinggraphpanel to communicate to the outside world.

The SwingGraphPanel is not made for extending and thus forbids subclassing explicity. Still it can be embedded like any other swing-component.

Version:
$Id: SwingGraphPanel.java,v 1.557 2006/06/08 13:27:52 BurkhardWick Exp $
Author:
MichaelKegel, Stepan Rutz, BurkhardWick
See Also:
VisualGraph, VisualGraphView, GraphController, Graph, GraphApplication, JPopupMenuSourceWithUpdateUI, GraphDocument, Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 boolean DEBUG_REPAINTMANAGER
          Global flag to disable/enable debugging feature for the RepaintManager.
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface com.tensegrity.gui.graphdocument.GraphPanel
DRAG_TOLERANCE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
SwingGraphPanel()
          Creates a simple SwingGraphPanel without the association to a document nor to a applicationFrame.
SwingGraphPanel(ApplicationFrame applicationFrame, GraphDocument graphdocument, JPopupMenuSourceWithUpdateUI popupmenusource)
          Creates a new SwingGraphPanel with double buffering enabled.
SwingGraphPanel(ApplicationFrame applicationFrame, GraphDocument graphdocument, JPopupMenuSourceWithUpdateUI popupmenusource, boolean isDoubleBuffered)
          Generic constructor for the graphpanel.
SwingGraphPanel(ApplicationFrame applicationFrame, GraphDocument graphdocument, JPopupMenuSourceWithUpdateUI popupmenusource, DragContext vgoDragSource)
          Generic constructor for the graphpanel.
SwingGraphPanel(ApplicationFrame applicationFrame, GraphDocument graphdocument, JPopupMenuSourceWithUpdateUI popupmenusource, DragContext vgoDragSource, boolean isDoubleBuffered)
          Generic constructor for the graphpanel.
SwingGraphPanel(Application application, GraphDocument graphdocument, JPopupMenuSourceWithUpdateUI popupmenusource)
          Deprecated. Use {@link #SwingGraphPanel(ApplicationFrame, GraphDocument, JPopupMenuSourceWithUpdateUI)
SwingGraphPanel(Application application, GraphDocument graphdocument, JPopupMenuSourceWithUpdateUI popupmenusource, boolean isDoubleBuffered)
          Deprecated. Use SwingGraphPanel(ApplicationFrame, GraphDocument, JPopupMenuSourceWithUpdateUI, boolean)
SwingGraphPanel(Application application, GraphDocument graphdocument, JPopupMenuSourceWithUpdateUI popupmenusource, DragContext vgoDragSource)
          Deprecated. Use SwingGraphPanel(ApplicationFrame, GraphDocument, JPopupMenuSourceWithUpdateUI, DragContext)
SwingGraphPanel(Application application, GraphDocument graphdocument, JPopupMenuSourceWithUpdateUI popupmenusource, DragContext vgoDragSource, boolean isDoubleBuffered)
          Generic constructor for the graphpanel.
SwingGraphPanel(GraphDocument graphdocument, JPopupMenuSourceWithUpdateUI popupmenusource, DragContext vgoDragSource)
          Generic constructor for the graphpanel.
 
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 adjustmentValueChanged(java.awt.event.AdjustmentEvent event)
          This method is triggered by adjustment events due to scrollbar changes.
 void applyEvList()
          Tells the component to apply its UIItemEvaluationList.
 boolean confirmImageSize(UIManager uiManager)
          Display a confirmation dialog that prompts the user whether the computed image size for raster export is accepted or not.
 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 destroy()
          Cleans up resources we hold on to.
 void disableKeyboardSupport()
          Disables the keyboard support for the SwingGraphPanel.
 void disableKeyboardSupport(java.awt.Component component)
          This method disables the keyboard support for this SwingGraphPanel.
 void disableMode(int modemask)
          Disables the given mode(s) on this instance.
 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()
          Enables the keyboard support for the SwingGraphPanel.
 void enableKeyboardSupport(java.awt.Component 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
 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.
 VisualEdge getDeepestVisualEdgeAt(int x, int y)
          Returns the deepest VisualEdge at the coordinate given by x and y that can be found in the hierarchy.
 VisualNode getDeepestVisualNodeAt(int x, int y)
          Returns the deepest VisualNode at the coordinate given by x and y that can be found in the hierarchy.
 VisualNode getDeepestVisualNodeAt(int x, int y, boolean traverseFoldedGroups)
          Returns the deepest VisualNode at the coordinate given x, y that can be found in the hierarchy.
 VisualSubgraph getDeepestVisualSubgraphAt(int x, int y)
          Returns the deepest VisualSubgraph at the coordinate given by x and y that can be found in the hierarchy.
 GraphApplication getGraphApplication()
          Returns the GraphApplication reference.
 GraphController getGraphController()
          Returns the GraphController that is currently shown in this component.
 GraphDocument getGraphDocument()
          Returns the enclosing GraphDocument instance.
 InplaceEditorConfigurator getInplaceEditorConfigurator()
          Returns the InplaceEditorConfigurator that is used to configure the inplace editor component whenever a label is edited in the view.
 BasicComponent getParentComponent()
          Returns the parent Component of this instance.
 JPopupMenuSourceWithUpdateUI getPopupMenuSource()
          Returns an instance of a JPopupMenuSourceWithUpdateUI or null if this instance of SwingGraphPanel has no context menu.
 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
 java.lang.String getToolTipText()
           
 java.lang.String getToolTipText(java.awt.event.MouseEvent event)
           
 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 VisualGraph 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.
 java.awt.Image getVisualGraphImage()
          Deprecated. Use VisualGraphImageUtil.renderToImage(VisualGraphView, Insets) instead!
 java.awt.Image getVisualGraphImage(int width, int height)
          Deprecated. Use VisualGraphImageUtil.renderToImage(VisualGraphView, int, int, Insets) instead!
 Size getVisualGraphImagePreferredSize()
          Deprecated. Use VisualGraphImageUtil.getPreferredSize(VisualGraphView) instead!
 int getVisualGraphImageRequiredSize()
          Deprecated. Use VisualGraphImageUtil.getPreferredSize(VisualGraphView) to get the actual size of an image of a VisualGraphView
 int getVisualGraphImageThreshold()
          Deprecated. Do not use this function, the calculation might be wrong.
 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 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.
 boolean isDrawDuringDrag()
          Returns the drawDuringDrag flag, if true then composites are drawn during dragging (in drag'n'drop).
 boolean isEditable()
          Returns whether the document is editable or not.
 boolean isFocusable()
          Overridden method from Component to make the panel focusable in fullscreen mode.
 boolean isInplaceEditEnabled()
          Returns a boolean that indicates whether inplace editing of text is enabled for an instance of the SwingGraphPanel or not.
 boolean isLowDetailForInteraction()
          Gets the low-detail-during interaction flag, if true then the selected composites are drawn with minimum detail only during interaction.
 boolean isModified()
          Returns whether the document needs saving or not.
 boolean isStrokeZoomingEnabled()
          Returns the state of the stroke zooming
protected  void paintChildren(java.awt.Graphics g)
           
 void paintComponent(java.awt.Graphics gfx)
          Overridden paintComponent for custom painting.
 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 registerDropTarget(java.awt.dnd.DropTarget droptarget)
          Registers the DropTarget given by droptarget as the new drop target for the SwingGraphPanel.
 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 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 visualgraphview)
          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 setInplaceEditorConfigurator(InplaceEditorConfigurator iec)
          Sets the InplaceEditorConfigurator that is used to configure the inplace editor component whenever a label is edited in the view.
 void setJPopupMenuSource(JPopupMenuSourceWithUpdateUI popupmenusource)
          Sets the JPopupMenuSourceWithUpdateUI to use for displaying popup menus.
 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 document to be unmodified.
 void setToolTipGenerator(ToolTipGenerator toolTipGenerator)
          Sets the toolTipGenerator.
 void setUnmodified()
          Sets the document to be unmodified.
 void setVisualGraph(VisualGraphView visualgraphview)
          Sets the VisualGraph to display in the graphpanel.
 void setVisualGraphBackground(java.awt.Color color)
          Sets the color given by color as the background color as the VisualGraphView.
 void setVisualGraphDisabledBackground(java.awt.Color color)
          Sets the color given by color as the background color as the VisualGraphView when 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 and triggers a repaint.
 void setZoom(double scaleX, double scaleY, boolean smartzoom)
          Sets the zoom factors for the graph view and triggers a repaint.
 void setZoomToFit()
          Zooms and translates the viewport so that all visible items can be seen.
 void startInplaceEditing(BaseComposite baseComposite, Label2D label)
          Starts the editing of the given label in the baseComposite for plain text editing.
 void stopInplaceEditing()
          Removes a previously added inplace editor component
 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.
 void updateScrollbars()
          This method updates the scrollbars according to the composite view settings.
 void updateUI()
          Perform some custom ui updating.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.tensegrity.gui.component.BasicComponent
getHeight, getWidth, repaint
 

Field Detail

DEBUG_REPAINTMANAGER

public boolean DEBUG_REPAINTMANAGER
Global flag to disable/enable debugging feature for the RepaintManager.

Constructor Detail

SwingGraphPanel

public SwingGraphPanel()
Creates a simple SwingGraphPanel without the association to a document nor to a applicationFrame. NOTE: You must call setGraphController(GraphController, VisualGraphView) or setVisualGraph(VisualGraphView) in prior to use this panel.


SwingGraphPanel

public SwingGraphPanel(Application application,
                       GraphDocument graphdocument,
                       JPopupMenuSourceWithUpdateUI popupmenusource)
Deprecated. Use {@link #SwingGraphPanel(ApplicationFrame, GraphDocument, JPopupMenuSourceWithUpdateUI)

Creates a new SwingGraphPanel with double buffering enabled.

Parameters:
application - reference to the application
graphdocument - the graphdocument this panel is embedded in.
popupmenusource - the source class for the popupmenu.

SwingGraphPanel

public SwingGraphPanel(Application application,
                       GraphDocument graphdocument,
                       JPopupMenuSourceWithUpdateUI popupmenusource,
                       boolean isDoubleBuffered)
Deprecated. Use SwingGraphPanel(ApplicationFrame, GraphDocument, JPopupMenuSourceWithUpdateUI, boolean)

Generic constructor for the graphpanel.

Parameters:
application - reference to the application
graphdocument - the graphdocument this panel is embedded in.
popupmenusource - the source class for the popupmenu.
isDoubleBuffered - flag whether to use double buffering or not.

SwingGraphPanel

public SwingGraphPanel(Application application,
                       GraphDocument graphdocument,
                       JPopupMenuSourceWithUpdateUI popupmenusource,
                       DragContext vgoDragSource)
Deprecated. Use SwingGraphPanel(ApplicationFrame, GraphDocument, JPopupMenuSourceWithUpdateUI, DragContext)

Generic constructor for the graphpanel.

Parameters:
application - reference to the application (may be null).
graphdocument - the graphdocument this panel is embedded in.
popupmenusource - the source class for the popupmenu.
vgoDragSource - the dragsource that can be used for meaningful drawing during the drag operation.

SwingGraphPanel

public SwingGraphPanel(Application application,
                       GraphDocument graphdocument,
                       JPopupMenuSourceWithUpdateUI popupmenusource,
                       DragContext vgoDragSource,
                       boolean isDoubleBuffered)
Generic constructor for the graphpanel.

Parameters:
application - reference to the application
graphdocument - the graphdocument this panel is embedded in.
popupmenusource - the source class for the popupmenu.
vgoDragSource - the dragsource that can be used for meaningful drawing during the drag operation.
isDoubleBuffered - flag whether to use double buffering or not.

SwingGraphPanel

public SwingGraphPanel(ApplicationFrame applicationFrame,
                       GraphDocument graphdocument,
                       JPopupMenuSourceWithUpdateUI popupmenusource)
Creates a new SwingGraphPanel with double buffering enabled.

Parameters:
applicationFrame - reference to the application's main frame.
graphdocument - the graphdocument this panel is embedded in.
popupmenusource - the source class for the popupmenu.

SwingGraphPanel

public SwingGraphPanel(ApplicationFrame applicationFrame,
                       GraphDocument graphdocument,
                       JPopupMenuSourceWithUpdateUI popupmenusource,
                       boolean isDoubleBuffered)
Generic constructor for the graphpanel.

Parameters:
applicationFrame - reference to the application's main frame.
graphdocument - the graphdocument this panel is embedded in.
popupmenusource - the source class for the popupmenu.
isDoubleBuffered - flag whether to use double buffering or not.

SwingGraphPanel

public SwingGraphPanel(ApplicationFrame applicationFrame,
                       GraphDocument graphdocument,
                       JPopupMenuSourceWithUpdateUI popupmenusource,
                       DragContext vgoDragSource)
Generic constructor for the graphpanel.

Parameters:
applicationFrame - reference to the application's main frame (may be null).
graphdocument - the graphdocument this panel is embedded in.
popupmenusource - the source class for the popupmenu.
vgoDragSource - the dragsource that can be used for meaningful drawing during the drag operation.

SwingGraphPanel

public SwingGraphPanel(GraphDocument graphdocument,
                       JPopupMenuSourceWithUpdateUI popupmenusource,
                       DragContext vgoDragSource)
Generic constructor for the graphpanel.

Parameters:
graphdocument - the graphdocument this panel is embedded in.
popupmenusource - the source class for the popupmenu.
vgoDragSource - the dragsource that can be used for meaningful drawing during the drag operation.

SwingGraphPanel

public SwingGraphPanel(ApplicationFrame applicationFrame,
                       GraphDocument graphdocument,
                       JPopupMenuSourceWithUpdateUI popupmenusource,
                       DragContext vgoDragSource,
                       boolean isDoubleBuffered)
Generic constructor for the graphpanel.

Parameters:
applicationFrame - reference to the application's main frame.
graphdocument - the graphdocument this panel is embedded in.
popupmenusource - the source class for the popupmenu.
vgoDragSource - the dragsource that can be used for meaningful drawing during the drag operation.
isDoubleBuffered - flag whether to use double buffering or not.
Method Detail

getRendererConfigurationLowDetail

public static final 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.

Returns:
the AttributeSet for user-interaction rendering configuration.
See Also:
RendererConfiguration

addGraphPanelListener

public void addGraphPanelListener(GraphPanelListener listener)
Description copied from interface: GraphPanel
Adds a GraphPanelListener to this instance.

Specified by:
addGraphPanelListener in interface GraphPanel
Parameters:
listener - the listener instance to add.

removeGraphPanelListener

public void removeGraphPanelListener(GraphPanelListener listener)
Description copied from interface: GraphPanel
Removes a GraphPanelListener from this instance.

Specified by:
removeGraphPanelListener in interface GraphPanel
Parameters:
listener - the listener instance to remove.

enableKeyboardSupport

public void enableKeyboardSupport()
Enables the keyboard support for the SwingGraphPanel. To enable the keyboard support SwingGraphPanel searches for the first frame (mostly the top level frame) that can be found in the component hierarchy of the awt toolkit and adds a key listener, so that any key event that occurs when the frame has focus is routed to the SwingGraphPanel.


disableKeyboardSupport

public void disableKeyboardSupport()
Disables the keyboard support for the SwingGraphPanel. To disable the keyboard support SwingGraphPanel searches for the first frame (mostly the top level frame) that can be found in the component hierarchy of the awt toolkit and removes the key listener, so that no more key events are routed to the SwingGraphPanel.


enableKeyboardSupport

public void enableKeyboardSupport(java.awt.Component component)
This method enables the keyboard support for this SwingGraphPanel. This is done by adding a key listener on the specified Component. Calling this method more than once will not have any effect.

Parameters:
component - the Component to use for adding a keyboard listener.

disableKeyboardSupport

public void disableKeyboardSupport(java.awt.Component component)
This method disables the keyboard support for this SwingGraphPanel. This is done by removing a key listener from the specified Component. Invoking this method many times will not have any effect.

Parameters:
component - the Component to use for adding a keyboard listener.

setVisualGraphBackground

public void setVisualGraphBackground(java.awt.Color color)
Sets the color given by color as the background color as the VisualGraphView.

Parameters:
color - the new background color for the VisualGraphView.

setVisualGraphDisabledBackground

public void setVisualGraphDisabledBackground(java.awt.Color color)
Sets the color given by color as the background color as the VisualGraphView when it is not editable.

Parameters:
color - the new background color for the VisualGraphView.

setVisualGraphObjectDragSource

public void setVisualGraphObjectDragSource(DragContext vgoDragSource)
Sets the DragContext that this instance should use.

Parameters:
vgoDragSource - the DragContext that this instance should use.

registerDropTarget

public void registerDropTarget(java.awt.dnd.DropTarget droptarget)
Registers the DropTarget given by droptarget as the new drop target for the SwingGraphPanel.
To get more information about the DropTarget class see the documentation about DropTarget.

Parameters:
droptarget - new the DropTarget to register

getRendererConfiguration

public final RendererConfiguration getRendererConfiguration()
Returns the RendererConfiguration that is used for drawing contents of this instance.

Specified by:
getRendererConfiguration in interface GraphPanel
Returns:
the RendererConfiguration that is used for drawing contents of this instance.

isAntialiasing

public final boolean isAntialiasing()
Returns true is anti-aliasing is enabled, otherwise false

Specified by:
isAntialiasing in interface GraphPanel
Returns:
true is anti-aliasing is enabled, otherwise false

enableStrokeZooming

public final void enableStrokeZooming(boolean enabled)
Enables/disables the zooming of the strokes

Parameters:
enabled - true, to enable the zooming

isStrokeZoomingEnabled

public boolean isStrokeZoomingEnabled()
Returns the state of the stroke zooming

Returns:
true, if the zooming of strokes is enabled

setAntialiasing

public final void setAntialiasing(boolean antialiasing)
Enables anti-aliasing if the argument is true, otherwise anti-aliasing is disabled.

Specified by:
setAntialiasing in interface GraphPanel
Parameters:
antialiasing - true for enabling antialiasing otherwise false.

setJPopupMenuSource

public final void setJPopupMenuSource(JPopupMenuSourceWithUpdateUI popupmenusource)
Sets the 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.

Parameters:
popupmenusource - the popupmenu source for the graphpanel.

deleteSelection

public void deleteSelection()
Deletes the currently selected objects. If no object is selected nothing will be deleted.

Specified by:
deleteSelection in interface GraphPanel

destroy

public void destroy()
Cleans up resources we hold on to.


updateUI

public void updateUI()
Perform some custom ui updating.


isModified

public final boolean isModified()
Returns whether the document needs saving or not.

Specified by:
isModified in interface GraphPanel
Returns:
boolean flag that indicates whether saving is needed or not.

setUnmodified

public final void setUnmodified()
Sets the document to be unmodified. This method will invoke the indicateUnmodifiedDocument() method in the mdi component, iff the mdi reference is not null.

Specified by:
setUnmodified in interface GraphPanel

setModified

public final void setModified()
Sets the document to be unmodified. This method will invoke the indicateModifiedDocument() method in the mdi component, iff the mdi reference is not null.

Specified by:
setModified in interface GraphPanel

isDrawDuringDrag

public final boolean isDrawDuringDrag()
Returns the drawDuringDrag flag, if true then composites are drawn during dragging (in drag'n'drop).

Returns:
true if composites are drawn during dragging.

setDrawDuringDrag

public final void setDrawDuringDrag(boolean drawDuringDrag)
Sets the drawDuringDrag flag, if true then composites are drawn during dragging (in drag'n'drop).

Parameters:
drawDuringDrag - true if composites are drawn during dragging.

isAutoScale

public final boolean isAutoScale()
Gets the auto-scale flag, if true then the drawing area is automatically scaled to fit its gui space.

Returns:
true if autoscale mode is enabled.

setAutoScale

public final void setAutoScale(boolean autoScale)
Sets the auto-scale flag, if true then the drawing area is automatically scaled to fit its gui space.

Parameters:
autoScale - true if autoscale mode is enabled.

isLowDetailForInteraction

public final boolean isLowDetailForInteraction()
Gets the low-detail-during interaction flag, if true then the selected composites are drawn with minimum detail only during interaction. This improves performance and may improve usability for certain scenarios.

Returns:
true if low-detail-mode is enabled.

setLowDetailForInteraction

public final 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. This improves performance and may improve usability for certain scenarios.

Parameters:
lowDetailForInteraction - flag that indicates whether to use low-detail drawing mode for selected composites.

isEditable

public final boolean isEditable()
Returns whether the document is editable or not.

Specified by:
isEditable in interface GraphPanel
Returns:
boolean flag that indicates whether editing is enabled or disabled.

enableMode

public final void enableMode(int modemask)
Description copied from interface: GraphPanel
Enables the given mode(s) on this instance.

Specified by:
enableMode in interface GraphPanel
Parameters:
modemask - the mode(s) to enable.

disableMode

public final void disableMode(int modemask)
Description copied from interface: GraphPanel
Disables the given mode(s) on this instance.

Specified by:
disableMode in interface GraphPanel
Parameters:
modemask - the mode(s) to disable.

getGraphApplication

public final GraphApplication getGraphApplication()
Returns the GraphApplication reference.

Specified by:
getGraphApplication in interface GraphPanel
Returns:
the GraphApplication reference associated with the SwingGraphPanel.

getApplicationFrame

public ApplicationFrame getApplicationFrame()
Description copied from interface: GraphPanel
Returns the application frame reference.

Specified by:
getApplicationFrame in interface GraphPanel
Returns:
a reference to the ApplicationFrame.

getVisualGraphIcon

public final java.awt.Image getVisualGraphIcon(int width,
                                               int height)
Renders an icon for the 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.

Specified by:
getVisualGraphIcon in interface GraphPanel
Parameters:
width - the desired image width.
height - the desired image height.
Returns:
the image icon.

getVisualGraphIcon

public final java.awt.Image getVisualGraphIcon(int width,
                                               int height,
                                               boolean visibleRegion)
Renders an icon for the 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.

Parameters:
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.
Returns:
the image icon.

getVisualGraphImageThreshold

public int getVisualGraphImageThreshold()
Deprecated. Do not use this function, the calculation might be wrong.

Returns the number of pixels that represent the maximum number of pixels for a full unscaled export of the current VisualGraphView.

Returns:
the maximum number of pixels for export.

getVisualGraphImageRequiredSize

public int getVisualGraphImageRequiredSize()
Deprecated. Use VisualGraphImageUtil.getPreferredSize(VisualGraphView) to get the actual size of an image of a VisualGraphView

Returns the number of pixels that are required for a full unscaled export of the current VisualGraphView.

Returns:
the required number of pixels for export.

getVisualGraphImagePreferredSize

public Size getVisualGraphImagePreferredSize()
Deprecated. Use VisualGraphImageUtil.getPreferredSize(VisualGraphView) instead!

Returns the preferred size for an unscaled export of the current VisualGraphView.

Returns:
the dimensions for unscaled export.

getVisualGraphImage

public final java.awt.Image getVisualGraphImage()
Deprecated. Use VisualGraphImageUtil.renderToImage(VisualGraphView, Insets) instead!

Renders a picture for the VisualGraph. The current display contents are rendered into a standard RGB image (true-color) of the specified 1:1 zoomed width and height and returned as an image.

Returns:
an image representing the currently assigned VisualGraphView or null which is returned if no VisualGraphView is currently active.

getVisualGraphImage

public final java.awt.Image getVisualGraphImage(int width,
                                                int height)
Deprecated. Use VisualGraphImageUtil.renderToImage(VisualGraphView, int, int, Insets) instead!

Create an image of the panel's contents with the given size.

Parameters:
width - width of the image to create.
height - height of the image to create.
Returns:
the created image.

confirmImageSize

public final boolean confirmImageSize(UIManager uiManager)
Display a confirmation dialog that prompts the user whether the computed image size for raster export is accepted or not.

Parameters:
uiManager - the UIManager to use for the displayed texts.
Returns:
true if and only if the user confirmed.

getGraphController

public final GraphController getGraphController()
Returns the GraphController that is currently shown in this component.

Specified by:
getGraphController in interface GraphPanel
Returns:
the graphcontroller that is currently shown in this component.

setGraphController

public final void setGraphController(GraphController graphcontroller,
                                     VisualGraphView visualgraphview)
Sets a VisualGraph to display along with a controller. The previous visualgraph is removed from the panel.

Specified by:
setGraphController in interface GraphPanel
Parameters:
graphcontroller - the controller for the visualgraph
visualgraphview - the visualgraphview to be displayed.

getVisualGraph

public final VisualGraphView getVisualGraph()
Gets the VisualGraph instance that is currently displayed in the graphpanel.

Specified by:
getVisualGraph in interface GraphPanel
Returns:
the visualgraph instance shown in this graphpanel.

setVisualGraph

public final void setVisualGraph(VisualGraphView visualgraphview)
Sets the VisualGraph to display in the graphpanel.

Specified by:
setVisualGraph in interface GraphPanel
Parameters:
visualgraphview - the VisualGraph to display in the graphpanel

getDeepestVisualEdgeAt

public final VisualEdge getDeepestVisualEdgeAt(int x,
                                               int y)
Returns the deepest VisualEdge at the coordinate given by x and y that can be found in the hierarchy. If no VisualEdge is found at the coordinate null is returned.
Notice that the coordinate is given in device coordinates.

Parameters:
x - the x component of the coordinate to check for
y - the y component of the coordinate to check for
Returns:
VisualEdge the deepest VisualEdge found or null

getDeepestVisualNodeAt

public final VisualNode getDeepestVisualNodeAt(int x,
                                               int y)
Returns the deepest VisualNode at the coordinate given by x and y that can be found in the hierarchy. If no VisualNode is found at the coordinate null is returned. By default VisualNodes contained inside folded groups are ignored. Please use getDeepestVisualNodeAt(int, int, boolean) with the last parameter set to true in order to traverse folded groups during the search.
Notice that the coordinate is given in device coordinates.

Parameters:
x - the x component of the coordinate to check for
y - the y component of the coordinate to check for
Returns:
VisualNode the deepest VisualNode found or null

getDeepestVisualNodeAt

public final VisualNode getDeepestVisualNodeAt(int x,
                                               int y,
                                               boolean traverseFoldedGroups)
Returns the deepest VisualNode at the coordinate given x, y that can be found in the hierarchy. If no VisualNode is found at the coordinate null is returned.
If the parameter traverseFoldedGroups is set to false, the first folded CompositeGroup found at the given coordinate is considered as the deepest VisualNode for this coordinate and is therefore returned by this method. Notice that the coordinate is given in device coordinates.

Parameters:
x - the x component of the coordinate to check for
y - the y component of the coordinate to check for
traverseFoldedGroups - set to false if VisualNodes inside a folded CompositeGroup should be ignored.
Returns:
VisualNode the deepest VisualNode found or null

getDeepestVisualSubgraphAt

public final VisualSubgraph getDeepestVisualSubgraphAt(int x,
                                                       int y)
Returns the deepest VisualSubgraph at the coordinate given by x and y that can be found in the hierarchy. If no VisualSubgraph is found at the coordinate null is returned.
Notice that the coordinate is given in device coordinates.

Parameters:
x - the x component of the coordinate to check for
y - the y component of the coordinate to check for
Returns:
VisualSubgraph the deepest VisualSubgraph found or null

getZoomX

public final double getZoomX()
Returns the zoom factor for the VisualGraphView in x direction.

Returns:
double the zoom factor in x direction

getZoomY

public final double getZoomY()
Returns the zoom factor for the VisualGraphView in y direction.

Returns:
double the zoom factor in y direction

setZoom

public final void setZoom(double scaleX,
                          double scaleY)
Sets the zoom factors for the graph view and triggers a repaint.

Specified by:
setZoom in interface GraphPanel
Parameters:
scaleX - the zoom factor for the x axis
scaleY - the zoom factor for the y axis

setZoomToFit

public final void setZoomToFit()
Zooms and translates the viewport so that all visible items can be seen.

Specified by:
setZoomToFit in interface GraphPanel

setZoom

public final void setZoom(double scaleX,
                          double scaleY,
                          boolean smartzoom)
Sets the zoom factors for the graph view and triggers a repaint. Smart zooming means to zoom to the center of the visible rectangle or if a selection exists than to the center of the bounding box of the selection.

Specified by:
setZoom in interface GraphPanel
Parameters:
scaleX - the zoom factor for the x axis
scaleY - the zoom factor for the y axis
smartzoom - flag whether to do a smart zoom.

getViewportWidth

public final int getViewportWidth()
Description copied from interface: GraphPanel
Computes the sizes of the client area that corresponds to the viewport width in PIXELS.

Specified by:
getViewportWidth in interface GraphPanel
Returns:
the viewport width in pixels.

getViewportHeight

public final int getViewportHeight()
Description copied from interface: GraphPanel
Computes the sizes of the client area that corresponds to the viewport width in PIXELS.

Specified by:
getViewportHeight in interface GraphPanel
Returns:
the viewport width in pixels.

drag

public final 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.

Parameters:
visualgraphobject - the visual object.
additional_vgos - An array holding additional VisualGraphObjects that are included in the dragging operation
scalefactor - the scale factor.
x - the x component of the mouse position.
y - the y component of the mouse position.

drag

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.

Parameters:
visualgraphobject - the visual object.
additional_vgos - An array holding additional VisualGraphObjects that are included in the dragging operation
dragRepresentation - the drag representation composite.
scalefactor - the scale factor.
x - the x component of the mouse position.
y - the y component of the mouse position.

drop

public final void drop(VisualGraphObject vgo,
                       VisualGraphObject[] additional_vgos,
                       int x,
                       int y)
Invoked by the DropListener to let the panel handle the dropped VisualGraphObject.

Specified by:
drop in interface GraphPanel
Parameters:
vgo - users dropped VisualGraphObject.
x - the x coordinate of the point where the drop occurred.
y - the y coordinate of the point where the drop occurred.
additional_vgos - The objects that have been dropped

paintChildren

protected void paintChildren(java.awt.Graphics g)

paintComponent

public void paintComponent(java.awt.Graphics gfx)
Overridden paintComponent for custom painting. Delegates core work to actualPainting()


updateScrollbars

public void updateScrollbars()
This method updates the scrollbars according to the composite view settings.


update

public void update(Observable o,
                   java.lang.Object arg)
This method is called by the observable that registered this instance as observers.

Specified by:
update in interface GraphPanel
Parameters:
o - observable that invoked this method
arg - additional arguments from the observable.

adjustmentValueChanged

public void adjustmentValueChanged(java.awt.event.AdjustmentEvent event)
This method is triggered by adjustment events due to scrollbar changes.

Specified by:
adjustmentValueChanged in interface java.awt.event.AdjustmentListener
Parameters:
event - adjustment event

applyEvList

public void applyEvList()
Description copied from interface: Evaluable
Tells the component to apply its UIItemEvaluationList.

Specified by:
applyEvList in interface Evaluable

installEvList

public void installEvList()
Description copied from interface: Evaluable
Tells the component to setup its internal state.

Specified by:
installEvList in interface Evaluable

addModifyListener

public void addModifyListener(ModifiedVisualGraphListener listener)
Description copied from interface: GraphPanel
The method addModifyListener lets users to keep track on current changes of the represented VisualGraph. Basically any GraphPanel implementation might redirect the passed listener instance to the various addListener of the contained VisualGraphView.

Specified by:
addModifyListener in interface GraphPanel
Parameters:
listener - the ModifiedVisualGraphListener to add.

removeModifyListener

public void removeModifyListener(ModifiedVisualGraphListener listener)
Removes the modifiy listener that checks for the first initial modification from a VisualGraph.

Specified by:
removeModifyListener in interface GraphPanel
Parameters:
listener - the ModifiedVisualGraphListener to remove.

getRecentPopupMenuMouseCoordinate

public final Coordinate getRecentPopupMenuMouseCoordinate()
Returns the most recent meaningful mouse-coordinate of this instance.

Returns:
the most recent meaningful mouse-coordinate of this instance.

switchLowDetail

public final void switchLowDetail(boolean isLowDetail)
internal worker function that toggles low-detail modes

Parameters:
isLowDetail - true to enable low detail, otherwise false.

resetDragAndDropState

public final 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.


undo

public void undo()
Description copied from interface: GraphPanel
Undo the last undoable change.

Specified by:
undo in interface GraphPanel

redo

public void redo()
Description copied from interface: GraphPanel
Redo the last undone change.

Specified by:
redo in interface GraphPanel

cut

public void cut()
Description copied from interface: GraphPanel
Cut the selection into the internal clipboard.

Specified by:
cut in interface GraphPanel

copy

public void copy()
Description copied from interface: GraphPanel
Copy the selection into the internal clipboard.

Specified by:
copy in interface GraphPanel

paste

public void paste()
Description copied from interface: GraphPanel
Paste the contents of the internal clipboard into the GraphPanel.

Specified by:
paste in interface GraphPanel

paste

public void paste(Coordinate coordinate)
Paste the contents of the internal clipboard into the GraphPanel at the specified Coordinate.

Parameters:
coordinate - the position where to paste.

pasteStart

public void pasteStart()
Description copied from interface: GraphPanel
Paste the contents of the internal clipboard into the GraphPanel.

Specified by:
pasteStart in interface GraphPanel

pasteStop

public void pasteStop()
Description copied from interface: GraphPanel
Paste the contents of the internal clipboard into the GraphPanel.

Specified by:
pasteStop in interface GraphPanel

pasteBefore

public void pasteBefore(VisualNode visualnode)
Description copied from interface: GraphPanel
Paste the contents of the internal clipboard into the GraphPanel.

Specified by:
pasteBefore in interface GraphPanel
Parameters:
visualnode - the VisualNode to paste before.

pasteBehind

public void pasteBehind(VisualNode visualnode)
Description copied from interface: GraphPanel
Paste the contents of the internal clipboard into the GraphPanel.

Specified by:
pasteBehind in interface GraphPanel
Parameters:
visualnode - the VisualNode to paste behind.

postSelect

public void postSelect()
Description copied from interface: GraphPanel
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. E.g. SelectAll, etc.

Specified by:
postSelect in interface GraphPanel

setAttributableOnSetDelegate

public void setAttributableOnSetDelegate(AttributableOnSetDelegate delegate)
Description copied from interface: GraphPanel
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.

Specified by:
setAttributableOnSetDelegate in interface GraphPanel
Parameters:
delegate - the delegate object to delegate determineAttributableOnSet calls to.

getAttributableOnSetDelegate

public AttributableOnSetDelegate getAttributableOnSetDelegate()
Description copied from interface: GraphPanel
The method getAttributableOnSetDelegate returns the previously set AttributableOnSet instance of this GraphPanel or null,if no such object has been set.

Specified by:
getAttributableOnSetDelegate in interface GraphPanel
Returns:
AttributableOnSetDelegate

getPopupMenuSource

public JPopupMenuSourceWithUpdateUI getPopupMenuSource()
Returns an instance of a JPopupMenuSourceWithUpdateUI or null if this instance of SwingGraphPanel has no context menu.

Returns:
JPopupMenuSourceWithUpdateUI an instance of a JPopupMenuSourceWithUpdateUI or null

getToolTipGenerator

public ToolTipGenerator getToolTipGenerator()
Description copied from interface: GraphPanel
Returns the currently used tooltip generator

Specified by:
getToolTipGenerator in interface GraphPanel
Returns:
ToolTipGenerator

setToolTipGenerator

public void setToolTipGenerator(ToolTipGenerator toolTipGenerator)
Sets the toolTipGenerator.

Specified by:
setToolTipGenerator in interface GraphPanel
Parameters:
toolTipGenerator - The toolTipGenerator to set

getToolTipText

public java.lang.String getToolTipText()

getToolTipText

public java.lang.String getToolTipText(java.awt.event.MouseEvent event)

getGraphDocument

public GraphDocument getGraphDocument()
Returns the enclosing GraphDocument instance.

Returns:
the enclosing GraphDocument instance

isInplaceEditEnabled

public boolean isInplaceEditEnabled()
Returns a boolean that indicates whether inplace editing of text is enabled for an instance of the SwingGraphPanel or not.

Returns:
boolean a flag that indicates whether inplace editing is enabled or not

setInplaceEditEnabled

public void setInplaceEditEnabled(boolean enableInplaceEdit)
Sets the inplace edit enabled flag to the value given by enableInplaceEdit.

Parameters:
enableInplaceEdit - the new value for the inplace edit enabled flag

getParentComponent

public BasicComponent getParentComponent()
Description copied from interface: BasicComponent
Returns the parent Component of this instance.

Specified by:
getParentComponent in interface BasicComponent
Returns:
the parent component or null if no parent exists.

addDragListener

public void addDragListener(GraphPanelDragListener listener)
Description copied from interface: GraphPanel
Adds a listener that will react on drag events like start, enter, exit, move and drop.

Specified by:
addDragListener in interface GraphPanel
Parameters:
listener - The listener for the events

removeDragListener

public void removeDragListener(GraphPanelDragListener listener)
Description copied from interface: GraphPanel
Removed a listener that will react on drag events like start, enter, exit, move and drop.

Specified by:
removeDragListener in interface GraphPanel
Parameters:
listener - The listener for the events

isFocusable

public boolean isFocusable()
Overridden method from Component to make the panel focusable in fullscreen mode. (since 1.5.0)

Returns:
true

getInplaceEditorConfigurator

public InplaceEditorConfigurator getInplaceEditorConfigurator()
Returns the InplaceEditorConfigurator that is used to configure the inplace editor component whenever a label is edited in the view.

Returns:
the InplaceEditorConfigurator that is used to configure the inplace editor component whenever a label is edited in the view.

setInplaceEditorConfigurator

public void setInplaceEditorConfigurator(InplaceEditorConfigurator iec)
Sets the InplaceEditorConfigurator that is used to configure the inplace editor component whenever a label is edited in the view.

Parameters:
iec - the InplaceEditorConfigurator that is used to configure the inplace editor component whenever a label is edited in the view.

startInplaceEditing

public void startInplaceEditing(BaseComposite baseComposite,
                                Label2D label)
Starts the editing of the given label in the baseComposite for plain text editing.

Parameters:
baseComposite - The BaseComposite the label belongs to
label - The label to edit

stopInplaceEditing

public void stopInplaceEditing()
Removes a previously added inplace editor component



Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.