Package java.awt

Examples of java.awt.Graphics.drawRect()


    @Override
    public void paint(InstancePainter painter) {
      Bounds bds = getBounds(painter);
      Graphics g = painter.getGraphics();
      g.setColor(Color.RED);
      g.drawRect(bds.getX(), bds.getY(), bds.getWidth(), bds.getHeight());
      g.setColor(Color.BLACK);
    }
 
    @Override
    public void keyTyped(InstanceState state, KeyEvent e) {
View Full Code Here


            y += delta.getY();
          }
          x = (int) Math.round(zoom * x);
          y = (int) Math.round(zoom * y);
          gCopy.clearRect(x - offs, y - offs, size, size);
          gCopy.drawRect(x - offs, y - offs, size, size);
        }
      }
      Handle selHandle = selection.getSelectedHandle();
      if (selHandle != null) {
        int x = selHandle.getX();
View Full Code Here

    g.setColor(Color.black);
    if (painter.getGateShape() == AppPreferences.SHAPE_RECTANGULAR) {
      if (toolIconRect != null) {
        toolIconRect.paintIcon(painter.getDestination(), g, 2, 2);
      } else {
        g.drawRect(0, 2, 16, 16);
        GraphicsUtil.drawCenteredText(g, RECT_LABEL, 8, 8);
        g.drawOval(16, 8, 4, 4);
      }
    } else if (painter.getGateShape() == AppPreferences.SHAPE_DIN40700) {
      if (toolIconDin != null) {
View Full Code Here

      }
    } else if (painter.getGateShape() == AppPreferences.SHAPE_DIN40700) {
      if (toolIconDin != null) {
        toolIconDin.paintIcon(painter.getDestination(), g, 2, 2);
      } else {
        g.drawRect(0, 2, 16, 16);
        GraphicsUtil.drawCenteredText(g, RECT_LABEL, 8, 8);
        g.drawOval(16, 8, 4, 4);
      }
    } else {
      if (toolIcon != null) {
View Full Code Here

    Graphics g = painter.getGraphics();
    g.setColor(Color.RED);
    int wid = 7 * len + 2; // width of caret rectangle
    int ht = 16; // height of caret rectangle
    g.drawRect(bds.getX() + (bds.getWidth() - wid) / 2,
        bds.getY() + (bds.getHeight() - ht) / 2, wid, ht);
    g.setColor(Color.BLACK);
  }

  /** Processes a key by just adding it onto the end of the current value. */
 
View Full Code Here

    final Graphics graphics = gfx.create();
    graphics.setColor(value);
    graphics.fillRect(box.x, box.y, box.width, box.height);
    graphics.setColor(Color.BLACK);
    graphics.drawRect(box.x, box.y, box.width, box.height);
    graphics.dispose();
  }

  public String getJavaInitializationString()
  {
View Full Code Here

                Color foreColor = next.getForegroundColor();
                if (foreColor == null) {
                    foreColor = Color.BLACK;
                }
                g.setColor(foreColor);
                g.drawRect(next.myLeftX, next.myTopY, next.myWidth,
                        next.myHeight);
            } else {
                g.setColor(next.getBackgroundColor());
                g.fillRect(next.myLeftX, next.myTopY, next.myWidth,
                        next.myHeight);
View Full Code Here

            g.fillRect(0, 0, s.width - 1, s.height - 1);
            int px = 0;
            int py = 0;
            g.setColor(borderColor);
            for (int i = 0; i < borderWidth; i++) {
                g.drawRect(px, py, s.width - px - 1, s.height - py - 1);
                px++;
                py++;
            }
            if (insets != null) {
                px += insets.left;
View Full Code Here

    currHeight = height;
   
    if (dragRect != null)
    {
      graphics.setColor(Color.black);
      graphics.drawRect(dragRect.x, dragRect.y, dragRect.width, dragRect.height);
    }
  }

   
  public Vector getChunkVisInfosForPoint(Point p)
View Full Code Here

   
    if (dragRect != null)
    {
      //System.out.println("drawing: " + dragRect.toString());
      graphics.setColor(Color.black);
      graphics.drawRect(dragRect.x, dragRect.y, dragRect.width, dragRect.height);
    }
   
    currXMulti = xMulti;
    currHeight = height;
  }
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.