Module org.jpo
Package org.jpo.gui

Class OverlayedPictureController

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, ScalablePictureListener

public class OverlayedPictureController extends PictureController implements ScalablePictureListener
Overrides the Picture Controller with functionality to overlay the picture with information

The showInfo flag controls whether information about the picture is overlayed on the image.

See Also:
  • Constructor Details

    • OverlayedPictureController

      public OverlayedPictureController(ScalablePicture scalablePicture)
      Constructs the overlay that can show an info panel
      Parameters:
      scalablePicture - a reference to the picture
  • Method Details

    • cycleInfoDisplay

      public void cycleInfoDisplay()
      This function cycles to the next info display. The first is DISPLAY_NONE, DISPLAY_PHOTOGRAPHIC and DISPLAY_APPLICATION
    • setPicture

      public void setPicture(PictureInfo pictureInfo)
      Brings up the indicated picture on the display.
      Parameters:
      pictureInfo - The pictureInfo to display
    • paintComponent

      public void paintComponent(Graphics g)
      Overriding the paint to add the drawing of the info panel
      Overrides:
      paintComponent in class PictureController
      Parameters:
      g - Graphics
    • scalableStatusChange

      public void scalableStatusChange(ScalablePicture.ScalablePictureStatus pictureStatusCode, String pictureStatusMessage)
      method that gets invoked from the ScalablePicture object to notify of status changes. The ScalablePicture goes through several statuses: UNINITIALISED, GARBAGE_COLLECTION, LOADING, SCALING, READY, ERROR.

      Each status is passed to the listener upon receipt.

      When the ScalablePicture signals that it is READY the legend of the picture is sent to the listener. The method PictureController.centerImage() is called and a repaint is requested.

      Specified by:
      scalableStatusChange in interface ScalablePictureListener
      Parameters:
      pictureStatusCode - New Status Code
      pictureStatusMessage - New Status Message
    • sourceLoadProgressNotification

      public void sourceLoadProgressNotification(SourcePicture.SourcePictureStatus statusCode, int percentage)
      pass messages about progress onto the PictureViewer for updating of the progress bar
      Specified by:
      sourceLoadProgressNotification in interface ScalablePictureListener
      Parameters:
      statusCode - status code
      percentage - percentage
    • addStatusListener

      public void addStatusListener(ScalablePictureListener listener)
      method to register the listening object of the status events
      Parameters:
      listener - Listener
    • getScalablePicture

      public ScalablePicture getScalablePicture()
      method that returns a handle to the scalable picture that this component is displaying
      Returns:
      the scaled image