Module org.jpo
Package org.jpo.gui

Class ThumbnailController

java.lang.Object
org.jpo.gui.ThumbnailController
All Implemented Interfaces:
ThumbnailQueueRequestCallbackHandler, JpoDropTargetDropEventHandler

public class ThumbnailController extends Object implements JpoDropTargetDropEventHandler, ThumbnailQueueRequestCallbackHandler
ThumbnailController controls a visual representation of the specified node.
  • Constructor Details

    • ThumbnailController

      public ThumbnailController(int thumbnailSize)
      Constructor
      Parameters:
      thumbnailSize - The size in which the thumbnail is to be created
  • Method Details

    • getNode

      Returns the node for which the controller is acting
      Returns:
      the node
    • getThumbnail

      public Thumbnail getThumbnail()
      returns the Thumbnail that is being controlled by this Controller.
      Returns:
      the Thumbnail
    • isAlreadyDisplayingNode

      public boolean isAlreadyDisplayingNode(NodeNavigatorInterface nodeNavigator, int index)
      Returns to the caller whether this ThumbnailController is already linked to the specified node.
      Parameters:
      nodeNavigator - The NodeNavigatorInterface from which the node is coming
      index - The index position that should be checked.
      Returns:
      true if the indicated node is already showing, false if not
    • setNode

      public void setNode(NodeNavigatorInterface mySetOfNodes, int index)
      Sets the node being visualised by this ThumbnailController object.
      Parameters:
      mySetOfNodes - The NodeNavigatorInterface being tracked
      index - The position of this object to be displayed.
    • setShowTimestamp

      public void setShowTimestamp(boolean show)
    • callbackThumbnailCreated

      public void callbackThumbnailCreated(ThumbnailQueueRequest thumbnailQueueRequest)
      Entry point for the callback handler
      Specified by:
      callbackThumbnailCreated in interface ThumbnailQueueRequestCallbackHandler
      Parameters:
      thumbnailQueueRequest - The request from the queue
    • setFactor

      public void setFactor(float thumbnailSizeFactor)
      This method sets the scaling factor for the display of a thumbnail. 0..1
      Parameters:
      thumbnailSizeFactor - Factor
    • setDecorateThumbnails

      public void setDecorateThumbnails(boolean decorateThumbnails)
      Determines whether decorations should be drawn or not
      Parameters:
      decorateThumbnails - Whether to decorate
    • determineMailSelectionStatus

      public void determineMailSelectionStatus()
      determines if the thumbnail is part of the mail selection and changes the drawMailIcon flag to ensure that the mail icon will be place over the image.
    • handleJpoDropTargetDropEvent

      public void handleJpoDropTargetDropEvent(DropTargetDropEvent event)
      Description copied from interface: JpoDropTargetDropEventHandler
      The implementing class must handle the drop event if one occurs.
      Specified by:
      handleJpoDropTargetDropEvent in interface JpoDropTargetDropEventHandler
      Parameters:
      event - The drop event