Package org.eclipse.zest.core.viewers
Class GraphViewer
- All Implemented Interfaces:
- IInputProvider,- IInputSelectionProvider,- IPostSelectionProvider,- ISelectionProvider
This view is used to represent a static graph. Static graphs can be layed
 out, but do not continually update their layout locations.
- @noextend
- This class is not intended to be subclassed by clients.
- 
Nested Class SummaryNested classes/interfaces inherited from class org.eclipse.jface.viewers.StructuredViewerStructuredViewer.ColorAndFontCollector, StructuredViewer.ColorAndFontCollectorWithProviders
- 
Field SummaryFieldsFields inherited from class org.eclipse.jface.viewers.ViewerWIDGET_DATA_KEY
- 
Constructor SummaryConstructorsConstructorDescriptionGraphViewer(Composite composite, int style) Initializes the viewer.GraphViewer(Graph graph) Initializes the viewer.
- 
Method SummaryModifier and TypeMethodDescriptionvoidvoidApplys the current layout to the viewerfindGraphItem(Object element) Finds the graph widget item for a given user model item.Object[]protected org.eclipse.zest.core.viewers.internal.IStylingGraphModelFactoryReturns the factory used to create the model.protected LayoutAlgorithmGets the current layout algorithm.Object[]intgetStyle()Gets the styles for this structuredViewerprotected org.eclipse.zest.core.viewers.internal.ZoomManagerReturns a ZoomManager that zooming can be done on.protected voidhookControl(Control control) protected voidinputChanged(Object input, Object oldInput) voidNOTE: If a layout algorithm is set in the receiver, layout is performed after the refresh.voidNOTE: If a layout algorithm is set in the receiver, layout is performed after the refresh.voidvoidvoidsetConnectionStyle(int connectionStyle) Sets the default style for connections in this graph.voidsetContentProvider(IContentProvider contentProvider) voidsetControl(Graph graphModel) voidsetLayoutAlgorithm(LayoutAlgorithm algorithm) Equivalent to setLayoutAlgorithm(algorithm, false).voidsetLayoutAlgorithm(LayoutAlgorithm algorithm, boolean runLayout) Sets the layout algorithm to use for this viewer.voidsetNodeStyle(int nodeStyle) Sets the default style for nodes in this graph.protected voidsetSelectionToWidget(List l, boolean reveal) voidvoidNOTE: If a layout algorithm is set in the receiver, layout is performed after the update.voidNOTE: If a layout algorithm is set in the receiver, layout is performed after the update.Methods inherited from class org.eclipse.zest.core.viewers.AbstractStructuredGraphVieweraddConstraintAdapter, addGraphModelConnection, addGraphModelContainer, addGraphModelNode, addGraphModelNode, addNode, addRelationship, addRelationship, createConnectionObject, createNodeObject, doFindInputItem, doFindItem, doUpdateItem, filterVisuals, findItems, getConnectionsArray, getConnectionStyle, getConstraintAdapters, getGraphModelConnection, getGraphModelNode, getGraphStyle, getNodesArray, getNodesMap, getNodeStyle, getRawChildren, getSelectionFromWidget, getWidgetSelection, internalRefresh, removeGraphModelConnection, removeGraphModelNode, removeNode, removeRelationshipMethods inherited from class org.eclipse.zest.core.viewers.AbstractZoomableViewerzoomToMethods inherited from class org.eclipse.jface.viewers.StructuredVieweraddDoubleClickListener, addDragSupport, addDropSupport, addFilter, addOpenListener, addPostSelectionChangedListener, assertContentProviderType, assertElementsNotNull, associate, buildLabel, disassociate, equals, filter, findItem, findItems, fireDoubleClick, fireOpen, firePostSelectionChanged, getColorAndFontCollector, getComparator, getComparer, getFilteredChildren, getFilters, getItem, getRoot, getSelection, getSortedChildren, getSorter, getStructuredSelection, handleDispose, handleDoubleSelect, handleInvalidSelection, handleLabelProviderChanged, handleOpen, handlePostSelect, handleSelect, hasFilters, internalRefresh, internalUpdate, mapElement, needsRefilter, preservingSelection, refresh, refresh, refreshItem, removeDoubleClickListener, removeFilter, removeOpenListener, removePostSelectionChangedListener, resetFilters, setComparator, setComparer, setFilters, setInput, setLabelProvider, setSelection, setSelectionToWidget, setSorter, setUseHashlookup, testFindItem, testFindItems, unmapAllElements, unmapElement, unmapElement, updateItem, updateSelection, usingElementMapMethods inherited from class org.eclipse.jface.viewers.ContentViewergetContentProvider, getInput, getLabelProvider, labelProviderChangedMethods inherited from class org.eclipse.jface.viewers.VieweraddHelpListener, fireHelpRequested, fireSelectionChanged, getData, handleHelpRequest, removeHelpListener, scrollDown, scrollUp, setData, setSelectionMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.jface.viewers.ISelectionProvidergetSelection, setSelection
- 
Field Details- 
graph
 
- 
- 
Constructor Details- 
GraphViewerInitializes the viewer.- Parameters:
- composite- The parent composite.
- style- The style for the viewer and the related Graph.
- See Also:
 
- 
GraphViewerInitializes the viewer.- Parameters:
- graph- The initial graph widget
- Since:
- 1.14
 
 
- 
- 
Method Details- 
setControl
- 
hookControl- Overrides:
- hookControlin class- StructuredViewer
 
- 
inputChanged- Overrides:
- inputChangedin class- AbstractStructuredGraphViewer
 
- 
getStylepublic int getStyle()Gets the styles for this structuredViewer
- 
getGraphControl- Overrides:
- getGraphControlin class- AbstractStructuredGraphViewer
 
- 
setLayoutAlgorithmSets the layout algorithm to use for this viewer.- Specified by:
- setLayoutAlgorithmin class- AbstractStructuredGraphViewer
- Parameters:
- algorithm- the algorithm to layout the nodes
- runLayout- if the layout should be run
 
- 
setLayoutAlgorithmDescription copied from class:AbstractStructuredGraphViewerEquivalent to setLayoutAlgorithm(algorithm, false).- Overrides:
- setLayoutAlgorithmin class- AbstractStructuredGraphViewer
- Parameters:
- algorithm-
 
- 
setNodeStylepublic void setNodeStyle(int nodeStyle) Description copied from class:AbstractStructuredGraphViewerSets the default style for nodes in this graph. Note: if an input is set on the viewer, a ZestException will be thrown.- Overrides:
- setNodeStylein class- AbstractStructuredGraphViewer
- Parameters:
- nodeStyle- the style for the nodes.
- See Also:
 
- 
setContentProvider- Overrides:
- setContentProviderin class- StructuredViewer
 
- 
findGraphItemFinds the graph widget item for a given user model item. Note: This method returns an internal interface (GraphItem). You should be able to cast this to either a IGraphModelNode or IGraphModelConnection (which are also internal). These are internal because this API is not stable. If use this method (to access internal nodes and edges), your code may not compile between versions.- Parameters:
- element- The user model node.
- Returns:
- An IGraphItem. This should be either a IGraphModelNode or IGraphModelConnection
 
- 
applyLayoutpublic void applyLayout()Applys the current layout to the viewer- Specified by:
- applyLayoutin class- AbstractStructuredGraphViewer
 
- 
setSelectionToWidget- Overrides:
- setSelectionToWidgetin class- AbstractStructuredGraphViewer
 
- 
getControl- Specified by:
- getControlin class- Viewer
 
- 
getNodeElements- Overrides:
- getNodeElementsin class- AbstractStructuredGraphViewer
 
- 
getConnectionElements- Overrides:
- getConnectionElementsin class- AbstractStructuredGraphViewer
 
- 
reveal- Overrides:
- revealin class- AbstractStructuredGraphViewer
 
- 
setConnectionStylepublic void setConnectionStyle(int connectionStyle) Description copied from class:AbstractStructuredGraphViewerSets the default style for connections in this graph. Note: if an input is set on the viewer, a ZestException will be thrown.- Overrides:
- setConnectionStylein class- AbstractStructuredGraphViewer
- Parameters:
- connectionStyle- the style for the connections.
- See Also:
 
- 
unReveal- Overrides:
- unRevealin class- AbstractStructuredGraphViewer
 
- 
addSelectionChangedListener- Specified by:
- addSelectionChangedListenerin interface- ISelectionProvider
- Overrides:
- addSelectionChangedListenerin class- Viewer
 
- 
removeSelectionChangedListener- Specified by:
- removeSelectionChangedListenerin interface- ISelectionProvider
- Overrides:
- removeSelectionChangedListenerin class- Viewer
 
- 
refreshNOTE: If a layout algorithm is set in the receiver, layout is performed after the refresh.- Overrides:
- refreshin class- StructuredViewer
 
- 
refreshNOTE: If a layout algorithm is set in the receiver, layout is performed after the refresh.- Overrides:
- refreshin class- StructuredViewer
 
- 
updateNOTE: If a layout algorithm is set in the receiver, layout is performed after the update.- Overrides:
- updatein class- StructuredViewer
 
- 
updateNOTE: If a layout algorithm is set in the receiver, layout is performed after the update.- Overrides:
- updatein class- StructuredViewer
 
- 
getZoomManagerprotected org.eclipse.zest.core.viewers.internal.ZoomManager getZoomManager()Description copied from class:AbstractZoomableViewerReturns a ZoomManager that zooming can be done on. May return null if none is available.- Specified by:
- getZoomManagerin class- AbstractZoomableViewer
- Returns:
- a ZoomManager that zooming can be done on.
 
- 
getFactoryprotected org.eclipse.zest.core.viewers.internal.IStylingGraphModelFactory getFactory()Description copied from class:AbstractStructuredGraphViewerReturns the factory used to create the model. This must not be called before the content provider is set.- Specified by:
- getFactoryin class- AbstractStructuredGraphViewer
 
- 
getLayoutAlgorithmDescription copied from class:AbstractStructuredGraphViewerGets the current layout algorithm.- Specified by:
- getLayoutAlgorithmin class- AbstractStructuredGraphViewer
- Returns:
- the current layout algorithm.
 
 
-