|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Canvas
|
+--Draw2DprotPlot
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.
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 |
|
| 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 |
public ProtPlot prp
public ReadPRP rd
public Filter fil
public ShowScatterPlotPopup spp
private UtilPRP util
public static int dbugCnt
public static final double ln10
public static final double log10e
static final int RADIUS
static final int MIN_CANVAS_WIDTH
static final int MIN_CANVAS_HEIGHT
static final int XRANGE_DEF
static final int YRANGE_DEF
static final int XOFFSET_DEF
static final int YOFFSET_DEF
static final int SCALE_DEF
static final int TARGET_SIZE
public int preferredHeight
public int preferredWidth
private int iWidth
private int iHeight
java.awt.Font normFont
java.awt.Font titleFont
public int nPointsMax
public float[] xDataScatterPlot
public float[] yDataScatterPlot
public int[] xPlotted
public int[] yPlotted
public int nPointsPlotted
public int cvPrecision
public java.lang.String vertCaption
public java.lang.String horizCaption
public java.lang.String title
public java.lang.String topTitle1
public java.lang.String topTitle2
public java.lang.String topTitle3
public java.lang.String topTitle4
public java.lang.String lowerTitle1
public java.lang.String lowerTitle2
public java.lang.String info1
public java.lang.String info2
public java.lang.String info3
public java.lang.String info4
public java.lang.String info5
public java.lang.String info6
public java.lang.String aText
private int xText
private int yText
public double scaleX
public double scaleY
public double minX
public double maxX
public double minY
public double maxY
public double minXscroll
public double minYscroll
public double maxXscroll
public double maxYscroll
private boolean logScalingFlag
private float xScale
private float yScale
private float xBase
private float yBase
private int xOffset
private int yOffset
private float xRange
private float yRange
private int xLeft
private int xRight
private float scaleXplot
private float scaleYplot
private float logScaleY
private float logScaleX
private int scale
private int radius
private int leftTextX
private int yTop
private int iCurMPid
private int xcurProtein
private int ycurProtein
private java.lang.String sMinX
private java.lang.String sMaxX
private java.lang.String sMinY
private java.lang.String sMaxY
private java.awt.Color curProteinColor
private java.awt.Color okColor
private java.awt.Color notOkColor
private java.awt.Color pointColor
private int xPnt
private int yPnt
int iBest
float eDiff
float eDiffBest
private java.awt.Image img
private boolean drawIntoImageFlag
private java.lang.String oGifFileName
| Constructor Detail |
Draw2DprotPlot(ProtPlot prp,
ShowScatterPlotPopup spp,
java.lang.String title)
prp - is instance of ProtPlotspp - is instance of ShowScatterPlotPopup if it is parent, else nulltitle - for the display| Method Detail |
public void setupArrays(int nPointsToPlot)
nPointsToPlot - is max # of points to plotpublic java.awt.Dimension getPreferredSize()
getPreferredSize in class java.awt.Componentpublic java.awt.Dimension getMinimumSize()
getMinimumSize in class java.awt.Componentpublic boolean drawGifFile(java.lang.String oGifFileName)
oGifFileName - is the name of the GIF output file.Component.repaint()public void paint(java.awt.Graphics g)
paint in class java.awt.Canvasg - is graphics context
private final void drawPlus(java.awt.Graphics g,
int x,
int y,
java.awt.Color color)
g - is graphics contextx - is x coordinate to ploty - is y coordinate to plotcolor - to draw the plus sign
private final void drawCircle(java.awt.Graphics g,
int xC,
int yC,
int radius,
java.awt.Color color)
g - is graphics contextx - is x coordinate to ploty - is y coordinate to plotradius - is size of circle to drawcolor - to draw the circle
private final void drawSquare(java.awt.Graphics g,
int xC,
int yC,
int radius,
java.awt.Color color)
g - is graphics contextx - is x coordinate to ploty - is y coordinate to plotradius - is size of circle to drawcolor - to draw the circle
private final void drawFilledGrayCircle(java.awt.Graphics g,
int x,
int y,
int radius,
int grayValue)
g - is graphics contextx - is x coordinate to ploty - is y coordinate to plotradius - is size of circle to drawgrayValue - to draw the circle
private final void drawFilledColoredCircle(java.awt.Graphics g,
int x,
int y,
int radius,
int red,
int green,
int blue)
g - is graphics contextx - is x coordinate to ploty - is y coordinate to plotradius - is size of circle to drawred - to component of color to drawgreen - to component of color to drawblue - to component of color to draw
private final void drawFilledColoredCircle(java.awt.Graphics g,
int x,
int y,
int radius,
java.awt.Color color)
g - is graphics contextx - is x coordinate to ploty - is y coordinate to plotred - to component of color to drawgreen - to component of color to drawblue - to component of color to draw
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)
vertCaption - vertical captionhorizCaption - horizontal captiontitle - title of the displaytopTitle1 - is the upper LHC datatopTitle2 - topTitle3 - topTitle4 - lowerTitle1 - is the data for below X axislowerTitle2 - 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 samplesmaxX - is the max possible range of XminY - is the min possible range of YmaxY - is the max possible range of Y
public void updateScrolledRegion(float xLB,
float xUB,
float yLB,
float yUB)
xLB - range 0.0:1.0xUB - in range 0.0:1.0yLB - in range 0.0:1.0yUB - in range 0.0:1.0
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)
info1 - is the data for the 1st info lineinfo2 - is the data for the 2nd info lineinfo3 - is the data for the 3rd info lineinfo4 - is the data for the 4th info lineinfo5 - is the data for the 5th info lineinfo6 - is the data for the 5th info linepublic void calcBaseImage()
private void drawRedPlusGreenRatioScaleMap(java.awt.Graphics gi,
int yTop,
int xRight,
float maxValue,
float minValue)
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
gi - is graphics contextyTop - position of the scale mapxRight - position of the scale mapmaxValue - correspoding to top of scale mapminValue - correspoding to bottom of scale map
private void drawCmapRatioScaleMap(java.awt.Graphics gi,
int yTop,
int xRight,
float maxValue,
float minValue)
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]
gi - is graphics contextyTop - position of the scale mapxRight - position of the scale mapmaxValue - correspoding to top of scale mapminValue - correspoding to bottom of scale map
private void drawScaleMap(java.awt.Graphics gi,
int yTop,
int xRight,
float maxValue,
float minValue)
gi - is graphics contextyTop - position of the scale mapxRight - position of the scale mapmaxValue - correspoding to top of scale mapminValue - correspoding to bottom of scale mapprivate void drawFilterStatusText(java.awt.Graphics g)
g - is graphics contextprivate void drawScatterPlotScaleAndLabels(java.awt.Graphics g)
private boolean drawProtein(java.awt.Graphics g,
int idx,
int mPid)
g - is Graphics contextidx - is the idx'th index that corresponds to the mPidmPid - is protein to drawprivate void draw2Dplot(java.awt.Graphics g)
g - is graphics contextpublic void updateScaling(boolean logScalingFlag)
logScalingFlag - to enable log scalingpublic static double logZero(double x)
x - is value to usepublic static double log10(double x)
x - is value to usepublic static double alog10(double x)
x - is value to usepublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenere - is MouseEventpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenere - is MouseEventpublic void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenerpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenerpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenerpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListener
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||