|
||||||||||
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 | +--ScrollableImageCanvas
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/.
ArrayScroller
,
DrawPseudoImage
, 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 |
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 |
|
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 |
private MAExplorer mae
private Maps map
private CompositeDatabase cdb
private Config cfg
private Filter fc
MaHybridSample msR
private GeneClass gct
ArrayScroller is
private java.lang.String isName
private java.awt.Point[] xyCQ
static final int tSize
static final int MAX_TEXT
private int markerShape
private int addPixels
private int xBase
private int yBase
private int xImg
private int yImg
private int xObj
private int yObj
private int xRelMap
private int yRelMap
public int preferredHeight
public int preferredWidth
int iWidth
int iHeight
int extraWidth
int extraHeight
private int scWidth
private int scHeight
private boolean showedHPmouseOverFlag
private boolean showedGeneMouseOverFlag
private boolean ctrlMod
private boolean shiftMod
private boolean drawIntoImageFlag
private java.lang.String oGifFileName
java.awt.Color objColor
java.awt.Color targetColor
java.awt.Font smallFont
java.awt.Font mediumFont
java.awt.Point xyObj
java.awt.Point fromPoint
java.awt.Point toPoint
Constructor Detail |
ScrollableImageCanvas(MaHybridSample ms, int preferredWidth, int preferredHeight, ArrayScroller is)
ms
- is the MaHybridSample instancepreferredWidth
- is the mae.canvasHSizepreferredHeight
- is the mae.canvasVSizeis
- is the ArrayScroller instanceMethod Detail |
boolean drawGifFile(java.lang.String oGifFileName)
oGifFileName
- is the GIF output file full path for doing SaveAs GIFComponent.repaint()
void syncCanvasAccess()
Component.repaint()
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class java.awt.Component
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class java.awt.Component
void setObjState(MaHybridSample ms, int xObj, int yObj)
ms
- is the sample to use for current ObjxObj
- is the current X coordinate of the objectyObj
- is the current Y coordinate of the objectvoid setImgPos(MaHybridSample ms, int xImg, int yImg)
ms
- is the sample to use for current ObjxObj
- is the current X coordinate of the objectyObj
- is the current Y coordinate of the objectArrayScroller.setScrollBar(int, int)
,
Component.repaint()
java.awt.Point getImgPos()
void setObjPos(int xObj, int yObj)
xObj
- is the current X coordinate of the objectyObj
- is the current Y coordinate of the objectjava.awt.Point getObjPos()
private void drawSquareAroundSpot(java.awt.Point xyo, java.awt.Graphics g, java.awt.Color optColor, int useRadius)
xyo
- point to drawg
- is graphics contextoptColor
- to use, else BlueuseRadius
- is radius to use. If <0, use mae.spotRad/2drawGeneList(java.awt.Graphics, GeneList, int)
private void drawCircleAroundSpot(java.awt.Point xyo, java.awt.Graphics g, java.awt.Color optColor, int extraPixels, int thickness)
xyo
- point to drawg
- is graphics contextoptColor
- to use, else BlueextraPixels
- to extend the default radius (mae.spotRad/2)thickness
- (0,1,2) of the linedrawGeneList(java.awt.Graphics, GeneList, int)
private void drawCircleAroundSpot(java.awt.Point xyo, java.awt.Graphics g, java.awt.Color optColor, int extraPixels, int thickness, java.lang.String sTitle)
xyo
- point to drawg
- is graphics contextoptColor
- to use, else BlueextraPixels
- to extend the default radius (mae.spotRad/2)thickness
- (0,1,2) of the linesTitle
- is title to label circledrawGeneList(java.awt.Graphics, GeneList, int)
private void drawPlustAtSpot(java.awt.Point xyo, java.awt.Graphics g, java.awt.Color optColor)
xyo
- point to drawg
- is graphics contextoptColor
- to use, else ReddrawGeneList(java.awt.Graphics, GeneList, int)
private void showImageMousePos(java.awt.event.MouseEvent e, java.lang.String msg, int x, int y)
e
- is mouse event so we can get the data if neededx
- is mouse X positiony
- is mouse Y positionprivate void showMouseCoords(java.lang.String msg, int x, int y, int imgNbr)
ms
- is messagex
- is mouse X positiony
- is mouse Y positionimgNbr
- is the HP sample numberprivate final void mapRelXYtoImage(java.awt.event.MouseEvent e, int x, int y)
e
- is mouse event so we can get the key modfifiersx
- is mouse X positiony
- is mouse Y positiongetHPnbrInImage(java.awt.event.MouseEvent)
void drawImageTitle()
private int getHPnbrInImage(java.awt.event.MouseEvent e)
e
- is MouseEvent so can get modifiers and (x,y) event datapublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
e
- is MouseEvent so can get modifiers and (x,y) event datapublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
e
- is MouseEvent so can get modifiers and (x,y) event datapublic void mouseReleased(java.awt.event.MouseEvent e)
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.
mouseReleased
in interface java.awt.event.MouseListener
e
- is MouseEvent so can get modifiers and (x,y) event dataCompositeDatabase.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()
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
e
- is MouseEvent so can get modifiers and (x,y) event datapublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
e
- is MouseEvent so can get modifiers and (x,y) event dataCompositeDatabase.lookupHPcoords(int, int, int, boolean, MaHybridSample)
,
SampleSets.setHPxyModStrings()
,
SpotFeatures.showValidSpotInfo(java.awt.Point, MaHybridSample)
,
getHPnbrInImage(java.awt.event.MouseEvent)
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
e
- is MouseEvent so can get modifiers and (x,y) event datapublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
e
- is MouseEvent so can get modifiers and (x,y) event datapublic void update(java.awt.Graphics g)
update
in class java.awt.Component
g
- is graphics to update if ready to draw.Component.repaint()
private void zoomImage(java.awt.Graphics g, java.awt.Image im, int xS, int yS, int cWidth, int cHeight)
g
- is graphics to update if ready to draw.im
- is the image to draw intoxS
- center of point to zoom into or out ofyS
- center of point to zoom into or out ofcWidth
- of region to zoomcHeight
- of region to zoomprivate void drawGeneList(java.awt.Graphics g, GeneList ml, int markerBits)
g
- is graphics contextml
- is the gene list to use for overlay graphicsmarkerBits
- is the MARKER_xxxx symbol(s) to usedrawCircleAroundSpot(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)
private void drawGeneClustersOfCurrentGene(java.awt.Graphics g)
drawCircleAroundSpot(java.awt.Point, java.awt.Graphics, java.awt.Color, int, int)
,
drawSquareAroundSpot(java.awt.Point, java.awt.Graphics, java.awt.Color, int)
private void drawCountsOfGeneClusters(java.awt.Graphics g)
g
- is graphics contextdrawCircleAroundSpot(java.awt.Point, java.awt.Graphics, java.awt.Color, int, int)
private boolean drawNprimaryNodesGenes(java.awt.Graphics g)
g
- is graphics contextdrawCircleAroundSpot(java.awt.Point, java.awt.Graphics, java.awt.Color, int, int)
private void drawEditedGeneList(java.awt.Graphics g)
g
- is graphics contextEditedGeneList
,
Filter
,
drawSquareAroundSpot(java.awt.Point, java.awt.Graphics, java.awt.Color, int)
public void paint(java.awt.Graphics g)
paint
in class java.awt.Canvas
g
- is graphics contextDrawPseudoImage.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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |