Landmark
Class LmsWizardPopup

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by Landmark.LmsWizardPopup
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.AdjustmentListener, java.awt.event.ItemListener, java.awt.event.WindowListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.lang.Runnable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class LmsWizardPopup
extends javax.swing.JFrame
implements java.lang.Runnable, java.awt.event.ItemListener, java.awt.event.AdjustmentListener, java.awt.event.ActionListener, java.awt.event.WindowListener

The LmsWizardPopup class implements a popup Image Viewer GUI to show images used in the landmarking program.

  
 The Landmark GUI
 The Landmark GUI contains 4 image windows in 1 JFrame and possibly an 
 additional popup flicker image. If the flicker popup image is not used, 
 then it uses the upper right hand corner image as the flicker window.

   ----------------------------------------------------------------------
   | [Menubar] File Edit View Help                                      |
   ----------------------------------------------------------------------
   | small Rsample zoom window  | small Sample/flicker zoom window      |
   |                            |                                       |
   ----------------------------------------------------------------------
   | scrollable Rsample window  | scrollable Sample window              |
   |                            |                                       |
   ----------------------------------------------------------------------
   |  Rsample delay scrollbar   | Sample delay scrollbar                |
   ----------------------------------------------------------------------
   | [nX zoom]  [*]Flicker  AddLM DeleteLM SaveImage Done Cancel        |
   ----------------------------------------------------------------------
The small windows track the position of the cursor in the scrollable windows. The optional popup flicker window duplicates the content of the small Sample zoom window when it is used for flickering.
  
 Panel hierarchy:
 This describes the panel hierarchy. Note that the flickerWindow
 is not part of the hierarchy as it is a separate optional popup .

  this.(NORTH): text message area
  this.(CENTER???): isPanel
  this.(SOUTH): controlPanel

    isPanel - [holds images]
        splitPane (CENTER)             
        southPanel (SOUTH) 

    controlPanel - [holds control buttons, etc]
       subCtrlPanel 

       subCtrlPanel 
           zoom Choice
           flicker Checkbox
           control Buttons

       splitPane  - holds top and bottom images panels
           (topImgPanel, bottonImgPanel)

           topImgPanel
             lPanel -  Rsample scrollable zoom image
             rPanel -  Sample scrollable zoom image

           bottonImgPanel
             siPanelL -  Rsample scrollable image
             siPanelR -  Sample scrollable image

        southPanel - [holds images and delay controls]
          dPanel - holds delay scrollers

          dPanel - 
             delayLabelLeft, delayBarLeft - left delays
             delayLabelRight, delayBarRight - right delays
             curImageLabel
Image objects used in repainting the windows   
   siLeft     - LmsScrollableImagePanel
   siRight    - LmsScrollableImagePanel
   
   dziRight   - DisplayZoomedImg 
   dziLeft    - DisplayZoomedImg
   dziFlicker - DisplayZoomedImg     
The Guard Region
 Because flickering works by aligning images, it is impossible to align
 the edge of one image with that of another if they are not colinear. A
 solution to this problem is to add a "guard" region (set to a neutral
 color such as white, gray or black) and center the original image in
 this larger image such that you could center edges of the new images
 in the cross hairs and thus align them.

 The guard region is up to 1/2 width (on horizontal side) and 1/2 height
 (on vertical side) of the upper zoom window.

Edited and refactored by Greg Thornwall, SAIC; Peter Lemkin.

This work was produced by Peter Lemkin of the National Cancer Institute, an agency of the United States Government. As a work of the United States Government there is no associated copyright. It is offered as open source software under the Mozilla Public License (version 1.1) subject to the limitations noted in the accompanying LEGAL file. This notice must be included with the code. The Open2Dprot Mozilla and Legal files are available on http://Open2Dprot.sourceforge.net/.

Version:
$Date: 2005/12/22 00:18:10 $ $Revision: 1.30 $
Author:
P. Lemkin, NCI-Frederick, Frederick, MD, 21702
See Also:
Open2Dprot Home, Serialized Form

Nested Class Summary
(package private)  class LmsWizardPopup.DisplayZoomedImg
           
private  class LmsWizardPopup.SeparateFlickerWindow
           
 
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 boolean addFocusBoxFlag
          set from "Add focus box" checkbox
 java.lang.String baseImageFile
          base name of the image for use in the title
static int canvasHeight
          Working height of the canvas
static int canvasWidth
          Working width of the canvas
 boolean changeGuiFlag
          flag to indicating that the GUI may have changed and that it should be rebuilt.
 int cHeight
          canvas height
 javax.swing.JPanel controlPanel
          Control panel for the main frame
 Landmark cs
          instance of the main class
 java.awt.Label curImageLabel
          current image being display during flickering
 int cWidth
          canvas width
 DbSample dbRsample
          Reference sample
 DbSample dbS
          landmark flicker sample is set by run() to either dbRsample or dbSample
 DbSample dbSample
          Independent sample
private static int DEF_FLK_DELAY
          default flicker delay 0.3 seconds
 int delay
           
 java.awt.Scrollbar delayBarLeft
          scroll bar for Rsample image delay
 java.awt.Scrollbar delayBarRight
          scroll bar for Sample image delay
 java.awt.Label delayLabelLeft
          label for Rsample image delay
 java.awt.Label delayLabelRight
          label for Sample image delay
 int dispHeight
          Height of display image
 java.awt.Image dispImage
          Display image
 java.lang.String dispName
          Name of image to display
 java.awt.Choice dispPixChoice
          Selector for image to display (Rsample, Sample)
 int dispWidth
          Width of display image
static int DIST_THR
          Distance threshold in pixels from mouse (x,y) to spot centroid to find spot
 int DIVIDER_LOCATION
          location of JsplitPane divider
 LmsWizardPopup.DisplayZoomedImg dziFlicker
          for displaying flickered img
 LmsWizardPopup.DisplayZoomedImg dziLeft
          for displaying upper left zoomed img
 LmsWizardPopup.DisplayZoomedImg dziRight
          for displaying upper right zoomed img
 java.awt.Menu editMenu
          "Edit" pull down Menu list
 java.awt.Menu fileMenu
          "File" pull down Menu list
 java.awt.Checkbox flickerCB
          Flicker (C-F) checkbox
 int flickerDelayLeft
           
 int flickerDelayRight
           
 boolean flickerFlag
          set from "Flicker" choice
 LmsWizardPopup.SeparateFlickerWindow flickerWindow
          separate flicker window/frame
static int FOCUS_BOX_SIZE
          Size of optional focus box used to aid flickering.
 java.awt.Color focusBoxColor
          optional Focus box color
 java.lang.String fontFamily
           
 java.awt.Color guardRegionColor
          Guard region color, can be set from view menu
 boolean guiBuiltInitialFlag
          build the initial GUI flag
 java.awt.Menu helpMenu
          "Help" pull down Menu list
private  boolean isSuspendedFlag
          runT is suspended
 boolean isVisibleFlag
          Set true if window is visible
 java.awt.Font largeFont
           
 boolean logReportFlag
          set from "Log report" checkbox menu item
private static int MAX_FLK_DELAY
          MAX flicker delay 3.0 seconds
 int maxSampleHeight
          maximum original image height computed as: max(dbRsample.pixHeight,dbSample.pixHeight)
 int maxSampleWidth
          maximum original image width computed as: max(dbRsample.pixWidth,dbSample.pixWidth)
(package private)  java.awt.MenuBar mbar
          menu bar for the frame
 int meanRsamplePixGray
          Rsample mean pixel gray value
 int meanSamplePixGray
          Sample mean pixel gray value
 java.awt.Font mediumFont
           
private static int MIN_FLK_DELAY
          MIN flicker delay 0.1 seconds
private  MenuSupport ms
          Menu support hash tables
private  java.awt.TextArea msgTextArea
          Text area GUI for message rporting
(package private) static int NCOLS
           
 int nDispPixels
          # of dispImage pixels computed as dispWidth*dispHeight
static boolean needToSaveLMSdataFlag
          Flag indicates need to save the data
private  boolean notDoneFlag
          Set to kill the run loop
 int nPixelsRsample
          The pixWidthRsample*pixHeightRsample
 int nPixelsSample
          The pixWidthSample*pixHeightSample
(package private) static int NROWS
          size of the text area in characters
 java.lang.String oGifFileName
          Full path of image to "Save image" in
 java.awt.Image origImgLeft
          original left image
 java.awt.Image origImgRight
          original right image
 java.lang.Object parentObj
          parent or calling class
 java.awt.Image pImgRsample
          Rsample Image to display
 java.awt.Image pImgSample
          Sample Image to display
 int pixHeightLeft
          left image pixel height
 int pixHeightRight
          right image pixel height
 int pixHeightRsample
          The width of the Rsample image
 int pixHeightSample
          The width of the Sample image
 char[] pixRsample
          Rsample Picture buffer char[] of image to display .
 char[] pixSample
          Sample Picture buffer char[] of image to display .
 int pixWidthLeft
          left image pixel width
 int pixWidthRight
          right image pixel width
 int pixWidthRsample
          The width of the Rsample image
 int pixWidthSample
          The width of the Sample image
 java.awt.Dimension preferedCanvasSize
          prefered canvas size
 int preferredHeight
          preferred size of canvas
 int preferredWidth
          preferred size of canvas
 java.awt.Color rsampleCursorColor
          Rsample image cursor color when flickering
private  java.lang.Thread runT
          Flickering thread
 java.awt.Color sampleCursorColor
          Sample image cursor color when flickering
 int sampleNbrEdit
          The sample for the following edit coords if not -1
 int SCROLLER_VIEW_HEIGHT
          Height of the frame
 int SCROLLER_VIEW_WIDTH
          Width of the frame
 int scrollPaneHeightLeft
          left scroll pane height
 int scrollPaneHeightRight
          right scroll pane height
 int scrollPaneWidthLeft
          left scroll pane width
 int scrollPaneWidthRight
          right scroll pane width
 java.awt.Checkbox separateFlickerWindowCB
          checkbox for flicker separate window toggle (on/off)
(package private) static long serialVersionUID
          frame id
 LmsScrollableImagePanel siLeft
          left scroller
 LmsScrollableImagePanel siRight
          right scroller
 java.awt.Font smallFont
           
private  int textAreaFontSize
          font size
private  java.lang.String textFontFamily
          font family for message window
 boolean titleFlag
          turn off titles on lower panels
 int UPPER_IMG_HEIGHT
          Height of the upper img
 int UPPER_IMG_WIDTH
          Width of the upper img
 boolean useAddLMradiiFlag
          set from "View LM radii" Menu CB
 java.awt.Checkbox useDragCB
          the "Use drag" checkbox
 boolean useDragFlag
          set from "Use drag" checkbox
 boolean useLMnbrLabelsFlag
           
 java.awt.Checkbox useLogCB
          the "Use log" checkbox
 boolean useLogFlag
          set from "Use log" checkbox
 boolean useSaveImageFlag
          set from "Save image" Command
 boolean useShowRadiiTableFlag
          set from (View | Show radii table) menu
 int VIEW_HEIGHT
          Height of the frame
 int VIEW_WIDTH
          Width of the frame
 int viewHeight
           
 java.awt.Menu viewMenu
          "View" pull down Menu list
 int viewWidth
           
 int xCurRsample
          the current X of the Rsample image
 int xCurSample
          the current X of the Sample image
 int xEdit
          The X coordinate of landmark to edit if not -1
 int xImg
          image address (x,y)+(xBase,yBase)
 int xImgRight
          image address (x,y)+(xBase,yBase) for using right upper window for flickering
 int yCurRsample
          the current Y of the Rsample image
 int yCurSample
          the current Y of the Sample image
 int yEdit
          The Y coordinate of landmark to edit if not -1
 int yImg
          image address (x,y)+(xBase,yBase)
 int yImgRight
          image address (x,y)+(xBase,yBase) for using right upper window for flickering
 java.awt.Choice zoomChoice
          Choice Selector for Zoom
 int zoomFactor
          zoomFactor
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
LmsWizardPopup(Landmark cs)
          LmsWizardPopup() - Constructor
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          actionPerformed() - Handle button clicks
private  boolean addLandmark()
          addLandmark() - add currently selected coordiantes as next landmark
private  void addMenuTree(java.awt.Frame f, java.awt.MenuBar mbar)
          addMenuTree() - create pull down menus in menu bar
 void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
          adjustmentValueChanged() - handle ImageScroller scroll events.
 boolean buildImageGUI()
          buildImageGUI() - Build the ImageViewer GUI
 void clearCurImgXY()
          clearCurImgXY() - clear the current Rsample and Sample coordinates
 void close()
          close() - close this popup and reset flags
private  boolean deleteLandmark()
          deleteLandmark() - delete landmark of currently selected coordinates if it is a landmark.
 java.awt.Dimension getPreferredSize()
          getPreferredSize() - getPreferredSize, needed for sizing frame and ScrollPane correctly.
 boolean isValidROI(int rX1, int rY1, int rX2, int rY2)
          isValidROI() - check if current region of interest (ROI) is valid
 void itemStateChanged(java.awt.event.ItemEvent e)
          itemStateChanged() - handle item state changed events NOTE: need to implement radio groups here since AWT only implements radio groups for Checkboxes, and CheckboxMenuItems.
 void paintAll()
          paintAll() - repaint all image windows (zoomed and unzoomed) and the flickerWindow.
 void paintComponent(java.awt.Graphics g)
          paintComponent() -
 void paintUpperWindows()
          paintUpperWindows() - repaint all upper zoom windows and flickerWindow
 void positionImageWindow()
          positionImageWindow() - position image window on the screen
 void run()
          run() - Flicker method to run threads and perform timing dependent operators.
 boolean setImage(java.lang.String rightOrLeft, int xImg, int yImg)
          setImage() - change the img coords TODO
 boolean setPixDatabase(DbSample dbRsample, DbSample dbSample)
          setPixDatabase() - change the samples to use
 boolean showLMSimageGUI()
          showLMSimageGUI() - show the Image Viewer GUI window
 void showMsg(java.lang.String msg)
          showMsg() - display the msg in text area window
 void start()
          start() - start new or resume Flicker threads
 void stop()
          stop() - stop or suspend Flicker threads [TODO] add KeepAlive code to kill it for real if time out.
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
          windowClosing() - closing down the window
 void windowDeactivated(java.awt.event.WindowEvent e)
           
 void windowDeiconified(java.awt.event.WindowEvent e)
           
 void windowIconified(java.awt.event.WindowEvent e)
           
 void windowOpened(java.awt.event.WindowEvent e)
           
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

serialVersionUID

static final long serialVersionUID
frame id

See Also:
Constant Field Values

cs

public Landmark cs
instance of the main class


VIEW_WIDTH

public final int VIEW_WIDTH
Width of the frame

See Also:
Constant Field Values

VIEW_HEIGHT

public final int VIEW_HEIGHT
Height of the frame

See Also:
Constant Field Values

UPPER_IMG_WIDTH

public final int UPPER_IMG_WIDTH
Width of the upper img

See Also:
Constant Field Values

UPPER_IMG_HEIGHT

public final int UPPER_IMG_HEIGHT
Height of the upper img

See Also:
Constant Field Values

DIVIDER_LOCATION

public final int DIVIDER_LOCATION
location of JsplitPane divider

See Also:
Constant Field Values

SCROLLER_VIEW_WIDTH

public final int SCROLLER_VIEW_WIDTH
Width of the frame

See Also:
Constant Field Values

SCROLLER_VIEW_HEIGHT

public final int SCROLLER_VIEW_HEIGHT
Height of the frame

See Also:
Constant Field Values

NROWS

static final int NROWS
size of the text area in characters

See Also:
Constant Field Values

NCOLS

static final int NCOLS
See Also:
Constant Field Values

DIST_THR

public static final int DIST_THR
Distance threshold in pixels from mouse (x,y) to spot centroid to find spot

See Also:
Constant Field Values

MIN_FLK_DELAY

private static final int MIN_FLK_DELAY
MIN flicker delay 0.1 seconds

See Also:
Constant Field Values

MAX_FLK_DELAY

private static final int MAX_FLK_DELAY
MAX flicker delay 3.0 seconds

See Also:
Constant Field Values

DEF_FLK_DELAY

private static final int DEF_FLK_DELAY
default flicker delay 0.3 seconds

See Also:
Constant Field Values

FOCUS_BOX_SIZE

public static final int FOCUS_BOX_SIZE
Size of optional focus box used to aid flickering.

See Also:
Constant Field Values

dbRsample

public DbSample dbRsample
Reference sample


dbSample

public DbSample dbSample
Independent sample


dbS

public DbSample dbS
landmark flicker sample is set by run() to either dbRsample or dbSample


oGifFileName

public java.lang.String oGifFileName
Full path of image to "Save image" in


baseImageFile

public java.lang.String baseImageFile
base name of the image for use in the title


changeGuiFlag

public boolean changeGuiFlag
flag to indicating that the GUI may have changed and that it should be rebuilt.


titleFlag

public boolean titleFlag
turn off titles on lower panels


guiBuiltInitialFlag

public boolean guiBuiltInitialFlag
build the initial GUI flag


isVisibleFlag

public boolean isVisibleFlag
Set true if window is visible


flickerFlag

public boolean flickerFlag
set from "Flicker" choice


useAddLMradiiFlag

public boolean useAddLMradiiFlag
set from "View LM radii" Menu CB


useShowRadiiTableFlag

public boolean useShowRadiiTableFlag
set from (View | Show radii table) menu


useLMnbrLabelsFlag

public boolean useLMnbrLabelsFlag

useDragFlag

public boolean useDragFlag
set from "Use drag" checkbox


useLogFlag

public boolean useLogFlag
set from "Use log" checkbox


addFocusBoxFlag

public boolean addFocusBoxFlag
set from "Add focus box" checkbox


useSaveImageFlag

public boolean useSaveImageFlag
set from "Save image" Command


logReportFlag

public boolean logReportFlag
set from "Log report" checkbox menu item


runT

private java.lang.Thread runT
Flickering thread


isSuspendedFlag

private boolean isSuspendedFlag
runT is suspended


notDoneFlag

private boolean notDoneFlag
Set to kill the run loop


pixRsample

public char[] pixRsample
Rsample Picture buffer char[] of image to display . Note this is read either from the pix variable.


pixSample

public char[] pixSample
Sample Picture buffer char[] of image to display . Note this is read from the pix variable.


pixWidthRsample

public int pixWidthRsample
The width of the Rsample image


pixHeightRsample

public int pixHeightRsample
The width of the Rsample image


nPixelsRsample

public int nPixelsRsample
The pixWidthRsample*pixHeightRsample


pixWidthSample

public int pixWidthSample
The width of the Sample image


pixHeightSample

public int pixHeightSample
The width of the Sample image


nPixelsSample

public int nPixelsSample
The pixWidthSample*pixHeightSample


viewWidth

public int viewWidth

viewHeight

public int viewHeight

canvasWidth

public static int canvasWidth
Working width of the canvas


canvasHeight

public static int canvasHeight
Working height of the canvas


dispImage

public java.awt.Image dispImage
Display image


maxSampleWidth

public int maxSampleWidth
maximum original image width computed as: max(dbRsample.pixWidth,dbSample.pixWidth)


maxSampleHeight

public int maxSampleHeight
maximum original image height computed as: max(dbRsample.pixHeight,dbSample.pixHeight)


dispWidth

public int dispWidth
Width of display image


dispHeight

public int dispHeight
Height of display image


nDispPixels

public int nDispPixels
# of dispImage pixels computed as dispWidth*dispHeight


xCurRsample

public int xCurRsample
the current X of the Rsample image


yCurRsample

public int yCurRsample
the current Y of the Rsample image


xCurSample

public int xCurSample
the current X of the Sample image


yCurSample

public int yCurSample
the current Y of the Sample image


sampleNbrEdit

public int sampleNbrEdit
The sample for the following edit coords if not -1


xEdit

public int xEdit
The X coordinate of landmark to edit if not -1


yEdit

public int yEdit
The Y coordinate of landmark to edit if not -1


xImg

public int xImg
image address (x,y)+(xBase,yBase)


yImg

public int yImg
image address (x,y)+(xBase,yBase)


xImgRight

public int xImgRight
image address (x,y)+(xBase,yBase) for using right upper window for flickering


yImgRight

public int yImgRight
image address (x,y)+(xBase,yBase) for using right upper window for flickering


mbar

java.awt.MenuBar mbar
menu bar for the frame


fileMenu

public java.awt.Menu fileMenu
"File" pull down Menu list


viewMenu

public java.awt.Menu viewMenu
"View" pull down Menu list


editMenu

public java.awt.Menu editMenu
"Edit" pull down Menu list


helpMenu

public java.awt.Menu helpMenu
"Help" pull down Menu list


ms

private MenuSupport ms
Menu support hash tables


controlPanel

public javax.swing.JPanel controlPanel
Control panel for the main frame


msgTextArea

private java.awt.TextArea msgTextArea
Text area GUI for message rporting


textAreaFontSize

private int textAreaFontSize
font size


textFontFamily

private java.lang.String textFontFamily
font family for message window


fontFamily

public java.lang.String fontFamily

smallFont

public java.awt.Font smallFont

mediumFont

public java.awt.Font mediumFont

largeFont

public java.awt.Font largeFont

dispPixChoice

public java.awt.Choice dispPixChoice
Selector for image to display (Rsample, Sample)


dispName

public java.lang.String dispName
Name of image to display


rsampleCursorColor

public java.awt.Color rsampleCursorColor
Rsample image cursor color when flickering


sampleCursorColor

public java.awt.Color sampleCursorColor
Sample image cursor color when flickering


focusBoxColor

public java.awt.Color focusBoxColor
optional Focus box color


guardRegionColor

public java.awt.Color guardRegionColor
Guard region color, can be set from view menu


meanRsamplePixGray

public int meanRsamplePixGray
Rsample mean pixel gray value


meanSamplePixGray

public int meanSamplePixGray
Sample mean pixel gray value


delayLabelLeft

public java.awt.Label delayLabelLeft
label for Rsample image delay


delayBarLeft

public java.awt.Scrollbar delayBarLeft
scroll bar for Rsample image delay


flickerDelayLeft

public int flickerDelayLeft

delayLabelRight

public java.awt.Label delayLabelRight
label for Sample image delay


delayBarRight

public java.awt.Scrollbar delayBarRight
scroll bar for Sample image delay


flickerDelayRight

public int flickerDelayRight

delay

public int delay

curImageLabel

public java.awt.Label curImageLabel
current image being display during flickering


flickerCB

public java.awt.Checkbox flickerCB
Flicker (C-F) checkbox


zoomChoice

public java.awt.Choice zoomChoice
Choice Selector for Zoom


zoomFactor

public int zoomFactor
zoomFactor


useDragCB

public java.awt.Checkbox useDragCB
the "Use drag" checkbox


useLogCB

public java.awt.Checkbox useLogCB
the "Use log" checkbox


pImgRsample

public java.awt.Image pImgRsample
Rsample Image to display


pImgSample

public java.awt.Image pImgSample
Sample Image to display


needToSaveLMSdataFlag

public static boolean needToSaveLMSdataFlag
Flag indicates need to save the data


origImgRight

public java.awt.Image origImgRight
original right image


origImgLeft

public java.awt.Image origImgLeft
original left image


siRight

public LmsScrollableImagePanel siRight
right scroller


siLeft

public LmsScrollableImagePanel siLeft
left scroller


scrollPaneWidthRight

public int scrollPaneWidthRight
right scroll pane width


scrollPaneWidthLeft

public int scrollPaneWidthLeft
left scroll pane width


scrollPaneHeightRight

public int scrollPaneHeightRight
right scroll pane height


scrollPaneHeightLeft

public int scrollPaneHeightLeft
left scroll pane height


pixHeightRight

public int pixHeightRight
right image pixel height


pixHeightLeft

public int pixHeightLeft
left image pixel height


pixWidthLeft

public int pixWidthLeft
left image pixel width


pixWidthRight

public int pixWidthRight
right image pixel width


parentObj

public java.lang.Object parentObj
parent or calling class


cWidth

public int cWidth
canvas width


cHeight

public int cHeight
canvas height


preferedCanvasSize

public java.awt.Dimension preferedCanvasSize
prefered canvas size


preferredWidth

public int preferredWidth
preferred size of canvas


preferredHeight

public int preferredHeight
preferred size of canvas


separateFlickerWindowCB

public java.awt.Checkbox separateFlickerWindowCB
checkbox for flicker separate window toggle (on/off)


dziRight

public LmsWizardPopup.DisplayZoomedImg dziRight
for displaying upper right zoomed img


dziLeft

public LmsWizardPopup.DisplayZoomedImg dziLeft
for displaying upper left zoomed img


dziFlicker

public LmsWizardPopup.DisplayZoomedImg dziFlicker
for displaying flickered img


flickerWindow

public LmsWizardPopup.SeparateFlickerWindow flickerWindow
separate flicker window/frame

Constructor Detail

LmsWizardPopup

public LmsWizardPopup(Landmark cs)
LmsWizardPopup() - Constructor

Parameters:
cs - is an instance of the main class
Method Detail

getPreferredSize

public java.awt.Dimension getPreferredSize()
getPreferredSize() - getPreferredSize, needed for sizing frame and ScrollPane correctly.

Overrides:
getPreferredSize in class java.awt.Container
Returns:
frame size

setPixDatabase

public boolean setPixDatabase(DbSample dbRsample,
                              DbSample dbSample)
setPixDatabase() - change the samples to use

Parameters:
dbRsample - is the Rsample instance
dbSample - is the Sample instance
Returns:
true if succeed

showLMSimageGUI

public boolean showLMSimageGUI()
showLMSimageGUI() - show the Image Viewer GUI window

Returns:
true if succeed

buildImageGUI

public boolean buildImageGUI()
buildImageGUI() - Build the ImageViewer GUI


setImage

public boolean setImage(java.lang.String rightOrLeft,
                        int xImg,
                        int yImg)
setImage() - change the img coords TODO

Parameters:
rightOrLeft - which img is it, String "left" or "right"
xImg - x image address (x,y)+(xBase,yBase)
yImg - y image address (x,y)+(xBase,yBase)

addMenuTree

private void addMenuTree(java.awt.Frame f,
                         java.awt.MenuBar mbar)
addMenuTree() - create pull down menus in menu bar

Parameters:
f - is frame
mbar - is MenuBar

showMsg

public void showMsg(java.lang.String msg)
showMsg() - display the msg in text area window

Parameters:
msg - to display

positionImageWindow

public void positionImageWindow()
positionImageWindow() - position image window on the screen


close

public void close()
close() - close this popup and reset flags


windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
windowClosing() - closing down the window

Specified by:
windowClosing in interface java.awt.event.WindowListener
Parameters:
e - is window closing event
See Also:
close()

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Specified by:
windowOpened in interface java.awt.event.WindowListener

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Specified by:
windowClosed in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Specified by:
windowIconified in interface java.awt.event.WindowListener

paintComponent

public void paintComponent(java.awt.Graphics g)
paintComponent() -

Parameters:
g - is graphics context

adjustmentValueChanged

public void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
adjustmentValueChanged() - handle ImageScroller scroll events. Handle ImageScroller scroll events & cause repaint of canvas. If we are using the scroll bar for this canvas, then set the obj position for use by other canvas for the same image. Handle the delay scrollbar as well if it exists.

Specified by:
adjustmentValueChanged in interface java.awt.event.AdjustmentListener
Parameters:
e - is adjustment event for scroll bars

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
itemStateChanged() - handle item state changed events NOTE: need to implement radio groups here since AWT only implements radio groups for Checkboxes, and CheckboxMenuItems.

Specified by:
itemStateChanged in interface java.awt.event.ItemListener
Parameters:
e - is ItemEvent

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed() - Handle button clicks

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - is action evet

isValidROI

public boolean isValidROI(int rX1,
                          int rY1,
                          int rX2,
                          int rY2)
isValidROI() - check if current region of interest (ROI) is valid

Parameters:
rX1 - - ULHC x coordinate
rY1 - - ULHC y coordinate
rX2 - - LRHC x coordinate
rY2 - - LRHC y coordinate
Returns:
true if valid

clearCurImgXY

public void clearCurImgXY()
clearCurImgXY() - clear the current Rsample and Sample coordinates


addLandmark

private boolean addLandmark()
addLandmark() - add currently selected coordiantes as next landmark

Returns:
true if added. If useRsampleLMSFlag is set, then if we are adding a new LM for a new Sample, then use the Rsample coordinates.

deleteLandmark

private boolean deleteLandmark()
deleteLandmark() - delete landmark of currently selected coordinates if it is a landmark.

Returns:
true if added.

start

public void start()
start() - start new or resume Flicker threads


stop

public void stop()
stop() - stop or suspend Flicker threads [TODO] add KeepAlive code to kill it for real if time out. Could create a thread to sleep 1 minute and then check the KeepAlive timer and then call finalize() if overflow...


run

public void run()
run() - Flicker method to run threads and perform timing dependent operators. It first loads the images and then enters the thread based timing loop.

Specified by:
run in interface java.lang.Runnable

paintAll

public void paintAll()
paintAll() - repaint all image windows (zoomed and unzoomed) and the flickerWindow.


paintUpperWindows

public void paintUpperWindows()
paintUpperWindows() - repaint all upper zoom windows and flickerWindow