Package java.awt

Examples of java.awt.Graphics.drawLine()



        Point lastPoint = lastVehiclePosition.get(vehicleId);
        Graphics graphics = lblMap.getGraphics();
        graphics.setColor(vehicleColors.get(vehicleId));
        graphics.drawLine(lastPoint.x, lastPoint.y, x, y);


        lastVehiclePosition.put(vehicleId, new Point(x, y));
    }
View Full Code Here


    for (int i = 0; i < 155; i++) {
      int x = random.nextInt(width - 1);
      int y = random.nextInt(height - 1);
      int x1 = random.nextInt(6) + 1;
      int y1 = random.nextInt(12) + 1;
      g.drawLine(x, y, x + x1, y + y1);
    }
    // 该变量用于保存系统生成的随机字符串
    String sRand = "";
    for (int i = 0; i < num; i++) {
      // 取得一个随机字符
View Full Code Here

    for (int i = 0; i < 155; i++) {
      int x = random.nextInt(WIDTH);
      int y = random.nextInt(HEIGHT);
      int xl = random.nextInt(12);
      int yl = random.nextInt(12);
      g.drawLine(x, y, x + xl, y + yl);
    }

    // 取随机产生的认证码(6位数字)
    String sRand = "";
    for (int i = 0; i < 6; i++) {
View Full Code Here

                    int previousX = translator.translateLongitudeToX(previousLocation.getLongitude());
                    int previousY = translator.translateLatitudeToY(previousLocation.getLatitude());
                    VrpLocation location = customer.getLocation();
                    int x = translator.translateLongitudeToX(location.getLongitude());
                    int y = translator.translateLatitudeToY(location.getLatitude());
                    g.drawLine(previousX, previousY, x, y);
                    // Determine where to draw the vehicle info
                    int distance = customer.getDistanceToPreviousAppearance();
                    if (customer.getPreviousAppearance() instanceof VrpCustomer) {
                        if (longestNonDepotDistance < distance) {
                            longestNonDepotDistance = distance;
View Full Code Here

                    }
                    if (needsBackToVehicleLineDraw) {
                        VrpLocation vehicleLocation = vehicle.getLocation();
                        int vehicleX = translator.translateLongitudeToX(vehicleLocation.getLongitude());
                        int vehicleY = translator.translateLatitudeToY(vehicleLocation.getLatitude());
                        g.drawLine(x, y,vehicleX, vehicleY);
                    }
                }
            }
            // Draw vehicle info
            if (vehicleInfoCustomer != null) {
View Full Code Here

                                              0,
                                              this.cellSize * numberOfColumns - 1,
                                              this.cellSize * numberOfRows - 1 );
            backgroundImageGraphics.setColor( CellGridCanvas.GRID_COLOR );
            for ( int x = 1; x < numberOfColumns; x++ ) {
                backgroundImageGraphics.drawLine( x * this.cellSize - 1,
                                                  0,
                                                  x * this.cellSize - 1,
                                                  this.cellSize * numberOfRows - 1 );
            }
            for ( int y = 1; y < numberOfRows; y++ ) {
View Full Code Here

                                                  0,
                                                  x * this.cellSize - 1,
                                                  this.cellSize * numberOfRows - 1 );
            }
            for ( int y = 1; y < numberOfRows; y++ ) {
                backgroundImageGraphics.drawLine( 0,
                                                  y * this.cellSize - 1,
                                                  this.cellSize * numberOfColumns - 1,
                                                  y * this.cellSize - 1 );
            }
        }
View Full Code Here

          if (pP != null)
          {
            int pX = pP.x + (blobSize / 2);
            int pY = pP.y + (blobSize / 2);
            graphics.setColor(featureColor.brighter());
            graphics.drawLine(x + (blobSize / 2), y
                + (blobSize / 2), pX, pY);
          }
        }
        previousPoints[i][j] = new Point(x, y);
View Full Code Here

        og.fillRect((int) x, (int) y - height, intPixelsPerBar, height);
      }
      og.setColor(Color.BLACK);
      int len = 2;
      if (i % 5 == 0) len = 4;
      og.drawLine((int)x, (int)y, (int)x, (int)y + len);
      x += pixelsPerBar;
      if (x > availWidth) {
        x = xBorder;
        y += rowHeight + yBorder;
      }
View Full Code Here

                int priorityBand = ((int) ((y - 42) / ((190 - 42) / 14))) + 1;

                if (priorityBand != currentPriorityBand) {
                    currentPriorityBand = priorityBand;
                    bandsGraphics.setColor(EgaPalette.COLOR_OBJECTS[priorityBand]);
                    bandsGraphics.drawLine(0, y, 319, y);
                }
            }

        } else if (pictureType.equals(PictureType.AGI)) {
            int currentPriorityBand = 4;
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.