|
||||||||||
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 | +--DrawRatioHistogram
This class draws a ratio histogram on an extended Canvas. It is updated by the PopupRegistry when the normalization, 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/.
ShowPlotPopup
, Serialized FormInner 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 |
activeBin
active bin # [0:nHist] else -1 |
private int[] |
binIndex
corresponding hist bin index |
private CompositeDatabase |
cdb
link to global instance |
private int |
curXbinIdx
index of X axis for data arrays |
private boolean |
drawIntoImageFlag
set if draw plot to GIF file |
private int[] |
histRatio
freq bin hist[0:nHist-1]. |
private double[] |
histValue
value bin hist[0:nHist-1]. |
private java.lang.String |
horizCaption
horizontal caption |
private java.lang.String |
horizVariableCaption
horizontal variable caption |
private int |
iHeight
|
private int |
iWidth
|
private boolean |
logScalingFlag
Linear(false)/Log(true) |
private MAExplorer |
mae
link to global instance |
private double |
maxX
ARG: maximum possible value range set by scrollers |
private double |
maxXfound
min value of range of values found |
(package private) static int |
MIN_CANVAS_HEIGHT
|
(package private) static int |
MIN_CANVAS_WIDTH
|
private double |
minX
ARG: minimum possible value range set by scrollers |
private double |
minXfound
min value of range of values found |
private java.lang.String |
ncStr
Info on genes in the current bin |
private int |
nHist
hist[0:npoints-1] |
private java.lang.String |
oGifFileName
full Gif file path name |
private boolean |
outsideRangeFlag
for testing range |
private java.awt.Canvas |
pCanvas
canvas used to draw ratio histogram |
private int |
plotMode
plot mode |
private int |
pointType
point type: DRAW _PLUS, _CIRCLE, _BOX |
int |
preferredHeight
|
int |
preferredWidth
|
private float |
ratioLower
lower range of histogram values |
private float |
ratioUpper
upper range of histogram values |
private java.awt.Font |
smallFont
font used for lableing |
private ShowPlotPopup |
spp
link to global instance |
(package private) static int |
TARGET_SIZE
target Size for selecting a line |
private java.lang.String |
title
title |
private java.lang.String |
titleX
X title |
private java.lang.String |
titleY
Y title |
private java.lang.String |
vertCaption
vertical caption |
private int[] |
x1
X2 [1:nHist] for clicking on point in list |
private int[] |
x2
X2 [1:nHist] for clicking on point in list |
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) |
DrawRatioHistogram(MAExplorer mae,
ShowPlotPopup spp,
int plotMode)
DrawRatioHistogram() - constructor to draw ratio histogram |
Method Summary | |
(package private) boolean |
drawGifFile(java.lang.String oGifFileName)
drawGifFile() - draw plot into Gif image file if in stand-alone mode. |
(package private) void |
drawHistogramRatios(java.awt.Graphics g)
drawHistogramRatios() - draw histogram of rg.ratioHist[]. |
(package private) static void |
drawPlus(java.awt.Graphics g,
int x,
int y,
java.awt.Color color)
drawPlus() - draw plus sign in the specified color. |
(package private) void |
drawRectangleBin(java.awt.Graphics g,
int x,
int y,
int width,
int height,
java.awt.Color color,
int binIdx,
boolean fillIt)
drawRectangleBin() - draw histogram bin |
(package private) void |
filterByBin()
filterByBin() - filter genes by current activeBin histogram bin. |
java.awt.Dimension |
getMinimumSize()
getMinimumSize() - get the minimum preferred size |
java.awt.Dimension |
getPreferredSize()
getPreferredSize() - get the preferred size. |
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 |
mouseHandler(int x,
int y)
mouseHandler() - interact with current plot if a graphic plot. |
void |
mouseMoved(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
mousePressed() - process mouse event |
void |
mouseReleased(java.awt.event.MouseEvent e)
|
void |
paint(java.awt.Graphics g)
paint() - draw the histogram |
(package private) void |
setHistogramRatiosData(java.lang.String vertCaption,
java.lang.String horizCaption,
java.lang.String title,
java.lang.String titleX,
java.lang.String titleY,
double minX,
double maxX,
int pointType,
int[] histRatio,
double[] histValue,
int nHist)
setHistogramRatiosData() - draw histogram of rg.ratioHist[]. |
(package private) void |
updateRatioHistogramPlot()
updateRatioHistogramPlot() - set ratioHist state & do repaint to draw it. |
(package private) void |
updateScaling(boolean logScalingFlag)
updateScaling() - set scaling mode in proper sub-object. |
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 |
private MAExplorer mae
private CompositeDatabase cdb
private ShowPlotPopup spp
private int plotMode
private java.awt.Canvas pCanvas
static final int MIN_CANVAS_WIDTH
static final int MIN_CANVAS_HEIGHT
static final int TARGET_SIZE
public int preferredHeight
public int preferredWidth
private int[] x1
private int[] x2
private int[] binIndex
private int iWidth
private int iHeight
private java.lang.String oGifFileName
private java.lang.String ncStr
private java.lang.String vertCaption
private java.lang.String horizCaption
private java.lang.String horizVariableCaption
private java.lang.String title
private java.lang.String titleX
private java.lang.String titleY
private double minXfound
private double maxXfound
private double minX
private double maxX
private int pointType
private int[] histRatio
private double[] histValue
private int curXbinIdx
private int activeBin
private int nHist
private float ratioLower
private float ratioUpper
private boolean drawIntoImageFlag
private boolean outsideRangeFlag
private boolean logScalingFlag
private java.awt.Font smallFont
Constructor Detail |
DrawRatioHistogram(MAExplorer mae, ShowPlotPopup spp, int plotMode)
mae
- is the MAExplorer instancespp
- is the ShowPlotPopup instanceplotMode
- is the specific plot mode to implementupdateRatioHistogramPlot()
Method Detail |
boolean drawGifFile(java.lang.String oGifFileName)
oGifFileName
- is the full path GIF output fileComponent.repaint()
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class java.awt.Component
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class java.awt.Component
void updateRatioHistogramPlot()
CompositeDatabase.calcHistOfF1F2Ratios(GeneList, MaHybridSample)
,
CompositeDatabase.calcHistOfHP_XYratios(GeneList, boolean)
,
setHistogramRatiosData(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, double, double, int, int[], double[], int)
public void paint(java.awt.Graphics g)
paint
in class java.awt.Canvas
g
- is graphics contextdrawHistogramRatios(java.awt.Graphics)
static final void drawPlus(java.awt.Graphics g, int x, int y, java.awt.Color color)
g
- is graphics contextx
- is center of objecty
- is center of objectcolor
- is color to drawfinal void drawRectangleBin(java.awt.Graphics g, int x, int y, int width, int height, java.awt.Color color, int binIdx, boolean fillIt)
g
- is graphics contextx
- is center of objecty
- is center of objectwidth
- of objectheight
- of objectcolor
- is color to drawfillit
- to draw a solid objectvoid setHistogramRatiosData(java.lang.String vertCaption, java.lang.String horizCaption, java.lang.String title, java.lang.String titleX, java.lang.String titleY, double minX, double maxX, int pointType, int[] histRatio, double[] histValue, int nHist)
vertCaption
- is the vertical captionhorizCaption
- title
- is the window titletitleX
- is the X axis titletitleY
- is the Y axis titleminX
- is lowest X axis valuemaxX
- is highest X axis valuepointType
- is either DRAW _PLUS, _CIRCLE, _BOXhistRatio
- is the ratios of the ratio histogramhistValue
- is the bin values frequencies of the ratio histogramnHist
- is the number of points in hist[0:npoints-1]Util.showMsg(java.lang.String)
,
drawRectangleBin(java.awt.Graphics, int, int, int, int, java.awt.Color, int, boolean)
,
Component.repaint()
void drawHistogramRatios(java.awt.Graphics g)
g
- is graphics contextUtil.showMsg(java.lang.String)
,
WriteGifEncoder
,
WriteGifEncoder.writeFile(java.lang.String)
,
drawRectangleBin(java.awt.Graphics, int, int, int, int, java.awt.Color, int, boolean)
void filterByBin()
CompositeDatabase.setRatioHistCLfromF1F2Ratios(GeneList, MaHybridSample, float, float, boolean)
,
CompositeDatabase.setRatioHistCLfromHP_XYratios(GeneList, MaHybridSample, MaHybridSample, float, float, boolean)
,
CompositeDatabase.setRatioHistCLfromHP_XYsetRatios(GeneList, float, float, boolean)
,
Filter.computeWorkingGeneList()
,
Component.repaint()
,
Util.cvf2s(float, int)
,
Util.saveCmdHistory(java.lang.String)
,
Util.showMsg2(java.lang.String)
,
Util.showMsg3(java.lang.String)
,
Component.repaint()
public void mouseHandler(int x, int y)
x
- mouse positiony
- mouse positionfilterByBin()
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
e
- is mouse pressed eventmouseHandler(int, int)
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseMoved(java.awt.event.MouseEvent e)
public void mouseDragged(java.awt.event.MouseEvent e)
void updateScaling(boolean logScalingFlag)
logScalingFlag
- if using log scalingfilterByBin()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |