コード例 #1
0
  /** Draws this connector. */
  public void draw(Graphics g) {
    Rectangle r = displayBox();

    g.setColor(Color.blue);
    g.fillOval(r.x, r.y, r.width, r.height);
    g.setColor(Color.black);
    g.drawOval(r.x, r.y, r.width, r.height);
  }
コード例 #2
0
  /** Prints the drawing. */
  public void print() {
    tool().deactivate();
    PrintJob printJob = getToolkit().getPrintJob(this, "Print Drawing", null);

    if (printJob != null) {
      Graphics pg = printJob.getGraphics();

      if (pg != null) {
        ((StandardDrawingView) view()).printAll(pg);
        pg.dispose(); // flush page
      }
      printJob.end();
    }
    tool().activate();
  }
コード例 #3
0
 /**
  * Draws the background. If a background pattern is set it is used to fill the background.
  * Otherwise the background is filled in the background color.
  */
 public void drawBackground(Graphics g) {
   g.setColor(getBackground());
   g.fillRect(0, 0, getBounds().width, getBounds().height);
 }
コード例 #4
0
 public void drawFrame(Graphics g) {
   Rectangle r = displayBox();
   g.drawRoundRect(r.x, r.y, r.width - 1, r.height - 1, fArcWidth, fArcHeight);
 }
コード例 #5
0
 public void drawBackground(Graphics g) {
   Rectangle r = displayBox();
   g.fillRoundRect(r.x, r.y, r.width, r.height, fArcWidth, fArcHeight);
 }
コード例 #6
0
  /*
  	public void paintBackground(Graphics g) { }

  	public void paintNormal(Graphics g) {
  		if (fIcon.normal() != null)
  			g.drawImage(fIcon.normal(), 0, 0, this);
  	}

  	public void paintPressed(Graphics g) {
  		if (fIcon.pressed() != null)
  			g.drawImage(fIcon.pressed(), 0, 0, this);
  	}
  */
  public void paintSelected(Graphics g) {
    if (fIcon.selected() != null) {
      g.drawImage(fIcon.selected(), 0, 0, this);
    }
  }