Exemplo n.º 1
0
 /**
  * Constructor
  *
  * @param pict the picture to display
  * @exception IOException problem while reading the picture
  * @exception QDException problem while displaying the picture
  */
 public QDCanvas(QDPicture pict) throws IOException, QDException {
   super();
   this.pict = pict;
   this.port = new QDAwtPort(this);
   Rectangle bounds = pict.getBounds();
   setBounds(bounds);
 } // QDCanvas
Exemplo n.º 2
0
 /**
  * Basic component method - draw the picture The code is not fault-tolerant at all.
  *
  * @param g the AWT graphic object
  */
 public void paint(Graphics g) {
   try {
     port.setPortGraphics(g);
     setCursor(processing);
     pict.execute(port);
     setCursor(idle);
   } catch (Exception e) {
     e.printStackTrace();
     System.exit(0);
   }
 } // paint