|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.tensegrity.gui.swing.graph.SwingGraphPanel
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.
GraphApplication
This reference
may be null. If it is not null, it is used to show error messages
in a unified way in the preferred way of the applicationFrame.
Another optional feature realized by means of this reference is
the automatic update of an optional attributetable.
JPopupMenuSourceWithUpdateUI.
This reference may be
null and is used to allow an external class to be the source for
a popupmenu. Popupmenu recreation is triggered automatically when
the look and feel of swing is changed. Popupmenus must be recreated
to reflect changes of the look and feel.
GraphDocument.
This reference may not be
null and is needed to communicate the "document has changed"
flag to the outside world.
com.tensegrity.gui.swing.CompositeDragSource.
This reference may be
null. If it is not null then it is used query the most recently dragged
composite from a drag-source. This is needed to support drawing during
drag.
The SwingGraphPanel is not made for extending and thus
forbids subclassing explicity. Still it can be embedded like any
other swing-component.
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 |
public boolean DEBUG_REPAINTMANAGER
| Constructor Detail |
public SwingGraphPanel()
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.
public SwingGraphPanel(Application application,
GraphDocument graphdocument,
JPopupMenuSourceWithUpdateUI popupmenusource)
application - reference to the applicationgraphdocument - the graphdocument this panel is embedded in.popupmenusource - the source class for the popupmenu.
public SwingGraphPanel(Application application,
GraphDocument graphdocument,
JPopupMenuSourceWithUpdateUI popupmenusource,
boolean isDoubleBuffered)
SwingGraphPanel(ApplicationFrame, GraphDocument, JPopupMenuSourceWithUpdateUI, boolean)
application - reference to the applicationgraphdocument - the graphdocument this panel is embedded in.popupmenusource - the source class for the popupmenu.isDoubleBuffered - flag whether to use double buffering or not.
public SwingGraphPanel(Application application,
GraphDocument graphdocument,
JPopupMenuSourceWithUpdateUI popupmenusource,
DragContext vgoDragSource)
SwingGraphPanel(ApplicationFrame, GraphDocument, JPopupMenuSourceWithUpdateUI, DragContext)
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.
public SwingGraphPanel(Application application,
GraphDocument graphdocument,
JPopupMenuSourceWithUpdateUI popupmenusource,
DragContext vgoDragSource,
boolean isDoubleBuffered)
application - reference to the applicationgraphdocument - 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.
public SwingGraphPanel(ApplicationFrame applicationFrame,
GraphDocument graphdocument,
JPopupMenuSourceWithUpdateUI popupmenusource)
applicationFrame - reference to the application's main frame.graphdocument - the graphdocument this panel is embedded in.popupmenusource - the source class for the popupmenu.
public SwingGraphPanel(ApplicationFrame applicationFrame,
GraphDocument graphdocument,
JPopupMenuSourceWithUpdateUI popupmenusource,
boolean isDoubleBuffered)
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.
public SwingGraphPanel(ApplicationFrame applicationFrame,
GraphDocument graphdocument,
JPopupMenuSourceWithUpdateUI popupmenusource,
DragContext vgoDragSource)
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.
public SwingGraphPanel(GraphDocument graphdocument,
JPopupMenuSourceWithUpdateUI popupmenusource,
DragContext vgoDragSource)
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.
public SwingGraphPanel(ApplicationFrame applicationFrame,
GraphDocument graphdocument,
JPopupMenuSourceWithUpdateUI popupmenusource,
DragContext vgoDragSource,
boolean isDoubleBuffered)
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 |
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.RendererConfigurationpublic 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 void enableKeyboardSupport()
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.
public void disableKeyboardSupport()
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.
public void enableKeyboardSupport(java.awt.Component 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(java.awt.Component 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 setVisualGraphBackground(java.awt.Color color)
color as the background color as
the VisualGraphView.
color - the new background color for the
VisualGraphView.public void setVisualGraphDisabledBackground(java.awt.Color color)
color as the background color as
the VisualGraphView when it is not
editable.
color - the new background color for the
VisualGraphView.public void setVisualGraphObjectDragSource(DragContext vgoDragSource)
DragContext that this instance should use.
vgoDragSource - the DragContext that this
instance should use.public void registerDropTarget(java.awt.dnd.DropTarget droptarget)
DropTarget given by droptarget as
the new drop target for the SwingGraphPanel.DropTarget class see the
documentation about DropTarget.
droptarget - new the DropTarget to registerpublic 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 final boolean isAntialiasing()
true is anti-aliasing is enabled,
otherwise false
isAntialiasing in interface GraphPaneltrue is anti-aliasing is enabled,
otherwise falsepublic 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 void setJPopupMenuSource(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 void deleteSelection()
deleteSelection in interface GraphPanelpublic void destroy()
public void updateUI()
public final boolean isModified()
isModified in interface GraphPanelpublic final void setUnmodified()
indicateUnmodifiedDocument() method in the mdi component,
iff the mdi reference is not null.
setUnmodified in interface GraphPanelpublic final void setModified()
indicateModifiedDocument() method in the mdi component,
iff the mdi reference is not null.
setModified in interface GraphPanelpublic final boolean isDrawDuringDrag()
public final void setDrawDuringDrag(boolean drawDuringDrag)
drawDuringDrag - true if composites are drawn during dragging.public final boolean isAutoScale()
public final void setAutoScale(boolean autoScale)
autoScale - true if autoscale mode is enabled.public final boolean isLowDetailForInteraction()
public final void setLowDetailForInteraction(boolean lowDetailForInteraction)
lowDetailForInteraction - flag that indicates whether to use
low-detail drawing mode for selected composites.public final boolean isEditable()
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 GraphApplication getGraphApplication()
GraphApplication
reference.
getGraphApplication in interface GraphPanelGraphApplication
reference associated with the SwingGraphPanel.public ApplicationFrame getApplicationFrame()
GraphPanel
getApplicationFrame in interface GraphPanel
public final java.awt.Image getVisualGraphIcon(int width,
int height)
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.
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 int getVisualGraphImageThreshold()
VisualGraphView.
public int getVisualGraphImageRequiredSize()
VisualGraphImageUtil.getPreferredSize(VisualGraphView) to
get the actual size of an image of a VisualGraphView
VisualGraphView.
public Size getVisualGraphImagePreferredSize()
VisualGraphImageUtil.getPreferredSize(VisualGraphView) instead!
VisualGraphView.
public final java.awt.Image getVisualGraphImage()
VisualGraphImageUtil.renderToImage(VisualGraphView, Insets) instead!
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.
VisualGraphView or null which is returned if no
VisualGraphView is currently active.
public final java.awt.Image getVisualGraphImage(int width,
int height)
VisualGraphImageUtil.renderToImage(VisualGraphView, int, int, Insets) instead!
width - width of the image to create.height - height of the image to create.
public final boolean confirmImageSize(UIManager uiManager)
uiManager - the UIManager to use for the displayed texts.
true if and only if the user confirmed.public final GraphController getGraphController()
GraphController
that is currently shown in this component.
getGraphController in interface GraphPanel
public final void setGraphController(GraphController graphcontroller,
VisualGraphView visualgraphview)
VisualGraph to display along
with a controller.
The previous visualgraph is removed from the panel.
setGraphController in interface GraphPanelgraphcontroller - the controller for the visualgraphvisualgraphview - the visualgraphview to be displayed.public final VisualGraphView getVisualGraph()
VisualGraph
instance that is currently displayed in the
graphpanel.
getVisualGraph in interface GraphPanelpublic final void setVisualGraph(VisualGraphView visualgraphview)
VisualGraph
to display in the graphpanel.
setVisualGraph in interface GraphPanelvisualgraphview - the VisualGraph
to display in the graphpanel
public final VisualEdge getDeepestVisualEdgeAt(int x,
int y)
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.
x - the x component of the coordinate to check fory - the y component of the coordinate to check for
VisualEdge found or
null
public final VisualNode getDeepestVisualNodeAt(int x,
int y)
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.
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)
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.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.
x - the x component of the coordinate to check fory - the y component of the coordinate to check fortraverseFoldedGroups - set to false if VisualNodes
inside a folded CompositeGroup should be ignored.
VisualNode found or
null
public final VisualSubgraph getDeepestVisualSubgraphAt(int x,
int y)
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.
x - the x component of the coordinate to check fory - the y component of the coordinate to check for
VisualSubgraph found or
nullpublic final double getZoomX()
VisualGraphView in x
direction.
public final double getZoomY()
VisualGraphView in y
direction.
public final void setZoom(double scaleX,
double scaleY)
setZoom in interface GraphPanelscaleX - the zoom factor for the x axisscaleY - the zoom factor for the y axispublic final void setZoomToFit()
setZoomToFit in interface GraphPanel
public final void setZoom(double scaleX,
double scaleY,
boolean smartzoom)
setZoom in interface GraphPanelscaleX - the zoom factor for the x axisscaleY - the zoom factor for the y axissmartzoom - flag whether to do a smart zoom.public final int getViewportWidth()
GraphPanel
getViewportWidth in interface GraphPanelpublic final int getViewportHeight()
GraphPanel
getViewportHeight in interface GraphPanel
public final void drag(VisualGraphObject visualgraphobject,
VisualGraphObject[] additional_vgos,
double scalefactor,
int x,
int y)
visualgraphobject - the visual object.additional_vgos - An array holding additional
VisualGraphObjects that are included
in the dragging operationscalefactor - 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)
visualgraphobject - the visual object.additional_vgos - An array holding additional
VisualGraphObjects that are included
in the dragging operationdragRepresentation - the drag representation composite.scalefactor - the scale factor.x - 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)
VisualGraphObject.
drop in interface GraphPanelvgo - 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 droppedprotected void paintChildren(java.awt.Graphics g)
public void paintComponent(java.awt.Graphics gfx)
public void updateScrollbars()
public void update(Observable o,
java.lang.Object arg)
update in interface GraphPanelo - observable that invoked this methodarg - additional arguments from the observable.public void adjustmentValueChanged(java.awt.event.AdjustmentEvent event)
adjustmentValueChanged in interface java.awt.event.AdjustmentListenerevent - adjustment eventpublic void applyEvList()
EvaluableUIItemEvaluationList.
applyEvList in interface Evaluablepublic void installEvList()
Evaluable
installEvList in interface Evaluablepublic void addModifyListener(ModifiedVisualGraphListener listener)
GraphPanelListener of the contained VisualGraphView.
addModifyListener in interface GraphPanellistener - the ModifiedVisualGraphListener to add.public void removeModifyListener(ModifiedVisualGraphListener listener)
VisualGraph.
removeModifyListener in interface GraphPanellistener - the ModifiedVisualGraphListener to remove.public final Coordinate getRecentPopupMenuMouseCoordinate()
public final void switchLowDetail(boolean isLowDetail)
isLowDetail - true to enable low detail, otherwise
false.public final void resetDragAndDropState()
public void undo()
GraphPanel
undo in interface GraphPanelpublic void redo()
GraphPanel
redo in interface GraphPanelpublic void cut()
GraphPanel
cut in interface GraphPanelpublic void copy()
GraphPanel
copy in interface GraphPanelpublic void paste()
GraphPanelGraphPanel.
paste in interface GraphPanelpublic void paste(Coordinate coordinate)
GraphPanel at the specified
Coordinate.
coordinate - the position where to paste.public 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 postSelect()
GraphPanel
postSelect 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 JPopupMenuSourceWithUpdateUI getPopupMenuSource()
JPopupMenuSourceWithUpdateUI or
null if this instance of SwingGraphPanel has
no context menu.
JPopupMenuSourceWithUpdateUI or nullpublic ToolTipGenerator getToolTipGenerator()
GraphPanel
getToolTipGenerator in interface GraphPanelpublic void setToolTipGenerator(ToolTipGenerator toolTipGenerator)
setToolTipGenerator in interface GraphPaneltoolTipGenerator - The toolTipGenerator to setpublic java.lang.String getToolTipText()
public java.lang.String getToolTipText(java.awt.event.MouseEvent event)
public GraphDocument getGraphDocument()
GraphDocument instance.
GraphDocument instancepublic 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 flagpublic BasicComponent getParentComponent()
BasicComponent
getParentComponent in interface BasicComponentnull if no parent exists.public 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 boolean isFocusable()
public InplaceEditorConfigurator getInplaceEditorConfigurator()
InplaceEditorConfigurator that is used to
configure the inplace editor component whenever a label is edited in
the view.
InplaceEditorConfigurator that is used to
configure the inplace editor component whenever a label is
edited in the view.public void setInplaceEditorConfigurator(InplaceEditorConfigurator iec)
InplaceEditorConfigurator that is used to
configure the inplace editor component whenever a label is edited in
the view.
iec - the InplaceEditorConfigurator that is used to
configure the inplace editor component whenever a label is
edited in the view.
public void startInplaceEditing(BaseComposite baseComposite,
Label2D label)
baseComposite
for plain text editing.
baseComposite - The BaseComposite the label
belongs tolabel - The label to editpublic void stopInplaceEditing()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||