public class GraphViewer extends AbstractStructuredGraphViewer implements ISelectionProvider
StructuredViewer.ColorAndFontCollector, StructuredViewer.ColorAndFontCollectorWithProviders| Modifier and Type | Field and Description |
|---|---|
protected GraphWidget |
graph |
WIDGET_DATA_KEY| Constructor and Description |
|---|
GraphViewer(Composite composite,
int style)
Initializes the viewer.
|
GraphViewer(GraphWidget graph)
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.gef4.zest.core.viewers.internal.IStylingGraphModelFactory |
getFactory()
(non-Javadoc)
|
GraphWidget |
getGraphControl() |
protected org.eclipse.gef4.layout.LayoutAlgorithm |
getLayoutAlgorithm()
Gets the current layout algorithm.
|
java.lang.Object[] |
getNodeElements() |
int |
getStyle()
Gets the styles for this structuredViewer
|
protected ZoomManager |
getZoomManager()
Returns a ZoomManager that zooming can be done on.
|
protected void |
hookControl(Control control) |
protected void |
inputChanged(java.lang.Object input,
java.lang.Object oldInput) |
void |
refresh(java.lang.Object element) |
void |
refresh(java.lang.Object element,
boolean updateLabels) |
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 |
setLayoutAlgorithm(org.eclipse.gef4.layout.LayoutAlgorithm algorithm)
Equivalent to setLayoutAlgorithm(algorithm, false).
|
void |
setLayoutAlgorithm(org.eclipse.gef4.layout.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) |
void |
update(java.lang.Object[] elements,
java.lang.String[] properties) |
void |
update(java.lang.Object element,
java.lang.String[] properties) |
addGraphModelConnection, addGraphModelContainer, addGraphModelNode, addGraphModelNode, addNode, addRelationship, addRelationship, doFindInputItem, doFindItem, doUpdateItem, filterVisuals, findItems, getConnectionsArray, getConnectionStyle, getGraphModelConnection, getGraphModelNode, getGraphStyle, getNodesArray, getNodesMap, getNodeStyle, getRawChildren, getSelectionFromWidget, getWidgetSelection, internalRefresh, removeGraphModelConnection, removeGraphModelNode, removeNode, removeRelationshipzoomToaddDoubleClickListener, 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, 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, usingElementMapgetContentProvider, getInput, getLabelProvider, labelProviderChangedaddHelpListener, fireHelpRequested, fireSelectionChanged, getData, handleHelpRequest, removeHelpListener, scrollDown, scrollUp, setData, setSelectionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetSelection, setSelectionprotected GraphWidget graph
public GraphViewer(Composite composite, int style)
composite - style - the style for the viewer and for the layout algorithmZestStyles#LAYOUT_GRID,
ZestStyles#LAYOUT_TREE,
ZestStyles#LAYOUT_RADIAL,
ZestStyles#LAYOUT_SPRING,
ZestStyles#NO_OVERLAPPING_NODES,
ZestStyles#NODES_HIGHLIGHT_ADJACENT,
ZestStyles.GESTURES_DISABLED,
ZestStyles#ANIMATION_DISABLED,
SWT.V_SCROLL,
SWT.H_SCROLLpublic GraphViewer(GraphWidget graph)
graph - The initial graph widgetprotected void hookControl(Control control)
hookControl in class StructuredViewerprotected void inputChanged(java.lang.Object input,
java.lang.Object oldInput)
inputChanged in class AbstractStructuredGraphViewerpublic int getStyle()
public GraphWidget getGraphControl()
getGraphControl in class AbstractStructuredGraphViewerpublic void setLayoutAlgorithm(org.eclipse.gef4.layout.LayoutAlgorithm algorithm,
boolean runLayout)
setLayoutAlgorithm in class AbstractStructuredGraphVieweralgorithm - the algorithm to layout the nodesrunLayout - if the layout should be runpublic void setLayoutAlgorithm(org.eclipse.gef4.layout.LayoutAlgorithm algorithm)
AbstractStructuredGraphViewersetLayoutAlgorithm in class AbstractStructuredGraphViewerpublic void setNodeStyle(int nodeStyle)
AbstractStructuredGraphViewersetNodeStyle in class AbstractStructuredGraphViewernodeStyle - the style for the nodes.#ZestStylespublic void setContentProvider(IContentProvider contentProvider)
setContentProvider in class StructuredViewerpublic GraphItem findGraphItem(java.lang.Object element)
The - user model node.public void applyLayout()
applyLayout in class AbstractStructuredGraphViewerprotected void setSelectionToWidget(java.util.List l,
boolean reveal)
setSelectionToWidget in class AbstractStructuredGraphViewerpublic Control getControl()
getControl in class Viewerpublic java.lang.Object[] getNodeElements()
getNodeElements in class AbstractStructuredGraphViewerpublic java.lang.Object[] getConnectionElements()
getConnectionElements in class AbstractStructuredGraphViewerpublic void reveal(java.lang.Object element)
reveal in class AbstractStructuredGraphViewerpublic void setConnectionStyle(int connectionStyle)
AbstractStructuredGraphViewersetConnectionStyle in class AbstractStructuredGraphViewerconnectionStyle - the style for the connections.#ZestStylespublic void unReveal(java.lang.Object element)
unReveal in class AbstractStructuredGraphViewerpublic void addSelectionChangedListener(ISelectionChangedListener listener)
addSelectionChangedListener in interface ISelectionProvideraddSelectionChangedListener in class Viewerpublic void removeSelectionChangedListener(ISelectionChangedListener listener)
removeSelectionChangedListener in interface ISelectionProviderremoveSelectionChangedListener in class Viewerpublic void refresh(java.lang.Object element)
refresh in class StructuredViewerpublic void refresh(java.lang.Object element,
boolean updateLabels)
refresh in class StructuredViewerpublic void update(java.lang.Object element,
java.lang.String[] properties)
update in class StructuredViewerpublic void update(java.lang.Object[] elements,
java.lang.String[] properties)
update in class StructuredViewerprotected ZoomManager getZoomManager()
AbstractZoomableViewergetZoomManager in class AbstractZoomableViewerprotected org.eclipse.gef4.zest.core.viewers.internal.IStylingGraphModelFactory getFactory()
getFactory in class AbstractStructuredGraphViewerAbstractStructuredGraphViewer.getFactory()protected org.eclipse.gef4.layout.LayoutAlgorithm getLayoutAlgorithm()
AbstractStructuredGraphViewergetLayoutAlgorithm in class AbstractStructuredGraphViewerCopyright (c) 2014 itemis AG and others. All rights reserved.