public class GraphViewer extends org.eclipse.zest.core.viewers.internal.AbstractStructuredGraphViewer implements ISelectionProvider
StructuredViewer.ColorAndFontCollector, StructuredViewer.ColorAndFontCollectorWithProviders
Modifier and Type | Field and Description |
---|---|
protected Graph |
graph |
WIDGET_DATA_KEY
Constructor and Description |
---|
GraphViewer(Composite composite,
int style)
Initializes the viewer.
|
Modifier and Type | Method and Description |
---|---|
void |
addSelectionChangedListener(ISelectionChangedListener listener) |
void |
applyLayout()
Applys the current layout to the viewer
|
GraphItem |
findGraphItem(java.lang.Object element)
Finds the graph widget item for a given user model item.
|
java.lang.Object[] |
getConnectionElements() |
Control |
getControl() |
protected org.eclipse.zest.core.viewers.internal.IStylingGraphModelFactory |
getFactory()
Returns the factory used to create the model.
|
Graph |
getGraphControl() |
protected LayoutAlgorithm |
getLayoutAlgorithm()
Gets the current layout algorithm.
|
java.lang.Object[] |
getNodeElements() |
int |
getStyle()
Gets the styles for this structuredViewer
|
protected org.eclipse.zest.core.viewers.internal.ZoomManager |
getZoomManager()
Returns a ZoomManager that zooming can be done on.
|
protected void |
hookControl(Control control) |
void |
removeSelectionChangedListener(ISelectionChangedListener listener) |
void |
reveal(java.lang.Object element) |
void |
setConnectionStyle(int connectionStyle)
Sets the default style for connections in this graph.
|
void |
setContentProvider(IContentProvider contentProvider) |
void |
setControl(Graph graphModel) |
void |
setLayoutAlgorithm(LayoutAlgorithm algorithm)
Equivalent to setLayoutAlgorithm(algorithm, false).
|
void |
setLayoutAlgorithm(LayoutAlgorithm algorithm,
boolean runLayout)
Sets the layout algorithm to use for this viewer.
|
void |
setNodeStyle(int nodeStyle)
Sets the default style for nodes in this graph.
|
protected void |
setSelectionToWidget(java.util.List l,
boolean reveal) |
void |
unReveal(java.lang.Object element) |
addConstraintAdapter, addNode, addRelationship, addRelationship, doFindInputItem, doFindItem, doUpdateItem, filterVisuals, findItems, getConnectionsArray, getConnectionStyle, getConstraintAdapters, getGraphStyle, getNodesArray, getNodeStyle, getRawChildren, getSelectionFromWidget, getWidgetSelection, inputChanged, internalRefresh, removeNode, removeRelationship
zoomTo
addDoubleClickListener, 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, refresh, refresh, refreshItem, removeDoubleClickListener, removeFilter, removeOpenListener, removePostSelectionChangedListener, resetFilters, setComparator, setComparer, setFilters, setInput, setLabelProvider, setSelection, setSelectionToWidget, setSorter, setUseHashlookup, testFindItem, testFindItems, unmapAllElements, unmapElement, unmapElement, update, update, updateItem, updateSelection, usingElementMap
getContentProvider, getInput, getLabelProvider, labelProviderChanged
addHelpListener, fireHelpRequested, fireSelectionChanged, getData, handleHelpRequest, removeHelpListener, scrollDown, scrollUp, setData, setSelection
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSelection, setSelection
protected Graph graph
public GraphViewer(Composite composite, int style)
composite
- The parent composite.style
- The style for the viewer and the related Graph.SWT.V_SCROLL
,
SWT.H_SCROLL
public void setControl(Graph graphModel)
protected void hookControl(Control control)
hookControl
in class StructuredViewer
public int getStyle()
public Graph getGraphControl()
getGraphControl
in class org.eclipse.zest.core.viewers.internal.AbstractStructuredGraphViewer
public void setLayoutAlgorithm(LayoutAlgorithm algorithm, boolean runLayout)
setLayoutAlgorithm
in class org.eclipse.zest.core.viewers.internal.AbstractStructuredGraphViewer
algorithm
- the algorithm to layout the nodesrunLayout
- if the layout should be runpublic void setLayoutAlgorithm(LayoutAlgorithm algorithm)
org.eclipse.zest.core.viewers.internal.AbstractStructuredGraphViewer
setLayoutAlgorithm
in class org.eclipse.zest.core.viewers.internal.AbstractStructuredGraphViewer
public void setNodeStyle(int nodeStyle)
org.eclipse.zest.core.viewers.internal.AbstractStructuredGraphViewer
setNodeStyle
in class org.eclipse.zest.core.viewers.internal.AbstractStructuredGraphViewer
nodeStyle
- the style for the nodes.#ZestStyles
public void setContentProvider(IContentProvider contentProvider)
setContentProvider
in class StructuredViewer
public GraphItem findGraphItem(java.lang.Object element)
The
- user model node.public void applyLayout()
applyLayout
in class org.eclipse.zest.core.viewers.internal.AbstractStructuredGraphViewer
protected void setSelectionToWidget(java.util.List l, boolean reveal)
setSelectionToWidget
in class org.eclipse.zest.core.viewers.internal.AbstractStructuredGraphViewer
public Control getControl()
getControl
in class Viewer
public java.lang.Object[] getNodeElements()
getNodeElements
in class org.eclipse.zest.core.viewers.internal.AbstractStructuredGraphViewer
public java.lang.Object[] getConnectionElements()
getConnectionElements
in class org.eclipse.zest.core.viewers.internal.AbstractStructuredGraphViewer
public void reveal(java.lang.Object element)
reveal
in class org.eclipse.zest.core.viewers.internal.AbstractStructuredGraphViewer
public void setConnectionStyle(int connectionStyle)
org.eclipse.zest.core.viewers.internal.AbstractStructuredGraphViewer
setConnectionStyle
in class org.eclipse.zest.core.viewers.internal.AbstractStructuredGraphViewer
connectionStyle
- the style for the connections.#ZestStyles
public void unReveal(java.lang.Object element)
unReveal
in class org.eclipse.zest.core.viewers.internal.AbstractStructuredGraphViewer
public void addSelectionChangedListener(ISelectionChangedListener listener)
addSelectionChangedListener
in interface ISelectionProvider
addSelectionChangedListener
in class Viewer
public void removeSelectionChangedListener(ISelectionChangedListener listener)
removeSelectionChangedListener
in interface ISelectionProvider
removeSelectionChangedListener
in class Viewer
protected org.eclipse.zest.core.viewers.internal.ZoomManager getZoomManager()
AbstractZoomableViewer
getZoomManager
in class AbstractZoomableViewer
protected org.eclipse.zest.core.viewers.internal.IStylingGraphModelFactory getFactory()
org.eclipse.zest.core.viewers.internal.AbstractStructuredGraphViewer
getFactory
in class org.eclipse.zest.core.viewers.internal.AbstractStructuredGraphViewer
protected LayoutAlgorithm getLayoutAlgorithm()
org.eclipse.zest.core.viewers.internal.AbstractStructuredGraphViewer
getLayoutAlgorithm
in class org.eclipse.zest.core.viewers.internal.AbstractStructuredGraphViewer
Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.