Search in sources :

Example 71 with Polygon

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;
}
Also used : Polygon(java.awt.Polygon)

Example 72 with Polygon

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;
}
Also used : Polygon(java.awt.Polygon)

Example 73 with Polygon

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());
}
Also used : Point(java.awt.Point) Polygon(java.awt.Polygon)

Example 74 with Polygon

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;
}
Also used : Polygon(java.awt.Polygon)

Example 75 with Polygon

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);
}
Also used : Point(java.awt.Point) Polygon(java.awt.Polygon)

Aggregations

Polygon (java.awt.Polygon)192 Point (java.awt.Point)53 Rectangle (java.awt.Rectangle)30 Graphics2D (java.awt.Graphics2D)28 Area (java.awt.geom.Area)22 ArrayList (java.util.ArrayList)21 BasicStroke (java.awt.BasicStroke)20 Color (java.awt.Color)19 Paint (java.awt.Paint)15 Point2D (java.awt.geom.Point2D)13 AffineTransform (java.awt.geom.AffineTransform)12 Rectangle2D (java.awt.geom.Rectangle2D)12 Shape (java.awt.Shape)11 LocalPoint (net.runelite.api.coords.LocalPoint)11 Point (net.runelite.api.Point)10 FloatPolygon (ij.process.FloatPolygon)9 Font (java.awt.Font)8 List (java.util.List)8 FontMetrics (java.awt.FontMetrics)7 Stroke (java.awt.Stroke)7