edu.iastate.metnet.birdseyeview.goview
Class GoView

java.lang.Object
  extended by edu.iastate.metnet.birdseyeview.AbstractView
      extended by edu.iastate.metnet.birdseyeview.goview.GoView
Direct Known Subclasses:
GoBioProcessView, GoFunctionView

public abstract class GoView
extends AbstractView

The GoView Class encapsulates the common functionality of the different GO views.

Author:
Matt Studham Created Mar 13, 2005

Field Summary
protected  int bottomLevel
           
protected  int currentLevel
           
protected  java.util.ArrayList goLevelColors
           
protected  java.util.ArrayList goLevels
           
static int MaxLevel
           
protected  GoNode rootNode
           
 
Fields inherited from class edu.iastate.metnet.birdseyeview.AbstractView
algorithm, annotations, birdsEyeView, size, viewInfo
 
Constructor Summary
GoView(ViewInfo vi, BirdsEyeView bev, java.util.ArrayList anns, java.awt.Dimension s, java.lang.String alg, int rootID)
          Constructor.
 
Method Summary
abstract  void addGenesToNodes(java.util.ArrayList nodes)
          Subclasses must provide a way to match nodes and annotations (genes).
protected  java.util.ArrayList createLevelColors(double hue, double hIncrement, double saturation, double sIncrement, double brightness, double bIncrement)
          This method creates an array with slightly different colors.
 void displayChildren(GoNode node, boolean populateLevel)
          This method displays the child nodes for the given node.
 java.awt.Color getBackground()
          Subclasses must indicate their background color so the parent can blend in if the display area is bigger than the view.
 java.awt.Component getComponent()
          Subclasses must return some sort of component to display as their view.
 GoLevel getCurrentGoLevel()
          This method returns the level object for the current level.
 java.awt.LayoutManager getLayout()
          This method returns a layout which centers the view in the parent.
abstract  java.util.ArrayList getLevelColors()
          Subclasses must provide the different level colors.
 void goDown()
          This method does nothing by default.
 void goUp()
          This method does nothing by default.
 void loadConfiguration()
           
abstract  void redisplayGenesToNodes(java.util.ArrayList nodes)
           
 void reloadData()
          Subclasses must reload the annotation data and modify their displays accordingly.
 void replayChildren(GoNode node, boolean populateLevel)
          This method displays the child nodes for the given node.
 void setlevelCapacity(int c)
           
 
Methods inherited from class edu.iastate.metnet.birdseyeview.AbstractView
getViewInfo, loadData, toggleMapLabels
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rootNode

protected GoNode rootNode

goLevels

protected java.util.ArrayList goLevels

currentLevel

protected int currentLevel

bottomLevel

protected int bottomLevel

goLevelColors

protected java.util.ArrayList goLevelColors

MaxLevel

public static final int MaxLevel
See Also:
Constant Field Values
Constructor Detail

GoView

public GoView(ViewInfo vi,
              BirdsEyeView bev,
              java.util.ArrayList anns,
              java.awt.Dimension s,
              java.lang.String alg,
              int rootID)
Constructor. Display an empty root node. Call reload() before trying to display nodes with genes.

Parameters:
vi -
bev -
anns - List of Annotation objects
s - Size of the view
alg - Treemap algorithm
rootID - The GO ID of the root node
Method Detail

getBackground

public java.awt.Color getBackground()
Description copied from class: AbstractView
Subclasses must indicate their background color so the parent can blend in if the display area is bigger than the view.

Specified by:
getBackground in class AbstractView
Returns:
Color

reloadData

public void reloadData()
Description copied from class: AbstractView
Subclasses must reload the annotation data and modify their displays accordingly.

Specified by:
reloadData in class AbstractView

setlevelCapacity

public void setlevelCapacity(int c)
Specified by:
setlevelCapacity in class AbstractView

loadConfiguration

public void loadConfiguration()
Specified by:
loadConfiguration in class AbstractView

goUp

public void goUp()
Description copied from class: AbstractView
This method does nothing by default. Subclasses must override to do something when the "up" button is pressed.

Overrides:
goUp in class AbstractView

goDown

public void goDown()
Description copied from class: AbstractView
This method does nothing by default. Subclasses must override to do something when the "down" button is pressed.

Overrides:
goDown in class AbstractView

getLayout

public java.awt.LayoutManager getLayout()
Description copied from class: AbstractView
This method returns a layout which centers the view in the parent. This is the default.

Overrides:
getLayout in class AbstractView
Returns:
LayoutManager

getComponent

public java.awt.Component getComponent()
Description copied from class: AbstractView
Subclasses must return some sort of component to display as their view.

Specified by:
getComponent in class AbstractView
Returns:
Component

displayChildren

public void displayChildren(GoNode node,
                            boolean populateLevel)
This method displays the child nodes for the given node. The reason that the GoView is called (instead of just the GoNode) is because the child nodes are created dynamically for memory & time efficiency. The GoView helps to create those child nodes. Also, the GO levels are populated here.

Parameters:
node - The parent node
populateLevel - Flag indicating if new GO level should be populated

replayChildren

public void replayChildren(GoNode node,
                           boolean populateLevel)
This method displays the child nodes for the given node. The reason that the GoView is called (instead of just the GoNode) is because the child nodes are created dynamically for memory & time efficiency. The GoView helps to create those child nodes. Also, the GO levels are populated here.

Parameters:
node - The parent node
populateLevel - Flag indicating if new GO level should be populated

createLevelColors

protected java.util.ArrayList createLevelColors(double hue,
                                                double hIncrement,
                                                double saturation,
                                                double sIncrement,
                                                double brightness,
                                                double bIncrement)
This method creates an array with slightly different colors. The colors at the beginning of the array are meant to be used for the lowest levels in the GO hierarchy. All values should be in the range 0.0-1.0.

Parameters:
hue - Starting hue
hIncrement - Hue increment; difference in hue between 2 adjacent levels
saturation - Starting saturation
sIncrement - Saturation increment; difference between 2 adjacent levels
brightness - Starting brightness
bIncrement - Brightness increment; difference between 2 adjacent levels
Returns:
ArrayList of Color objects

getCurrentGoLevel

public GoLevel getCurrentGoLevel()
This method returns the level object for the current level. Multiply the current level times negative 1 to get the array index.

Returns:
GoLevel

getLevelColors

public abstract java.util.ArrayList getLevelColors()
Subclasses must provide the different level colors.

Returns:
ArrayList

addGenesToNodes

public abstract void addGenesToNodes(java.util.ArrayList nodes)
Subclasses must provide a way to match nodes and annotations (genes).

Parameters:
nodes - Array List of GoNode objects

redisplayGenesToNodes

public abstract void redisplayGenesToNodes(java.util.ArrayList nodes)