Class DrawClusterGram

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.ScrollPane
                    |
                    +--DrawClusterGram
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.event.ItemListener, java.awt.MenuContainer, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable, java.awt.event.WindowListener

class DrawClusterGram
extends java.awt.ScrollPane
implements java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.event.WindowListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener

This class creates and displays a ClusterGram canvas window. It contains a scrollable ClusterGram canvas of ordered genes in a popup window. When performing clustering, it is updated by the PopupRegistry when the current gene, Filter.workingCL, or other state values change. If hierarchical clustering is used, it uses dendrogram data structures in HierClustNode - otherwise data may be] passed an ordered GeneList (i.e. mList[]).

This work was produced by Peter Lemkin of the National Cancer Institute, an agency of the United States Government. As a work of the United States Government there is no associated copyright. It is offered as open source software under the Mozilla Public License (version 1.1) subject to the limitations noted in the accompanying LEGAL file. This notice must be included with the code. The MAExplorer Mozilla and Legal files are available on http://maexplorer.sourceforge.net/.

Version:
$Date: 2002/10/14 20:46:12 $ $Revision: $
Author:
P. Lemkin (NCI), G.g Thornwall (SAIC), NCI-Frederick, Frederick, MD
See Also:
MAExplorer Home, ClusterGenes, ClusterGramCanvas, HierClustNode, Serialized Form

Inner classes inherited from class java.awt.ScrollPane
java.awt.ScrollPane.AccessibleAWTScrollPane, java.awt.ScrollPane.PeerFixer
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock
 
Field Summary
(package private)  ClusterGramCanvas cgC
          Clustergram canvas
private  int curCGmid
          current mid of selected ClusterGram row
private  int curCGrow
          current selected row of ClusterGram
private  java.awt.Button custGramReport
          popup Report
private  java.awt.Checkbox dGramCheckBox
          toggle drawing the dendrogram
(package private)  boolean drawDendroGramFlag
          set if draw dendrogram as well
(package private)  java.awt.Graphics gGif
          draw status at top of Gif image
(package private)  ShowExprProfilesPopup hierClustersExprProfPopup
          exists if create EP plot subset popup
private  boolean keepFlagsOnClosing
          mode of operation used in creating thiswindow for use in closing the window
private  MAExplorer mae
          link to global instance
(package private)  int N_EP_GENES
          default # of genes to display in EP list
private  int nCols
          # of columns in clustergram
private  int nEPgenes
          # of genes to display in popup EP plot
private  int nGenes
          # genes in orderedCL
private  int nRows
          # of rows in clustergram
private  GeneList orderedCL
          GeneList being used
(package private)  int plotMode
          plot mode
private  java.awt.Button saveAsGIF
          Save display as GIF file
private  java.awt.Button showEPsubset
          show expression profiles for nEPgenes at current ClusterGram position curCGrow
private  java.awt.Button showHPnames
          show list of Samples
(package private)  ShowPlotPopup spp
          Parent popup window instance
(package private)  StatusCanvas statusCanvas
          status canvas
(package private)  int statusCanvasHeight
          height size of status canvas
private  java.lang.String title
          title for window
private  java.awt.Panel titlePanel
          titlePanel of parent
private  HierClustNode tree
          cluster tree
private  java.awt.Button zoomDgramButton
          zoom in on dendrogram
 
Fields inherited from class java.awt.ScrollPane
base, hAdjustable, nameCounter, scrollbarDisplayPolicy, SCROLLBARS_ALWAYS, SCROLLBARS_AS_NEEDED, SCROLLBARS_NEVER, serialVersionUID, vAdjustable
 
Fields inherited from class java.awt.Container
component, containerListener, containerSerializedDataVersion, dbg, dispatcher, layoutMgr, listeningBoundsChildren, listeningChildren, maxSize, ncomponents, printing, printingThreads
 
Fields inherited from class java.awt.Component
accessibleContext, actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, 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) DrawClusterGram(MAExplorer mae, ShowPlotPopup spp, java.awt.Panel titlePanel, HierClustNode tree, GeneList orderedCL, java.lang.String title, int plotMode, boolean keepFlagsOnClosing)
          DrawClusterGram() - Create popup grid of ClusterGram plots.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          actionPerformed() - Handle button clicks
(package private)  void addButtonsToParent(ShowPlotPopup spp, java.awt.Panel p, java.awt.Font bFont)
          addButtonsToParent() - add buttons for this plot to parents's panel
(package private)  void close()
          close() - close this popup and reset flags if keepFlagsOnClosing is false
(package private)  void drawScaleMapAndVerticalLabels(java.awt.Graphics gGif)
          drawScaleMapAndVerticalLabels() - draw scale map & vert lbls i in the title panel status area
 java.awt.Dimension getMinimumSize()
          getMinimumSize() - get the minimum preferred size
 java.awt.Dimension getPreferredSize()
          getPreferredSize() - get the preferred size
 void itemStateChanged(java.awt.event.ItemEvent e)
           
 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
 void mousePressed(java.awt.event.MouseEvent e)
          Pass all mouse events down to the Canvas.
 void mouseReleased(java.awt.event.MouseEvent e)
          mouseReleased() - Pass all mouse events down to the Canvas.
 void paint()
          paint() - redraw clustergram
(package private)  void updateCGplot(GeneList orderedCL, HierClustNode tree)
          updateCGplot() - update ClusterGram plots using new GeneList.
(package private)  void updateCurGene(int mid)
          updateCurGene()- update the current gene in the ClusterGram
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
          windowClosing() - closing down the window, get rid of the frame.
 void windowDeactivated(java.awt.event.WindowEvent e)
           
 void windowDeiconified(java.awt.event.WindowEvent e)
           
 void windowIconified(java.awt.event.WindowEvent e)
           
 void windowOpened(java.awt.event.WindowEvent e)
           
 
Methods inherited from class java.awt.ScrollPane
, addImpl, addNotify, calculateChildSize, constructComponentName, doLayout, getAccessibleContext, getHAdjustable, getHScrollbarHeight, getScrollbarDisplayPolicy, getScrollPosition, getVAdjustable, getViewportSize, getVScrollbarWidth, initIDs, layout, paramString, printComponents, setLayout, setScrollPosition, setScrollPosition
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, adjustListeningChildren, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventImpl, dispatchEventToSelf, eventEnabled, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getInsets, getLayout, getListeners, getMaximumSize, getMouseEventTarget, getWindow, insets, invalidate, invalidateTree, isAncestorOf, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, nextFocus, numListening, paint, paintComponents, paintHeavyweightComponents, postProcessKeyEvent, postsOldMouseEvents, preferredSize, preProcessKeyEvent, print, printHeavyweightComponents, processContainerEvent, processEvent, proxyEnableEvents, proxyRequestFocus, readObject, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusOwner, setFont, transferFocus, update, validate, validateTree, writeObject
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, checkWindowClosingException, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleIndexInParent, getAccessibleStateSet, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkit, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isRecursivelyVisible, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, resetGC, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

mae

private MAExplorer mae
link to global instance

spp

ShowPlotPopup spp
Parent popup window instance

tree

private HierClustNode tree
cluster tree

title

private java.lang.String title
title for window

titlePanel

private java.awt.Panel titlePanel
titlePanel of parent

cgC

ClusterGramCanvas cgC
Clustergram canvas

orderedCL

private GeneList orderedCL
GeneList being used

nGenes

private int nGenes
# genes in orderedCL

N_EP_GENES

final int N_EP_GENES
default # of genes to display in EP list

plotMode

int plotMode
plot mode

nRows

private int nRows
# of rows in clustergram

nCols

private int nCols
# of columns in clustergram

curCGrow

private int curCGrow
current selected row of ClusterGram

curCGmid

private int curCGmid
current mid of selected ClusterGram row

nEPgenes

private int nEPgenes
# of genes to display in popup EP plot

statusCanvasHeight

int statusCanvasHeight
height size of status canvas

drawDendroGramFlag

boolean drawDendroGramFlag
set if draw dendrogram as well

keepFlagsOnClosing

private boolean keepFlagsOnClosing
mode of operation used in creating thiswindow for use in closing the window

statusCanvas

StatusCanvas statusCanvas
status canvas

gGif

java.awt.Graphics gGif
draw status at top of Gif image

dGramCheckBox

private java.awt.Checkbox dGramCheckBox
toggle drawing the dendrogram

saveAsGIF

private java.awt.Button saveAsGIF
Save display as GIF file

custGramReport

private java.awt.Button custGramReport
popup Report

zoomDgramButton

private java.awt.Button zoomDgramButton
zoom in on dendrogram

showHPnames

private java.awt.Button showHPnames
show list of Samples

showEPsubset

private java.awt.Button showEPsubset
show expression profiles for nEPgenes at current ClusterGram position curCGrow

hierClustersExprProfPopup

ShowExprProfilesPopup hierClustersExprProfPopup
exists if create EP plot subset popup
Constructor Detail

DrawClusterGram

DrawClusterGram(MAExplorer mae,
                ShowPlotPopup spp,
                java.awt.Panel titlePanel,
                HierClustNode tree,
                GeneList orderedCL,
                java.lang.String title,
                int plotMode,
                boolean keepFlagsOnClosing)
DrawClusterGram() - Create popup grid of ClusterGram plots. Set the mae.fc.workingCL if the specified list is null.
Parameters:
mae - is the MAExplorer instance
spp - is the ShowPlotPopup instance
titlePanel - is where to put extra stuff
tree - is the HierClustNode cluster tree
orderedCL - is thegene list to use
title - for window
plotMode - is the specific plot mode to implement
keepFlagsOnClosing - to save flags on closing
See Also:
ClusterGramCanvas, Filter.showNbrFilteredGenes(), StatusCanvas, Util.showMsg(java.lang.String), Component.repaint()
Method Detail

addButtonsToParent

void addButtonsToParent(ShowPlotPopup spp,
                        java.awt.Panel p,
                        java.awt.Font bFont)
addButtonsToParent() - add buttons for this plot to parents's panel
Parameters:
spp - is the ShowPlotPopup instance
p - is panel where to put extra stuff
bFont - is font to use

getPreferredSize

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

getMinimumSize

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

paint

public void paint()
paint() - redraw clustergram
Parameters:
g - is graphics context
See Also:
Component.repaint(), updateCGplot(GeneList, HierClustNode)

updateCurGene

void updateCurGene(int mid)
updateCurGene()- update the current gene in the ClusterGram
Parameters:
mid - is the Master Gene Index if not -1
See Also:
ClusterGramCanvas.updateCurGene(int), Component.repaint()

updateCGplot

void updateCGplot(GeneList orderedCL,
                  HierClustNode tree)
updateCGplot() - update ClusterGram plots using new GeneList. Set the mae.fc.workingCL if the specified list is null.
Parameters:
orderedCL - is thegene list to use
tree - is the HierClustNode cluster tree
See Also:
ClusterGramCanvas.updateData(GeneList, HierClustNode)

close

void close()
close() - close this popup and reset flags if keepFlagsOnClosing is false
See Also:
EventMenu.setClusterDisplayState(java.awt.CheckboxMenuItem, boolean)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed() - Handle button clicks
Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - is button pressed event
See Also:
ClusterGramCanvas.drawGifFile(java.lang.String), Component.repaint(), EventMenu.promptFileName(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean, boolean), Component.repaint(), Report, SampleSets.showHP_E_assignmentsPopup(), ShowExprProfilesPopup, Util.rmvFinalSubDirectory(java.lang.String, java.lang.String, boolean), Util.nextZoomMag(int, int), Util.saveCmdHistory(java.lang.String), Component.repaint(), close()

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
Specified by:
itemStateChanged in interface java.awt.event.ItemListener

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
windowClosing() - closing down the window, get rid of the frame.
Specified by:
windowClosing in interface java.awt.event.WindowListener
Parameters:
e - is window closing event
See Also:
Window.dispose()

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Pass all mouse events down to the Canvas.
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseDragged

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

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased() - Pass all mouse events down to the Canvas.
Specified by:
mouseReleased in interface java.awt.event.MouseListener
Parameters:
e - is button released event
See Also:
ClusterGramCanvas.setCurrentGene(int, int, int, boolean)

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

mouseMoved

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

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Specified by:
windowOpened in interface java.awt.event.WindowListener

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Specified by:
windowClosed in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Specified by:
windowIconified in interface java.awt.event.WindowListener

drawScaleMapAndVerticalLabels

void drawScaleMapAndVerticalLabels(java.awt.Graphics gGif)
drawScaleMapAndVerticalLabels() - draw scale map & vert lbls i in the title panel status area
Parameters:
gGif - is graphics context