Class EventMenu

java.lang.Object
  extended by EventMenu
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.ItemListener, java.util.EventListener

public class EventMenu
extends java.lang.Object
implements java.awt.event.ItemListener, java.awt.event.ActionListener

EventMenu class supports menu item event handling for Flicker top level GUI.

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 Flicker Mozilla and Legal files are available on http://open2dprot.sourceforge.net/Flicker/

Version:
$Date$ $Revision$
Author:
P. Lemkin (LECB/NCI), G. Thornwall (SAIC), Frederick, MD
See Also:
Flicker Home

Field Summary
private  BuildGUI bGui
           
private  Flicker flk
          instances of global classes
 int id
           
private static ImageData iData
           
private static java.lang.String imgFile
           
private  ImageIO imgIO
           
private static ImageScroller lastIS
           
private static boolean leftOrRightSelectedFlag
          Flag that indicates the currently selected image is either left or right.
private  Landmark lms
           
 java.lang.String name
           
 Popup popup
           
private  Util util
           
private  Windump windmp
           
 
Constructor Summary
EventMenu(Flicker flk, BuildGUI bGui)
          EventMenu() - constructor
EventMenu(java.lang.String name, int id)
          EventMenu() - constructor assigns name and id to object.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          actionPerformed() - common function to handle action events
 void itemStateChanged(java.awt.event.ItemEvent e)
          itemStateChanged() - handle menu item state changed events
private  boolean lookupCanvasPtrAndName()
          lookupCanvasPtrAndName() - lookup current image base on activeImage.
 boolean processTransform(java.lang.String cmd, java.lang.String lastISName, int extFctNbr)
          processTransform() - process the specified transform
 void setAccessServerDBcheckbox(java.awt.CheckboxMenuItem cmb)
          setAccessServerDBcheckbox() - set checkbox radio button afor server access DB
 void setWindmpRadixCheckbox(int radix)
          setWindmpRadixCheckbox() - set checkbox radio button and process event for windmp radix checkboxes
 void setWindmpSizeCheckbox(int size)
          setWindmpSizeCheckbox() - set checkbox radio button and process event for windmp size checkboxes
 void shutOffGuardRegion()
          shutOffGuardRegion() - turn off guard region
 void turnOnGuardRegion()
          turnOnGuardRegion() - turn on guard region
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

flk

private Flicker flk
instances of global classes


bGui

private BuildGUI bGui

util

private Util util

popup

public Popup popup

imgIO

private ImageIO imgIO

lms

private Landmark lms

windmp

private Windump windmp

id

public int id

name

public java.lang.String name

lastIS

private static ImageScroller lastIS

imgFile

private static java.lang.String imgFile

iData

private static ImageData iData

leftOrRightSelectedFlag

private static boolean leftOrRightSelectedFlag
Flag that indicates the currently selected image is either left or right. It is false for "flicker" or none.

Constructor Detail

EventMenu

public EventMenu(Flicker flk,
                 BuildGUI bGui)
EventMenu() - constructor

Parameters:
flk - is Flicker instance

EventMenu

public EventMenu(java.lang.String name,
                 int id)
EventMenu() - constructor assigns name and id to object.

Parameters:
name - to assign
id - to assign
Method Detail

lookupCanvasPtrAndName

private boolean lookupCanvasPtrAndName()
lookupCanvasPtrAndName() - lookup current image base on activeImage. Set the instance variables
  instance  Image         Image         Image       Image
  variable  "left"        "right"       "flicker"   none
  ========  ======        =======       =========   ====
  iData     fli.iData1    flk.iData2    null        null
  lastIS    flk.i1IS      flk.i2IS      flk.flkIS   null
  imgFile   iData.imgName iData.imgName "flicker"   "no image"

 Then set leftOrRightSelectedFlag if the "left" or "right" 
 image was selected.

Returns:
leftOrRightSelectedFlag

setWindmpSizeCheckbox

public void setWindmpSizeCheckbox(int size)
setWindmpSizeCheckbox() - set checkbox radio button and process event for windmp size checkboxes

Parameters:
cb - checkbox item is one of bGui.mi_WinDmpSizeNxNCB
size - is the size X size window in the range of 5 to 40.

setWindmpRadixCheckbox

public void setWindmpRadixCheckbox(int radix)
setWindmpRadixCheckbox() - set checkbox radio button and process event for windmp radix checkboxes

Parameters:
cb - checkbox item is one of bGui.mi_WinDmpRadix_XXX_CB
radix - is the radix to set Windump.SHOW_XXXXX

setAccessServerDBcheckbox

public void setAccessServerDBcheckbox(java.awt.CheckboxMenuItem cmb)
setAccessServerDBcheckbox() - set checkbox radio button afor server access DB

Parameters:
cmb - checkbox menu item

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
itemStateChanged() - handle menu item state changed events

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

processTransform

public boolean processTransform(java.lang.String cmd,
                                java.lang.String lastISName,
                                int extFctNbr)
processTransform() - process the specified transform

Parameters:
cmd - is the transform to be performed on the current image
lastISName - is the image scroller selected to be transformed it is either "left" or "right"
extFctNbr - is the external plugin fuction number if NOT 0
Returns:
true if succeed

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed() - common function to handle action events

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

shutOffGuardRegion

public void shutOffGuardRegion()
shutOffGuardRegion() - turn off guard region


turnOnGuardRegion

public void turnOnGuardRegion()
turnOnGuardRegion() - turn on guard region