Package java.awt

Examples of java.awt.Graphics.drawRect()


    if (painter.getGateShape() == AppPreferences.SHAPE_SHAPED) {
      int[] xp = {   0,  -5,   5,  -5,   5, -50 };
      int[] yp = { -25, -23, -19, -15, -11, -7, -5};
      g.drawPolyline(xp, yp, xp.length);
    } else {
      g.drawRect(-5, -25, 10, 20);
    }
    if (rotate != 0.0) {
      ((Graphics2D) g).rotate(-rotate);
    }
  }
View Full Code Here


                break;
            case ZOOM:
                repaint();
                Graphics gcomp = getGraphics();
                gcomp.setColor(Color.black);
                gcomp.drawRect(min(mouseClick[0], mouseCurent[0]), min(mouseClick[1], mouseCurent[1]), abs(mouseCurent[0] - mouseClick[0]), abs(mouseCurent[1] - mouseClick[1]));
                break;
        }
        //repaint();
    }
View Full Code Here

                int minx = Math.min(_zoomx, _zoomxn);
                int maxx = Math.max(_zoomx, _zoomxn);
                int miny = Math.min(_zoomy, _zoomyn);
                int maxy = Math.max(_zoomy, _zoomyn);
                graphics.setXORMode(_boxColor);
                graphics.drawRect(minx, miny, maxx - minx, maxy - miny);
                graphics.setPaintMode();

                // constrain to be in range
                if (y > _lry) {
                    y = _lry;
View Full Code Here

            // Erase previous rectangle.
            graphics.setXORMode(_boxColor);

            int x_diff = Math.abs(_zoomx - _zoomxn);
            int y_diff = Math.abs(_zoomy - _zoomyn);
            graphics.drawRect(_zoomx - 15 - x_diff, _zoomy - 15 - y_diff,
                    30 + (x_diff * 2), 30 + (y_diff * 2));
            graphics.setPaintMode();

            // Calculate zoom factor.
            double a = (Math.abs(_zoomx - x)) / 30.0;
View Full Code Here

                if (y < _zoomy) {
                    _zoomout = true;

                    // Draw reference box.
                    graphics.setXORMode(_boxColor);
                    graphics.drawRect(_zoomx - 15, _zoomy - 15, 30, 30);
                } else if (y > _zoomy) {
                    _zoomin = true;
                }
            }
View Full Code Here

                    int minx = Math.min(_zoomx, _zoomxn);
                    int maxx = Math.max(_zoomx, _zoomxn);
                    int miny = Math.min(_zoomy, _zoomyn);
                    int maxy = Math.max(_zoomy, _zoomyn);
                    graphics.setXORMode(_boxColor);
                    graphics.drawRect(minx, miny, maxx - minx, maxy - miny);
                }

                // Draw a new box if necessary.
                if (y > _zoomy) {
                    _zoomxn = x;
View Full Code Here

                    int minx = Math.min(_zoomx, _zoomxn);
                    int maxx = Math.max(_zoomx, _zoomxn);
                    int miny = Math.min(_zoomy, _zoomyn);
                    int maxy = Math.max(_zoomy, _zoomyn);
                    graphics.setXORMode(_boxColor);
                    graphics.drawRect(minx, miny, maxx - minx, maxy - miny);
                    _drawn = true;
                    return;
                } else {
                    _drawn = false;
                }
View Full Code Here

                // Erase previous box if necessary.
                if (((_zoomxn != -1) || (_zoomyn != -1)) && (_drawn == true)) {
                    int x_diff = Math.abs(_zoomx - _zoomxn);
                    int y_diff = Math.abs(_zoomy - _zoomyn);
                    graphics.setXORMode(_boxColor);
                    graphics.drawRect(_zoomx - 15 - x_diff, _zoomy - 15
                            - y_diff, 30 + (x_diff * 2), 30 + (y_diff * 2));
                }

                if (y < _zoomy) {
                    _zoomxn = x;
View Full Code Here

                    _zoomyn = y;

                    int x_diff = Math.abs(_zoomx - _zoomxn);
                    int y_diff = Math.abs(_zoomy - _zoomyn);
                    graphics.setXORMode(_boxColor);
                    graphics.drawRect(_zoomx - 15 - x_diff, _zoomy - 15
                            - y_diff, 30 + (x_diff * 2), 30 + (y_diff * 2));
                    _drawn = true;
                    return;
                } else {
                    _drawn = false;
View Full Code Here

                int l = 0;
                // Disegno dei grafici
                for (int row = 0; row < Elenco.length; row++) {
                  for (int col = 0; col < Elenco.length; col++) {
                    g.setColor(Color.BLACK);
                    g.drawRect(col * WIDTH_TOT, row * HEIGHT_TOT, WIDTH_TOT, HEIGHT_TOT);
                    if (col == row) {
                      // Scrittura della variabile
                      Graphics2D gr = (Graphics2D) g;
                      gr.setFont(new Font("Arial", Font.BOLD, 13));
                      FontRenderContext context = gr.getFontRenderContext();
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.