Class ScrollableImageCanvas

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Canvas
          extended by ScrollableImageCanvas
All Implemented Interfaces:
java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

 class ScrollableImageCanvas
extends java.awt.Canvas
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.KeyListener

ScrollableImageCanvas class supports a scrollable canvas Define a scrollable image canvas. Note the scroll bars may or may not exist and so we need to test for this.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Canvas
java.awt.Canvas.AccessibleAWTCanvas
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  boolean altMod
          ALT/Mouse
(package private)  BrightnessContrastFilter bcImgF
          Instance of Brightness/Contrast Filter.
(package private)  int bkGrdX
          bk grd X
(package private)  int bkGrdY
          bk grd Y
(package private)  java.awt.Point centerPt
          center point
(package private)  int cHeight
          canvas height
(package private)  int circleX
          img X coords for circle
(package private)  int circleY
          img Y coords for circle
(package private)  java.awt.Color[] color_text
          text list items colors
private  boolean ctrlMod
          CTRL/Mouse
private  boolean ctrlShiftMod
          CTRL-SHIFT/Mouse
 java.awt.Point curPos
          keep track of current "+" where last clicked in 1.0 (mag) state
 ImageScroller currentIS
          right or left IS that is being flickered
(package private)  int cWidth
          canvas width
(package private)  Flicker flk
           
 java.awt.Point flkCurPos
           
(package private)  java.awt.Font[] font_text
          text list fonts
 int guardHeight
          size of top & bottom guard region
 int guardImgHeight
          size of img with guard region
 int guardImgWidth
          size of img with guard region
 boolean guardRegionFlag
          guard region flag
 int guardWidth
          size of right & left guard region
(package private)  int gValue
          gray value of (x,y) pixel object
(package private)  int imgRoiX1
          The true position of ROI with respect to the image not canvas
(package private)  int imgRoiX2
          The true position of ROI with respect to the image not canvas
(package private)  int imgRoiY1
          The true position of ROI with respect to the image not canvas
(package private)  int imgRoiY2
          The true position of ROI with respect to the image not canvas
(package private)  Info info
           
 ImageScroller is
          Parent class
(package private)  java.lang.String isName
          name of ImageScroller parent
(package private)  java.lang.String lastlastISName
          from time before...
(package private)  int MAX_TEXT
          max # of text items
(package private)  java.awt.Dimension maxCanvasDim
          Maximum canvas size
(package private)  int nTextItems
          actual # text items to display
 int preferredHeight
          preferred size of canvas
 int preferredWidth
          preferred size of canvas
(package private)  java.lang.String saveAsImgFile
          Name of GIF file to save the next repaint.
(package private)  java.awt.Point scrollPos
          current scroll position
(package private) static java.awt.Color selectedImageColor
          selected image title color
private  boolean shiftMod
          SHIFT/Mouse
(package private)  int sicHeight
          image height
(package private)  int sicWidth
          image width
(package private)  java.lang.String[] text
          text list items
(package private)  int ticX
          tic mark X
(package private)  int ticY
          tic mark Y
(package private)  int tSize
          target Size
(package private) static java.awt.Color unselectedImageColor
          selected image title color
(package private)  boolean useScrollBarsFlag
          create and use scrollers flag
(package private)  Util util
          new boundary state
(package private)  java.awt.Dimension viewPortSize
          dimensions of the view port
(package private)  int[] x_text
          x text list items positions
(package private)  int X_TRIAL_OBJ_OFFSET
          offset to draw trial obj
(package private)  int xBase
          + base address of ULHC of clipped image in image canvas used in last paint
(package private)  int xCtr
          center coords of image, for zoom/dezoom
(package private)  int xImg
          + image address (x,y)+(xBase,yBase)
(package private)  int xObj
           
(package private)  int[] y_text
          y text list items positions
(package private)  int Y_TRIAL_OBJ_OFFSET
          offset to draw label
(package private)  int yBase
           
(package private)  int yCtr
          center coords of image, for zoom/dezoom
(package private)  int yImg
          + externally set (x,y) object position
(package private)  int yObj
           
 
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
ScrollableImageCanvas(java.awt.Image img, ImageScroller is, Flicker flk, boolean useScrollBarsFlag)
          ScrollableImageCanvas() - constructor.
 
Method Summary
 void cleanup()
          cleanup() - destroy data structures
 void clearLandmarkTextListToDraw()
          clearLandmarkTextListToDraw() - disable text list of landmarks to draw in canvas.
 void copy(ScrollableImageCanvas newSIC)
          copy() - destroy data structures
private  void drawBackgroundCircleInImage(java.awt.Graphics g, java.awt.Image pImg)
          drawBackgroundCircleInImage() - draw background circle in window if visible.
private  void drawCircleAroundSpot(java.awt.Graphics g, int xC, int yC, java.awt.Color color, int radius, int thickness)
          drawCircleAroundSpot() - draw a circle around spot if visible.
 void drawImageTitle()
          drawImageTitle() - draw title in image.
private  void drawLandmarksTextInImage(java.awt.Graphics g, int xFlkOrigin, int yFlkOrigin)
          drawLandmarksTextInImage() - redraw landmark text[] in the image at (x,y)[] locs with the specified color and fonts.
private  void drawMeasCircleInImage(java.awt.Graphics g, java.awt.Image pImg)
          drawMeasCircleInImage() - draw measurement circles in window if visible.
private  void drawRoiInImage(java.awt.Graphics g, java.awt.Image iImg)
          drawRoiInImage() - draw region of interest in window if visible.
private  void drawSpotMeasurementsInImage(java.awt.Graphics g, java.awt.Image pImg)
          drawSpotMeasurementsInImage() - Draw spot measurements in image if valid and is visible.
private  void drawTargetOverlay(java.awt.Graphics g, ImageScroller is, ImageScroller currentIS)
          drawTargetOverlay() - Draw Target Overlay in the ImageScroller window.
private  void drawTrialObjInImage(java.awt.Graphics g)
          drawTrialObjInImage() - redraw xyObj in window if visible.
 java.awt.Point getImgPosition()
          getImgPosition() - get the Image position.
 java.awt.Point getNewImageCenterPoint()
          getNewImageCenterPoint() - Calc new center point in image based on scrollers
 java.awt.Point getObjPosition()
          getObjPosition() - get the object position.
 java.awt.Dimension getPreferredSize()
          getPreferredSize() - getPreferredSize, must be implemented for ScrollPane to be displayed correctly.
 java.awt.Point guardRegionCorrection(java.awt.Point pt)
          guardRegionCorrection() - return guard region location
private  void highlightActiveIS()
          highlightActiveIS() - highlight ScrollableImageCanvas.
 void keyPressed(java.awt.event.KeyEvent e)
          keyPressed() - handle key pressed events
 void keyReleased(java.awt.event.KeyEvent e)
          keyReleased() - handle key down events
 void keyTyped(java.awt.event.KeyEvent e)
          keyTyped() - handle key down events
(package private)  boolean mapRelCircleCoordstoImageCoords(int cX, int cY, int bX, int bY, java.awt.Image pImg)
          mapRelCircleCoordstoImageCoords() - remap circle center and background (x,y) coords in current canvas to img coords (x,y).
(package private)  boolean mapRelRoiCoordstoImageCoords(int x1, int x2, int y1, int y2, java.awt.Image pImg)
          mapRelRoiCoordstoImageCoords() - remap ROI(x,y) in current canvas to img ROI(x,y).
(package private)  void mapRelXYtoImage(java.awt.event.MouseEvent e, int x, int y)
          mapRelXYtoImage() - map (x,y) Mouse in current canvas to (xImg,yImg) as well as updating the parent.(xImg,yImg) values which are RELATIVE to the current image.
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseDragged(java.awt.event.MouseEvent e)
          mouseDragged() - update (xImg,yImg) with relative position in canvas by adding (x,y) to paint ULHC base address (xBase,yBase).
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
          mousePressed() - update (xImg,yImg) with relative position in canvas by adding (x,y) to paint ULHC base address (xBase,yBase).
 void mouseReleased(java.awt.event.MouseEvent e)
          mouseReleased() - update (xImg,yImg) with relative position in canvas by adding (x,y) to paint ULHC base address (xBase,yBase).
 void paint(java.awt.Graphics g)
          paint() - repaint scrollable canvas in region defined by scroll bars
 boolean processBCimage(ImageData id)
          processBCimage() - process colormap image by running the filter.
 void setCanvasSize(int size)
          setCanvasSize() - change the size of this Canvas.
 void setCanvasSize(int preferredWidth, int preferredHeight)
          setCanvasSize() - change the size of this Canvases.
 void setImgPosition(int xImg, int yImg)
          setImgPosition() - set the Image position.
 void setLandmarksTextListToDraw(int nTextItems, java.awt.Color[] color_text, java.lang.String[] text, java.awt.Font[] font_text, int[] x_text, int[] y_text)
          setLandmarksTextListToDraw() - set text list including color and position.
 void setObjPosition(int xObj, int yObj)
          setObjPosition() - set the object position.
(package private)  void setTrialLMS(int x, int y)
          setTrialLMS() - set trial landmark in & center image, save object(x,y).
(package private)  void showImageMousePositions(java.awt.event.MouseEvent e, java.lang.String msgs, int x, int y)
          showImageMousePositions() - show the image mouse positions Only report if debugging...
 void update(java.awt.Graphics g)
          update() - update without background the scrollable canvas
(package private)  void updateClickableCanvas()
          updateClickableCanvas() - perform clickable canvas update operations invoked by various controls.
 void updateImageScrollableTitles(boolean forceUpdateFlag)
          updateImageScrollableTitles() - update 1 or 2 scrollable images
(package private)  void updateScrollCanvas()
          updateScrollCanvas() - scroll the image in the scrollable canvas.
 
Methods inherited from class java.awt.Canvas
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

util

Util util
new boundary state


flk

Flicker flk

info

Info info

tSize

final int tSize
target Size

See Also:
Constant Field Values

MAX_TEXT

final int MAX_TEXT
max # of text items

See Also:
Constant Field Values

X_TRIAL_OBJ_OFFSET

final int X_TRIAL_OBJ_OFFSET
offset to draw trial obj

See Also:
Constant Field Values

Y_TRIAL_OBJ_OFFSET

final int Y_TRIAL_OBJ_OFFSET
offset to draw label

See Also:
Constant Field Values

is

public ImageScroller is
Parent class


isName

java.lang.String isName
name of ImageScroller parent


lastlastISName

java.lang.String lastlastISName
from time before...


saveAsImgFile

java.lang.String saveAsImgFile
Name of GIF file to save the next repaint. This is initially null, and is reset to null after it writes the file.


bcImgF

BrightnessContrastFilter bcImgF
Instance of Brightness/Contrast Filter. It is reused across images for this image scroller.


nTextItems

int nTextItems
actual # text items to display


xBase

int xBase
+ base address of ULHC of clipped image in image canvas used in last paint


yBase

int yBase

xImg

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


yImg

int yImg
+ externally set (x,y) object position


xObj

int xObj

yObj

int yObj

imgRoiX1

int imgRoiX1
The true position of ROI with respect to the image not canvas


imgRoiX2

int imgRoiX2
The true position of ROI with respect to the image not canvas


imgRoiY1

int imgRoiY1
The true position of ROI with respect to the image not canvas


imgRoiY2

int imgRoiY2
The true position of ROI with respect to the image not canvas


circleX

int circleX
img X coords for circle


circleY

int circleY
img Y coords for circle


bkGrdX

int bkGrdX
bk grd X


bkGrdY

int bkGrdY
bk grd Y


ticX

int ticX
tic mark X


ticY

int ticY
tic mark Y


gValue

int gValue
gray value of (x,y) pixel object


ctrlMod

private boolean ctrlMod
CTRL/Mouse


shiftMod

private boolean shiftMod
SHIFT/Mouse


ctrlShiftMod

private boolean ctrlShiftMod
CTRL-SHIFT/Mouse


altMod

private boolean altMod
ALT/Mouse


selectedImageColor

static java.awt.Color selectedImageColor
selected image title color


unselectedImageColor

static java.awt.Color unselectedImageColor
selected image title color


color_text

java.awt.Color[] color_text
text list items colors


text

java.lang.String[] text
text list items


font_text

java.awt.Font[] font_text
text list fonts


x_text

int[] x_text
x text list items positions


y_text

int[] y_text
y text list items positions


maxCanvasDim

java.awt.Dimension maxCanvasDim
Maximum canvas size


centerPt

java.awt.Point centerPt
center point


scrollPos

java.awt.Point scrollPos
current scroll position


viewPortSize

java.awt.Dimension viewPortSize
dimensions of the view port


cWidth

int cWidth
canvas width


cHeight

int cHeight
canvas height


sicWidth

int sicWidth
image width


sicHeight

int sicHeight
image height


guardWidth

public int guardWidth
size of right & left guard region


guardHeight

public int guardHeight
size of top & bottom guard region


guardImgWidth

public int guardImgWidth
size of img with guard region


guardImgHeight

public int guardImgHeight
size of img with guard region


xCtr

int xCtr
center coords of image, for zoom/dezoom


yCtr

int yCtr
center coords of image, for zoom/dezoom


preferredWidth

public int preferredWidth
preferred size of canvas


preferredHeight

public int preferredHeight
preferred size of canvas


useScrollBarsFlag

boolean useScrollBarsFlag
create and use scrollers flag


currentIS

public ImageScroller currentIS
right or left IS that is being flickered


curPos

public java.awt.Point curPos
keep track of current "+" where last clicked in 1.0 (mag) state


flkCurPos

public java.awt.Point flkCurPos

guardRegionFlag

public boolean guardRegionFlag
guard region flag

Constructor Detail

ScrollableImageCanvas

ScrollableImageCanvas(java.awt.Image img,
                      ImageScroller is,
                      Flicker flk,
                      boolean useScrollBarsFlag)
ScrollableImageCanvas() - constructor.

Parameters:
img - is the image to create
is - is the image scroller associated with the image
flk - is the link to the main class.
Method Detail

copy

public void copy(ScrollableImageCanvas newSIC)
copy() - destroy data structures


cleanup

public void cleanup()
cleanup() - destroy data structures


getPreferredSize

public java.awt.Dimension getPreferredSize()
getPreferredSize() - getPreferredSize, must be implemented for ScrollPane to be displayed correctly.

Overrides:
getPreferredSize in class java.awt.Component

setCanvasSize

public void setCanvasSize(int size)
setCanvasSize() - change the size of this Canvas. We assume that the legality of the new size is checked prior to this method being called.

Parameters:
size - is new size

setCanvasSize

public void setCanvasSize(int preferredWidth,
                          int preferredHeight)
setCanvasSize() - change the size of this Canvases. We assume that the legality of the new size is checked prior to this method being called.

Parameters:
preferredWidth - is new width
preferredHeight - is new height

setImgPosition

public void setImgPosition(int xImg,
                           int yImg)
setImgPosition() - set the Image position.

Parameters:
xImg - is the image position.
yImg - is the image position

getImgPosition

public java.awt.Point getImgPosition()
getImgPosition() - get the Image position.

Returns:
image position point

setObjPosition

public void setObjPosition(int xObj,
                           int yObj)
setObjPosition() - set the object position. Don't repaint here...

Parameters:
xObj - is object position
yObj - is object position

getObjPosition

public java.awt.Point getObjPosition()
getObjPosition() - get the object position.

Returns:
object position point

setLandmarksTextListToDraw

public void setLandmarksTextListToDraw(int nTextItems,
                                       java.awt.Color[] color_text,
                                       java.lang.String[] text,
                                       java.awt.Font[] font_text,
                                       int[] x_text,
                                       int[] y_text)
setLandmarksTextListToDraw() - set text list including color and position. To disable the list, just set nTextItems to 0.

Parameters:
nTextItems - to set
color_text - list to set
text - list to set
font_text - list to set
x_text - list to set
y_text - list to set

clearLandmarkTextListToDraw

public void clearLandmarkTextListToDraw()
clearLandmarkTextListToDraw() - disable text list of landmarks to draw in canvas.


drawLandmarksTextInImage

private final void drawLandmarksTextInImage(java.awt.Graphics g,
                                            int xFlkOrigin,
                                            int yFlkOrigin)
drawLandmarksTextInImage() - redraw landmark text[] in the image at (x,y)[] locs with the specified color and fonts. Note: landmarks are indicated by "+"

Parameters:
g - is graphics context
xFlkOrigin - new x (0,0) to draw img to in flicker window only
yFlkOrigin - new y (0,0) to draw img to in flicker window only

getNewImageCenterPoint

public java.awt.Point getNewImageCenterPoint()
getNewImageCenterPoint() - Calc new center point in image based on scrollers

Returns:
Point new center point image based on scrollers

drawTrialObjInImage

private final void drawTrialObjInImage(java.awt.Graphics g)
drawTrialObjInImage() - redraw xyObj in window if visible.

Parameters:
g - is graphics context

mapRelRoiCoordstoImageCoords

final boolean mapRelRoiCoordstoImageCoords(int x1,
                                           int x2,
                                           int y1,
                                           int y2,
                                           java.awt.Image pImg)
mapRelRoiCoordstoImageCoords() - remap ROI(x,y) in current canvas to img ROI(x,y). NOTE: it is possible for either (x1,y1) to be -1 or (x2,y2) to be -1 and thus be undefined

Parameters:
x1 - is ROI coords
x2 - is ROI coords
y1 - is ROI coords
y2 - is ROI coords
Returns:
false if neither(x1,y1) or (x2,y2) defined, or img null.

drawRoiInImage

private final void drawRoiInImage(java.awt.Graphics g,
                                  java.awt.Image iImg)
drawRoiInImage() - draw region of interest in window if visible.

Parameters:
g - is graphics context

mapRelCircleCoordstoImageCoords

final boolean mapRelCircleCoordstoImageCoords(int cX,
                                              int cY,
                                              int bX,
                                              int bY,
                                              java.awt.Image pImg)
mapRelCircleCoordstoImageCoords() - remap circle center and background (x,y) coords in current canvas to img coords (x,y).

Parameters:
cX - is circle x coords
cY - is circle y coords
bX - is background coords
bX - is background y coords
Returns:
true if ok, false if no img

drawBackgroundCircleInImage

private final void drawBackgroundCircleInImage(java.awt.Graphics g,
                                               java.awt.Image pImg)
drawBackgroundCircleInImage() - draw background circle in window if visible.

Parameters:
g - is graphics context

drawMeasCircleInImage

private final void drawMeasCircleInImage(java.awt.Graphics g,
                                         java.awt.Image pImg)
drawMeasCircleInImage() - draw measurement circles in window if visible.

Parameters:
g - is graphics context

drawSpotMeasurementsInImage

private final void drawSpotMeasurementsInImage(java.awt.Graphics g,
                                               java.awt.Image pImg)
drawSpotMeasurementsInImage() - Draw spot measurements in image if valid and is visible. It will draw various combinations of things depending on the switch options.
 
   Location switches               Action
   -----------------------------   ----------------------------  
   flk.viewDrawSpotLocCircleFlag   Draw circle 
 or
   flk.viewDrawSpotLocPlusFlag     Draw '+'
 or 
    neither                        Don't indicate location

   Annotation switches             Action draw right of location
   -----------------------------   -----------------------------  
   flk.viewDrawSpotAnnNbrFlag      Draw s.nbr 
 or
   flk.viewDrawSpotAnnIdFlag       Draw s.id or ""
 or 
    neither                        Don't indicate annotation

Parameters:
g - is graphics context

drawCircleAroundSpot

private void drawCircleAroundSpot(java.awt.Graphics g,
                                  int xC,
                                  int yC,
                                  java.awt.Color color,
                                  int radius,
                                  int thickness)
drawCircleAroundSpot() - draw a circle around spot if visible. NOTE: It draws (2*radius+thickess) diameter circle.

Parameters:
g - is graphics context
xC - is center of circle
yC - is center of the circle
color - to use
radius - to draw circle
thickness - (0,1,2) of the line

drawTargetOverlay

private void drawTargetOverlay(java.awt.Graphics g,
                               ImageScroller is,
                               ImageScroller currentIS)
drawTargetOverlay() - Draw Target Overlay in the ImageScroller window.


showImageMousePositions

final void showImageMousePositions(java.awt.event.MouseEvent e,
                                   java.lang.String msgs,
                                   int x,
                                   int y)
showImageMousePositions() - show the image mouse positions Only report if debugging...

Parameters:
e - is mouse event
msgs - is message to display
x - is image object position
y - is image object position

mapRelXYtoImage

final void mapRelXYtoImage(java.awt.event.MouseEvent e,
                           int x,
                           int y)
mapRelXYtoImage() - map (x,y) Mouse in current canvas to (xImg,yImg) as well as updating the parent.(xImg,yImg) values which are RELATIVE to the current image. Set the lastISName for possible use elsewhere.

Parameters:
e - is mouse event
x - is image cursor
y - is image cursor

updateImageScrollableTitles

public final void updateImageScrollableTitles(boolean forceUpdateFlag)
updateImageScrollableTitles() - update 1 or 2 scrollable images

Parameters:
forceUpdateFlag - state

drawImageTitle

public final void drawImageTitle()
drawImageTitle() - draw title in image. Also if displaying grayscale and using circular mask, then draw the circle around (xObj,yObj)


setTrialLMS

final void setTrialLMS(int x,
                       int y)
setTrialLMS() - set trial landmark in & center image, save object(x,y). This moves the scroll image and object to (x,y).

Parameters:
x - is trial LMS cursor
y - is trial LMS cursor

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
keyPressed() - handle key pressed events

Specified by:
keyPressed in interface java.awt.event.KeyListener
Parameters:
e - is KeyEvent

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
keyTyped() - handle key down events

Specified by:
keyTyped in interface java.awt.event.KeyListener
Parameters:
e - is KeyEvent

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
keyReleased() - handle key down events

Specified by:
keyReleased in interface java.awt.event.KeyListener
Parameters:
e - is KeyEvent

processBCimage

public boolean processBCimage(ImageData id)
processBCimage() - process colormap image by running the filter. NOTE: need to do repaint() just after this call. NOTE: we must sync this so that it completes a full image computation before we do it again. If not allowing image transforms (i.e. !flk.allowXformFlag), then use the id.iImg. Otherwise, if we are composing output images then use id.oImg else id.iImg. It creates the id.bcImg in the process if successful

Parameters:
id - is the ImageData to get the image to process
Returns:
true if succeed

updateClickableCanvas

void updateClickableCanvas()
updateClickableCanvas() - perform clickable canvas update operations invoked by various controls. It uses the current (xImg,yImg) values for this canvas.


updateScrollCanvas

void updateScrollCanvas()
updateScrollCanvas() - scroll the image in the scrollable canvas. It uses the current (xImg,yImg) values for this canvas.


highlightActiveIS

private void highlightActiveIS()
highlightActiveIS() - highlight ScrollableImageCanvas.


mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged() - update (xImg,yImg) with relative position in canvas by adding (x,y) to paint ULHC base address (xBase,yBase). If not CONTROL and not SHIFT keys, set the new image scroll positions. If SHIFT key, change brightness/contrast for this canvas.

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

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
mousePressed() - update (xImg,yImg) with relative position in canvas by adding (x,y) to paint ULHC base address (xBase,yBase). If !CTRL & !SHIFT mode, then set trial landmark for corresponding image at the (xObj,yObj) defined by the current mouse position. Draw the position in the image title. Set the img_selectedFlag for the image. If clickableImageDBflag, then dont set the trial landmark, but access the database if the clickableGUIbaseURL exists.

Specified by:
mousePressed in interface java.awt.event.MouseListener
Parameters:
e - is MouseEvent

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased() - update (xImg,yImg) with relative position in canvas by adding (x,y) to paint ULHC base address (xBase,yBase). If CONTROL key, rescroll canvas.

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

mouseClicked

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

mouseMoved

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

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

guardRegionCorrection

public java.awt.Point guardRegionCorrection(java.awt.Point pt)
guardRegionCorrection() - return guard region location

Returns:
guard region point

update

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

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

paint

public void paint(java.awt.Graphics g)
paint() - repaint scrollable canvas in region defined by scroll bars

Overrides:
paint in class java.awt.Canvas
Parameters:
g - is graphics context