Package org.eclipse.zest.core.viewers
Class AbstractStructuredGraphViewer
java.lang.Object
org.eclipse.jface.viewers.Viewer
org.eclipse.jface.viewers.ContentViewer
org.eclipse.jface.viewers.StructuredViewer
org.eclipse.zest.core.viewers.AbstractZoomableViewer
org.eclipse.zest.core.viewers.AbstractStructuredGraphViewer
- All Implemented Interfaces:
- IInputProvider,- IInputSelectionProvider,- IPostSelectionProvider,- ISelectionProvider
- Direct Known Subclasses:
- GraphViewer
Abstraction of graph viewers to implement functionality used by all of them.
 Not intended to be implemented by clients. Use one of the provided children
 instead.
- Since:
- 1.14
- @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 SummaryFields inherited from class org.eclipse.jface.viewers.ViewerWIDGET_DATA_KEY
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddConstraintAdapter(ConstraintAdapter constraintAdapter) Adds a new constraint adapter to the list of constraintsaddGraphModelConnection(Object element, GraphNode source, GraphNode target) addGraphModelContainer(Object element) addGraphModelNode(Object element, IFigure figure) addGraphModelNode(IContainer container, Object element) voidCreates a new node and adds it to the graph.voidaddRelationship(Object connection) Adds a new relationship given the connection.voidaddRelationship(Object connection, Object srcNode, Object destNode) Creates a new relationship between the source node and the destination node.abstract voidApplies the viewers layouts.protected GraphConnectioncreateConnectionObject(Graph graphModel, GraphNode source, GraphNode destination) Implement and return the new connection object, enables to define custom graph connectionsprotected GraphNodecreateNodeObject(Graph graphModel, IFigure figure) Implement and return the new node object, enables to define custom graph nodesprotected WidgetdoFindInputItem(Object element) protected GraphItemdoFindItem(Object element) protected voiddoUpdateItem(Widget item, Object element, boolean fullMap) protected voidprotected GraphItem[]Object[]protected GraphConnection[]getConnectionsArray(Graph graph) Converts the list of GraphModelConnection objects into an array and returns it.intList<? extends ConstraintAdapter> Gets all the constraint adapters currently on the viewerprotected abstract org.eclipse.zest.core.viewers.internal.IStylingGraphModelFactoryReturns the factory used to create the model.getGraphModelNode(Object obj) intReturns the style set for the graphprotected abstract LayoutAlgorithmGets the current layout algorithm.Object[]protected GraphNode[]getNodesArray(Graph graph) Converts the list of GraphModelNode objects into an array an returns it.intReturns the style set for the nodes.protected Object[]getRawChildren(Object parent) Gets the internal model elements that are selected.protected voidinputChanged(Object input, Object oldInput) protected voidinternalRefresh(Object element) voidvoidvoidremoveNode(Object element) Removes the given element from the layout algorithm and the model.voidremoveRelationship(Object connection) Removes the given connection object from the layout algorithm and the model.voidvoidsetConnectionStyle(int connectionStyle) Sets the default style for connections in this graph.voidsetLayoutAlgorithm(LayoutAlgorithm algorithm) Equivalent to setLayoutAlgorithm(algorithm, false).abstract voidsetLayoutAlgorithm(LayoutAlgorithm algorithm, boolean run) Sets the layout algorithm for this viewer.voidsetNodeStyle(int nodeStyle) Sets the default style for nodes in this graph.protected voidsetSelectionToWidget(List l, boolean reveal) voidMethods inherited from class org.eclipse.zest.core.viewers.AbstractZoomableViewergetZoomManager, zoomToMethods 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, hookControl, internalRefresh, internalUpdate, mapElement, needsRefilter, preservingSelection, refresh, refresh, refresh, refresh, refreshItem, removeDoubleClickListener, removeFilter, removeOpenListener, removePostSelectionChangedListener, resetFilters, setComparator, setComparer, setContentProvider, setFilters, setInput, setLabelProvider, setSelection, setSelectionToWidget, setSorter, setUseHashlookup, testFindItem, testFindItems, unmapAllElements, unmapElement, unmapElement, update, update, updateItem, updateSelection, usingElementMapMethods inherited from class org.eclipse.jface.viewers.ContentViewergetContentProvider, getInput, getLabelProvider, labelProviderChangedMethods inherited from class org.eclipse.jface.viewers.VieweraddHelpListener, addSelectionChangedListener, fireHelpRequested, fireSelectionChanged, getControl, getData, handleHelpRequest, removeHelpListener, removeSelectionChangedListener, 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.ISelectionProvideraddSelectionChangedListener, removeSelectionChangedListener, setSelection
- 
Constructor Details- 
AbstractStructuredGraphViewerprotected AbstractStructuredGraphViewer(int graphStyle) 
 
- 
- 
Method Details- 
setNodeStylepublic void setNodeStyle(int nodeStyle) Sets the default style for nodes in this graph. Note: if an input is set on the viewer, a ZestException will be thrown.- Parameters:
- nodeStyle- the style for the nodes.
- See Also:
 
- 
setConnectionStylepublic void setConnectionStyle(int connectionStyle) Sets the default style for connections in this graph. Note: if an input is set on the viewer, a ZestException will be thrown.- Parameters:
- connectionStyle- the style for the connections.
- See Also:
 
- 
getGraphStylepublic int getGraphStyle()Returns the style set for the graph- Returns:
- The style set of the graph
 
- 
getNodeStylepublic int getNodeStyle()Returns the style set for the nodes.- Returns:
- the style set for the nodes.
 
- 
getGraphControl
- 
getConnectionStylepublic int getConnectionStyle()- Returns:
- the connection style.
 
- 
addConstraintAdapterAdds a new constraint adapter to the list of constraints- Parameters:
- constraintAdapter-
 
- 
getConstraintAdaptersGets all the constraint adapters currently on the viewer
- 
setLayoutAlgorithmSets the layout algorithm for this viewer. Subclasses may place restrictions on the algorithms that it accepts.- Parameters:
- algorithm- the layout algorithm
- run- true if the layout algorithm should be run immediately. This is a hint.
 
- 
getLayoutAlgorithmGets the current layout algorithm.- Returns:
- the current layout algorithm.
 
- 
setLayoutAlgorithmEquivalent to setLayoutAlgorithm(algorithm, false).- Parameters:
- algorithm-
 
- 
getNodeElements
- 
getConnectionElements
- 
getNodesMap- @noreference
- This method is not intended to be referenced by clients.
 
- 
addGraphModelContainer- @noreference
- This method is not intended to be referenced by clients.
 
- 
addGraphModelNode- @noreference
- This method is not intended to be referenced by clients.
 
- 
createNodeObjectImplement and return the new node object, enables to define custom graph nodes- Parameters:
- graphModel- where the created nodes gets added to
- figure- of the created node object
- Returns:
- instance of a GraphNode
- Since:
- 1.7
 
- 
createConnectionObjectprotected GraphConnection createConnectionObject(Graph graphModel, GraphNode source, GraphNode destination) Implement and return the new connection object, enables to define custom graph connections- Parameters:
- graphModel- where the created nodes gets added to
- source-- GraphNode
- destination-- GraphNode
- Returns:
- instance of a GraphConnection
- Since:
- 1.7
 
- 
addGraphModelNode- @noreference
- This method is not intended to be referenced by clients.
 
- 
addGraphModelConnection- @noreference
- This method is not intended to be referenced by clients.
 
- 
getGraphModelConnection- @noreference
- This method is not intended to be referenced by clients.
 
- 
getGraphModelNode- @noreference
- This method is not intended to be referenced by clients.
 
- 
removeGraphModelConnection- @noreference
- This method is not intended to be referenced by clients.
 
- 
removeGraphModelNode- @noreference
- This method is not intended to be referenced by clients.
 
- 
internalRefresh- Specified by:
- internalRefreshin class- StructuredViewer
 
- 
doUpdateItem- Specified by:
- doUpdateItemin class- StructuredViewer
 
- 
doFindInputItem- Specified by:
- doFindInputItemin class- StructuredViewer
 
- 
doFindItem- Specified by:
- doFindItemin class- StructuredViewer
 
- 
getSelectionFromWidget- Specified by:
- getSelectionFromWidgetin class- StructuredViewer
 
- 
findItems
- 
setSelectionToWidget- Specified by:
- setSelectionToWidgetin class- StructuredViewer
 
- 
getWidgetSelectionGets the internal model elements that are selected.
- 
inputChanged- Overrides:
- inputChangedin class- Viewer
 
- 
getFactoryprotected abstract org.eclipse.zest.core.viewers.internal.IStylingGraphModelFactory getFactory()Returns the factory used to create the model. This must not be called before the content provider is set.- @nooverride
- This method is not intended to be re-implemented or extended by clients.
- @noreference
- This method is not intended to be referenced by clients.
 
- 
filterVisualsprotected void filterVisuals()
- 
getRawChildren- Overrides:
- getRawChildrenin class- StructuredViewer
 
- 
reveal- Specified by:
- revealin class- StructuredViewer
 
- 
unReveal
- 
applyLayoutpublic abstract void applyLayout()Applies the viewers layouts.
- 
removeRelationshipRemoves the given connection object from the layout algorithm and the model.- Parameters:
- connection-
 
- 
addNodeCreates a new node and adds it to the graph. If it already exists nothing happens.- Parameters:
- element-
 
- 
removeNodeRemoves the given element from the layout algorithm and the model.- Parameters:
- element- The node element to remove.
 
- 
addRelationshipCreates a new relationship between the source node and the destination node. If either node doesn't exist then it will be created.- Parameters:
- connection- The connection data object.
- srcNode- The source node data object.
- destNode- The destination node data object.
 
- 
addRelationshipAdds a new relationship given the connection. It will use the content provider to determine the source and destination nodes.- Parameters:
- connection- The connection data object.
 
- 
getConnectionsArrayConverts the list of GraphModelConnection objects into an array and returns it.- Returns:
- GraphModelConnection[]
 
- 
getNodesArrayConverts the list of GraphModelNode objects into an array an returns it.- Returns:
- GraphModelNode[]
 
 
-