Package java.awt

Examples of java.awt.Graphics.drawRoundRect()


        g.setColor(Color.GRAY);
        if (value.getWidth() <= 1) {
            g.drawOval(x + 1, y + 1,
                bds.getWidth() - 2, bds.getHeight() - 2);
        } else {
            g.drawRoundRect(x + 1, y + 1,
                bds.getWidth() - 2, bds.getHeight() - 2, 6, 6);
        }

        g.setColor(Color.BLACK);
        painter.drawLabel();
View Full Code Here


    @Override
    public void paintGhost(InstancePainter painter) {
        Graphics g = painter.getGraphics();
        GraphicsUtil.switchToWidth(g, 2);
        g.drawRoundRect(-30, -10, 30, 30, 8, 8);
    }

    @Override
    public void paintInstance(InstancePainter painter) {
        Location loc = painter.getLocation();
View Full Code Here

        Location loc = painter.getLocation();
        int x = loc.getX();
        int y = loc.getY();

        Graphics g = painter.getGraphics();
        g.drawRoundRect(x - 30, y - 10, 30, 30, 8, 8);
        g.drawRoundRect(x - 28, y - 8, 26, 26, 4, 4);
        drawBall(g, x - 15, y + 5, painter.getAttributeValue(Io.ATTR_COLOR),
                painter.shouldDrawColor());
        painter.drawPorts();
    }
View Full Code Here

        int x = loc.getX();
        int y = loc.getY();

        Graphics g = painter.getGraphics();
        g.drawRoundRect(x - 30, y - 10, 30, 30, 8, 8);
        g.drawRoundRect(x - 28, y - 8, 26, 26, 4, 4);
        drawBall(g, x - 15, y + 5, painter.getAttributeValue(Io.ATTR_COLOR),
                painter.shouldDrawColor());
        painter.drawPorts();
    }
View Full Code Here

                    int h = b.getHeight();
                    if (Pin.FACTORY.isInputPin(port)) {
                        gCopy.drawRect(x, y, w, h);
                    } else {
                        if (b.getWidth() > 25) {
                            gCopy.drawRoundRect(x, y, w, h, 4, 4);
                        } else {
                            gCopy.drawOval(x, y, w, h);
                        }
                    }
                }
View Full Code Here

    @Override
    public void paintGhost(InstancePainter painter) {
        Graphics g = painter.getGraphics();
        GraphicsUtil.switchToWidth(g, 2);
        Bounds bds = painter.getBounds();
        g.drawRoundRect(bds.getX(), bds.getY(), bds.getWidth(), bds.getHeight(),
                10, 10);
    }

    @Override
    public void paintInstance(InstancePainter painter) {
View Full Code Here

            g.fillRoundRect(bds.getX(), bds.getY(), bds.getWidth(), bds.getHeight(),
                    10, 10);
        }
        GraphicsUtil.switchToWidth(g, 2);
        g.setColor(Color.BLACK);
        g.drawRoundRect(bds.getX(), bds.getY(), bds.getWidth(), bds.getHeight(),
                2 * BORDER, 2 * BORDER);
        GraphicsUtil.switchToWidth(g, 1);
        painter.drawPort(CLR);
        painter.drawPort(WE);
        painter.drawPort(IN);
View Full Code Here

            BitWidth width = attrs.getValue(StdAttr.WIDTH);
            if (width == BitWidth.ONE) {
                g.drawOval(x + bds.getX() + 1, y + bds.getY() + 1,
                    bds.getWidth() - 1, bds.getHeight() - 1);
            } else {
                g.drawRoundRect(x + bds.getX() + 1, y + bds.getY() + 1,
                    bds.getWidth() - 1, bds.getHeight() - 1, 6, 6);
            }
        } else {
            g.drawRect(x + bds.getX() + 1, y + bds.getY() + 1,
                bds.getWidth() - 1, bds.getHeight() - 1);
View Full Code Here

        if (attrs.type == EndData.OUTPUT_ONLY) {
            if (attrs.width.getWidth() == 1) {
                g.drawOval(x + 1, y + 1,
                    bds.getWidth() - 1, bds.getHeight() - 1);
            } else {
                g.drawRoundRect(x + 1, y + 1,
                    bds.getWidth() - 1, bds.getHeight() - 1, 6, 6);
            }
        } else {
            g.drawRect(x + 1, y + 1,
                bds.getWidth() - 1, bds.getHeight() - 1);
View Full Code Here

    }

    g.setColor(color);
    g.fillRoundRect(0, 0, 31, 31, 16, 16);
    g.setColor(Color.BLACK);
    g.drawRoundRect(0, 0, 31, 31, 16, 16);

    return new MultiImageIcon(new ImageIcon(image));
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.