Class ScrollableImageCanvas

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

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

This class supports a scrollable image canvas for the pseudoarray image. The scrollbars live in ArrayScroller whose event handler calls the ScrollableImageCanvas. In additionl, the mouse event handler finds the current gene if the xy coords are close to any gene and then invokes updates of other windows through the PopupRegistry.

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

Version:
$Date: 2003/07/07 21:40:40 $ $Revision: 1.19 $
Author:
P. Lemkin (NCI), G. Thornwall (SAIC), NCI-Frederick, Frederick, MD
See Also:
MAExplorer Home, ArrayScroller, DrawPseudoImage, Serialized Form

Inner classes inherited from class java.awt.Canvas
java.awt.Canvas.AccessibleAWTCanvas
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock
 
Field Summary
private  int addPixels
          extra pixels for circles
private  CompositeDatabase cdb
          link to global instance of CompositeDatabase
private  Config cfg
          link to global instance of Config
private  boolean ctrlMod
          CTRL/Mouse
private  boolean drawIntoImageFlag
          set if draw clustergram to GIF file
(package private)  int extraHeight
          status area MaHPquantTable.Y_SPOTQ_OFFSET
(package private)  int extraWidth
          status area MaHPquantTable.X_SPOTQ_OFFSET
private  Filter fc
          link to global instance of Filter
(package private)  java.awt.Point fromPoint
          mousePressed record
private  GeneClass gct
          link to global instance of GeneClass
(package private)  int iHeight
          size of array area within canvas
(package private)  ArrayScroller is
          Parent class
private  java.lang.String isName
          name of ArrayScroller parent
(package private)  int iWidth
          size of array area within canvas
private  MAExplorer mae
          link to global instance of MAExplorer
private  Maps map
          link to global instance of Maps
private  int markerShape
          either MARKER_PLUS or MARKER_CIRCLE
(package private) static int MAX_TEXT
          max # of text items
(package private)  java.awt.Font mediumFont
          small char font - 12pt
(package private)  MaHybridSample msR
          link to current sample
(package private)  java.awt.Color objColor
          object color
private  java.lang.String oGifFileName
          GIF output file if used
 int preferredHeight
           
 int preferredWidth
           
private  int scHeight
          pImage: iHeight+extraHeight of the actual canvas
private  int scWidth
          pImage: iWidth+extraWidth of the actual canvas
private  boolean shiftMod
          SHIFT/Mouse
private  boolean showedGeneMouseOverFlag
          displayed Gene MouseOver
private  boolean showedHPmouseOverFlag
          displayed HP MouseOver
(package private)  java.awt.Font smallFont
          small char font - 12pt
(package private)  java.awt.Color targetColor
          cross-hairs color
(package private)  java.awt.Point toPoint
          mouseDragged record
(package private) static int tSize
          target Size
private  int xBase
          + base address of ULHC of clipped image in image canvas used in last paint
private  int xImg
           
private  int xObj
          eventHndlr set (x,y) object position
private  int xRelMap
           
private  java.awt.Point[] xyCQ
          link to ms.xyCQ[] coordinates of spots
(package private)  java.awt.Point xyObj
          current point (xObj,yObj) on event
private  int yBase
          + base address of ULHC of clipped image in image canvas used in last paint
private  int yImg
           
private  int yObj
          eventHndlr set (x,y) object position
private  int yRelMap
           
 
Fields inherited from class java.awt.Canvas
base, nameCounter, serialVersionUID
 
Fields inherited from class java.awt.Component
accessibleContext, actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dbg, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, privateKey, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
(package private) ScrollableImageCanvas(MaHybridSample ms, int preferredWidth, int preferredHeight, ArrayScroller is)
          ScrollableImageCanvas() - constructor for scrollable pseudoarray image canvas.
 
Method Summary
private  void drawCircleAroundSpot(java.awt.Point xyo, java.awt.Graphics g, java.awt.Color optColor, int extraPixels, int thickness)
          drawCircleAroundSpot() - draw a circle around spot if visible.
private  void drawCircleAroundSpot(java.awt.Point xyo, java.awt.Graphics g, java.awt.Color optColor, int extraPixels, int thickness, java.lang.String sTitle)
          drawCircleAroundSpot() - draw circle & title around spot if visible.
private  void drawCountsOfGeneClusters(java.awt.Graphics g)
          drawCountsOfGeneClusters() - draw colored circles as nGeneClusterCnt's.
private  void drawEditedGeneList(java.awt.Graphics g)
          drawEditedGeneList() - draw magenta squares of Filter.editedCL genes
private  void drawGeneClustersOfCurrentGene(java.awt.Graphics g)
          drawGeneClustersOfCurrentGene() - draw genes in clusters as colored circles or squares
private  void drawGeneList(java.awt.Graphics g, GeneList ml, int markerBits)
          drawGeneList() - draw a gene list on either SaveAsGif or Pseudoarray Image.
(package private)  boolean drawGifFile(java.lang.String oGifFileName)
          drawGifFile() - draw pseudoimage into Gif image file if in standalone mode.
(package private)  void drawImageTitle()
          drawImageTitle() - draw title in image.
private  boolean drawNprimaryNodesGenes(java.awt.Graphics g)
          drawNprimaryNodesGenes() - draw magenta circles as nGeneClusterCnt's.
private  void drawPlustAtSpot(java.awt.Point xyo, java.awt.Graphics g, java.awt.Color optColor)
          drawPlustAtSpot() - draw a 7x7 + around spot if visible.
private  void drawSquareAroundSpot(java.awt.Point xyo, java.awt.Graphics g, java.awt.Color optColor, int useRadius)
          drawSquareAroundSpot() - draw a square around spot if visible.
private  int getHPnbrInImage(java.awt.event.MouseEvent e)
          getHPnbrInImage() - return HP # if within threshold distance
(package private)  java.awt.Point getImgPos()
          getImgPos() - get the Image position (xImg,yImg).
 java.awt.Dimension getMinimumSize()
          getMinimumSize() - get the minimum current size of the canvas size
(package private)  java.awt.Point getObjPos()
          getObjPos() - get the object position (xObj,yObj).
 java.awt.Dimension getPreferredSize()
          getPreferredSize() - get the preferred size
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.
 void mouseClicked(java.awt.event.MouseEvent e)
          mouseClicked() - handle mouse Click events
 void mouseDragged(java.awt.event.MouseEvent e)
          mouseDragged() - handle mouse dragged.
 void mouseEntered(java.awt.event.MouseEvent e)
          mouseEntered() - handle mouse Enter events
 void mouseExited(java.awt.event.MouseEvent e)
          mouseExited() - handle mouse Exit events
 void mouseMoved(java.awt.event.MouseEvent e)
          mouseMoved() - handle mouse Move events to update the mouseover display of the gene that is near the mouse.
 void mousePressed(java.awt.event.MouseEvent e)
          mousePressed() - handle mouse dragged.
 void mouseReleased(java.awt.event.MouseEvent e)
          mouseReleased() - process mouse events for pseudoarray image.
 void paint(java.awt.Graphics g)
          paint() - repaint scrollable canvas in region defined by the scroll bars.
(package private)  void setImgPos(MaHybridSample ms, int xImg, int yImg)
          setImgPos() - set the Image position.
(package private)  void setObjPos(int xObj, int yObj)
          setObjPos() - set the object position (xObj,yObj).
(package private)  void setObjState(MaHybridSample ms, int xObj, int yObj)
          setObjState() - change the object position
private  void showImageMousePos(java.awt.event.MouseEvent e, java.lang.String msg, int x, int y)
          showImageMousePos() - show the mouse positions in the image.
private  void showMouseCoords(java.lang.String msg, int x, int y, int imgNbr)
          showMouseCoords() - show the mouse coordinates for DEBUGGING
(package private)  void syncCanvasAccess()
          syncCanvasAccess() - update canvas access
 void update(java.awt.Graphics g)
          update() - update, without background, the scrollable canvas
private  void zoomImage(java.awt.Graphics g, java.awt.Image im, int xS, int yS, int cWidth, int cHeight)
          zoomImage() - zoom the image in the canvas.
 
Methods inherited from class java.awt.Canvas
, addNotify, constructComponentName, getAccessibleContext, postsOldMouseEvents
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkGD, checkImage, checkImage, checkWindowClosingException, coalesceEvents, contains, contains, createChildHierarchyEvents, createHierarchyEvents, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, dispatchEventImpl, doLayout, enable, enable, enableEvents, enableInputMethods, eventEnabled, firePropertyChange, getAccessibleIndexInParent, getAccessibleStateSet, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getMaximumSize, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkit, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, initIDs, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isRecursivelyVisible, isShowing, isValid, isVisible, keyDown, keyUp, layout, lightweightPaint, lightweightPrint, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, numListening, paintAll, paintHeavyweightComponents, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, printHeavyweightComponents, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, readObject, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, resetGC, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, validate, writeObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

mae

private MAExplorer mae
link to global instance of MAExplorer

map

private Maps map
link to global instance of Maps

cdb

private CompositeDatabase cdb
link to global instance of CompositeDatabase

cfg

private Config cfg
link to global instance of Config

fc

private Filter fc
link to global instance of Filter

msR

MaHybridSample msR
link to current sample

gct

private GeneClass gct
link to global instance of GeneClass

is

ArrayScroller is
Parent class

isName

private java.lang.String isName
name of ArrayScroller parent

xyCQ

private java.awt.Point[] xyCQ
link to ms.xyCQ[] coordinates of spots

tSize

static final int tSize
target Size

MAX_TEXT

static final int MAX_TEXT
max # of text items

markerShape

private int markerShape
either MARKER_PLUS or MARKER_CIRCLE

addPixels

private int addPixels
extra pixels for circles

xBase

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

yBase

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

xImg

private int xImg

yImg

private int yImg

xObj

private int xObj
eventHndlr set (x,y) object position

yObj

private int yObj
eventHndlr set (x,y) object position

xRelMap

private int xRelMap

yRelMap

private int yRelMap

preferredHeight

public int preferredHeight

preferredWidth

public int preferredWidth

iWidth

int iWidth
size of array area within canvas

iHeight

int iHeight
size of array area within canvas

extraWidth

int extraWidth
status area MaHPquantTable.X_SPOTQ_OFFSET

extraHeight

int extraHeight
status area MaHPquantTable.Y_SPOTQ_OFFSET

scWidth

private int scWidth
pImage: iWidth+extraWidth of the actual canvas

scHeight

private int scHeight
pImage: iHeight+extraHeight of the actual canvas

showedHPmouseOverFlag

private boolean showedHPmouseOverFlag
displayed HP MouseOver

showedGeneMouseOverFlag

private boolean showedGeneMouseOverFlag
displayed Gene MouseOver

ctrlMod

private boolean ctrlMod
CTRL/Mouse

shiftMod

private boolean shiftMod
SHIFT/Mouse

drawIntoImageFlag

private boolean drawIntoImageFlag
set if draw clustergram to GIF file

oGifFileName

private java.lang.String oGifFileName
GIF output file if used

objColor

java.awt.Color objColor
object color

targetColor

java.awt.Color targetColor
cross-hairs color

smallFont

java.awt.Font smallFont
small char font - 12pt

mediumFont

java.awt.Font mediumFont
small char font - 12pt

xyObj

java.awt.Point xyObj
current point (xObj,yObj) on event

fromPoint

java.awt.Point fromPoint
mousePressed record

toPoint

java.awt.Point toPoint
mouseDragged record
Constructor Detail

ScrollableImageCanvas

ScrollableImageCanvas(MaHybridSample ms,
                      int preferredWidth,
                      int preferredHeight,
                      ArrayScroller is)
ScrollableImageCanvas() - constructor for scrollable pseudoarray image canvas.
Parameters:
ms - is the MaHybridSample instance
preferredWidth - is the mae.canvasHSize
preferredHeight - is the mae.canvasVSize
is - is the ArrayScroller instance
Method Detail

drawGifFile

boolean drawGifFile(java.lang.String oGifFileName)
drawGifFile() - draw pseudoimage into Gif image file if in standalone mode. This sets it up and lets paint() to the heavy lifting...
Parameters:
oGifFileName - is the GIF output file full path for doing SaveAs GIF
Returns:
false if unable to generate the image file.
See Also:
Component.repaint()

syncCanvasAccess

void syncCanvasAccess()
syncCanvasAccess() - update canvas access
See Also:
Component.repaint()

getPreferredSize

public java.awt.Dimension getPreferredSize()
getPreferredSize() - get the preferred size
Overrides:
getPreferredSize in class java.awt.Component
Returns:
size of the canvas

getMinimumSize

public java.awt.Dimension getMinimumSize()
getMinimumSize() - get the minimum current size of the canvas size
Overrides:
getMinimumSize in class java.awt.Component
Returns:
size of the canvas

setObjState

void setObjState(MaHybridSample ms,
                 int xObj,
                 int yObj)
setObjState() - change the object position
Parameters:
ms - is the sample to use for current Obj
xObj - is the current X coordinate of the object
yObj - is the current Y coordinate of the object

setImgPos

void setImgPos(MaHybridSample ms,
               int xImg,
               int yImg)
setImgPos() - set the Image position. Don't repaint here. Note: used by ArrayScroller when move scroll bars.
Parameters:
ms - is the sample to use for current Obj
xObj - is the current X coordinate of the object
yObj - is the current Y coordinate of the object
See Also:
ArrayScroller.setScrollBar(int, int), Component.repaint()

getImgPos

java.awt.Point getImgPos()
getImgPos() - get the Image position (xImg,yImg).
Returns:
(xImg,yImg) point

setObjPos

void setObjPos(int xObj,
               int yObj)
setObjPos() - set the object position (xObj,yObj). Don't repaint here...
Parameters:
xObj - is the current X coordinate of the object
yObj - is the current Y coordinate of the object

getObjPos

java.awt.Point getObjPos()
getObjPos() - get the object position (xObj,yObj).
Returns:
(xObj,yObj) point

drawSquareAroundSpot

private void drawSquareAroundSpot(java.awt.Point xyo,
                                  java.awt.Graphics g,
                                  java.awt.Color optColor,
                                  int useRadius)
drawSquareAroundSpot() - draw a square around spot if visible. The color is optional and if null it draws it in Blue.
Parameters:
xyo - point to draw
g - is graphics context
optColor - to use, else Blue
useRadius - is radius to use. If <0, use mae.spotRad/2
See Also:
drawGeneList(java.awt.Graphics, GeneList, int)

drawCircleAroundSpot

private void drawCircleAroundSpot(java.awt.Point xyo,
                                  java.awt.Graphics g,
                                  java.awt.Color optColor,
                                  int extraPixels,
                                  int thickness)
drawCircleAroundSpot() - draw a circle around spot if visible. The color is optional and if null it draws it in green. If the thickness is 0, it is set to 1.
Parameters:
xyo - point to draw
g - is graphics context
optColor - to use, else Blue
extraPixels - to extend the default radius (mae.spotRad/2)
thickness - (0,1,2) of the line
See Also:
drawGeneList(java.awt.Graphics, GeneList, int)

drawCircleAroundSpot

private void drawCircleAroundSpot(java.awt.Point xyo,
                                  java.awt.Graphics g,
                                  java.awt.Color optColor,
                                  int extraPixels,
                                  int thickness,
                                  java.lang.String sTitle)
drawCircleAroundSpot() - draw circle & title around spot if visible. Draw the title to the right of the circle The color is optional and if null it draws it in green (blue). If the thickness is 0, it is set to 1.
Parameters:
xyo - point to draw
g - is graphics context
optColor - to use, else Blue
extraPixels - to extend the default radius (mae.spotRad/2)
thickness - (0,1,2) of the line
sTitle - is title to label circle
See Also:
drawGeneList(java.awt.Graphics, GeneList, int)

drawPlustAtSpot

private void drawPlustAtSpot(java.awt.Point xyo,
                             java.awt.Graphics g,
                             java.awt.Color optColor)
drawPlustAtSpot() - draw a 7x7 + around spot if visible. If presentationViewFlag is set then draw it larger 9 x 9. Default to red
Parameters:
xyo - point to draw
g - is graphics context
optColor - to use, else Red
See Also:
drawGeneList(java.awt.Graphics, GeneList, int)

showImageMousePos

private void showImageMousePos(java.awt.event.MouseEvent e,
                               java.lang.String msg,
                               int x,
                               int y)
showImageMousePos() - show the mouse positions in the image. Only report if debugging...
Parameters:
e - is mouse event so we can get the data if needed
x - is mouse X position
y - is mouse Y position

showMouseCoords

private void showMouseCoords(java.lang.String msg,
                             int x,
                             int y,
                             int imgNbr)
showMouseCoords() - show the mouse coordinates for DEBUGGING
Parameters:
ms - is message
x - is mouse X position
y - is mouse Y position
imgNbr - is the HP sample number

mapRelXYtoImage

private 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. This sets (ctrlMode, shiftMod, xImg, yImg and is.img_selectedFlag) and (xObj, yObj, xyObj).
Parameters:
e - is mouse event so we can get the key modfifiers
x - is mouse X position
y - is mouse Y position
See Also:
getHPnbrInImage(java.awt.event.MouseEvent)

drawImageTitle

void drawImageTitle()
drawImageTitle() - draw title in image.

getHPnbrInImage

private int getHPnbrInImage(java.awt.event.MouseEvent e)
getHPnbrInImage() - return HP # if within threshold distance
Parameters:
e - is MouseEvent so can get modifiers and (x,y) event data
Returns:
-1 if fail, 0 if [X] or [Y], and >=1 if entry.

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
mousePressed() - handle mouse dragged. No-op for now.
Specified by:
mousePressed in interface java.awt.event.MouseListener
Parameters:
e - is MouseEvent so can get modifiers and (x,y) event data

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged() - handle mouse dragged. No-op for now.
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
Parameters:
e - is MouseEvent so can get modifiers and (x,y) event data

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased() - process mouse events for pseudoarray image. It attempts to match the (x,y) position to active regions to change the current HP-X or HP-Y sample (also toggling the [X] and [Y]). If is is successful, it redraws the Pseudoarray Image and reruns the data Filter.

Otherwise, it attempts to latch onto a spot's (x,y) (+-spotRadius) to redefine the current gene. If it matches a spot, it redefines the current gene, updates gene information in status lines, runs the data filter, updates (xImg,yImg) with the relative position in canvas by adding (x,y) to paint ULHC base address (xBase,yBase) and repaints the canvas.

Specified by:
mouseReleased in interface java.awt.event.MouseListener
Parameters:
e - is MouseEvent so can get modifiers and (x,y) event data
See Also:
CompositeDatabase.lookupHPcoords(int, int, int, boolean, MaHybridSample), Filter.computeWorkingGeneList(), PopupRegistry.updateCurGene(int, int, java.lang.Object), SampleSets.setHPxyModStrings(), SpotFeatures.showValidSpotInfo(java.awt.Point, MaHybridSample), getHPnbrInImage(java.awt.event.MouseEvent), Component.repaint()

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked() - handle mouse Click events
Specified by:
mouseClicked in interface java.awt.event.MouseListener
Parameters:
e - is MouseEvent so can get modifiers and (x,y) event data

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved() - handle mouse Move events to update the mouseover display of the gene that is near the mouse.
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
Parameters:
e - is MouseEvent so can get modifiers and (x,y) event data
See Also:
CompositeDatabase.lookupHPcoords(int, int, int, boolean, MaHybridSample), SampleSets.setHPxyModStrings(), SpotFeatures.showValidSpotInfo(java.awt.Point, MaHybridSample), getHPnbrInImage(java.awt.event.MouseEvent)

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered() - handle mouse Enter events
Specified by:
mouseEntered in interface java.awt.event.MouseListener
Parameters:
e - is MouseEvent so can get modifiers and (x,y) event data

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
mouseExited() - handle mouse Exit events
Specified by:
mouseExited in interface java.awt.event.MouseListener
Parameters:
e - is MouseEvent so can get modifiers and (x,y) event data

update

public void update(java.awt.Graphics g)
update() - update, without background, the scrollable canvas
Overrides:
update in class java.awt.Component
Parameters:
g - is graphics to update if ready to draw.
See Also:
Component.repaint()

zoomImage

private void zoomImage(java.awt.Graphics g,
                       java.awt.Image im,
                       int xS,
                       int yS,
                       int cWidth,
                       int cHeight)
zoomImage() - zoom the image in the canvas. [DISABLED] Fake a zoom by drawing zoomed image into restricted canvas
Parameters:
g - is graphics to update if ready to draw.
im - is the image to draw into
xS - center of point to zoom into or out of
yS - center of point to zoom into or out of
cWidth - of region to zoom
cHeight - of region to zoom

drawGeneList

private void drawGeneList(java.awt.Graphics g,
                          GeneList ml,
                          int markerBits)
drawGeneList() - draw a gene list on either SaveAsGif or Pseudoarray Image. The marker bits determine what to draw.
If MARKER_GENES is set, then draw each spot in the gene list in Red(white) MARKER_PLUS, MARKER_CIRCLE or MARKER_SQUARE, MARKER_KMEANS_CLUSTER, or NONE if 0 or MARKER_NONE.
If using PLOT_PSEUDO_F1F2_IMAGE || PLOT_PSEUDO_HP_XY_IMAGE then draw it in white since the background is black.
If the MARKER_CURRENT is set then draw it as a Green circle. if Gang mode is enabled, draw it on both spots.
Parameters:
g - is graphics context
ml - is the gene list to use for overlay graphics
markerBits - is the MARKER_xxxx symbol(s) to use
See Also:
drawCircleAroundSpot(java.awt.Point, java.awt.Graphics, java.awt.Color, int, int), drawPlustAtSpot(java.awt.Point, java.awt.Graphics, java.awt.Color), drawSquareAroundSpot(java.awt.Point, java.awt.Graphics, java.awt.Color, int)

drawGeneClustersOfCurrentGene

private void drawGeneClustersOfCurrentGene(java.awt.Graphics g)
drawGeneClustersOfCurrentGene() - draw genes in clusters as colored circles or squares
See Also:
drawCircleAroundSpot(java.awt.Point, java.awt.Graphics, java.awt.Color, int, int), drawSquareAroundSpot(java.awt.Point, java.awt.Graphics, java.awt.Color, int)

drawCountsOfGeneClusters

private void drawCountsOfGeneClusters(java.awt.Graphics g)
drawCountsOfGeneClusters() - draw colored circles as nGeneClusterCnt's. If the Filter count has changed, then re-run the clustering of all filtered genes. This draws circles proportional to # clusters/gene
Parameters:
g - is graphics context
See Also:
drawCircleAroundSpot(java.awt.Point, java.awt.Graphics, java.awt.Color, int, int)

drawNprimaryNodesGenes

private boolean drawNprimaryNodesGenes(java.awt.Graphics g)
drawNprimaryNodesGenes() - draw magenta circles as nGeneClusterCnt's. This draws circles proportional to the K-means # clusters/Node-gene.
Parameters:
g - is graphics context
Returns:
true if succeed.
See Also:
drawCircleAroundSpot(java.awt.Point, java.awt.Graphics, java.awt.Color, int, int)

drawEditedGeneList

private void drawEditedGeneList(java.awt.Graphics g)
drawEditedGeneList() - draw magenta squares of Filter.editedCL genes
Parameters:
g - is graphics context
See Also:
EditedGeneList, Filter, drawSquareAroundSpot(java.awt.Point, java.awt.Graphics, java.awt.Color, int)

paint

public void paint(java.awt.Graphics g)
paint() - repaint scrollable canvas in region defined by the scroll bars. This includes the pseudoarray image which is then followed by various overlays include: the genes passing the data filter, clustered genes, K-means clustered genes, genes in the EGL, etc. If they requested a "SaveAs GIF", then it creates WriteGifEncoder image to draw in and then save and then it repaints one more time to refresh the visible canvas.
Overrides:
paint in class java.awt.Canvas
Parameters:
g - is graphics context
See Also:
DrawPseudoImage.drawPseudoImage(java.awt.Graphics, int, int, int, MaHybridSample), WriteGifEncoder, WriteGifEncoder.writeFile(java.lang.String), drawCountsOfGeneClusters(java.awt.Graphics), drawEditedGeneList(java.awt.Graphics), drawGeneClustersOfCurrentGene(java.awt.Graphics), drawGeneList(java.awt.Graphics, GeneList, int), drawNprimaryNodesGenes(java.awt.Graphics), Component.repaint(), zoomImage(java.awt.Graphics, java.awt.Image, int, int, int, int)