Module org.jpo
Package org.jpo.gui

Class PictureViewer

java.lang.Object
org.jpo.gui.PictureViewer
All Implemented Interfaces:
NodeNavigatorListener, AutoAdvanceInterface

public class PictureViewer extends Object implements NodeNavigatorListener, AutoAdvanceInterface
PictureViewer is a Controller that manages a window which displays a picture. It concerns itself with which picture from the Naviator Context should be displayed. It provides navigation control over the collection as well as mouse and keyboard control over the zooming.

The user can zoom in on a picture coordinate by clicking the left mouse button. The middle button scales the picture so that it fits in the available space and centers it there. The right mouse button zooms out.

Picture Viewer
  • Constructor Details

    • PictureViewer

      public PictureViewer(ShowPictureRequest request)
      This is a Controller that works off a NodeNavigatorInterface. It opens a new window and shows the picture pointed at by the NodeNavigator and the index. It has buttons to navigate, shows the description and responds to mouse actions of the user.
  • Method Details

    • closeViewerTest

      @TestOnly public void closeViewerTest()
      Don't use: accessor to the private closeViewer function for unit tests.
    • getCurrentNodeTest

      @TestOnly public SortableDefaultMutableTreeNode getCurrentNodeTest()
      Don't use: accessor to the private getCurrentNode method for unit tests.
      Returns:
      the current node
    • showNode

      public void showNode(NodeNavigatorInterface newNodeNavigator, int newIndex)
      Puts the picture of the indicated node onto the viewer panel
      Specified by:
      showNode in interface AutoAdvanceInterface
      Parameters:
      newNodeNavigator - The set of nodes from which one picture is to be shown
      newIndex - The index of the set of nodes to be shown. TODO: this should probably become a request from the bus and possibly this should be private The AutoAdvanceDialog is making this problematic
    • nodeLayoutChanged

      public void nodeLayoutChanged()
      gets called when the Navigator notices a change
      Specified by:
      nodeLayoutChanged in interface NodeNavigatorListener
    • startAdvanceTimer

      public void startAdvanceTimer(int seconds)
      This method sets up the Advance Timer
      Specified by:
      startAdvanceTimer in interface AutoAdvanceInterface
      Parameters:
      seconds - Seconds
    • switchWindowMode

      public void switchWindowMode(ResizableJFrame.WindowSize newMode)
      The location and size of the Window can be changed by a call to this method
      Parameters:
      newMode - new window mode