use of java.awt.Polygon in project airavata by apache.
the class IfNodeGUI method createHeadNode.
private Polygon createHeadNode(Point position) {
Polygon head = new Polygon();
head.addPoint(position.x, position.y + this.headHeight / 2);
head.addPoint(position.x, position.y + this.headHeight);
head.addPoint(position.x + this.dimension.width, position.y + this.headHeight);
head.addPoint(position.x + this.dimension.width, position.y + this.headHeight / 2);
head.addPoint(position.x + this.dimension.width / 2, position.y);
return head;
}
use of java.awt.Polygon in project airavata by apache.
the class ReceiveNodeGUI method createHeader.
private Polygon createHeader(Point position) {
Polygon head = new Polygon();
head.addPoint(position.x, position.y);
head.addPoint(position.x, position.y + this.headHeight);
head.addPoint(position.x + this.dimension.width, position.y + this.headHeight);
head.addPoint(position.x + this.dimension.width, position.y + this.headHeight / 2);
return head;
}
use of java.awt.Polygon in project airavata by apache.
the class ReceiveNodeGUI method calculatePositions.
private void calculatePositions() {
this.polygon = new Polygon();
Point position = getPosition();
this.polygon.addPoint(position.x, position.y);
this.polygon.addPoint(position.x, position.y + this.dimension.height + this.headHeight / 2);
this.polygon.addPoint(position.x + this.dimension.width, position.y + this.dimension.height);
this.polygon.addPoint(position.x + this.dimension.width, position.y + this.headHeight / 2);
DrawUtils.setupRoundedGeneralPath(polygon, getComponentShape());
}
use of java.awt.Polygon in project airavata by apache.
the class TerminateInstanceNodeGUI method createHeader.
private Polygon createHeader(Point position) {
Polygon head = new Polygon();
head.addPoint(position.x, position.y);
head.addPoint(position.x, position.y + this.headHeight);
head.addPoint(position.x + this.dimension.width, position.y + this.headHeight);
head.addPoint(position.x + this.dimension.width, position.y + this.headHeight / 2);
return head;
}
use of java.awt.Polygon in project airavata by apache.
the class TerminateInstanceNodeGUI method paint.
/**
* @see org.apache.airavata.xbaya.ui.graph.system.ConfigurableNodeGUI#paint(java.awt.Graphics2D)
*/
@Override
protected void paint(Graphics2D g) {
Point position = getPosition();
// Draws the body.
if (this.dragged) {
g.setColor(DRAGGED_BODY_COLOR);
} else {
g.setColor(this.bodyColor);
}
drawBody(g, generalPath, g.getColor());
// Draws the head.
Polygon head = createHeader(position);
drawHeader(g, DrawUtils.getRoundedShape(head), node.getName(), headColor);
// Edge
drawEdge(g, generalPath, EDGE_COLOR);
// Paint all ports
drawPorts(g, node);
}
Aggregations