jpl.mipl.jade.tools.stereo.api
Class ApplicationModel

java.lang.Object
  extended by jpl.mipl.mars.viewer.api.PropertyManagerImpl
      extended by jpl.mipl.jade.tools.stereo.api.ApplicationModel
All Implemented Interfaces:
PropertyManager

public class ApplicationModel
extends PropertyManagerImpl

Purpose: Model class for use with the SIth application.

   Copyright 2008, California Institute of Technology.
   ALL RIGHTS RESERVED.
   U.S. Government Sponsorship acknowledge. 2008.
   
 ============================================================================
 Modification History :
 ----------------------

 Date              Who              What
 ----------------------------------------------------------------------------
 03/07/2008        Nick             Initial Release
 ============================================================================
 

Version:
$Id: ApplicationModel.java,v 1.7 2008/05/29 23:34:39 ntt Exp $
Author:
Nicholas Toole (Nicholas.T.Toole@jpl.nasa.gov)

Field Summary
 
Fields inherited from class jpl.mipl.mars.viewer.api.PropertyManagerImpl
_changes, _optionsMap
 
Constructor Summary
ApplicationModel()
          Constructs new instance of ApplicationModel.
 
Method Summary
protected  void checkSystemPropertyOverrides()
           
 ImageTriple getImageTriple()
           
 String getLineNumber()
          Returns line number.
 double getPercentStretchMax()
          Returns the upper bound on the percent stretch range.
 double getPercentStretchMin()
          Returns the lower bound on the percent stretch range.
 Point getPosition()
          Returns copy of current position to prevent destructive behavior
 ImagePreferences getPreferenceRegistry()
          Sets preference for a given property of an image type.
 float getRotationAngle()
          Returns current rotation angle, in radians, from range -pi to pi.
 String getSampleNumber()
          Returns sample number.
 String getStatusMessage()
          Returns current status to be displayed as part of GUI.
 StereoState getStereoUiModel()
           
 int getStretchType()
          Returns the active stretch type for application.
 boolean getUsePreferences()
          Returns boolean value dictating whether application components should check for preferences.
 boolean getViewOverlays()
          Returns flag of whether session is in regular-view-mode or overlay-view mode.
 float getZoomFactor()
          Returns current zoom factor.
protected  void handleNewImageTriple()
          Application logic of taking new image set, creating image contents from them, and setting those contents as the active image content set.
protected  void handleOverlayEnabled()
          Application logic of taking new image set, creating image contents from them, and setting those contents as the active image content set.
protected  void initState()
           
 boolean isStereoEnabled()
           
 void setImageTriple(ImageTriple triple)
           
 void setLineNumber(String l_num)
          Set current line number of mouse position over current image.
 void setPercentStretchMax(double max)
          Sets the lower bound percent for percent stretch.
 void setPercentStretchMin(double min)
          Sets the lower bound percent for percent stretch.
 void setPosition(Point newPosition)
          Sets the current JadeDisplay position so that all views are synchronized
 void setRotationAngle(float angle)
          Sets the rotation angle used by the JAI rotate operator
 void setSampleNumber(String s_num)
          Set current sample number of mouse position over current image.
 void setStatusMessage(String statMsg)
          Set current status message.
 void setStereoEnabled(boolean flag)
           
 void setStereoUiModel(StereoState stereoModel)
           
 void setStretchType(int stretchType)
          Sets the active stretch type for application.
 void setUsePreferences(boolean usePreferences)
          Enables/disables whether application components should check for preferences.
 void setViewOverlays(boolean viewOverlays)
          Set overlay view flag.
 void setZoomFactor(float zoom)
          Sets the zoom factor used by the JAI scale operator
 
Methods inherited from class jpl.mipl.mars.viewer.api.PropertyManagerImpl
addPropertyChangeListener, getBooleanProperty, getDoubleProperty, getFloatProperty, getIntProperty, getLongProperty, getProperty, getStringProperty, isPropertySet, removePropertyChangeListener, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplicationModel

public ApplicationModel()
Constructs new instance of ApplicationModel.

Method Detail

initState

protected void initState()

checkSystemPropertyOverrides

protected void checkSystemPropertyOverrides()
Overrides:
checkSystemPropertyOverrides in class PropertyManagerImpl

setZoomFactor

public void setZoomFactor(float zoom)
Sets the zoom factor used by the JAI scale operator

Parameters:
zoom - New zoom factor, must be positive.
Throws:
IllegalArgumentException - if parameter is non-positve

getZoomFactor

public float getZoomFactor()
Returns current zoom factor.

Returns:
Zoom factor

setRotationAngle

public void setRotationAngle(float angle)
Sets the rotation angle used by the JAI rotate operator

Parameters:
angle - Value of rotation angle in radians, in range -pi to pi.

getRotationAngle

public float getRotationAngle()
Returns current rotation angle, in radians, from range -pi to pi.

Returns:
Rotation angle.

setImageTriple

public void setImageTriple(ImageTriple triple)

getImageTriple

public ImageTriple getImageTriple()

setPosition

public void setPosition(Point newPosition)
Sets the current JadeDisplay position so that all views are synchronized

Parameters:
newPostion - New x,y point for view location.

getPosition

public Point getPosition()
Returns copy of current position to prevent destructive behavior

Returns:
Copy of position used by RDR views

setViewOverlays

public void setViewOverlays(boolean viewOverlays)
Set overlay view flag. Value of true sets overlay images to be viewed, else regular image view.

Parameters:
viewOverlays - Flag on viewing overlays

getViewOverlays

public boolean getViewOverlays()
Returns flag of whether session is in regular-view-mode or overlay-view mode.

Returns:
True if overlay view mode, false otherwise.

setStatusMessage

public void setStatusMessage(String statMsg)
Set current status message.

Parameters:
statMsg - Current status message.

getStatusMessage

public String getStatusMessage()
Returns current status to be displayed as part of GUI.

Returns:
Status message, empty string if none.

setLineNumber

public void setLineNumber(String l_num)
Set current line number of mouse position over current image.

Parameters:
l_num - Line number.

getLineNumber

public String getLineNumber()
Returns line number.

Returns:
line number.

setSampleNumber

public void setSampleNumber(String s_num)
Set current sample number of mouse position over current image.

Parameters:
s_num - Sample number.

getSampleNumber

public String getSampleNumber()
Returns sample number.

Returns:
Sample number.

getPreferenceRegistry

public ImagePreferences getPreferenceRegistry()
Sets preference for a given property of an image type.

Parameters:
imageType - RDR image content type to which preference is associated
propertyName - Property names
propertyValue - Property value
Throws:
IllegalArgumentException - if any parameters are null.

setUsePreferences

public void setUsePreferences(boolean usePreferences)
Enables/disables whether application components should check for preferences.

Parameters:
usePreferences - True if preferences enabled, false otherwise.

getUsePreferences

public boolean getUsePreferences()
Returns boolean value dictating whether application components should check for preferences.

Returns:
True if preferences enabled, false otherwise.

setStretchType

public void setStretchType(int stretchType)
Sets the active stretch type for application.

Parameters:
stretchType - The desired stretch type to be applied to image data ranges. One of STRETCH_NONE. STRETCH_EXTREMA, STRETCH_PERCENT, as defined in MarsImageViewModel.

getStretchType

public int getStretchType()
Returns the active stretch type for application.

Returns:
The current stretch type. One of STRETCH_NONE. STRETCH_EXTREMA, STRETCH_PERCENT, as defined in MarsImageViewModel.

setPercentStretchMin

public void setPercentStretchMin(double min)
Sets the lower bound percent for percent stretch. Note: percent stretch max + min must be less than 100


setPercentStretchMax

public void setPercentStretchMax(double max)
Sets the lower bound percent for percent stretch. Note: percent stretch max + min must be less than 100


getPercentStretchMin

public double getPercentStretchMin()
Returns the lower bound on the percent stretch range.

Returns:
percent stretch min

getPercentStretchMax

public double getPercentStretchMax()
Returns the upper bound on the percent stretch range.

Returns:
percent stretch max

setStereoEnabled

public void setStereoEnabled(boolean flag)

isStereoEnabled

public boolean isStereoEnabled()

setStereoUiModel

public void setStereoUiModel(StereoState stereoModel)

getStereoUiModel

public StereoState getStereoUiModel()

handleNewImageTriple

protected void handleNewImageTriple()
Application logic of taking new image set, creating image contents from them, and setting those contents as the active image content set.


handleOverlayEnabled

protected void handleOverlayEnabled()
Application logic of taking new image set, creating image contents from them, and setting those contents as the active image content set.