Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

edu.stanford.genetics.treeview.dendroview
Class DendroView  view DendroView download DendroView.java

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byedu.stanford.genetics.treeview.DragGridPanel
                      extended byedu.stanford.genetics.treeview.dendroview.DendroView
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ComponentListener, edu.stanford.genetics.treeview.ConfigNodePersistent, java.awt.event.ContainerListener, java.util.EventListener, java.awt.event.FocusListener, java.awt.image.ImageObserver, edu.stanford.genetics.treeview.MainPanel, java.awt.MenuContainer, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.Observer, java.io.Serializable
Direct Known Subclasses:
KnnDendroView

public class DendroView
extends edu.stanford.genetics.treeview.DragGridPanel
implements edu.stanford.genetics.treeview.ConfigNodePersistent, edu.stanford.genetics.treeview.MainPanel, java.util.Observer

This class encapsulates a dendrogram view, which is the classic Eisen treeview. It uses a drag grid panel to lay out a bunch of linked visualizations of the data, a la Eisen. In addition to laying out components, it also manages the GlobalZoomMap. This is necessary since both the GTRView (gene tree) and GlobalView need to know where to lay out genes using the same map. The zoom map is managed by the ViewFrame- it represents the selected genes, and potentially forms a link between different views, only one of which is the DendroView. The intention here is that you create this from a model, and never replace that model. If you want to show another file, make another dendroview. All views should of course still listen to the model, since that can still be changed ad libitum.

Version:
$Revision: 1.27 $ $Date: 2003/10/12 01:29:15 $

Nested Class Summary
(package private)  class DendroView.ButtonPanel
           
(package private)  class DendroView.GlobalGifExportWizard
           
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  ArrayDrawer arrayDrawer
           
protected  ArrayNameView arraynameview
           
protected  ATRView atrview
           
protected  ATRZoomView atrzview
           
protected  edu.stanford.genetics.treeview.BrowserControl browserControl
           
protected  edu.stanford.genetics.treeview.CdtSelection cdtSelection
           
protected  ColorExtractor colorExtractor
           
protected  edu.stanford.genetics.treeview.DataModel dataModel
           
protected  edu.stanford.genetics.treeview.FileMru fileMru
           
protected  GlobalView globalview
           
protected  MapContainer globalXmap
           
protected  javax.swing.JScrollBar globalXscrollbar
           
protected  MapContainer globalYmap
           
protected  javax.swing.JScrollBar globalYscrollbar
           
protected  GTRView gtrview
           
protected  edu.stanford.genetics.treeview.MessagePanel hintpanel
           
protected  InvertedTreeDrawer invertedTreeDrawer
           
protected  LeftTreeDrawer leftTreeDrawer
           
protected  boolean loaded
           
protected  java.awt.ScrollPane[] panes
           
protected  edu.stanford.genetics.treeview.ConfigNode root
           
protected  javax.swing.JDialog settingsFrame
           
protected  edu.stanford.genetics.treeview.TabbedSettingsPanel settingsPanel
           
protected  edu.stanford.genetics.treeview.MessagePanel statuspanel
           
protected  TextView textview
           
protected  edu.stanford.genetics.treeview.ViewFrame viewFrame
           
protected  boolean windowActive
           
protected  ZoomView zoomview
           
protected  MapContainer zoomXmap
           
protected  javax.swing.JScrollBar zoomXscrollbar
           
protected  MapContainer zoomYmap
           
protected  javax.swing.JScrollBar zoomYscrollbar
           
 
Fields inherited from class edu.stanford.genetics.treeview.DragGridPanel
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
DendroView(edu.stanford.genetics.treeview.DataModel tVModel, edu.stanford.genetics.treeview.ConfigNode root, edu.stanford.genetics.treeview.ViewFrame vFrame)
          Constructor for the DendroView object which binds to an explicit confignode
DendroView(edu.stanford.genetics.treeview.DataModel tVModel, edu.stanford.genetics.treeview.ViewFrame vFrame)
          Constructor for the DendroView object
 
Method Summary
private  void addSimpleExportOptions(java.awt.Menu menu)
           
 void addView(edu.stanford.genetics.treeview.ModelView modelView, java.awt.Rectangle rectangle)
          Adds a ModelView to the DendroView
 void bindConfig(edu.stanford.genetics.treeview.ConfigNode configNode)
          binds this dendroView to a particular confignode, resizing the panel sizes appropriately.
protected  void bindTrees()
          this is meant to be called from setupViews.
private  void doDoubleLayout()
           
private  void doSingleLayout()
           
 void exportGif()
           
 edu.stanford.genetics.treeview.CdtSelection getCdtSelection()
           
 edu.stanford.genetics.treeview.ConfigNode getConfigNode()
          Setter for root - may not work properly public void setConfigNode(ConfigNode root) { this.root = root; } /** Getter for root
 double getContrast()
          Gets the contrast attribute of the DendroView object
 edu.stanford.genetics.treeview.DataModel getDataModel()
          Getter for dataModel
private  java.lang.String getFilePath()
          prompts and returns file path, or null if cancelled.
private  edu.stanford.genetics.treeview.ConfigNode getFirst(java.lang.String name)
          always returns an instance of the node, even if it has to create it.
 MapContainer getGlobalXmap()
          Gets the globalXmap attribute of the DendroView object
 MapContainer getGlobalYmap()
          Gets the globalYmap attribute of the DendroView object
 edu.stanford.genetics.treeview.DataModel getModel()
          gets the model this dendroview is based on
 edu.stanford.genetics.treeview.ViewFrame getViewFrame()
          Getter for viewFrame
 MapContainer getZoomXmap()
          Gets the zoomXmap attribute of the DendroView object
 MapContainer getZoomYmap()
          Gets the zoomYmap attribute of the DendroView object
 void populateAnalysisMenu(java.awt.Menu menu)
          adds DendroView stuff to Analysis menu
 void populateExportMenu(java.awt.Menu menu)
          Add items which allow for export, if any.
 void populateSettingsMenu(java.awt.Menu menu)
          adds DendroView stuff to Document menu
 void scrollToIndex(int i)
          ensure a particular index is visible.
 void setCdtSelection(edu.stanford.genetics.treeview.CdtSelection cdtSelection)
           
 void setDataModel(edu.stanford.genetics.treeview.DataModel dataModel)
          Setter for dataModel
private  void setupSettingsPanel()
          this style has been deemed too slow.
private  void setupView(edu.stanford.genetics.treeview.ModelView modelView)
           
protected  void setupViews()
          This method should be called only during initial setup of the modelview It sets up the views and binds them all to config nodes.
 void setViewFrame(edu.stanford.genetics.treeview.ViewFrame viewFrame)
          Setter for viewFrame
private  void setWindowActive(boolean flag)
          Sets the windowActive attribute of the DendroView object
private  void showSummaryWindow(int[] indexes)
           
 void showSummaryWindow(int[] indexes, java.lang.String title)
          show summary of the specified indexes, with specified title, using settings stolen from zoomview.
 void syncConfig()
          this function changes the info in the confignode to match the current panel sizes.
 void update(java.util.Observable o, java.lang.Object arg)
          This method is called whenever the observable object changes, and has called notifyObservers.
 boolean windowActive()
          Determines if window is currently active
 
Methods inherited from class edu.stanford.genetics.treeview.DragGridPanel
addComponent, addComponent, componentAdded, componentHidden, componentMoved, componentRemoved, componentResized, componentShown, doLayout, focusGained, focusLost, getBorderHeight, getBorderWidth, getFocusHeight, getFocusWidth, getHeights, getMinimumHeight, getMinimumWidth, getPreferredSize, getWidths, isAdjustable, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, paintComponent, removeComponent, setAdjustable, setBorderHeight, setBorderWidth, setFocusHeight, setFocusWidth, setHeights, setMinimumHeight, setMinimumWidth, setWidths, toString
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

viewFrame

protected edu.stanford.genetics.treeview.ViewFrame viewFrame

panes

protected java.awt.ScrollPane[] panes

loaded

protected boolean loaded

windowActive

protected boolean windowActive

dataModel

protected edu.stanford.genetics.treeview.DataModel dataModel

globalXscrollbar

protected javax.swing.JScrollBar globalXscrollbar

globalYscrollbar

protected javax.swing.JScrollBar globalYscrollbar

globalview

protected GlobalView globalview

zoomXscrollbar

protected javax.swing.JScrollBar zoomXscrollbar

zoomYscrollbar

protected javax.swing.JScrollBar zoomYscrollbar

zoomview

protected ZoomView zoomview

textview

protected TextView textview

arraynameview

protected ArrayNameView arraynameview

gtrview

protected GTRView gtrview

atrview

protected ATRView atrview

atrzview

protected ATRZoomView atrzview

invertedTreeDrawer

protected InvertedTreeDrawer invertedTreeDrawer

leftTreeDrawer

protected LeftTreeDrawer leftTreeDrawer

cdtSelection

protected edu.stanford.genetics.treeview.CdtSelection cdtSelection

globalXmap

protected MapContainer globalXmap

globalYmap

protected MapContainer globalYmap

zoomXmap

protected MapContainer zoomXmap

zoomYmap

protected MapContainer zoomYmap

hintpanel

protected edu.stanford.genetics.treeview.MessagePanel hintpanel

statuspanel

protected edu.stanford.genetics.treeview.MessagePanel statuspanel

browserControl

protected edu.stanford.genetics.treeview.BrowserControl browserControl

arrayDrawer

protected ArrayDrawer arrayDrawer

root

protected edu.stanford.genetics.treeview.ConfigNode root

fileMru

protected edu.stanford.genetics.treeview.FileMru fileMru

settingsFrame

protected javax.swing.JDialog settingsFrame

settingsPanel

protected edu.stanford.genetics.treeview.TabbedSettingsPanel settingsPanel

colorExtractor

protected ColorExtractor colorExtractor
Constructor Detail

DendroView

public DendroView(edu.stanford.genetics.treeview.DataModel tVModel,
                  edu.stanford.genetics.treeview.ViewFrame vFrame)
Constructor for the DendroView object


DendroView

public DendroView(edu.stanford.genetics.treeview.DataModel tVModel,
                  edu.stanford.genetics.treeview.ConfigNode root,
                  edu.stanford.genetics.treeview.ViewFrame vFrame)
Constructor for the DendroView object which binds to an explicit confignode

Method Detail

getFirst

private edu.stanford.genetics.treeview.ConfigNode getFirst(java.lang.String name)
always returns an instance of the node, even if it has to create it.


getCdtSelection

public edu.stanford.genetics.treeview.CdtSelection getCdtSelection()

setCdtSelection

public void setCdtSelection(edu.stanford.genetics.treeview.CdtSelection cdtSelection)

getContrast

public double getContrast()
Gets the contrast attribute of the DendroView object


getModel

public edu.stanford.genetics.treeview.DataModel getModel()
gets the model this dendroview is based on


setWindowActive

private void setWindowActive(boolean flag)
Sets the windowActive attribute of the DendroView object


getGlobalXmap

public MapContainer getGlobalXmap()
Gets the globalXmap attribute of the DendroView object


getGlobalYmap

public MapContainer getGlobalYmap()
Gets the globalYmap attribute of the DendroView object


getZoomXmap

public MapContainer getZoomXmap()
Gets the zoomXmap attribute of the DendroView object


getZoomYmap

public MapContainer getZoomYmap()
Gets the zoomYmap attribute of the DendroView object


exportGif

public void exportGif()

scrollToIndex

public void scrollToIndex(int i)
Description copied from interface: edu.stanford.genetics.treeview.MainPanel
ensure a particular index is visible. Used by Find.

Specified by:
scrollToIndex in interface edu.stanford.genetics.treeview.MainPanel

update

public void update(java.util.Observable o,
                   java.lang.Object arg)
Description copied from interface: java.util.Observer
This method is called whenever the observable object changes, and has called notifyObservers. The Observable object can pass arbitrary information in the second parameter.

Specified by:
update in interface java.util.Observer

setupViews

protected void setupViews()
This method should be called only during initial setup of the modelview It sets up the views and binds them all to config nodes.


bindTrees

protected void bindTrees()
this is meant to be called from setupViews. It make sure that the trees are generated from the current model, and enables/disables them as required. I factored it out because it is common betwen DendroView and KnnDendroView.


doSingleLayout

private void doSingleLayout()

setupView

private void setupView(edu.stanford.genetics.treeview.ModelView modelView)

doDoubleLayout

private void doDoubleLayout()

addView

public void addView(edu.stanford.genetics.treeview.ModelView modelView,
                    java.awt.Rectangle rectangle)
Adds a ModelView to the DendroView


windowActive

public boolean windowActive()
Determines if window is currently active


populateExportMenu

public void populateExportMenu(java.awt.Menu menu)
Description copied from interface: edu.stanford.genetics.treeview.MainPanel
Add items which allow for export, if any.

Specified by:
populateExportMenu in interface edu.stanford.genetics.treeview.MainPanel

getFilePath

private java.lang.String getFilePath()
prompts and returns file path, or null if cancelled.


addSimpleExportOptions

private void addSimpleExportOptions(java.awt.Menu menu)

showSummaryWindow

private void showSummaryWindow(int[] indexes)

showSummaryWindow

public void showSummaryWindow(int[] indexes,
                              java.lang.String title)
show summary of the specified indexes, with specified title, using settings stolen from zoomview.


populateAnalysisMenu

public void populateAnalysisMenu(java.awt.Menu menu)
adds DendroView stuff to Analysis menu

Specified by:
populateAnalysisMenu in interface edu.stanford.genetics.treeview.MainPanel

setupSettingsPanel

private void setupSettingsPanel()
this style has been deemed too slow.


populateSettingsMenu

public void populateSettingsMenu(java.awt.Menu menu)
adds DendroView stuff to Document menu

Specified by:
populateSettingsMenu in interface edu.stanford.genetics.treeview.MainPanel

syncConfig

public void syncConfig()
this function changes the info in the confignode to match the current panel sizes. this is a hack, since I don't know how to intercept panel resizing. Actually, in the current layout this isn't even used.

Specified by:
syncConfig in interface edu.stanford.genetics.treeview.MainPanel

bindConfig

public void bindConfig(edu.stanford.genetics.treeview.ConfigNode configNode)
binds this dendroView to a particular confignode, resizing the panel sizes appropriately.

Specified by:
bindConfig in interface edu.stanford.genetics.treeview.ConfigNodePersistent

setViewFrame

public void setViewFrame(edu.stanford.genetics.treeview.ViewFrame viewFrame)
Setter for viewFrame


getViewFrame

public edu.stanford.genetics.treeview.ViewFrame getViewFrame()
Getter for viewFrame


setDataModel

public void setDataModel(edu.stanford.genetics.treeview.DataModel dataModel)
Setter for dataModel


getDataModel

public edu.stanford.genetics.treeview.DataModel getDataModel()
Getter for dataModel


getConfigNode

public edu.stanford.genetics.treeview.ConfigNode getConfigNode()
Setter for root - may not work properly public void setConfigNode(ConfigNode root) { this.root = root; } /** Getter for root

Specified by:
getConfigNode in interface edu.stanford.genetics.treeview.MainPanel