Package java.awt

Examples of java.awt.Graphics.drawRect()


                int x, int y, AttributeSet attrs) {
        Graphics g = context.getGraphics();
        Bounds bds = getOffsetBounds(attrs);
        g.setColor(color);
        GraphicsUtil.switchToWidth(g, 2);
        g.drawRect(x + bds.getX(), y + bds.getY(),
            bds.getWidth(), bds.getHeight());
    }

    @Override
    public void paintIcon(ComponentDrawContext context,
View Full Code Here


        Graphics g = context.getGraphics();
        if (toolIcon != null) {
            toolIcon.paintIcon(context.getDestination(), g, x + 2, y + 2);
        } else {
            g.setColor(Color.black);
            g.drawRect(x + 5, y + 2, 11, 17);
            Value[] v = { Value.TRUE, Value.FALSE };
            for (int i = 0; i < 3; i++) {
                g.setColor(v[i % 2].getColor());
                g.fillOval(x + 5 - 1, y + 5 + 5 * i - 1, 3, 3);
                g.setColor(v[(i + 1) % 2].getColor());
View Full Code Here

        @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

        @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

        g.setColor(Color.RED);
        // width of caret rectangle
        int wid = 7 * len + 2;
        // height of caret rectangle
        int ht = 16;
        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

                g.drawOval(p.getX() - 4, p.getY() - 4, 8, 8);
            } else if (stateMap.containsKey(e.state)) {
                CircuitState substate = stateMap.get(e.state);
                Component subcirc = substate.getSubcircuit();
                Bounds b = subcirc.getBounds();
                g.drawRect(b.getX(), b.getY(), b.getWidth(), b.getHeight());
            }
        }
        GraphicsUtil.switchToWidth(g, 1);
    }
View Full Code Here

        g.setColor(Color.white);
        g.fillRect(awtImage.getWidth() / 3, 0, awtImage.getWidth() / 3, awtImage.getHeight() - 1);
        g.setColor(Color.red);
        g.fillRect(awtImage.getWidth() / 3 * 2, 0, awtImage.getWidth() / 3, awtImage.getHeight() - 1);
        g.setColor(Color.black);
        g.drawRect(0, 0, awtImage.getWidth() - 1, awtImage.getHeight() - 1);
        g.dispose();
        return awtImage;
    }

}
View Full Code Here

        g.setColor(Color.white);
        g.fillRect(awtImage.getWidth() / 3, 0, awtImage.getWidth() / 3, awtImage.getHeight() - 1);
        g.setColor(Color.red);
        g.fillRect(awtImage.getWidth() / 3 * 2, 0, awtImage.getWidth() / 3, awtImage.getHeight() - 1);
        g.setColor(Color.black);
        g.drawRect(0, 0, awtImage.getWidth() - 1, awtImage.getHeight() - 1);
        g.dispose();
        return awtImage;
    }

    /**
 
View Full Code Here

    g.setColor(m_ZoomBoxColor);
  if (m_ZoomBoxXORColor == null)
    g.setXORMode(Color.white);
  else
    g.setXORMode(m_ZoomBoxXORColor);
  g.drawRect(m_oldMousePos.width, m_oldMousePos.height,
       m_newMousePos.width - m_oldMousePos.width,
       m_newMousePos.height - m_oldMousePos.height);
  g.dispose();
      }
      else {
View Full Code Here

  g.setColor(m_ZoomBoxColor);
      if (m_ZoomBoxXORColor == null)
  g.setXORMode(Color.white);
      else
  g.setXORMode(m_ZoomBoxXORColor);
      g.drawRect(m_oldMousePos.width, m_oldMousePos.height,
     m_newMousePos.width - m_oldMousePos.width,
     m_newMousePos.height - m_oldMousePos.height);
      g.dispose();
     
     
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.