Class Draw2DprotPlot

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
              |
              +--Draw2DprotPlot
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
Direct Known Subclasses:
DrawProtScatterPlot

public class Draw2DprotPlot
extends java.awt.Canvas
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener

Class Draw2DPlot.java - draw 2D graphics protein scatterplot. This work was produced by Peter Lemkin of the National Cancer Institute, an agency of the United States Government and Djamel Medjahed (SAIC-Frederick). 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.

Version:
$Date: 2002/10/14 20:17:17 $ $Revision: $
Author:
P. Lemkin (NCI), Djamel Medjahed (SAIC), NCI-Frederick, Frederick, MD
See Also:
ProtPlot Home

This work was derived from MAExplorer under the Mozilla 1.1 Open Source Public License by Peter Lemkin of the National Cancer Institute, an agency of the United States Government subject to the limitations noted in the accompanying LEGAL file. See licence info on http://maexplorer.sourceforge.org/, 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
 java.lang.String aText
           
private  java.awt.Color curProteinColor
           
 int cvPrecision
           
static int dbugCnt
          debugging counter
private  boolean drawIntoImageFlag
          set if draw clustergram to GIF file
(package private)  float eDiff
           
(package private)  float eDiffBest
           
 Filter fil
          instance of Filter
 java.lang.String horizCaption
           
(package private)  int iBest
          Best index of spot closest to where clicked with mouse
private  int iCurMPid
           
private  int iHeight
           
private  java.awt.Image img
          [TODO] buffered spot image.
 java.lang.String info1
           
 java.lang.String info2
           
 java.lang.String info3
           
 java.lang.String info4
           
 java.lang.String info5
           
 java.lang.String info6
           
private  int iWidth
           
private  int leftTextX
           
static double ln10
          log(x)= ln10*ln(x)
static double log10e
          ln(x)= log10e*log(x)
private  float logScaleX
           
private  float logScaleY
           
private  boolean logScalingFlag
          Linear(false)/Log(true)
 java.lang.String lowerTitle1
           
 java.lang.String lowerTitle2
           
 double maxX
          range set in initial call
 double maxXscroll
          range set by ShowPlotPopup scrollers
 double maxY
          range set in initial call
 double maxYscroll
          range set by ShowPlotPopup scrollers
(package private) static int MIN_CANVAS_HEIGHT
           
(package private) static int MIN_CANVAS_WIDTH
           
 double minX
          range set in initial call
 double minXscroll
          range set by ShowPlotPopup scrollers
 double minY
          range set in initial call
 double minYscroll
          range set by ShowPlotPopup scrollers
(package private)  java.awt.Font normFont
          The normal font
private  java.awt.Color notOkColor
           
 int nPointsMax
          maximum drawing list size.
 int nPointsPlotted
          # points plotted after data is filtered
private  java.lang.String oGifFileName
          GIF output file if used
private  java.awt.Color okColor
           
private  java.awt.Color pointColor
           
 int preferredHeight
          target Size for selecting a line
 int preferredWidth
          target Size for selecting a line
 ProtPlot prp
          instance of ProtPlot
private  int radius
           
(package private) static int RADIUS
           
 ReadPRP rd
          instance of ReadPRP
private  int scale
           
(package private) static int SCALE_DEF
           
 double scaleX
           
private  float scaleXplot
           
 double scaleY
           
private  float scaleYplot
           
private  java.lang.String sMaxX
           
private  java.lang.String sMaxY
           
private  java.lang.String sMinX
           
private  java.lang.String sMinY
           
 ShowScatterPlotPopup spp
          instance of ShowScatterPlotPopup if the parent, else null
(package private) static int TARGET_SIZE
           
 java.lang.String title
           
(package private)  java.awt.Font titleFont
          The title font
 java.lang.String topTitle1
           
 java.lang.String topTitle2
           
 java.lang.String topTitle3
           
 java.lang.String topTitle4
           
private  UtilPRP util
          instance of UtilPRP
 java.lang.String vertCaption
           
private  float xBase
          baseline for xList to xPnt
private  int xcurProtein
          current protein if defined
 float[] xDataScatterPlot
          X Coords [0:nPointsMax-1] used for computing ratios when clicking
private  int xLeft
           
private  int xOffset
           
(package private) static int XOFFSET_DEF
           
 int[] xPlotted
          X Coord [0:nPointsMax-1] for clicking on point in list
private  int xPnt
          xList[0:prp.nMpidSamples-1] data mapped to int
private  float xRange
           
(package private) static int XRANGE_DEF
           
private  int xRight
           
private  float xScale
          slope for xList to xPnt
private  int xText
           
private  float yBase
          baseline for yList to yPnt
private  int ycurProtein
          current protein if defined
 float[] yDataScatterPlot
          Y Coord [0:nPointsMax-1] used for computing ratios when clicking
private  int yOffset
           
(package private) static int YOFFSET_DEF
           
 int[] yPlotted
          Y Coord [0:nPointsMax-1] for clicking on point in list
private  int yPnt
          yList[0:prp.nMpidSamples-1] data mapped to int
private  float yRange
           
(package private) static int YRANGE_DEF
           
private  float yScale
          slope for yList to yPnt
private  int yText
           
private  int yTop
           
 
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) Draw2DprotPlot(ProtPlot prp, ShowScatterPlotPopup spp, java.lang.String title)
          Draw2Dplot() - constructor
 
Method Summary
static double alog10(double x)
          alog10() - compute alog(x) base 10.
 void calcBaseImage()
          calcBaseImage() - calculate base image for plot into img.
private  void draw2Dplot(java.awt.Graphics g)
          draw2Dplot() - draw a plot in the current graphics context This is the main plot drawing method generally called by paint().
private  void drawCircle(java.awt.Graphics g, int xC, int yC, int radius, java.awt.Color color)
          drawCircle() - draw a circle The color is optional and if null it draws it in green (blue).
private  void drawCmapRatioScaleMap(java.awt.Graphics gi, int yTop, int xRight, float maxValue, float minValue)
          drawCmapRatioScaleMap() - draw Cmap ratio scale factor color map on the right side of the canvas.
private  void drawFilledColoredCircle(java.awt.Graphics g, int x, int y, int radius, java.awt.Color color)
          drawFilledColoredCircle() - draw filled circle of specified RGB color
private  void drawFilledColoredCircle(java.awt.Graphics g, int x, int y, int radius, int red, int green, int blue)
          drawFilledColoredCircle() - draw filled circle of specified RGB color
private  void drawFilledGrayCircle(java.awt.Graphics g, int x, int y, int radius, int grayValue)
          drawFilledGrayCircle() - draw filled circle of specified gray value
private  void drawFilterStatusText(java.awt.Graphics g)
          drawFilterStatusText() - draw additional text on Filter status if required
 boolean drawGifFile(java.lang.String oGifFileName)
          drawGifFile() - draw clustergram into Gif image file.
private  void drawPlus(java.awt.Graphics g, int x, int y, java.awt.Color color)
          drawPlus() - draw plus sign
private  boolean drawProtein(java.awt.Graphics g, int idx, int mPid)
          drawProteinSpot() - draw protein mPid if passes the data filter
private  void drawRedPlusGreenRatioScaleMap(java.awt.Graphics gi, int yTop, int xRight, float maxValue, float minValue)
          drawRedPlusGreenRatioScaleMap() - draw (Red+Green)=(X+Y) scale factor color map on right side of the canvas
private  void drawScaleMap(java.awt.Graphics gi, int yTop, int xRight, float maxValue, float minValue)
          drawScaleMap() - draw scale factor color map on right side of the canvas
private  void drawScatterPlotScaleAndLabels(java.awt.Graphics g)
          drawScatterPlotScaleAndLabels() - draw scatterplot scale lines and labels
private  void drawSquare(java.awt.Graphics g, int xC, int yC, int radius, java.awt.Color color)
          drawSquare() - draw a square The color is optional and if null it draws it in green (blue).
 java.awt.Dimension getMinimumSize()
          getMinimumSize() - get the preferred size
 java.awt.Dimension getPreferredSize()
          getPreferredSize() - get the preferred size
static double log10(double x)
          log10() - compute log(x) base 10.
static double logZero(double x)
          logZero() - compute log10((x==0.0 ? 0.0 : x) - avoid log(0.0)! This defaults log10(0.0) to log(1.0).
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseDragged(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
          mouseMoved() - process mouse event - update MouseOver
 void mousePressed(java.awt.event.MouseEvent e)
          mousePressed() - process mouse event, change current clone
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void paint(java.awt.Graphics g)
          paint() - draw the expression profile
 void set2DplotSubtitles(java.lang.String info1, java.lang.String info2, java.lang.String info3, java.lang.String info4, java.lang.String info5, java.lang.String info6)
          set2DplotSubtitles() - set info1,2,3,4,5,6 subtitles for plot
 void setupArrays(int nPointsToPlot)
          setupArrays() - setup the arrays.
 void update2Dplot(java.lang.String vertCaption, java.lang.String horizCaption, java.lang.String title, java.lang.String topTitle1, java.lang.String topTitle2, java.lang.String topTitle3, java.lang.String topTitle4, java.lang.String lowerTitle1, java.lang.String lowerTitle2, java.lang.String aText, int xText, int yText, double scaleX, double scaleY, double minX, double maxX, double minY, double maxY)
          update2Dplot() - set data for plot.
 void updateScaling(boolean logScalingFlag)
          updateScaling() - set scaling mode in proper sub-object.
 void updateScrolledRegion(float xLB, float xUB, float yLB, float yUB)
          updateScrolledRegion() - update scrolled region to plot [(x1,y1):(x2,y2)].
 
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

prp

public ProtPlot prp
instance of ProtPlot

rd

public ReadPRP rd
instance of ReadPRP

fil

public Filter fil
instance of Filter

spp

public ShowScatterPlotPopup spp
instance of ShowScatterPlotPopup if the parent, else null

util

private UtilPRP util
instance of UtilPRP

dbugCnt

public static int dbugCnt
debugging counter

ln10

public static final double ln10
log(x)= ln10*ln(x)

log10e

public static final double log10e
ln(x)= log10e*log(x)

RADIUS

static final int RADIUS

MIN_CANVAS_WIDTH

static final int MIN_CANVAS_WIDTH

MIN_CANVAS_HEIGHT

static final int MIN_CANVAS_HEIGHT

XRANGE_DEF

static final int XRANGE_DEF

YRANGE_DEF

static final int YRANGE_DEF

XOFFSET_DEF

static final int XOFFSET_DEF

YOFFSET_DEF

static final int YOFFSET_DEF

SCALE_DEF

static final int SCALE_DEF

TARGET_SIZE

static final int TARGET_SIZE

preferredHeight

public int preferredHeight
target Size for selecting a line

preferredWidth

public int preferredWidth
target Size for selecting a line

iWidth

private int iWidth

iHeight

private int iHeight

normFont

java.awt.Font normFont
The normal font

titleFont

java.awt.Font titleFont
The title font

nPointsMax

public int nPointsMax
maximum drawing list size. Set when going to draw

xDataScatterPlot

public float[] xDataScatterPlot
X Coords [0:nPointsMax-1] used for computing ratios when clicking

yDataScatterPlot

public float[] yDataScatterPlot
Y Coord [0:nPointsMax-1] used for computing ratios when clicking

xPlotted

public int[] xPlotted
X Coord [0:nPointsMax-1] for clicking on point in list

yPlotted

public int[] yPlotted
Y Coord [0:nPointsMax-1] for clicking on point in list

nPointsPlotted

public int nPointsPlotted
# points plotted after data is filtered

cvPrecision

public int cvPrecision

vertCaption

public java.lang.String vertCaption

horizCaption

public java.lang.String horizCaption

title

public java.lang.String title

topTitle1

public java.lang.String topTitle1

topTitle2

public java.lang.String topTitle2

topTitle3

public java.lang.String topTitle3

topTitle4

public java.lang.String topTitle4

lowerTitle1

public java.lang.String lowerTitle1

lowerTitle2

public java.lang.String lowerTitle2

info1

public java.lang.String info1

info2

public java.lang.String info2

info3

public java.lang.String info3

info4

public java.lang.String info4

info5

public java.lang.String info5

info6

public java.lang.String info6

aText

public java.lang.String aText

xText

private int xText

yText

private int yText

scaleX

public double scaleX

scaleY

public double scaleY

minX

public double minX
range set in initial call

maxX

public double maxX
range set in initial call

minY

public double minY
range set in initial call

maxY

public double maxY
range set in initial call

minXscroll

public double minXscroll
range set by ShowPlotPopup scrollers

minYscroll

public double minYscroll
range set by ShowPlotPopup scrollers

maxXscroll

public double maxXscroll
range set by ShowPlotPopup scrollers

maxYscroll

public double maxYscroll
range set by ShowPlotPopup scrollers

logScalingFlag

private boolean logScalingFlag
Linear(false)/Log(true)

xScale

private float xScale
slope for xList to xPnt

yScale

private float yScale
slope for yList to yPnt

xBase

private float xBase
baseline for xList to xPnt

yBase

private float yBase
baseline for yList to yPnt

xOffset

private int xOffset

yOffset

private int yOffset

xRange

private float xRange

yRange

private float yRange

xLeft

private int xLeft

xRight

private int xRight

scaleXplot

private float scaleXplot

scaleYplot

private float scaleYplot

logScaleY

private float logScaleY

logScaleX

private float logScaleX

scale

private int scale

radius

private int radius

leftTextX

private int leftTextX

yTop

private int yTop

iCurMPid

private int iCurMPid

xcurProtein

private int xcurProtein
current protein if defined

ycurProtein

private int ycurProtein
current protein if defined

sMinX

private java.lang.String sMinX

sMaxX

private java.lang.String sMaxX

sMinY

private java.lang.String sMinY

sMaxY

private java.lang.String sMaxY

curProteinColor

private java.awt.Color curProteinColor

okColor

private java.awt.Color okColor

notOkColor

private java.awt.Color notOkColor

pointColor

private java.awt.Color pointColor

xPnt

private int xPnt
xList[0:prp.nMpidSamples-1] data mapped to int

yPnt

private int yPnt
yList[0:prp.nMpidSamples-1] data mapped to int

iBest

int iBest
Best index of spot closest to where clicked with mouse

eDiff

float eDiff

eDiffBest

float eDiffBest

img

private java.awt.Image img
[TODO] buffered spot image. This gets updated 1. if useFilterFlag, useExprFlag changes 2. if filtering and the Filter or tissue bits change.

drawIntoImageFlag

private boolean drawIntoImageFlag
set if draw clustergram to GIF file

oGifFileName

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

Draw2DprotPlot

Draw2DprotPlot(ProtPlot prp,
               ShowScatterPlotPopup spp,
               java.lang.String title)
Draw2Dplot() - constructor
Parameters:
prp - is instance of ProtPlot
spp - is instance of ShowScatterPlotPopup if it is parent, else null
title - for the display
Method Detail

setupArrays

public void setupArrays(int nPointsToPlot)
setupArrays() - setup the arrays. If the # of points to plot increases then realloc the arrays.
Parameters:
nPointsToPlot - is max # of points to plot

getPreferredSize

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

getMinimumSize

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

drawGifFile

public boolean drawGifFile(java.lang.String oGifFileName)
drawGifFile() - draw clustergram into Gif image file. This sets it up and lets paint() to the heavy lifting...
Parameters:
oGifFileName - is the name of the GIF output file.
See Also:
Component.repaint()

paint

public void paint(java.awt.Graphics g)
paint() - draw the expression profile
Overrides:
paint in class java.awt.Canvas
Parameters:
g - is graphics context

drawPlus

private final void drawPlus(java.awt.Graphics g,
                            int x,
                            int y,
                            java.awt.Color color)
drawPlus() - draw plus sign
Parameters:
g - is graphics context
x - is x coordinate to plot
y - is y coordinate to plot
color - to draw the plus sign

drawCircle

private final void drawCircle(java.awt.Graphics g,
                              int xC,
                              int yC,
                              int radius,
                              java.awt.Color color)
drawCircle() - draw a circle The color is optional and if null it draws it in green (blue). if prp.useDichromasyFlag then use blue.
Parameters:
g - is graphics context
x - is x coordinate to plot
y - is y coordinate to plot
radius - is size of circle to draw
color - to draw the circle

drawSquare

private final void drawSquare(java.awt.Graphics g,
                              int xC,
                              int yC,
                              int radius,
                              java.awt.Color color)
drawSquare() - draw a square The color is optional and if null it draws it in green (blue). if useDichomasyFlag then use blue.
Parameters:
g - is graphics context
x - is x coordinate to plot
y - is y coordinate to plot
radius - is size of circle to draw
color - to draw the circle

drawFilledGrayCircle

private final void drawFilledGrayCircle(java.awt.Graphics g,
                                        int x,
                                        int y,
                                        int radius,
                                        int grayValue)
drawFilledGrayCircle() - draw filled circle of specified gray value
Parameters:
g - is graphics context
x - is x coordinate to plot
y - is y coordinate to plot
radius - is size of circle to draw
grayValue - to draw the circle

drawFilledColoredCircle

private final void drawFilledColoredCircle(java.awt.Graphics g,
                                           int x,
                                           int y,
                                           int radius,
                                           int red,
                                           int green,
                                           int blue)
drawFilledColoredCircle() - draw filled circle of specified RGB color
Parameters:
g - is graphics context
x - is x coordinate to plot
y - is y coordinate to plot
radius - is size of circle to draw
red - to component of color to draw
green - to component of color to draw
blue - to component of color to draw

drawFilledColoredCircle

private final void drawFilledColoredCircle(java.awt.Graphics g,
                                           int x,
                                           int y,
                                           int radius,
                                           java.awt.Color color)
drawFilledColoredCircle() - draw filled circle of specified RGB color
Parameters:
g - is graphics context
x - is x coordinate to plot
y - is y coordinate to plot
red - to component of color to draw
green - to component of color to draw
blue - to component of color to draw

update2Dplot

public void update2Dplot(java.lang.String vertCaption,
                         java.lang.String horizCaption,
                         java.lang.String title,
                         java.lang.String topTitle1,
                         java.lang.String topTitle2,
                         java.lang.String topTitle3,
                         java.lang.String topTitle4,
                         java.lang.String lowerTitle1,
                         java.lang.String lowerTitle2,
                         java.lang.String aText,
                         int xText,
                         int yText,
                         double scaleX,
                         double scaleY,
                         double minX,
                         double maxX,
                         double minY,
                         double maxY)
update2Dplot() - set data for plot. The list of mPids is in global list prp.mPidSamples[0:prp.nMpidSamples-1].
Parameters:
vertCaption - vertical caption
horizCaption - horizontal caption
title - title of the display
topTitle1 - is the upper LHC data
topTitle2 -  
topTitle3 -  
topTitle4 -  
lowerTitle1 - is the data for below X axis
lowerTitle2 -  
aText -  
xText -  
yText -  
scaleX - is the global scaling (1.0 fixed)
scaleY - is the global scaling (1.0 fixed)
minX - is the min possible range of X of current set of samples
maxX - is the max possible range of X
minY - is the min possible range of Y
maxY - is the max possible range of Y

updateScrolledRegion

public void updateScrolledRegion(float xLB,
                                 float xUB,
                                 float yLB,
                                 float yUB)
updateScrolledRegion() - update scrolled region to plot [(x1,y1):(x2,y2)].
Parameters:
xLB - range 0.0:1.0
xUB - in range 0.0:1.0
yLB - in range 0.0:1.0
yUB - in range 0.0:1.0

set2DplotSubtitles

public void set2DplotSubtitles(java.lang.String info1,
                               java.lang.String info2,
                               java.lang.String info3,
                               java.lang.String info4,
                               java.lang.String info5,
                               java.lang.String info6)
set2DplotSubtitles() - set info1,2,3,4,5,6 subtitles for plot
Parameters:
info1 - is the data for the 1st info line
info2 - is the data for the 2nd info line
info3 - is the data for the 3rd info line
info4 - is the data for the 4th info line
info5 - is the data for the 5th info line
info6 - is the data for the 5th info line

calcBaseImage

public void calcBaseImage()
calcBaseImage() - calculate base image for plot into img. This gets updated 1. if useFilterFlag, useExprFlag changes 2. if filtering and the Filter or tissue bits change.

drawRedPlusGreenRatioScaleMap

private void drawRedPlusGreenRatioScaleMap(java.awt.Graphics gi,
                                           int yTop,
                                           int xRight,
                                           float maxValue,
                                           float minValue)
drawRedPlusGreenRatioScaleMap() - draw (Red+Green)=(X+Y) scale factor color map on right side of the canvas
 It makes a color grid
             Max-ratio         Min-ratio
  Max-expr  RED (X=1.0) . . . GREEN (Y=1.0)  full colors
                        . . .
  Min-expr  RED (X=0.0) . . . GREEN (Y=0.0)  (black)

 So at each point it makes a color (R,G,B)= (255*X*r,255*Y*r',0).
 where r 
Parameters:
gi - is graphics context
yTop - position of the scale map
xRight - position of the scale map
maxValue - correspoding to top of scale map
minValue - correspoding to bottom of scale map

drawCmapRatioScaleMap

private void drawCmapRatioScaleMap(java.awt.Graphics gi,
                                   int yTop,
                                   int xRight,
                                   float maxValue,
                                   float minValue)
drawCmapRatioScaleMap() - draw Cmap ratio scale factor color map on the right side of the canvas. Ratio values range from -10.0 through 1.0 through +10.0. Ratio Values beyond [-10.0 : +10.0] are mapped to [-10.0 : +10.0]. The spp.eCMapRatios[0:8] contains the ratio values The spp.eCMapRatios[0:8] contains the colors values
 Color points are:
   +10.0  brightest red (255,0,0)     eCmapColor[0]
   + 5.0  bright red (200,0,0)        eCmapColor[1]
   + 2.0  medium red (170,0,0)        eCmapColor[2]
   + 1.5  dim red (128,0,0)           eCmapColor[3]
   + 1.0  black (0,0,0)               eCmapColor[4]
   -1/1.5   dim green (0,128,0)       eCmapColor[5]
   -1/2.0   medium green (0,170,0)    eCmapColor[6]
   -1/5.0   bright green (0,200,0)    eCmapColor[7]
   -1/10.0  brightest green (0,255,0) eCmapColor[8]
Parameters:
gi - is graphics context
yTop - position of the scale map
xRight - position of the scale map
maxValue - correspoding to top of scale map
minValue - correspoding to bottom of scale map

drawScaleMap

private void drawScaleMap(java.awt.Graphics gi,
                          int yTop,
                          int xRight,
                          float maxValue,
                          float minValue)
drawScaleMap() - draw scale factor color map on right side of the canvas
Parameters:
gi - is graphics context
yTop - position of the scale map
xRight - position of the scale map
maxValue - correspoding to top of scale map
minValue - correspoding to bottom of scale map

drawFilterStatusText

private void drawFilterStatusText(java.awt.Graphics g)
drawFilterStatusText() - draw additional text on Filter status if required
Parameters:
g - is graphics context

drawScatterPlotScaleAndLabels

private void drawScatterPlotScaleAndLabels(java.awt.Graphics g)
drawScatterPlotScaleAndLabels() - draw scatterplot scale lines and labels

drawProtein

private boolean drawProtein(java.awt.Graphics g,
                            int idx,
                            int mPid)
drawProteinSpot() - draw protein mPid if passes the data filter
Parameters:
g - is Graphics context
idx - is the idx'th index that corresponds to the mPid
mPid - is protein to draw
Returns:
true if drew the spot

draw2Dplot

private void draw2Dplot(java.awt.Graphics g)
draw2Dplot() - draw a plot in the current graphics context This is the main plot drawing method generally called by paint().
Parameters:
g - is graphics context

updateScaling

public void updateScaling(boolean logScalingFlag)
updateScaling() - set scaling mode in proper sub-object. Linear(false)/Log(true)
Parameters:
logScalingFlag - to enable log scaling

logZero

public static double logZero(double x)
logZero() - compute log10((x==0.0 ? 0.0 : x) - avoid log(0.0)! This defaults log10(0.0) to log(1.0).
Parameters:
x - is value to use
Returns:
log10(x) with zero detection

log10

public static double log10(double x)
log10() - compute log(x) base 10. Since log(x)= ln(10)*ln(x).
Parameters:
x - is value to use
Returns:
log10(x)

alog10

public static double alog10(double x)
alog10() - compute alog(x) base 10. Since ln(x)= log10(e)*log(x).
Parameters:
x - is value to use
Returns:
alog10(x)

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
mousePressed() - process mouse event, change current clone
Specified by:
mousePressed in interface java.awt.event.MouseListener
Parameters:
e - is MouseEvent

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved() - process mouse event - update MouseOver
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
Parameters:
e - is MouseEvent

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

mouseReleased

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

mouseDragged

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