gov.lbl.genome.gui.panel
Class DisplayPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by gov.lbl.genome.gui.panel.VGBPanel
                      extended by gov.lbl.genome.gui.panel.VistaPanel
                          extended by gov.lbl.genome.gui.panel.DisplayPanel
All Implemented Interfaces:
java.awt.event.ComponentListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.print.Printable, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class DisplayPanel
extends VistaPanel
implements java.awt.event.ComponentListener

Title: DisplayPanel

Description: This panal is a container for all graphical content

Copyright: Copyright (c) 2002 Ernest Orlando Lawrence Berkeley National Laboratory

Company: LBNL

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 int activeTracerPanel
           
protected  AxisPanel axisPanel
           
 int currentPage
           
 int curvesPerPage
           
 boolean dragged
           
 boolean drawbar
           
 int endTracerPanel
           
 boolean inTracerPanel
           
 int pages
           
 int prevPage
           
protected  java.lang.Thread refreshThread
           
 int startTracerPanel
           
 int xend
           
 int xstart
           
 
Fields inherited from class gov.lbl.genome.gui.panel.VistaPanel
bottom, bottomSpace, df, g2d, height, horizSize, image, leftSpace, maxX, minX, offsetWidth, pixelWidth, rightSpace, top, topSpace, vertSize, wait_cursor, waitCursor
 
Fields inherited from class gov.lbl.genome.gui.panel.VGBPanel
commonParameters, debug, lineNumber, name, parameters, va
 
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.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
DisplayPanel(VistaApp vapp)
          DisplayPanel
 
Method Summary
 void addCurves(Status status)
          add Curves that are saved in status
 void addDefaultCurve(GenomeInfo genome)
          add Default Curves for the genome
 void addGraph(GeneralGraphView graph)
          add new Graph to the and
 void addPrintedGraph(int pos)
          add graph to a printedGraph list.
protected  void annotationLegend(java.awt.Graphics g, java.awt.Color color, int x, int y, java.lang.String name)
          draw annotation legend
 void componentHidden(java.awt.event.ComponentEvent e)
           
 void componentMoved(java.awt.event.ComponentEvent e)
           
 void componentResized(java.awt.event.ComponentEvent e)
          Logic of this method is the following: If number of rows is fixed and only vertical size changed - do nothing.
 void componentShown(java.awt.event.ComponentEvent e)
           
protected  void contigLegend(java.awt.Graphics g, java.awt.Color color, int x, int y, java.lang.String name)
          draw contig legend
 void drawContent(java.awt.Graphics g, int width, int height)
          draw Content in area with specified size
 void drawContent(java.awt.Graphics g, java.awt.print.PageFormat pf)
          print content on the page (printer, PDF or image)
 java.util.Vector getAllCurveInfos()
          return vector with all CurveInfo
 java.util.Vector getAllCurves()
          return all curves in all graphs
 java.util.Collection getAllGraphs()
          return All Graphs
 java.util.Collection getAllSelectedGraphs()
          return list of All Selected Graphs
 AnnotationPanel getAnnotationPanel()
          return Annotation Panel
 long getChromDX()
          return number of selected points
 int getFirstSelectedIndex()
          return index of the first (from top) selected graph
 GeneralGraphView getGraph(int pos)
          get Graph
 java.awt.Dimension getGraphPanelSize()
          return dimension of the graph panel
 int getLastSelectedIndex()
          return index of the last (from top) selected graph
 int getNumberOfGraphs()
          return Number Of Graphs
 int getPanelCapacity()
          return number of rows that would be drawn in the panel
 javax.swing.JPopupMenu getPopup()
          return Popup menu
 int getPrintHeight(int graphs, int lines)
          return min height that is necessary to fit all the content
 RepeatPanel getRepeatPanel()
          return Repeat Panel
 int[] getSelectedIndices()
          return numbers of selected lines in the bottom panel curve list
 java.util.Vector getStatistics()
          return conservation Statistics for all curves
 TracerPanel getTracerPanel()
          return Tracer Panel
 int getUniqOrganisms()
          return number uniq organisms
 java.util.Vector getVisibleCurveNames()
          return names of visible Curves
 void hideGraph(java.lang.String curveName)
          hide Graph
 void moveSelectedDown()
          move Selected Graphs Down
 void moveSelectedUp()
          move Selected Graphs Up
 void multiSelectGraphs()
          select more than one graph
 int print(java.awt.Graphics g, java.awt.print.PageFormat pf, int pi)
          print content
 void rebuildPanel()
          this method is responsible for positioning of all graphs, annotations, axis etc.
 void refreshAnnotations()
          request new information from the server for Annotations and repeats
 void refreshAnnotations(Status status)
          set Annotations and repeats from Status.
 void refreshGraphs()
          request new data from the server for all graphs and repaint
 void removeAllGraphs()
          remove All Graphs
 boolean removeAllSelectedGraphs()
          remove All Selected Graphs
 void removeDataImages()
          remove images for all graphs, annotation panel, repeat panel and axis panel
 void removeGraph(int pos)
          remove Graph
 void removeGraph(java.lang.String name)
          remove Graph
 void repaintTracerPanels()
          repaint all TracerPanels
protected  void repeatLegend(java.awt.Graphics g, java.awt.Color color, int x, int y, java.lang.String name)
          draw repeat legend
 void replaceGraph(GeneralGraphView graph, int i)
          replace Graph at the "i" position by another graph
 void resetPrintedGraphs()
          clear list of printed graphs
 void resetXBorders()
          resetXBorders
 void selectGraph(int index)
          select Graph in index position
 void setArrows()
          set buttons with Arrows in the bottom panel
 void setDetails()
          Enable or disable detailsAction
 void setFixedRows(int rows)
          set number of rows to show in the Display Panel
 void setPrintCapacity(int graphs, int lines)
          Set number of graphs and lines to be printed
 void setSelectedIndices(int[] indices)
          select lines in the bottom panel curve list
 void setSettings()
          SettingsAction can be enabled only if all curves are of the same type
 void setTracerPanel(TracerPanel tp)
          set Tracer Panel
 void setXBorders(int x)
          set Borders of the selected region
 void showGraph(java.lang.String curveName)
          show Graph
 void swapGraphs(int graph1, int graph2)
          swap 2 selected Graphs graph1<=>graph2
 void unselectAllGraphs()
          unselect all Graphs
 boolean updatePosition()
          update Position
 void updateSelectList()
          update Select List in the bottom panel curve list
 
Methods inherited from class gov.lbl.genome.gui.panel.VistaPanel
convertX, convertX, createImage, getFormattedNumberString, getFormattedNumberString, getFormattedXDisplayString, getFormattedXDisplayString, getHorizSize, getStringWidth, getVertSize, getXDisplay, getXDisplay, paintComponent, removeImage, setImage, shortenString
 
Methods inherited from class gov.lbl.genome.gui.panel.VGBPanel
Debug, dispatch, dispatchEvent, findParentFrame
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, 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, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, 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, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, 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, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, 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, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

axisPanel

protected AxisPanel axisPanel

refreshThread

protected java.lang.Thread refreshThread

pages

public int pages

currentPage

public int currentPage

prevPage

public int prevPage

curvesPerPage

public int curvesPerPage

inTracerPanel

public boolean inTracerPanel

dragged

public boolean dragged

drawbar

public boolean drawbar

xstart

public int xstart

xend

public int xend

startTracerPanel

public int startTracerPanel

endTracerPanel

public int endTracerPanel

activeTracerPanel

public int activeTracerPanel
Constructor Detail

DisplayPanel

public DisplayPanel(VistaApp vapp)
DisplayPanel

Parameters:
vapp - VistaApp
Method Detail

refreshAnnotations

public void refreshAnnotations()
request new information from the server for Annotations and repeats


refreshAnnotations

public void refreshAnnotations(Status status)
set Annotations and repeats from Status.

Parameters:
status - Status

updateSelectList

public void updateSelectList()
update Select List in the bottom panel curve list


removeGraph

public void removeGraph(int pos)
remove Graph

Parameters:
pos - int

getVisibleCurveNames

public java.util.Vector getVisibleCurveNames()
return names of visible Curves

Returns:
Vector

removeGraph

public void removeGraph(java.lang.String name)
remove Graph

Parameters:
name - String

resetPrintedGraphs

public void resetPrintedGraphs()
clear list of printed graphs


addPrintedGraph

public void addPrintedGraph(int pos)
add graph to a printedGraph list.

Parameters:
pos - int

removeAllGraphs

public void removeAllGraphs()
remove All Graphs


removeAllSelectedGraphs

public boolean removeAllSelectedGraphs()
remove All Selected Graphs

Returns:
boolean

getAllSelectedGraphs

public java.util.Collection getAllSelectedGraphs()
return list of All Selected Graphs

Returns:
Collection

unselectAllGraphs

public void unselectAllGraphs()
unselect all Graphs


setSettings

public void setSettings()
SettingsAction can be enabled only if all curves are of the same type

See Also:
SettingsAction

setDetails

public void setDetails()
Enable or disable detailsAction

See Also:
DetailsAction

setArrows

public void setArrows()
set buttons with Arrows in the bottom panel


multiSelectGraphs

public void multiSelectGraphs()
select more than one graph


getGraph

public GeneralGraphView getGraph(int pos)
get Graph

Parameters:
pos - int
Returns:
GeneralGraphView

getAllGraphs

public java.util.Collection getAllGraphs()
return All Graphs

Returns:
Collection

getAllCurves

public java.util.Vector getAllCurves()
return all curves in all graphs

Returns:
Vector

getAllCurveInfos

public java.util.Vector getAllCurveInfos()
return vector with all CurveInfo

Returns:
Vector
See Also:
CurveInfo

getRepeatPanel

public RepeatPanel getRepeatPanel()
return Repeat Panel

Returns:
RepeatPanel

getAnnotationPanel

public AnnotationPanel getAnnotationPanel()
return Annotation Panel

Returns:
AnnotationPanel

replaceGraph

public void replaceGraph(GeneralGraphView graph,
                         int i)
replace Graph at the "i" position by another graph

Parameters:
graph - GeneralGraphView
i - int

swapGraphs

public void swapGraphs(int graph1,
                       int graph2)
swap 2 selected Graphs graph1<=>graph2

Parameters:
graph1 - int
graph2 - int

moveSelectedUp

public void moveSelectedUp()
move Selected Graphs Up

See Also:
moveSelectedDown()

moveSelectedDown

public void moveSelectedDown()
move Selected Graphs Down

See Also:
moveSelectedUp()

getSelectedIndices

public int[] getSelectedIndices()
return numbers of selected lines in the bottom panel curve list

Returns:
int[]
See Also:
setSelectedIndices(int[])

setSelectedIndices

public void setSelectedIndices(int[] indices)
select lines in the bottom panel curve list

Parameters:
indices - int[]
See Also:
getSelectedIndices()

rebuildPanel

public void rebuildPanel()
this method is responsible for positioning of all graphs, annotations, axis etc.


addGraph

public void addGraph(GeneralGraphView graph)
add new Graph to the and

Parameters:
graph - GeneralGraphView

removeDataImages

public void removeDataImages()
remove images for all graphs, annotation panel, repeat panel and axis panel


refreshGraphs

public void refreshGraphs()
request new data from the server for all graphs and repaint


getStatistics

public java.util.Vector getStatistics()
return conservation Statistics for all curves

Returns:
Vector
See Also:
VistaCurveView.getStatistics(), GeneralGraphView.getStatistics()

getGraphPanelSize

public java.awt.Dimension getGraphPanelSize()
return dimension of the graph panel

Returns:
Dimension

getTracerPanel

public TracerPanel getTracerPanel()
return Tracer Panel

Returns:
TracerPanel

setTracerPanel

public void setTracerPanel(TracerPanel tp)
set Tracer Panel

Parameters:
tp - TracerPanel

getPopup

public javax.swing.JPopupMenu getPopup()
return Popup menu

Returns:
JPopupMenu

getNumberOfGraphs

public int getNumberOfGraphs()
return Number Of Graphs

Returns:
int

getPanelCapacity

public int getPanelCapacity()
return number of rows that would be drawn in the panel

Returns:
int

addCurves

public void addCurves(Status status)
add Curves that are saved in status

Parameters:
status - Status

addDefaultCurve

public void addDefaultCurve(GenomeInfo genome)
add Default Curves for the genome

Parameters:
genome - GenomeInfo

componentResized

public void componentResized(java.awt.event.ComponentEvent e)
Logic of this method is the following: If number of rows is fixed and only vertical size changed - do nothing. In all other cases try to rebuild panel to show maximum details

Specified by:
componentResized in interface java.awt.event.ComponentListener
Parameters:
e - ComponentEvent

componentMoved

public void componentMoved(java.awt.event.ComponentEvent e)
Specified by:
componentMoved in interface java.awt.event.ComponentListener

componentShown

public void componentShown(java.awt.event.ComponentEvent e)
Specified by:
componentShown in interface java.awt.event.ComponentListener

componentHidden

public void componentHidden(java.awt.event.ComponentEvent e)
Specified by:
componentHidden in interface java.awt.event.ComponentListener

print

public int print(java.awt.Graphics g,
                 java.awt.print.PageFormat pf,
                 int pi)
          throws java.awt.print.PrinterException
print content

Specified by:
print in interface java.awt.print.Printable
Overrides:
print in class VGBPanel
Parameters:
g - Graphics
pf - PageFormat
pi - int
Returns:
int
Throws:
java.awt.print.PrinterException

drawContent

public void drawContent(java.awt.Graphics g,
                        int width,
                        int height)
draw Content in area with specified size

Parameters:
g - Graphics
width - int
height - int
See Also:
drawContent(Graphics, PageFormat)

getPrintHeight

public int getPrintHeight(int graphs,
                          int lines)
return min height that is necessary to fit all the content

Parameters:
graphs - int
lines - int
Returns:
int

drawContent

public void drawContent(java.awt.Graphics g,
                        java.awt.print.PageFormat pf)
print content on the page (printer, PDF or image)

Parameters:
g - Graphics
pf - PageFormat

annotationLegend

protected void annotationLegend(java.awt.Graphics g,
                                java.awt.Color color,
                                int x,
                                int y,
                                java.lang.String name)
draw annotation legend

Parameters:
g - Graphics
color - Color
x - int
y - int
name - String

repeatLegend

protected void repeatLegend(java.awt.Graphics g,
                            java.awt.Color color,
                            int x,
                            int y,
                            java.lang.String name)
draw repeat legend

Parameters:
g - Graphics
color - Color
x - int
y - int
name - String

contigLegend

protected void contigLegend(java.awt.Graphics g,
                            java.awt.Color color,
                            int x,
                            int y,
                            java.lang.String name)
draw contig legend

Parameters:
g - Graphics
color - Color
x - int
y - int
name - String

repaintTracerPanels

public void repaintTracerPanels()
repaint all TracerPanels


setXBorders

public void setXBorders(int x)
set Borders of the selected region

Parameters:
x - int

resetXBorders

public void resetXBorders()
resetXBorders

See Also:
TracerPanel.reset()

getChromDX

public long getChromDX()
return number of selected points

Returns:
long

updatePosition

public boolean updatePosition()
update Position

Returns:
boolean
See Also:
VistaApp.updatePosition(long,long)

setPrintCapacity

public void setPrintCapacity(int graphs,
                             int lines)
Set number of graphs and lines to be printed

Parameters:
graphs - int
lines - int
See Also:
PrintAction

setFixedRows

public void setFixedRows(int rows)
set number of rows to show in the Display Panel

Parameters:
rows - int

getUniqOrganisms

public int getUniqOrganisms()
return number uniq organisms

Returns:
int

getFirstSelectedIndex

public int getFirstSelectedIndex()
return index of the first (from top) selected graph

Returns:
int
See Also:
getLastSelectedIndex()

selectGraph

public void selectGraph(int index)
select Graph in index position

Parameters:
index - int

getLastSelectedIndex

public int getLastSelectedIndex()
return index of the last (from top) selected graph

Returns:
int
See Also:
getFirstSelectedIndex()

hideGraph

public void hideGraph(java.lang.String curveName)
hide Graph

Parameters:
curveName - String

showGraph

public void showGraph(java.lang.String curveName)
show Graph

Parameters:
curveName - String