public class GraphNode extends GraphItem
Modifier and Type | Field and Description |
---|---|
protected GraphWidget |
graphWidget |
static int |
HIGHLIGHT_NONE |
static int |
HIGHLIGHT_ON |
protected int |
highlighted |
protected java.lang.Object |
internalNode
The internal node.
|
protected org.eclipse.draw2d.IFigure |
nodeFigure |
protected IContainer |
parent |
protected org.eclipse.draw2d.geometry.Dimension |
size |
CONNECTION, CONTAINER, GRAPH, NODE
Modifier | Constructor and Description |
---|---|
|
GraphNode(IContainer graphModel,
int style) |
protected |
GraphNode(IContainer graphModel,
int style,
org.eclipse.draw2d.IFigure figure) |
|
GraphNode(IContainer graphModel,
int style,
java.lang.Object data)
Deprecated.
Since Zest 2.0, use
GraphNode(IContainer, int) and
Widget.setData(Object) |
|
GraphNode(IContainer graphModel,
int style,
java.lang.String text) |
|
GraphNode(IContainer graphModel,
int style,
java.lang.String text,
Image image)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
boolean |
cacheLabel() |
protected org.eclipse.draw2d.IFigure |
createFigureForModel() |
void |
dispose() |
protected org.eclipse.draw2d.IFigure |
fishEye(boolean enable,
boolean animate) |
Color |
getBackgroundColor()
Get the background colour for this node.
|
Color |
getBorderColor() |
Color |
getBorderHighlightColor() |
int |
getBorderWidth() |
org.eclipse.draw2d.IFigure |
getFigure() |
Font |
getFont() |
Color |
getForegroundColor()
Get the foreground colour for this node
|
GraphWidget |
getGraphWidget()
Gets the graph widget that this node is contained in
|
Color |
getHighlightColor()
Get the highlight colour for this node
|
int |
getItemType()
Gets the graph item type.
|
org.eclipse.gef4.zest.core.widgets.InternalNodeLayout |
getLayout() |
org.eclipse.draw2d.geometry.Point |
getLocation()
Returns a copy of the node's location.
|
int |
getNodeStyle() |
org.eclipse.draw2d.geometry.Dimension |
getSize()
Returns a copy of the node's size.
|
java.util.List<GraphConnection> |
getSourceConnections()
Returns a new list of the source connections (GraphModelConnection
objects).
|
int |
getStyle() |
java.util.List<GraphConnection> |
getTargetConnections()
Returns a new list of the target connections (GraphModelConnection
objects).
|
org.eclipse.draw2d.IFigure |
getTooltip()
Gets the current tooltip for this node.
|
void |
highlight()
Highlights the node changing the background color and border color.
|
protected void |
initFigure() |
protected void |
initModel(IContainer graphModel,
java.lang.String text,
Image image) |
boolean |
isDisposed() |
boolean |
isSelected() |
boolean |
isSizeFixed()
Determines if this node has a fixed size or if it is packed to the size
of its contents.
|
boolean |
isVisible()
Get the visibility of this item.
|
void |
setBackgroundColor(Color c)
Permanently sets the background color (unhighlighted).
|
void |
setBorderColor(Color c)
Sets the border color.
|
void |
setBorderHighlightColor(Color c)
Sets the highlighted border color.
|
void |
setBorderWidth(int width) |
void |
setCacheLabel(boolean cacheLabel) |
void |
setFont(Font font) |
void |
setForegroundColor(Color c)
Set the foreground colour for this node
|
void |
setHighlightColor(Color c)
Set the highlight colour for this node
|
void |
setImage(Image image) |
void |
setLocation(double x,
double y)
Sets the current location for this node.
|
void |
setNodeStyle(int nodeStyle) |
void |
setSize(double width,
double height) |
void |
setText(java.lang.String string) |
void |
setTooltip(org.eclipse.draw2d.IFigure tooltip)
Sets the tooltip on this node.
|
void |
setVisible(boolean visible)
Set the visibility of this item.
|
java.lang.String |
toString()
A simple toString that we can use for debugging
|
void |
unhighlight()
Restores the nodes original background color and border width.
|
protected void |
updateFigureForModel(org.eclipse.draw2d.IFigure currentFigure) |
checkStyle
checkSubclass, getImage, getText
addDisposeListener, addListener, checkWidget, getData, getData, getDisplay, getListeners, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData
public static final int HIGHLIGHT_NONE
public static final int HIGHLIGHT_ON
protected org.eclipse.draw2d.geometry.Dimension size
protected GraphWidget graphWidget
protected IContainer parent
protected java.lang.Object internalNode
protected int highlighted
protected org.eclipse.draw2d.IFigure nodeFigure
public GraphNode(IContainer graphModel, int style)
public GraphNode(IContainer graphModel, int style, java.lang.String text)
public GraphNode(IContainer graphModel, int style, java.lang.Object data)
public GraphNode(IContainer graphModel, int style, java.lang.String text, Image image)
protected GraphNode(IContainer graphModel, int style, org.eclipse.draw2d.IFigure figure)
protected void initFigure()
protected void initModel(IContainer graphModel, java.lang.String text, Image image)
public java.lang.String toString()
public boolean isDisposed()
isDisposed
in class Widget
public boolean isSizeFixed()
public java.util.List<GraphConnection> getSourceConnections()
public java.util.List<GraphConnection> getTargetConnections()
public org.eclipse.draw2d.geometry.Point getLocation()
public boolean isSelected()
public void setLocation(double x, double y)
public org.eclipse.draw2d.geometry.Dimension getSize()
public Color getForegroundColor()
public void setForegroundColor(Color c)
public Color getBackgroundColor()
public void setBackgroundColor(Color c)
c
- public void setTooltip(org.eclipse.draw2d.IFigure tooltip)
public org.eclipse.draw2d.IFigure getTooltip()
public void setBorderColor(Color c)
c
- the border color.public void setBorderHighlightColor(Color c)
c
- the highlighted border color.public Color getHighlightColor()
public void setHighlightColor(Color c)
public void highlight()
public void unhighlight()
unhighlight
in class GraphItem
public Color getBorderColor()
public int getBorderWidth()
public void setBorderWidth(int width)
public Font getFont()
public void setFont(Font font)
public GraphWidget getGraphWidget()
getGraphWidget
in class GraphItem
public int getNodeStyle()
public void setNodeStyle(int nodeStyle)
nodeStyle
- the nodeStyle to setpublic void setSize(double width, double height)
public Color getBorderHighlightColor()
public boolean cacheLabel()
public void setCacheLabel(boolean cacheLabel)
public void setVisible(boolean visible)
GraphItem
setVisible
in class GraphItem
visible
- whether or not this item is visible.public boolean isVisible()
GraphItem
protected org.eclipse.draw2d.IFigure fishEye(boolean enable, boolean animate)
protected void updateFigureForModel(org.eclipse.draw2d.IFigure currentFigure)
protected org.eclipse.draw2d.IFigure createFigureForModel()
public int getItemType()
GraphItem
getItemType
in class GraphItem
public org.eclipse.draw2d.IFigure getFigure()
public org.eclipse.gef4.zest.core.widgets.InternalNodeLayout getLayout()
Copyright (c) 2014 itemis AG and others. All rights reserved.