Package java.awt

Examples of java.awt.Graphics.drawRect()


  for(int i=0; i<m_selectedAttribs.length; i++) {
    if(e.getX()>=xpos && e.getX()<=xpos+cellSize+extpad)
      if(e.getY()>=ypos && e.getY()<=ypos+cellSize+extpad) {
        if(xpos!=lastxpos || ypos!=lastypos) {
    g.setColor( Color.red );
    g.drawRect(xpos-1, ypos-1, cellSize+1, cellSize+1);
    if(lastxpos!=0 && lastypos!=0) {
      g.setColor( this.getBackground().darker() );
      g.drawRect(lastxpos-1, lastypos-1, cellSize+1, cellSize+1); }
    lastxpos = xpos; lastypos = ypos;
        }
View Full Code Here


        if(xpos!=lastxpos || ypos!=lastypos) {
    g.setColor( Color.red );
    g.drawRect(xpos-1, ypos-1, cellSize+1, cellSize+1);
    if(lastxpos!=0 && lastypos!=0) {
      g.setColor( this.getBackground().darker() );
      g.drawRect(lastxpos-1, lastypos-1, cellSize+1, cellSize+1); }
    lastxpos = xpos; lastypos = ypos;
        }
        return;
      }
    xpos+=cellSize+extpad;
View Full Code Here

  xpos=extpad;
  ypos+=cellSize+extpad;
      }
      if(lastxpos!=0 && lastypos!=0) {
  g.setColor( this.getBackground().darker() );
  g.drawRect(lastxpos-1, lastypos-1, cellSize+1, cellSize+1); }
      lastxpos=lastypos=0;
    }

    public void mouseDragged(MouseEvent e){ }
View Full Code Here

    m_shapePoints.addElement(new Double(e.getY()));
    //    Graphics g = PlotPanel.this.getGraphics();
    Graphics g = m_plot2D.getGraphics();
    g.setColor(Color.black);
    g.setXORMode(Color.white);
    g.drawRect(((Double)m_shapePoints.elementAt(1)).intValue(),
         ((Double)m_shapePoints.elementAt(2)).intValue(),
         ((Double)m_shapePoints.elementAt(3)).intValue() -
         ((Double)m_shapePoints.elementAt(1)).intValue(),
         ((Double)m_shapePoints.elementAt(4)).intValue() -
         ((Double)m_shapePoints.elementAt(2)).intValue());
View Full Code Here

        if (((Double)m_shapePoints.elementAt(0)).intValue() == 1) {
    m_createShape = false;
    Graphics g = m_plot2D.getGraphics();
    g.setColor(Color.black);
    g.setXORMode(Color.white);
    g.drawRect(((Double)m_shapePoints.elementAt(1)).
         intValue(),
         ((Double)m_shapePoints.elementAt(2)).intValue(),
         ((Double)m_shapePoints.elementAt(3)).intValue() -
         ((Double)m_shapePoints.elementAt(1)).intValue(),
         ((Double)m_shapePoints.elementAt(4)).intValue() -
View Full Code Here

      if (m_createShape) {
        if (((Double)m_shapePoints.elementAt(0)).intValue() == 1) {
    Graphics g = m_plot2D.getGraphics();
    g.setColor(Color.black);
    g.setXORMode(Color.white);
    g.drawRect(((Double)m_shapePoints.elementAt(1)).intValue(),
         ((Double)m_shapePoints.elementAt(2)).intValue(),
         ((Double)m_shapePoints.elementAt(3)).intValue() -
         ((Double)m_shapePoints.elementAt(1)).intValue(),
         ((Double)m_shapePoints.elementAt(4)).intValue() -
         ((Double)m_shapePoints.elementAt(2)).intValue());
View Full Code Here

         ((Double)m_shapePoints.elementAt(2)).intValue());
   
    m_shapePoints.setElementAt(new Double(e.getX()), 3);
    m_shapePoints.setElementAt(new Double(e.getY()), 4);
   
    g.drawRect(((Double)m_shapePoints.elementAt(1)).intValue(),
         ((Double)m_shapePoints.elementAt(2)).intValue(),
         ((Double)m_shapePoints.elementAt(3)).intValue() -
         ((Double)m_shapePoints.elementAt(1)).intValue(),
         ((Double)m_shapePoints.elementAt(4)).intValue() -
         ((Double)m_shapePoints.elementAt(2)).intValue());
View Full Code Here

        int len = (width + 3) / 4;

        Graphics g = painter.getGraphics();
        g.setColor(Color.RED);
        if (len > 4) {
            g.drawRect(bds.getX(), bds.getY() + 3, bds.getWidth(), 25);
        } else {
            int wid = 7 * len + 2;
            g.drawRect(bds.getX() + (bds.getWidth() - wid) / 2, bds.getY() + 4, wid, 15);
        }
        g.setColor(Color.BLACK);
View Full Code Here

    protected abstract void paintIconShaped(InstancePainter painter);

    protected void paintIconRectangular(InstancePainter painter) {
        Graphics g = painter.getGraphics();
        g.drawRect(1, 2, 16, 16);
        if (negateOutput) {
            g.drawOval(16, 8, 4, 4);
        }

        String label = getRectangularLabel(painter.getAttributeSet());
View Full Code Here

        g.setColor(Color.RED);
        if (len > 4) {
            g.drawRect(bds.getX(), bds.getY() + 3, bds.getWidth(), 25);
        } else {
            int wid = 7 * len + 2;
            g.drawRect(bds.getX() + (bds.getWidth() - wid) / 2, bds.getY() + 4, wid, 15);
        }
        g.setColor(Color.BLACK);
    }

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