Class DrawScatterPlot

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
              |
              +--Draw2Dplot
                    |
                    +--DrawScatterPlot
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 DrawScatterPlot
extends Draw2Dplot

Class to draw scatter plot in an extended Draw2Dplot canvas. It is updated by the PopupRegistry when the normalization, current gene, Filter.workingCL, or other state values change.

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:41 $ $Revision: 1.11 $
Author:
P. Lemkin (NCI), G.g Thornwall (SAIC), NCI-Frederick, Frederick, MD
See Also:
MAExplorer Home, Draw2Dplot, ShowPlotPopup, 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  CompositeDatabase cdb
          link to global instance
private  MAExplorer mae
          link to global instance
private  Maps map
          link to global instance
private  MaHybridSample ms
          link to global instance
private  int plotMode
          plot mode of scatter plot
private  int prevBestMID
          MID closest to point click on
private  ShowPlotPopup spp
          parent window
 
Fields inherited from class Draw2Dplot
aText, aTextOrig, cvPrecision, cx1, cx2, cy1, cy2, dispCL, draw180lineFlag, draw45lineFlag, drawIntoImageFlag, epov, eventHandlerCL, fc, fontReg, gScatterPlot, horizCaption, iFontHdrSize, iFontSize, iHeight, info1, info2, info3, info4, iWidth, jGrpList, logScalingFlag, mapPntToMid, maxLineList, maxX, maxXscroll, maxY, maxYscroll, MIN_CANVAS_HEIGHT, MIN_CANVAS_WIDTH, minX, minXscroll, minY, minYscroll, nLineGroup, nList, nPointsPlotted, oGifFileName, olmap, plotMode2D, preferredHeight, preferredWidth, propList, scaleX, scaleY, showNonFilteredGenesFlag, TARGET_SIZE, title, title1, title2, title3, topTitle, useXaxisIntNbrFlag, vertCaption, vx1, vx2, vy1, vy2, xBase, xDataScatterPlot, xLineList, xList, xPlotted, xPnt, xScale, xText, yBase, yDataScatterPlot, yLineList, yList, yPlotted, yPnt, yScale, yText
 
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) DrawScatterPlot(MAExplorer mae, ShowPlotPopup spp, int plotMode)
          DrawScatterPlot() - constructor to create scatter plot
 
Method Summary
(package private)  boolean drawGifFile(java.lang.String oGifFileName)
          drawGifFile() - draw plot into Gif image file if in standalone mode.
(package private)  void drawScatterPlot()
          drawScatterPlot() - draw scatter plot (repeatedly) of Filter data
 void mouseHandler(int x, int y, int mouseKeyMods, boolean setCurGeneFlag)
          mouseHandler() - interact with current plot if a graphic plot.
(package private)  void setCurGene(int mid)
          setCurGene() - set current gene and update data in displays
(package private)  void showGeneMsgsAndPlot(int mid)
          showGeneMsgsAndPlot() - show quant&NCBI data messages in MSG and in plot
(package private)  void showGeneOfInterest(int mid, int mouseKeyMods, boolean setCurGeneFlag)
          showGeneOfInterest() - show quant&NCBI data if click on a point in plot
(package private)  void updateScatterPlot()
          updateScatterPlot() - refresh scatter plot Note: prevBestMID could be -1 or -2.
 
Methods inherited from class Draw2Dplot
clipCodeViewport, clipViewport, draw2Dplot, drawCircle, drawFilledColoredCircle, drawFilledGrayCircle, drawNamedOverlayMaps, drawPlus, drawRectangleBin, drawSquare, getMinimumSize, getPreferredSize, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, paint, set2DplotSubtitles, setDataToClip, setFontsFromState, setViewport, update2Dplot, updateScaling, updateScrolledRegion
 
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, update, 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

ms

private MaHybridSample ms
link to global instance

map

private Maps map
link to global instance

cdb

private CompositeDatabase cdb
link to global instance

plotMode

private int plotMode
plot mode of scatter plot

spp

private ShowPlotPopup spp
parent window

prevBestMID

private int prevBestMID
MID closest to point click on
Constructor Detail

DrawScatterPlot

DrawScatterPlot(MAExplorer mae,
                ShowPlotPopup spp,
                int plotMode)
DrawScatterPlot() - constructor to create scatter plot
Parameters:
mae - is the MAExplorer instance
spp - is the ShowPlotPopup instance
plotMode - is the specific plot mode to implement
See Also:
drawScatterPlot()
Method Detail

updateScatterPlot

void updateScatterPlot()
updateScatterPlot() - refresh scatter plot Note: prevBestMID could be -1 or -2.
See Also:
drawScatterPlot(), showGeneMsgsAndPlot(int)

drawGifFile

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

drawScatterPlot

void drawScatterPlot()
drawScatterPlot() - draw scatter plot (repeatedly) of Filter data
See Also:
CompositeDatabase.getNormHP_XandYdata(float[], float[], int[], GeneList, MaHybridSample, MaHybridSample, boolean, boolean), MathMAE.calcXYstat(int, float[], float[], int[], java.lang.String, java.lang.String), MaHybridSample.getF1F2Data(float[], float[], int[], GeneList, boolean, boolean, boolean), MenuBarFrame.setHP_XYlabels(), SampleSets.setHPxyModStrings(), Util.showMsg(java.lang.String), Util.showMsg2(java.lang.String), Draw2Dplot.update2Dplot(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, int, int, double, double, double, double, double, double, boolean, boolean, float[], float[], int[], GeneList, int, int[])

setCurGene

void setCurGene(int mid)
setCurGene() - set current gene and update data in displays
Parameters:
mid - is the new Master Gene ID of the current gene
See Also:
CompositeDatabase.setObjCoordFromMID(int, java.lang.Object), showGeneMsgsAndPlot(int)

showGeneMsgsAndPlot

void showGeneMsgsAndPlot(int mid)
showGeneMsgsAndPlot() - show quant&NCBI data messages in MSG and in plot
Parameters:
mid - is the Master Gene Index if not -1
See Also:
GridCoords.cvtGID2str(int, boolean), MaHybridSample.getSpotDataStatic(int, boolean), SpotFeatures.getSpotFeatures(java.awt.Point, MaHybridSample), SpotFeatures.getSpotGenomicData(java.awt.Point, MaHybridSample), Util.cvf2s(float, int), Util.showMsg(java.lang.String), Util.showFeatures(java.lang.String, java.lang.String), Draw2Dplot.set2DplotSubtitles(java.lang.String, java.lang.String, java.lang.String, java.lang.String)

showGeneOfInterest

void showGeneOfInterest(int mid,
                        int mouseKeyMods,
                        boolean setCurGeneFlag)
showGeneOfInterest() - show quant&NCBI data if click on a point in plot
Parameters:
mid - is the Master Gene Index if not -1
mouseKeyMods - is Shift/Control key modifiers
setCurGeneFlag - if true
See Also:
PopupRegistry.updateCurGene(int, int, java.lang.Object), Component.repaint(), setCurGene(int), showGeneMsgsAndPlot(int)

mouseHandler

public void mouseHandler(int x,
                         int y,
                         int mouseKeyMods,
                         boolean setCurGeneFlag)
mouseHandler() - interact with current plot if a graphic plot. If get a hit, then display data for the gene. Note: because the plot lives in the ScrollerImageCanvas, there is only ONE plot so can't get into trouble with multiple plots.
Parameters:
x - is mouse x coordinate
y - is mouse y coordinate
mouseKeyMods - is Shift/Control key modifiers
setCurGeneFlag - if true
See Also:
Component.repaint(), Draw2Dplot.set2DplotSubtitles(java.lang.String, java.lang.String, java.lang.String, java.lang.String), showGeneOfInterest(int, int, boolean)