Exemplo n.º 1
0
  /**
   * Add an image to the panel.
   *
   * @param image The image to add.
   * @param url The url the image came from.
   * @param background If <code>true</code>, just add to pending list.
   */
  public void add(final Image image, final URL url, final boolean background) {
    Picture picture;
    int size;

    picture = new Picture();
    picture.setImage(image);
    picture.setURL(url);
    if (background)
      synchronized (mPending) {
        mPending.add(picture);
        size = mPending.size();
        if (mThumbelina.mReadyProgress.getMaximum() < size)
          mThumbelina.mReadyProgress.setMaximum(size);
        mThumbelina.mReadyProgress.setValue(size);
        mPending.notify();
      }
    else place(picture, false);
  }
Exemplo n.º 2
0
 /**
  * Construct a picture from the one given.
  *
  * @param picture The picture to copy.
  */
 public Picture(final Picture picture) {
   super(picture);
   setURL(picture.getURL());
   setImage(picture.getImage());
   setOrigin(picture.getOrigin());
 }
Exemplo n.º 3
0
 /**
  * Construct a picture over the rectangle given.
  *
  * @param r The coordinates of the area.
  */
 public Picture(final Rectangle r) {
   super(r);
   setURL(null);
   setImage(null);
   setOrigin(new Point(r.x, r.y));
 }
Exemplo n.º 4
0
 /**
  * Construct a Picture over the area given.
  *
  * @param x The x coordinate.
  * @param y The y coordinate.
  * @param width The width of the picture.
  * @param height The height of the picture.
  */
 public Picture(final int x, final int y, final int width, final int height) {
   super(x, y, width, height);
   setURL(null);
   setImage(null);
   setOrigin(new Point(x, y));
 }
Exemplo n.º 5
0
 /** Construct a Picture. */
 public Picture() {
   setURL(null);
   setImage(null);
   setOrigin(ORIGIN);
 }