Example #1
0
 public void paint(Graphics g) {
   g.setColor(Color.black);
   super.paint(g);
   int h = Math.abs(y1 - y2) - 1, w = Math.abs(x1 - x2) - 1;
   // int x0=x1>x2?x2:x1, y0=y1>y2?y2:y1;
   int x0 = 0, y0 = 0;
   g.drawRect(x0, y0, w, h);
 }
Example #2
0
  /** this method paints the line. */
  public void paint(Graphics g) {
    super.paint(g);

    if (GlobalDebug.isOn) System.out.println("Line.paint()");

    g.setColor(Color.black);
    g.drawLine(startX, startY, endX - 1, endY - 1);
    //   g.drawLine(0,0,30,30);
    /*
        if (y1 <= y2) {
          g.drawLine (0,0,x2-x1-1,y2-y1-1);
        }
        else {
          g.drawLine (0,y1-y2-1,x2-x1-1,0);
        }
    */
  }
Example #3
0
  public void paintShapes(final Graphics2D g) {

    // Preprocess
    preProcess();

    calculateScreenCoordinates();

    g3d.setSlabAndDepthValues((int) minZ, (int) maxZ);
    g3d.setSize(getSize(), highQuality);
    g3d.setBackground(Colix.getColix(background));
    g3d.beginRendering(null, highQuality);
    synchronized (shapes) {
      for (Shape shape : shapes) {
        shape.paint(Canvas3D.this, g3d);
      }
    }

    g3d.endRendering();
    Image img = g3d.getScreenImage();
    g.drawImage(img, 0, 0, getWidth(), getHeight(), Canvas3D.this);
  }