public abstract class NodeGUI extends Object implements GraphPieceGUI, Node.NodeObserver
| Modifier and Type | Field and Description |
|---|---|
protected Color |
bodyColor |
protected static Color |
BREAK_POINT_BORDER_COLOR
BREAK_POINT_BORDER_COLOR
|
protected static Color |
BREAK_POINT_COLOR |
static Color |
DEFAULT_BODY_COLOR
The default body color.
|
protected static Color |
DEFAULT_HEAD_COLOR |
protected Dimension |
dimension |
protected boolean |
dragged |
protected static Color |
DRAGGED_BODY_COLOR |
protected static Color |
EDGE_COLOR |
protected Color |
headColor |
protected int |
headHeight |
protected static int |
MINIMUM_HEIGHT
The minimum height of the node
|
protected static int |
MINIMUM_WIDTH
The minimum width of the node.
|
protected Node |
node |
protected List<Paintable> |
paintables |
protected static int |
PORT_GAP |
protected static int |
PORT_INITIAL_GAP |
protected boolean |
selected |
protected static Color |
SELECTED_HEAD_COLOR |
protected static Color |
TEXT_COLOR |
protected static int |
TEXT_GAP_X |
protected static int |
TEXT_GAP_Y |
| Modifier and Type | Method and Description |
|---|---|
void |
addPaintable(Paintable paintable) |
protected void |
calculatePositions(Graphics g)
Calculates the width of the node and x-coordinate of the ports.
|
protected void |
drawBody(Graphics2D g,
Shape shape,
Color paintBodyColor)
---------------------------------------------------------------------------------
|
protected void |
drawBreaks(Graphics2D g,
Point position) |
protected void |
drawEdge(Graphics2D g,
Shape completeComponentBoundaryShape,
Color edgeColor) |
protected void |
drawExtras(Graphics2D g) |
protected void |
drawHeader(Graphics2D g,
Shape shape,
String headerText,
Color headColor) |
protected void |
drawHeader(Graphics2D g,
Shape shape,
String headerText,
Color headColor,
boolean lowerBorderflat) |
protected void |
drawHeader(Graphics2D g,
Shape shape,
String headerText,
Color headColor,
Shape headerDrawBoundaryShape) |
protected void |
drawHeader(Graphics2D g,
Shape shape,
String headerText,
Color headColor,
Shape headerDrawBoundaryShape,
boolean lowerBorderflat) |
protected void |
drawPorts(Graphics2D g,
Collection<? extends Port> ports) |
protected void |
drawPorts(Graphics2D g,
Node node) |
protected Collection<? extends Port> |
getAllPorts()
Following functions need to be overridden for if the component shape/text/color is different
|
Color |
getBodyColor() |
protected Rectangle |
getBounds()
Gets the bounding Rectangle of this Node.
|
protected Color |
getComponentBodyColor() |
protected Color |
getComponentEdgeColor() |
protected Color |
getComponentHeaderColor() |
protected Shape |
getComponentHeaderShape() |
protected String |
getComponentHeaderText() |
protected Shape |
getComponentShape() |
protected Color |
getEndColor(Color bodyColor) |
protected Node |
getNode() |
protected Point |
getPosition()
Returns the position of the node.
|
protected boolean |
isIn(Point point)
Checks if a user's click is to select the node.
|
protected boolean |
isInConfig(Point point)
Checks if a user's click is to select the configuration
|
void |
mouseClicked(MouseEvent event,
XBayaEngine engine) |
void |
nodeUpdated(Node.NodeUpdateType type) |
protected void |
paint(Graphics2D g) |
void |
removePaintable(Paintable paintable) |
void |
resetTokens() |
void |
setBodyColor(Color color)
Sets the color of the body.
|
protected void |
setDraggedFlag(boolean flag) |
void |
setHeadColor(Color color)
Sets the color of the head.
|
protected void |
setPortPositions()
Sets up the position of ports
|
protected void |
setSelectedFlag(boolean flag) |
void |
setToken(String workflowName,
MonitorEventHandler.NodeState state) |
protected static final Color BREAK_POINT_BORDER_COLOR
protected static final int MINIMUM_WIDTH
protected static final int MINIMUM_HEIGHT
protected static final int TEXT_GAP_X
protected static final int TEXT_GAP_Y
protected static final Color TEXT_COLOR
protected static final int PORT_GAP
protected static final int PORT_INITIAL_GAP
protected static final Color EDGE_COLOR
protected static final Color DEFAULT_HEAD_COLOR
protected static final Color SELECTED_HEAD_COLOR
public static final Color DEFAULT_BODY_COLOR
protected static final Color DRAGGED_BODY_COLOR
protected static final Color BREAK_POINT_COLOR
protected Node node
protected Dimension dimension
protected int headHeight
protected boolean selected
protected boolean dragged
protected Color headColor
protected Color bodyColor
public NodeGUI(Node node)
node - public void setBodyColor(Color color)
color - The colorpublic Color getBodyColor()
public void setHeadColor(Color color)
color - The color to setpublic void mouseClicked(MouseEvent event, XBayaEngine engine)
mouseClicked in interface GraphPieceGUIGraphPieceGUI.mouseClicked(java.awt.event.MouseEvent,
org.apache.airavata.xbaya.XBayaEngine)public void addPaintable(Paintable paintable)
paintable - public void removePaintable(Paintable paintable)
paintable - protected void setSelectedFlag(boolean flag)
flag - protected void setDraggedFlag(boolean flag)
flag - protected Point getPosition()
protected Rectangle getBounds()
protected boolean isIn(Point point)
point - The location.protected boolean isInConfig(Point point)
point - protected void calculatePositions(Graphics g)
g - protected void paint(Graphics2D g)
g - protected final Collection<? extends Port> getAllPorts()
protected Node getNode()
protected final Color getComponentEdgeColor()
protected Color getComponentHeaderColor()
protected Shape getComponentHeaderShape()
protected final Color getComponentBodyColor()
protected Shape getComponentShape()
protected String getComponentHeaderText()
protected void drawBody(Graphics2D g, Shape shape, Color paintBodyColor)
protected void drawBreaks(Graphics2D g, Point position)
protected void drawExtras(Graphics2D g)
protected void drawPorts(Graphics2D g, Collection<? extends Port> ports)
protected void drawPorts(Graphics2D g, Node node)
protected void drawEdge(Graphics2D g, Shape completeComponentBoundaryShape, Color edgeColor)
protected void drawHeader(Graphics2D g, Shape shape, String headerText, Color headColor, boolean lowerBorderflat)
protected void drawHeader(Graphics2D g, Shape shape, String headerText, Color headColor)
protected void drawHeader(Graphics2D g, Shape shape, String headerText, Color headColor, Shape headerDrawBoundaryShape)
protected void drawHeader(Graphics2D g, Shape shape, String headerText, Color headColor, Shape headerDrawBoundaryShape, boolean lowerBorderflat)
protected void setPortPositions()
public void setToken(String workflowName, MonitorEventHandler.NodeState state)
workflowName - state - public void resetTokens()
public void nodeUpdated(Node.NodeUpdateType type)
nodeUpdated in interface Node.NodeObserverCopyright © 2011–2014 The Apache Software Foundation. All rights reserved.