Class ImagePanel

All Implemented Interfaces:
KeyListener, MouseListener, MouseMotionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class ImagePanel extends JPanel implements ImageObserver, MouseListener, MouseMotionListener, KeyListener
Class for controlling the display of color images.
Version:
$Revision: 1.71 $
Author:
Jeff McWhirter
See Also:
  • Constructor Details

    • ImagePanel

      public ImagePanel()
      NOOP ctor
  • Method Details

    • keyPressed

      public void keyPressed(KeyEvent e)
      Specified by:
      keyPressed in interface KeyListener
    • keyReleased

      public void keyReleased(KeyEvent e)
      Noop
      Specified by:
      keyReleased in interface KeyListener
      Parameters:
      e - The event
    • keyTyped

      public void keyTyped(KeyEvent e)
      Noop
      Specified by:
      keyTyped in interface KeyListener
      Parameters:
      e - The event
    • mouseMoved

      public void mouseMoved(MouseEvent e)
      Noop
      Specified by:
      mouseMoved in interface MouseMotionListener
      Parameters:
      e - The event
    • mouseClicked

      public void mouseClicked(MouseEvent e)
      Specified by:
      mouseClicked in interface MouseListener
    • mouseEntered

      public void mouseEntered(MouseEvent e)
      Noop
      Specified by:
      mouseEntered in interface MouseListener
      Parameters:
      e - The event
    • mouseExited

      public void mouseExited(MouseEvent e)
      Noop
      Specified by:
      mouseExited in interface MouseListener
      Parameters:
      e - The event
    • mousePressed

      public void mousePressed(MouseEvent event)
      Mouse was pressed
      Specified by:
      mousePressed in interface MouseListener
      Parameters:
      event - The event
    • mouseReleased

      public void mouseReleased(MouseEvent event)
      Specified by:
      mouseReleased in interface MouseListener
    • mouseDragged

      public void mouseDragged(MouseEvent event)
      Specified by:
      mouseDragged in interface MouseMotionListener
    • setSelectedFile

      public void setSelectedFile(int theIndex)
      Set the selected file. Will change index if it is invalid
      Parameters:
      theIndex - Index of the file.
    • loadFile

      public void loadFile(String theFile)
      Load the file into the preview. This uses the local loadingImage image object and listens for changes on it. When its ready to load we then load it into the panel
      Parameters:
      theFile - The image file (or url) to load
    • setFiles

      public void setFiles(List list)
    • getFiles

      public List getFiles()
    • getCurrentIndex

      public int getCurrentIndex()
    • imageUpdate

      public boolean imageUpdate(Image img, int flags, int x, int y, int width, int height)
      Handle the image update
      Specified by:
      imageUpdate in interface ImageObserver
      Overrides:
      imageUpdate in class Component
      Parameters:
      img - img
      flags - flags
      x - x
      y - y
      width - width
      height - height
      Returns:
      keep going
    • loadingImageDone

      public void loadingImageDone(Image image)
    • doZoomIn

      protected void doZoomIn()
    • doZoomOut

      protected void doZoomOut()
      zoom out
    • paint

      public void paint(Graphics g)
      Overrides:
      paint in class JComponent
    • setImage

      public void setImage(Image image)
    • getImage

      public Image getImage()