Accession
Class AccCALIBwizardPopup

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 Accession.AccCALIBwizardPopup
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.WindowListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class AccCALIBwizardPopup
extends java.awt.Frame
implements java.awt.event.ItemListener, java.awt.event.ActionListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.WindowListener

The AccCALIBwizardPopupclass implements a popup GUI to create and edit the image grayscale calibration used in the accessioning program.

 [TODO] Debug Calibration.
 1. The histogram does not correct - bad peak display.
 2. Also check permutations of 
     (no calibration, data, calib. data in Acc DB, has Wedge ROI CW,
      Wedge CW + calibr. data, explict calib w/o wedge, point list
      similar to Flicker). Resolve popup of missing data.
 This is tracked with  calDataMode set from 
   (CAL_WEDGE  CAL_SPOTLIST  CAL_DATA_FILE  CAL_MANUAL).
 3. Validate calibration table that can be used to sepecify 
    calibration values from a file. 
    It may have 1 or more of the following fields 
       "PEAK", "CAL", "GRAY", "CAL-UNIT", "CAL-ABBREV".  
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/10/20 11:11:05 $ $Revision: 1.13 $
Author:
P. Lemkin, NCI-Frederick, Frederick, MD, 21702
See Also:
Open2Dprot Home, Serialized Form

Nested Class Summary
 
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
 int activeBin
          active bin idx [0:nHist-1] else -1
private  java.awt.Font buttonFont
           
static int CAL_DATA_FILE
          get (cal,gray) list calibration from tab-delim data file field names: (PEAK CAL GRAY CAL-UNIT CAL-ABBREV)
static int CAL_MANUAL
          Enter calibration manually by typing into the table.
static int CAL_SPOTLIST
          Use Spot list values for gray values grayDataList[]
static int CAL_WEDGE
          Use ND step wedge ROI for gray values
 float[] calDataList
          calDataList is calibration value list if not null
 int calDataMode
          calDataMode of form CAL_WEDGE, CAL_SPOTLIST
private  java.awt.Color calibPeakColor
          calibration peaks on histogram color
 Table calibTbl
          calibration data file table
 java.lang.String calTypeStr
          String name of calDataMode.
 java.lang.String calUnits
          calUnits is name of calibration units if not null
 boolean changedAccCalibrDataFlag
          Flag indicating that the accession calibration fields were defined or were edited
 Accession cs
          instance of the main class
 DbSample dbS
          link to active sample
 java.lang.String dispName
          Name of image to display
 char[] dispPixC
          Picture buffer char[] of image to display .
private  boolean drawIntoImageFlag
          set if draw plot to GIF file
private  java.awt.Menu editMenu
          "Edit" pull down Menu list
private  java.awt.Menu fileMenu
          "File" pull down Menu list
private  java.lang.String fontFamily
           
 int[] grayDataList
          grayDataList is peak gray list if not null.
 boolean grayValueListChangedFlag
          Flag indicating that the accession calibration gray value fields were defined or were edited
private  java.awt.Menu helpMenu
          "Help" pull down Menu list
private  int[] hist
          freq hist[0:nHist-1].
private  java.awt.Color histColor
           
private  java.awt.Color histTopColor
           
 boolean isVisibleFlag
          If the Histogram is visible
private  java.awt.Color labelColor
           
private  java.awt.Font largeFont
           
 boolean logReportFlag
          set from "Log report" checkbox menu item
static int MAX_GRAY
          # gray values in a pixel
static int MAXBINS
          # of histogram into bins
private  java.awt.MenuBar mbar
          menu bar for the frame
private  java.awt.Font mediumFont
           
 MenuSupport ms
          Menu support functions using Hashtables to tack what is active.
private  java.awt.TextArea msgTextArea
          Text area GUI for message rporting
(package private) static int N_PCT_PROLOGUE
          default # of initial rows in the peak wedge calibration table
 int nCalSteps
          size of calDataList is calibration value list if not null
(package private) static int NCOLS
           
 int nGrayPeaks
          size of the grayDataList is peak gray list if not null
 int nPixels
          The pixWidth*pixHeight
(package private) static int NROWS
          size of the text area in characters
private  java.awt.Color odColor
           
 java.lang.String oGifFileName
          Full path of image to "Save image" in
private  java.awt.Color optBkgrdColor
           
(package private) static int PEAK_CAL_TBL_COLS
          default # of editPanel cols
(package private) static int PEAK_CAL_TBL_ROWS
          default # of editPanel rows
(package private) static int peakCalTblCols
          # of editPanel cols in actual table
(package private) static int peakCalTblRows
          # of editPanel rows in actual table
private  java.awt.TextField[][] peakCalTblTF
          Array of TextFields used in constructing the Peak Calibration Table editPanel.
private  java.awt.Color peakNbrColor
          peak number color
private  int peakNbrFontSize
          font size for peak number labels
 int pixHeight
          The width of the current image
 int pixWidth
          The width of the current image
(package private) static long serialVersionUID
          frame id
private  int[] sHist
          modified freq sHist[0:nHist-1].
private  java.awt.Font smallFont
           
private  int textAreaFontSize
          font size
private  java.lang.String textFontFamily
          font family for message window
 java.awt.Checkbox useLogCB
          the "Use log" checkbox
 boolean useLogFlag
          set from "Use log" checkbox
 boolean useSaveImageFlag
          set from "Save image" Command
static int VIEW_HEIGHT
          Height of the frame
static int VIEW_WIDTH
          Width of the frame
 int viewHeight
           
private  java.awt.Menu viewMenu
          "View" pull down Menu list
 int viewWidth
           
private static int[] xPainted
          active hit coordinates
 
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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
AccCALIBwizardPopup(Accession cs, DbSample dbS, int calDataMode, float[] calDataList, int[] grayDataList, int nCalSteps, int nGrayPeaks, java.lang.String calUnits, Table calibTbl)
          AccCALIBwizardPopup() - Constructor.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          actionPerformed() - Handle Control panel button clicks
private  void addMenuTree(java.awt.Frame f, java.awt.MenuBar mbar)
          addMenuTree() - create pull down menus in menu bar
private  void buildHistGUI()
          buildHistGUI() - build the histogram GUI
 void close(boolean tryToSaveFlag)
          close() - close this popup and reset flags
private static void drawFilledBox(java.awt.Graphics g, int xC, int yC, int width, java.awt.Color color)
          drawFilledBox() - draw plus sign at the specified color.
(package private)  boolean drawGifFile(java.lang.String oGifFileName)
          drawGifFile() - draw plot into Gif image file if in stand-alone mode.
private  boolean drawHistInCanvas(java.awt.Graphics g)
          drawHistInCanvas() - draw histogram of hist[].
 java.awt.Dimension getMinimumSize()
          getMinimumSize() - get the minimum preferred size
 java.awt.Dimension getPreferredSize()
          getPreferredSize() - getPreferredSize, needed for sizing frame and ScrollPane correctly.
 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 mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseDragged(java.awt.event.MouseEvent e)
          mouseDragged() - process mouse event
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 boolean mouseHandler(int x, int y)
          mouseHandler() - search for the active bin if any
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
          mouseReleased() - process mouse event
 void paint(java.awt.Graphics g)
          paint() - draw the histogram
private  void positionHistWindow()
          positionHistWindow() - position histogram window on the screen
private  boolean reExtrapolateCalibration()
          reExtrapolateCalibration() - regenerate the mapGrayToCal[] from the peak table
 boolean refreshMapFromTable(boolean updateMapFlag)
          refreshMapFromTable() - refresh the peak table from the TextFields...
 boolean setCalValueListCalibAccFields()
          setCalValueListCalibAccFields() - set the accession data calibration values peak list calibration fields
 boolean setGrayPeakListCalibAccFields()
          setGrayPeakListCalibAccFields() - set the accession data gray value peaks list calibration fields
 void setTitleHist(java.lang.String title)
          setTitleHist() - set the title
 void setVisible(boolean isVisibleFlag, boolean redoROIhistFlag)
          setVisible() - set the histogram as visible or not
 void showMsg(java.lang.String msg)
          showMsg() - display the msg in text area window
 void showMsg(java.lang.String msg, java.awt.Color color)
          showMsg() - set the status msg
 void update(java.awt.Graphics g)
          update() - update without background the scrollable canvas
 boolean updateAccTableWithSpotList()
          updateAccTableWithSpotList() - update accession DB table with spot list data.
 void updateHistogramPlot(boolean redoROIhistFlag)
          updateHistogramPlot() - set hist state and do repaint to draw it.
private  void updatePeakCalTable()
          updatePeakCalTable() - update the peak calibration table GUI text field and the dbS.calib cal and gray value arrays with new data from calDataList[] and grayDataList[].
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
          windowClosing() - close 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 java.awt.Frame
addNotify, finalize, getAccessibleContext, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, paramString, remove, removeNotify, setCursor, setExtendedState, setIconImage, 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, processWindowEvent, 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, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, 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 Accession cs
instance of the main class


dbS

public DbSample dbS
link to active sample


CAL_WEDGE

public static final int CAL_WEDGE
Use ND step wedge ROI for gray values

See Also:
Constant Field Values

CAL_SPOTLIST

public static final int CAL_SPOTLIST
Use Spot list values for gray values grayDataList[]

See Also:
Constant Field Values

CAL_DATA_FILE

public static final int CAL_DATA_FILE
get (cal,gray) list calibration from tab-delim data file field names: (PEAK CAL GRAY CAL-UNIT CAL-ABBREV)

See Also:
Constant Field Values

CAL_MANUAL

public static final int CAL_MANUAL
Enter calibration manually by typing into the table.

See Also:
Constant Field Values

calDataMode

public int calDataMode
calDataMode of form CAL_WEDGE, CAL_SPOTLIST


calDataList

public float[] calDataList
calDataList is calibration value list if not null


nCalSteps

public int nCalSteps
size of calDataList is calibration value list if not null


grayDataList

public int[] grayDataList
grayDataList is peak gray list if not null.


nGrayPeaks

public int nGrayPeaks
size of the grayDataList is peak gray list if not null


calUnits

public java.lang.String calUnits
calUnits is name of calibration units if not null


calTypeStr

public java.lang.String calTypeStr
String name of calDataMode.


VIEW_WIDTH

public static final int VIEW_WIDTH
Width of the frame

See Also:
Constant Field Values

VIEW_HEIGHT

public static final int VIEW_HEIGHT
Height of the frame

See Also:
Constant Field Values

viewWidth

public int viewWidth

viewHeight

public int viewHeight

N_PCT_PROLOGUE

static final int N_PCT_PROLOGUE
default # of initial rows in the peak wedge calibration table

See Also:
Constant Field Values

PEAK_CAL_TBL_ROWS

static final int PEAK_CAL_TBL_ROWS
default # of editPanel rows


PEAK_CAL_TBL_COLS

static final int PEAK_CAL_TBL_COLS
default # of editPanel cols

See Also:
Constant Field Values

peakCalTblRows

static final int peakCalTblRows
# of editPanel rows in actual table


peakCalTblCols

static final int peakCalTblCols
# of editPanel cols in actual table

See Also:
Constant Field Values

MAX_GRAY

public static int MAX_GRAY
# gray values in a pixel


MAXBINS

public static int MAXBINS
# of histogram into bins


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

mbar

private java.awt.MenuBar mbar
menu bar for the frame


fileMenu

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


viewMenu

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


editMenu

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


helpMenu

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


ms

public MenuSupport ms
Menu support functions using Hashtables to tack what is active.


activeBin

public int activeBin
active bin idx [0:nHist-1] else -1


hist

private int[] hist
freq hist[0:nHist-1].


sHist

private int[] sHist
modified freq sHist[0:nHist-1].


drawIntoImageFlag

private boolean drawIntoImageFlag
set if draw plot to GIF file


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

private java.lang.String fontFamily

smallFont

private java.awt.Font smallFont

mediumFont

private java.awt.Font mediumFont

largeFont

private java.awt.Font largeFont

buttonFont

private java.awt.Font buttonFont

peakNbrFontSize

private int peakNbrFontSize
font size for peak number labels


dispName

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


dispPixC

public char[] dispPixC
Picture buffer char[] of image to display . Note this is read either from the pix? variable or from the file if the pix? variable is null.


pixWidth

public int pixWidth
The width of the current image


pixHeight

public int pixHeight
The width of the current image


nPixels

public int nPixels
The pixWidth*pixHeight


oGifFileName

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


useLogCB

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


useLogFlag

public boolean useLogFlag
set from "Use log" checkbox


useSaveImageFlag

public boolean useSaveImageFlag
set from "Save image" Command


logReportFlag

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


optBkgrdColor

private java.awt.Color optBkgrdColor

histColor

private java.awt.Color histColor

histTopColor

private java.awt.Color histTopColor

odColor

private java.awt.Color odColor

calibPeakColor

private java.awt.Color calibPeakColor
calibration peaks on histogram color


labelColor

private java.awt.Color labelColor

peakNbrColor

private java.awt.Color peakNbrColor
peak number color


peakCalTblTF

private java.awt.TextField[][] peakCalTblTF
Array of TextFields used in constructing the Peak Calibration Table editPanel. Not all entries are used. It is of size [0:peakCalTblRows-1][0:peakCalTblCols-1].


xPainted

private static int[] xPainted
active hit coordinates


isVisibleFlag

public boolean isVisibleFlag
If the Histogram is visible


changedAccCalibrDataFlag

public boolean changedAccCalibrDataFlag
Flag indicating that the accession calibration fields were defined or were edited


grayValueListChangedFlag

public boolean grayValueListChangedFlag
Flag indicating that the accession calibration gray value fields were defined or were edited


calibTbl

public Table calibTbl
calibration data file table

Constructor Detail

AccCALIBwizardPopup

public AccCALIBwizardPopup(Accession cs,
                           DbSample dbS,
                           int calDataMode,
                           float[] calDataList,
                           int[] grayDataList,
                           int nCalSteps,
                           int nGrayPeaks,
                           java.lang.String calUnits,
                           Table calibTbl)
AccCALIBwizardPopup() - Constructor. Note: need to call setSampleDatabase() and setNameValueEditGUI() to do repaint. Note: data structures used by this class are validated and may pass one or more (calibration values, corresponding gray values, units, calibTable).

Parameters:
cs - is an instance of the main class
dbS - is sample to calibrate
calDataMode - is CAL_WEDGE, CAL_SPOTLIST, CAL_DATA_FILE, or CAL_MANUAL
calDataList - is calibration value list [0:nCalSteps-1] if not null. These are the target values corresponding to each of the gray values. E.G., they could be OD values for an OD step wedge, etc.
grayDataList - is peak gray list [0:nGrayPeaks-1] if not null. These are the gray values corresponding to calibration data.
nCalSteps - size of calDataList[]
nGrayPeaks - size of grayDataList[]
calUnits - is name of calibration units if not null
calibTbl - is calibration Table if doing CAL_DATA_FILE
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

getMinimumSize

public java.awt.Dimension getMinimumSize()
getMinimumSize() - get the minimum preferred size

Overrides:
getMinimumSize in class java.awt.Container
Returns:
window size

positionHistWindow

private void positionHistWindow()
positionHistWindow() - position histogram window on the screen


buildHistGUI

private void buildHistGUI()
buildHistGUI() - build the histogram GUI


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

showMsg

public void showMsg(java.lang.String msg,
                    java.awt.Color color)
showMsg() - set the status msg

Parameters:
msg - is the status window msg
color - to draw it

setTitleHist

public void setTitleHist(java.lang.String title)
setTitleHist() - set the title

Parameters:
title - is window title

setVisible

public void setVisible(boolean isVisibleFlag,
                       boolean redoROIhistFlag)
setVisible() - set the histogram as visible or not

Parameters:
redoROIhistFlag - will reompute thie iData.hist[] from the ROI window in the image.

drawGifFile

boolean drawGifFile(java.lang.String oGifFileName)
drawGifFile() - draw plot into Gif image file if in stand-alone mode. This sets it up and lets paint() to the heavy lifting...

Parameters:
oGifFileName - is the full path GIF output file
Returns:
true if successful

setCalValueListCalibAccFields

public boolean setCalValueListCalibAccFields()
setCalValueListCalibAccFields() - set the accession data calibration values peak list calibration fields

Returns:
true if succeed

setGrayPeakListCalibAccFields

public boolean setGrayPeakListCalibAccFields()
setGrayPeakListCalibAccFields() - set the accession data gray value peaks list calibration fields

Returns:
true if succeed

updatePeakCalTable

private void updatePeakCalTable()
updatePeakCalTable() - update the peak calibration table GUI text field and the dbS.calib cal and gray value arrays with new data from calDataList[] and grayDataList[].
 Array of TextFields used in constructing the editable
 Peak Calibration Table.
 It is of size [0:peakCalTblRows-1][0:peakCalTblCols-1].
 holding the N_PCT_PROLOGUE rows plus the MAX_WEDGE_STEPS.
 The following is an example:
  -------------------------------------------------------------
  col #0             col #1      col #2     col #3
  -------------------------------------------------------------
 0  Calibration units ["optical density" / "Grayvalue" / "CPM", etc.]
 1  Wedge window      [calCWx1:calCWx2, calCWy1:calCWy2] - set by ROI
 2  Wedge identifier  ["manufacturer and part #"]
 3  Step #1 OD        [od value] Gray peak [gray value]
    Step #2 OD        [od value] Gray peak [gray value]
           . . .
 n  Step #n OD        [od value] Gray peak [gray value]
  -------------------------------------------------------------  


refreshMapFromTable

public boolean refreshMapFromTable(boolean updateMapFlag)
refreshMapFromTable() - refresh the peak table from the TextFields...

Parameters:
updateMapFlag - to apply the new table to updating mapGrayToCal[].
Returns:
true if succeed

reExtrapolateCalibration

private boolean reExtrapolateCalibration()
reExtrapolateCalibration() - regenerate the mapGrayToCal[] from the peak table

Returns:
true if the extrapolate succeeds

updateAccTableWithSpotList

public boolean updateAccTableWithSpotList()
updateAccTableWithSpotList() - update accession DB table with spot list data. It will save the spot size in table field "SpotMeasSize" and the list of nGrayPeaks spot centroids in field "SpotXYlist" as "x1,y1,s1,x2,y2,s2, ...xn,yn,sn" where (xi,yi) is spot i's centroid and si is its size (square of odd size centered at xi,yi). Note could use Util.cvs2iArray(xysListValue, 60, ",") to parse this and then disect out the (x,y,x) triples. If the accession DB table does not have these fields, it will add it. Then it updates the columns.

Returns:
true if updated

updateHistogramPlot

public void updateHistogramPlot(boolean redoROIhistFlag)
updateHistogramPlot() - set hist state and do repaint to draw it.

Parameters:
redoROIhistFlag - will reompute thie iData.hist[] from the ROI window in the image.

drawFilledBox

private static final void drawFilledBox(java.awt.Graphics g,
                                        int xC,
                                        int yC,
                                        int width,
                                        java.awt.Color color)
drawFilledBox() - draw plus sign at the specified color.

Parameters:
g - is graphics context
x - is center of object
y - is center of object
width - is width of object
color - is color to draw

drawHistInCanvas

private boolean drawHistInCanvas(java.awt.Graphics g)
drawHistInCanvas() - draw histogram of hist[].

Parameters:
g - is graphics context

paint

public void paint(java.awt.Graphics g)
paint() - draw the histogram

Overrides:
paint in class java.awt.Container
Parameters:
g - is graphics context
See Also:
drawHistInCanvas(java.awt.Graphics)

actionPerformed

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

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - is ActionEvent for buttons in control panel

close

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

Parameters:
tryToSaveFlag - try to save calibration if needed

update

public void update(java.awt.Graphics g)
update() - update without background the scrollable canvas

Overrides:
update in class java.awt.Container
Parameters:
g - is graphics context

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

mouseHandler

public boolean mouseHandler(int x,
                            int y)
mouseHandler() - search for the active bin if any

Parameters:
x - mouse position
y - mouse position
Returns:
true if found it in the xPainted[] list and set activeBin to the index i in [0:255] else set activeBin to -1.

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged() - process mouse event

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
Parameters:
e - is mouse pressed event

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased() - process mouse event

Specified by:
mouseReleased in interface java.awt.event.MouseListener
Parameters:
e - is mouse pressed event

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

windowClosing

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

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

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