Examples of drawRect()


Examples of java.awt.Graphics.drawRect()

        }
      }
    }
    g.setColor(Color.BLACK);
    GraphicsUtil.switchToWidth(g, 2);
    g.drawRect(bds.getX(), bds.getY(), bds.getWidth(), bds.getHeight());
    GraphicsUtil.switchToWidth(g, 1);
    painter.drawPorts();
  }
 
  private static class State implements InstanceData, Cloneable {
View Full Code Here

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 stopEditing(InstanceState state) {
View Full Code Here

Examples of java.awt.Graphics.drawRect()

 
  @Override
  public void paintIconRectangular(InstancePainter painter) {
    Graphics g = painter.getGraphics();
    g.setColor(Color.black);
    g.drawRect(1, 2, 16, 16);
    Font old = g.getFont();
    g.setFont(old.deriveFont(9.0f));
    GraphicsUtil.drawCenteredText(g, "2k", 96);
    GraphicsUtil.drawCenteredText(g, "+1", 9, 13);
    g.setFont(old);
View Full Code Here

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

Examples of java.awt.Graphics.drawRect()

            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

Examples of java.awt.Graphics.drawRect()

    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

Examples of java.awt.Graphics.drawRect()

      }
    } 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

Examples of java.awt.Graphics.drawRect()

    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

Examples of java.awt.Graphics.drawRect()

    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

Examples of java.awt.Graphics.drawRect()

                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
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.