Class ViewJPanelHistoLUT

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

public class ViewJPanelHistoLUT extends JPanel implements HistoLUTParent, MouseListener, MouseMotionListener
Panel containing the histogram component (the graph) and the lut component (the gradient vertical bar).
Version:
1.0
Author:
Evan McCreedy
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Use serialVersionUID for interoperability.
      See Also:
    • GRAY_LUT

      public static final int GRAY_LUT
      Indicates a grayscale LUT.
      See Also:
    • RGB_LUT

      public static final int RGB_LUT
      Indicates a RGB LUT.
      See Also:
    • colorChooser

      private ViewJColorChooser colorChooser
      The LUT color chooser.
    • componentHistogram

      private ViewJComponentHLUTBase componentHistogram
      The histogram LUT of the image. The square one.
    • componentLUT

      private ViewJComponentLUT componentLUT
      Lookup table of image. The narrow rectangular one.
    • histogram

      private ModelHistogram histogram
      Model histogram.
    • histoLUTType

      private int histoLUTType
      The type of histogram component to show.
    • image

      private ModelImage image
      The image.
    • lut

      private ModelLUT lut
      The grayscale lookup table for the image.
    • LUTIndex

      private int LUTIndex
      The LUT index used when chaning the LUT color by clicking on the ViewJComponentLUT.
    • lutRecorder

      private JDialogRecordLUT lutRecorder
      LUT recorder.
    • parent

      private HistoLUTParent parent
      The component containing this panel.
    • RGBT

      private ModelRGB RGBT
      The RGB lookup table.
  • Constructor Details

    • ViewJPanelHistoLUT

      public ViewJPanelHistoLUT(HistoLUTParent parent, ModelImage image, ModelStorageBase lut, ModelHistogram histogram)
      Create this panel.
      Parameters:
      parent - component which will hold this panel
      image - the image
      lut - the image lut
      histogram - the image histogram
    • ViewJPanelHistoLUT

      public ViewJPanelHistoLUT(HistoLUTParent parent, ModelImage image, ModelLUT lut, ModelHistogram histogram)
      Deprecated.
      Create this panel.
      Parameters:
      parent - component which will hold this panel
      image - the image
      lut - the image lut
      histogram - the image histogram
    • ViewJPanelHistoLUT

      public ViewJPanelHistoLUT(HistoLUTParent parent, ModelImage image, ModelRGB RGBT, ModelHistogram histogram)
      Deprecated.
      Creates a new ViewJPanelHistoLUT object.
      Parameters:
      parent - HistoLUTParent
      image - ModelImage
      RGBT - ModelRGB
      histogram - ModelHistogram
  • Method Details

    • disposeLocal

      public void disposeLocal()
      Deletes local memory.
    • dragPoint

      public void dragPoint(MouseEvent mouseEvent)
      Handle the dragging of a transfer function point.
      Specified by:
      dragPoint in interface HistoLUTParent
      Parameters:
      mouseEvent - the point dragging event
    • finalize

      public void finalize()
      Clean up the panel memory.
      Overrides:
      finalize in class Object
    • getHistoLUTComponent

      public ViewJComponentHLUTBase getHistoLUTComponent()
      Get the histogram LUT component.
      Returns:
      the histogram component
    • getLUTComponent

      public ViewJComponentLUT getLUTComponent()
      Get the LUT component.
      Returns:
      the lut component
    • getLUTRecorder

      public JDialogRecordLUT getLUTRecorder()
      Get the LUT recorder reference.
      Returns:
      JDialogRecordLUT recorder dialog reference
    • initGUI

      public void initGUI()
      Construct the panel.
    • isImageUpdate

      public boolean isImageUpdate()
      Indicates if real-time update of the image should take place.
      Specified by:
      isImageUpdate in interface HistoLUTParent
      Returns:
      true if real time update should take place
    • mouseClicked

      public void mouseClicked(MouseEvent mouseEvent)
      Calls color chooser.
      Specified by:
      mouseClicked in interface MouseListener
      Parameters:
      mouseEvent - Event that triggered function
    • mouseDragged

      public void mouseDragged(MouseEvent mouseEvent)
      Continually updates the image depending on where the mouse is.
      Specified by:
      mouseDragged in interface MouseMotionListener
      Parameters:
      mouseEvent - event that triggered this function
    • mouseEntered

      public void mouseEntered(MouseEvent mouseEvent)
      Unchanged.
      Specified by:
      mouseEntered in interface MouseListener
      Parameters:
      mouseEvent - event
    • mouseExited

      public void mouseExited(MouseEvent mouseEvent)
      Unchanged.
      Specified by:
      mouseExited in interface MouseListener
      Parameters:
      mouseEvent - event
    • mouseMoved

      public void mouseMoved(MouseEvent mouseEvent)
      Changes the LUT text field display based on the Y value of the mouse when inside ViewJComponentLUT.
      Specified by:
      mouseMoved in interface MouseMotionListener
      Parameters:
      mouseEvent - Event that triggered this function
    • mousePressed

      public void mousePressed(MouseEvent mouseEvent)
      Checks whether the user is making new points in the lut function or not.
      Specified by:
      mousePressed in interface MouseListener
      Parameters:
      mouseEvent - event that triggered function
    • mouseReleased

      public void mouseReleased(MouseEvent mouseEvent)
      Updates the image and shows it in case a new point has been added to the function (or removed).
      Specified by:
      mouseReleased in interface MouseListener
      Parameters:
      mouseEvent - the event that triggered this function
    • setAllOff

      public void setAllOff()
      Accessor to disable the all RGB color channels button if one of the lines has moved.
      Specified by:
      setAllOff in interface HistoLUTParent
    • setLUT

      public void setLUT(ModelLUT newLUT)
      Replaces the LUT and builds a new LUT component.
      Specified by:
      setLUT in interface HistoLUTParent
      Parameters:
      newLUT - New LUT
    • setRangeText

      public void setRangeText(float x, float y, int _index)
      Set the range value of the text field.
      Specified by:
      setRangeText in interface HistoLUTParent
      Parameters:
      x - the x threshold range value
      y - the y threshold range value
      _index - the cursor index
    • showLUTRecorder

      public void showLUTRecorder()
      Show the LUT recorder dialog.
    • updateComponentLUT

      public void updateComponentLUT()
      Redraw the componentLUT.
      Specified by:
      updateComponentLUT in interface HistoLUTParent
    • updateFrames

      public void updateFrames(boolean flag)
      Update all of the image frames that display the image this histo lut is for.
      Specified by:
      updateFrames in interface HistoLUTParent
      Parameters:
      flag - this boolean indicates if the frame that displays the image should re-export the image and apply new LUT
      See Also:
    • updateLUTPositionString

      public void updateLUTPositionString(String str)
      Sets the position string in the LUT text field.
      Specified by:
      updateLUTPositionString in interface HistoLUTParent
      Parameters:
      str - the position string
    • updateLUTRecorder

      public void updateLUTRecorder()
      Update the LUT recorder table transfer function.
    • updateLUTRecorder

      public void updateLUTRecorder(ModelLUT _lut)
      Update the LUT table of LUTRecorder.
      Parameters:
      _lut - ModelLUT lut table
    • updateThresholdFields

      public void updateThresholdFields(float lower, float upper)
      Method to update the threshold text fields when the lower or upper threshold changes.
      Specified by:
      updateThresholdFields in interface HistoLUTParent
      Parameters:
      lower - the lower threshold value
      upper - the upper threshold value