snakeprogram3d
Class SnakeFrame

java.lang.Object
  extended by snakeprogram3d.SnakeFrame

public class SnakeFrame
extends java.lang.Object

Main control panel, is divided into four regions, the Image/3D view region, a tabbed panel with controls, and a status region on the bottom. Image View: This panel 4 viewing modes, the image panel which displays a 2D slice of the image. The host_threed, which contains the ThreeDSnake class, the host_interact which contains the interactive viewer. One mode for each of these views and then a final mode that shows all 3 of them.


Constructor Summary
SnakeFrame(SnakeModel model)
           
 
Method Summary
 javax.swing.JButton createActionButton(java.lang.String label, java.lang.String cmd)
          creates a button and adds it to the list of buttons
 void disableUI()
          When an action is running this prevents any input.
 void enableImageDirections()
          Allows moving the image planes.
 void enableUI()
          enables ui.
 java.util.HashMap<java.lang.String,java.lang.Double> getConstants()
          Returns the current constants that are set in the parameters pane.
 javax.swing.JFrame getFrame()
           
 int getModelIndex()
          The index of the selected view in the view selection menu.
 void imageLoaded(boolean t)
          causes values to be updated if the image was loaded correctly.
 void initializeProgressBar()
          sets the value to zero.
 void lightRepaint()
          repaints the image panel
 void repaint()
          repaints the JFrame.
 void resetConstants()
          Refreshes the constants according to the values in the text fields, which also refreshes the model.
 void set3DPanel(java.awt.Component threedview)
          The threed view is created afterwards, this set one of the variable panels to be the threed view.
 void setAlpha()
          Trys to set the 'alpha' value.
 void setBeta()
          Trys to set the 'beta' value.
 void setConstants(java.util.HashMap<java.lang.String,java.lang.Double> values)
          loads the default values for a HashMap
 void setForegroundIntensity()
          Trys to set the 'foreground' value.
 void setGamma()
          Trys to set the 'gamma' value.
 void setGridLayout()
          sets the 2x2 layout with all three views.
 void setInteractPanel(java.awt.Component threedview)
          The interactive view is created afterwards, this set one of the variable panels to be the interactive view.
 void setNumberOfSnakesLabel(int x)
          Updates the number of snakes label
 void setSingleLayout(java.awt.Component a)
          places a single component in prominace.
 void setStretch()
          Trys to set the 'stretch' value.
 void setView()
          decides the componenet to be displayed then revalidates the main Frame
 void setWeight()
          Trys to set the 'weight' value.
 void switchCards()
          Changes the display type by incrementing to the next one
 void updateBackgroundText(java.lang.String s)
          Sets the background text after it has been automatically determined.
 void updateForegroundText(java.lang.String s)
          Sets the foreground text after it has been automatically determined.
 void updateImageTitle()
          updates the title to show the name of the image.
 void updateProgressBar(int v)
          Sets the value of the progress bar.
 void updateStackProgressionLabel(int f, int frames, int s, int slices)
          Updates the display of the current slice and frame.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SnakeFrame

public SnakeFrame(SnakeModel model)
Method Detail

disableUI

public void disableUI()
When an action is running this prevents any input.


createActionButton

public javax.swing.JButton createActionButton(java.lang.String label,
                                              java.lang.String cmd)
creates a button and adds it to the list of buttons

Parameters:
label - that shows up on the button
cmd - the String name of a SnakeActions enum constant
Returns:
new jbutton that has an action command and is in the list of buttons.

setStretch

public void setStretch()
Trys to set the 'stretch' value. First validates input, if it can be a double then the value is set and the ui is enabled. Called when parameter has been changed.


setForegroundIntensity

public void setForegroundIntensity()
Trys to set the 'foreground' value. First validates input, if it can be a double then the value is set and the ui is enabled. Called when parameter has been changed.


setWeight

public void setWeight()
Trys to set the 'weight' value. First validates input, if it can be a double then the value is set and the ui is enabled. Called when parameter has been changed.


setGamma

public void setGamma()
Trys to set the 'gamma' value. First validates input, if it can be a double then the value is set and the ui is enabled. Called when parameter has been changed.


setBeta

public void setBeta()
Trys to set the 'beta' value. First validates input, if it can be a double then the value is set and the ui is enabled. Called when parameter has been changed.


setAlpha

public void setAlpha()
Trys to set the 'alpha' value. First validates input, if it can be a double then the value is set and the ui is enabled Called when parameter has been changed.


enableUI

public void enableUI()
enables ui.


repaint

public void repaint()
repaints the JFrame.


lightRepaint

public void lightRepaint()
repaints the image panel


setNumberOfSnakesLabel

public void setNumberOfSnakesLabel(int x)
Updates the number of snakes label

Parameters:
x - total number of snakes.

updateStackProgressionLabel

public void updateStackProgressionLabel(int f,
                                        int frames,
                                        int s,
                                        int slices)
Updates the display of the current slice and frame.

Parameters:
f - current frame.
frames - total number of frames.
s - current slice.
slices - total number of slices.

imageLoaded

public void imageLoaded(boolean t)
causes values to be updated if the image was loaded correctly.

Parameters:
t - response for the SnakeImages whether it loaded successfully or not.

updateImageTitle

public void updateImageTitle()
updates the title to show the name of the image.


getFrame

public javax.swing.JFrame getFrame()

updateForegroundText

public void updateForegroundText(java.lang.String s)
Sets the foreground text after it has been automatically determined.

Parameters:
s - the value

updateBackgroundText

public void updateBackgroundText(java.lang.String s)
Sets the background text after it has been automatically determined.

Parameters:
s - the value

setConstants

public void setConstants(java.util.HashMap<java.lang.String,java.lang.Double> values)
loads the default values for a HashMap

Parameters:
values - string value

resetConstants

public void resetConstants()
Refreshes the constants according to the values in the text fields, which also refreshes the model.


updateProgressBar

public void updateProgressBar(int v)
Sets the value of the progress bar.

Parameters:
v - a number from 0 to 100

initializeProgressBar

public void initializeProgressBar()
sets the value to zero.


getConstants

public java.util.HashMap<java.lang.String,java.lang.Double> getConstants()
Returns the current constants that are set in the parameters pane.

Returns:
a HashMap containing String Double mappings.

enableImageDirections

public void enableImageDirections()
Allows moving the image planes.


set3DPanel

public void set3DPanel(java.awt.Component threedview)
The threed view is created afterwards, this set one of the variable panels to be the threed view.

Parameters:
threedview - component that will be used.

setInteractPanel

public void setInteractPanel(java.awt.Component threedview)
The interactive view is created afterwards, this set one of the variable panels to be the interactive view.

Parameters:
threedview - component that will be used.

setGridLayout

public void setGridLayout()
sets the 2x2 layout with all three views.


setSingleLayout

public void setSingleLayout(java.awt.Component a)
places a single component in prominace.

Parameters:
a - the component displayed.

switchCards

public void switchCards()
Changes the display type by incrementing to the next one


setView

public void setView()
decides the componenet to be displayed then revalidates the main Frame


getModelIndex

public int getModelIndex()
The index of the selected view in the view selection menu.

Returns:
index value as an integer.