Package java.awt

Examples of java.awt.Graphics.drawOval()


        } else if (dir == Direction.SOUTH) { pinx = 9; piny = 16;
        }

        g.setColor(Color.black);
        if (output) {
            g.drawOval(4, 4, 13, 13);
        } else {
            g.drawRect(4, 4, 13, 13);
        }
        g.setColor(Value.TRUE.getColor());
        g.fillOval(7, 788);
View Full Code Here


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

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

        GraphicsUtil.switchToWidth(g, 2);
        boolean output = attrs.isOutput();
        if (output) {
            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);
            }
View Full Code Here

            g.setColor(val == desired ? onColor : offColor);
            g.fillOval(bds.getX(), bds.getY(), bds.getWidth(), bds.getHeight());
        }
        g.setColor(Color.BLACK);
        GraphicsUtil.switchToWidth(g, 2);
        g.drawOval(bds.getX(), bds.getY(), bds.getWidth(), bds.getHeight());
        GraphicsUtil.switchToWidth(g, 1);
        g.setColor(painter.getAttributeValue(Io.ATTR_LABEL_COLOR));
        painter.drawLabel();
        painter.drawPorts();
    }
View Full Code Here

        int y = bds.getY();
        GraphicsUtil.switchToWidth(g, 2);
        g.setColor(Color.black);
        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);
            }
View Full Code Here

            if (rctx.animate) {
                do {
                    if (rCArray != null) {
                        g.setColor(rCArray[ci++ & NUM_RANDOMCOLORMASK]);
                    }
                    g.drawOval(x, y, size, size);
                    if ((x -= 3) < 0) x += rctx.maxX;
                    if ((y -= 1) < 0) y += rctx.maxY;
                } while (--numReps > 0);
            } else {
                do {
View Full Code Here

            } else {
                do {
                    if (rCArray != null) {
                        g.setColor(rCArray[ci++ & NUM_RANDOMCOLORMASK]);
                    }
                    g.drawOval(x, y, size, size);
                } while (--numReps > 0);
            }
            rctx.colorindex = ci;
            g.translate(-rctx.orgX, -rctx.orgY);
        }
View Full Code Here

      //drawRoutePoint(g);
      //drawPoiPoint(g);
      g.setColor(Color.pink);
      int x = mapComponent.mc2LonToX(mapComponent.getSEPoint().x);
      int y = mapComponent.mc2LatToY(mapComponent.getSEPoint().y);
      g.drawOval(x, y, 10, 10);
      x = mapComponent.mc2LonToX(mapComponent.getNWPoint().x);
      y = mapComponent.mc2LatToY(mapComponent.getNWPoint().y);
      g.drawOval(x + 15, y + 15, 10, 10);
      x = mapComponent.mc2LonToX(mapComponent.getCPoint().x);
      y = mapComponent.mc2LatToY(mapComponent.getCPoint().y);
View Full Code Here

      int x = mapComponent.mc2LonToX(mapComponent.getSEPoint().x);
      int y = mapComponent.mc2LatToY(mapComponent.getSEPoint().y);
      g.drawOval(x, y, 10, 10);
      x = mapComponent.mc2LonToX(mapComponent.getNWPoint().x);
      y = mapComponent.mc2LatToY(mapComponent.getNWPoint().y);
      g.drawOval(x + 15, y + 15, 10, 10);
      x = mapComponent.mc2LonToX(mapComponent.getCPoint().x);
      y = mapComponent.mc2LatToY(mapComponent.getCPoint().y);
      /**
      System.out.println("CPoint = (" + mapComp.getCPoint().x + "," + mapComp.getCPoint().y + ")");
      System.out.println("SEPoint = (" + mapComp.getSEPoint().x + "," + mapComp.getSEPoint().y + ")");
View Full Code Here

      System.out.println("CPoint = (" + mapComp.getCPoint().x + "," + mapComp.getCPoint().y + ")");
      System.out.println("SEPoint = (" + mapComp.getSEPoint().x + "," + mapComp.getSEPoint().y + ")");
      System.out.println("NWPoint = (" + mapComp.getNWPoint().x + "," + mapComp.getNWPoint().y + ")");
       */
      //System.out.println("CPoint = (" + x + "," + y + ")");
      g.drawOval(x - 5, y - 5, 10, 10);
      //frame.repaint();
      mapPanel.repaint();
   }

   public static void main(String[] args) {
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.