apollo.gui.genomemap
Class LinearView

java.lang.Object
  extended by apollo.gui.genomemap.LinearView
All Implemented Interfaces:
ViewI
Direct Known Subclasses:
ContainerView, ManagedView, ScrollAdjustedView

public abstract class LinearView
extends java.lang.Object
implements ViewI

A basic, non useful, implementation of the LinearViewI interface.


Field Summary
protected  javax.swing.JComponent apollo_panel
           
protected  java.awt.Color backgroundColour
           
protected  boolean debug
           
protected  java.awt.Color foregroundColour
           
protected  java.awt.Graphics graphics
           
protected  boolean limitsSet
           
protected static org.apache.log4j.Logger logger
           
protected  Transformer transformer
           
protected  boolean transparent
           
protected  java.awt.Rectangle viewBounds
           
protected  java.util.List<VisibilityListener> visibilityListeners
           
protected  boolean visible
           
 
Fields inherited from interface apollo.gui.genomemap.ViewI
LEFTSIDE, NONE, RIGHTSIDE
 
Constructor Summary
LinearView(javax.swing.JComponent ap, java.lang.String name, boolean visible)
           
 
Method Summary
 void addViewListener(ViewListener l)
          Add a View event listener
 void addVisibilityListener(VisibilityListener l)
           
 boolean areLimitsSet()
           
 void clear()
           
 void fireViewEvent(ViewEvent evt)
           
 java.awt.Color getBackgroundColour()
           
 java.awt.Rectangle getBounds()
          Get the coordinates of the rectangle containing the View.
 int getCentre()
          Get the maximum limit.
 javax.swing.JComponent getComponent()
          LinearViews components that are part of an ApolloPanel which is a JComponent
 java.awt.Rectangle getDrawBounds()
           
 java.awt.Color getForegroundColour()
           
 java.awt.Graphics getGraphics()
           
 int[] getLimits()
          Limits not necasarily equal to seq start and end, Component.syncViewLimits pads out the limits beyond sequence
 int getMaximum()
          Get the maximum limit.
 int getMinimum()
          Get the minimum limit.
 java.lang.String getName()
          Returns the name of the view.
 java.awt.Rectangle getPreferredSize()
          Get the preferred size for the view
protected  java.awt.Rectangle getSelectionRectangle(java.awt.Point pnt)
           
 int getStrand()
           
 Transformer getTransform()
          Get the tranform object to convert between View and component coordinates.
 int[] getVisibleRange()
          visible range in base pairs
protected  void init(javax.swing.JComponent ap, java.lang.String name, boolean visible)
           
 boolean isInvalid()
          Get a flag indicating whether the view is invalid
 boolean isTransparent()
           
 boolean isVisible()
          return whether or not a view is visible
 void paintView()
          paintView draws a cross in the centre of the View and a small cross in the upper left quadrant
 void setBackgroundColour(java.awt.Color colour)
           
 void setBounds(java.awt.Rectangle rect)
          Set the coordinates of the rectangle containing the View.
 void setCentre(int centre)
          Set the centre position.
 void setComponent(javax.swing.JComponent ap)
          Set the component the view belongs to.
 void setDebug(boolean state)
           
 void setDrawBounds(java.awt.Rectangle rect)
           
 void setForegroundColour(java.awt.Color colour)
           
 void setGraphics(java.awt.Graphics graphics)
          Set the Graphics to draw to.
 void setInvalidity(boolean state)
          Set a flag indicating whether the view is currently invalid
 void setLimits(int[] limits)
          Sets the minimum and maximum limits for the extent
 void setLimitsSet(boolean state)
           
 void setMaximum(int max)
          Sets the maximum limit for the extent
 void setMinimum(int min)
          Sets the minimum limit for the extent
 void setName(java.lang.String name)
          Sets the name of the view
 void setStrand(int strand)
          I moved strand from FeatureView to here, because scrolling is different on reverse strand than forward strand.
 void setTransform(Transformer transformer)
           
 void setTransparent(boolean state)
           
 void setVisible(boolean state)
          Set whether or not a view is visible
 void setVisible(boolean state, boolean remove)
           
 void setZoomFactor(double factor)
          Set the ZoomFactor along the linear axis
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger

apollo_panel

protected javax.swing.JComponent apollo_panel

transformer

protected Transformer transformer

graphics

protected java.awt.Graphics graphics

backgroundColour

protected java.awt.Color backgroundColour

foregroundColour

protected java.awt.Color foregroundColour

viewBounds

protected java.awt.Rectangle viewBounds

visible

protected boolean visible

debug

protected boolean debug

limitsSet

protected boolean limitsSet

transparent

protected boolean transparent

visibilityListeners

protected java.util.List<VisibilityListener> visibilityListeners
Constructor Detail

LinearView

public LinearView(javax.swing.JComponent ap,
                  java.lang.String name,
                  boolean visible)
Method Detail

init

protected void init(javax.swing.JComponent ap,
                    java.lang.String name,
                    boolean visible)

setComponent

public void setComponent(javax.swing.JComponent ap)
Description copied from interface: ViewI
Set the component the view belongs to.

Specified by:
setComponent in interface ViewI

getComponent

public javax.swing.JComponent getComponent()
LinearViews components that are part of an ApolloPanel which is a JComponent

Specified by:
getComponent in interface ViewI

setInvalidity

public void setInvalidity(boolean state)
Description copied from interface: ViewI
Set a flag indicating whether the view is currently invalid

Specified by:
setInvalidity in interface ViewI

isInvalid

public boolean isInvalid()
Description copied from interface: ViewI
Get a flag indicating whether the view is invalid

Specified by:
isInvalid in interface ViewI

setBounds

public void setBounds(java.awt.Rectangle rect)
Description copied from interface: ViewI
Set the coordinates of the rectangle containing the View.

Specified by:
setBounds in interface ViewI
Parameters:
rect - The rectangle describing the new bounds of the View in parent component coordinates.

getBounds

public java.awt.Rectangle getBounds()
Description copied from interface: ViewI
Get the coordinates of the rectangle containing the View.

Specified by:
getBounds in interface ViewI

getDrawBounds

public java.awt.Rectangle getDrawBounds()

setDrawBounds

public void setDrawBounds(java.awt.Rectangle rect)

setName

public void setName(java.lang.String name)
Description copied from interface: ViewI
Sets the name of the view

Specified by:
setName in interface ViewI
Parameters:
name - The name of the view.

getName

public java.lang.String getName()
Description copied from interface: ViewI
Returns the name of the view.

Specified by:
getName in interface ViewI

setGraphics

public void setGraphics(java.awt.Graphics graphics)
Description copied from interface: ViewI
Set the Graphics to draw to.

Specified by:
setGraphics in interface ViewI
Parameters:
graphics - The new graphics to draw to. This will usually be the Graphics for the containing component (or for its offscreen buffer).

getGraphics

public java.awt.Graphics getGraphics()

paintView

public void paintView()
paintView draws a cross in the centre of the View and a small cross in the upper left quadrant

Specified by:
paintView in interface ViewI

getTransform

public Transformer getTransform()
Description copied from interface: ViewI
Get the tranform object to convert between View and component coordinates.

Specified by:
getTransform in interface ViewI

setTransform

public void setTransform(Transformer transformer)

setLimits

public void setLimits(int[] limits)
Description copied from interface: ViewI
Sets the minimum and maximum limits for the extent

Specified by:
setLimits in interface ViewI

areLimitsSet

public boolean areLimitsSet()
Specified by:
areLimitsSet in interface ViewI

setLimitsSet

public void setLimitsSet(boolean state)
Specified by:
setLimitsSet in interface ViewI

setMinimum

public void setMinimum(int min)
Description copied from interface: ViewI
Sets the minimum limit for the extent

Specified by:
setMinimum in interface ViewI

setMaximum

public void setMaximum(int max)
Description copied from interface: ViewI
Sets the maximum limit for the extent

Specified by:
setMaximum in interface ViewI

getLimits

public int[] getLimits()
Limits not necasarily equal to seq start and end, Component.syncViewLimits pads out the limits beyond sequence

Specified by:
getLimits in interface ViewI

getMaximum

public int getMaximum()
Description copied from interface: ViewI
Get the maximum limit.

Specified by:
getMaximum in interface ViewI

getMinimum

public int getMinimum()
Description copied from interface: ViewI
Get the minimum limit.

Specified by:
getMinimum in interface ViewI

setCentre

public void setCentre(int centre)
Description copied from interface: ViewI
Set the centre position.

Specified by:
setCentre in interface ViewI

getCentre

public int getCentre()
Description copied from interface: ViewI
Get the maximum limit.

Specified by:
getCentre in interface ViewI

getPreferredSize

public java.awt.Rectangle getPreferredSize()
Description copied from interface: ViewI
Get the preferred size for the view

Specified by:
getPreferredSize in interface ViewI

setZoomFactor

public void setZoomFactor(double factor)
Description copied from interface: ViewI
Set the ZoomFactor along the linear axis

Specified by:
setZoomFactor in interface ViewI

getVisibleRange

public int[] getVisibleRange()
visible range in base pairs

Specified by:
getVisibleRange in interface ViewI

setVisible

public void setVisible(boolean state,
                       boolean remove)

setVisible

public void setVisible(boolean state)
Description copied from interface: ViewI
Set whether or not a view is visible

Specified by:
setVisible in interface ViewI

isVisible

public boolean isVisible()
Description copied from interface: ViewI
return whether or not a view is visible

Specified by:
isVisible in interface ViewI

setDebug

public void setDebug(boolean state)

addViewListener

public void addViewListener(ViewListener l)
Description copied from interface: ViewI
Add a View event listener

Specified by:
addViewListener in interface ViewI

fireViewEvent

public void fireViewEvent(ViewEvent evt)

setBackgroundColour

public void setBackgroundColour(java.awt.Color colour)

getBackgroundColour

public java.awt.Color getBackgroundColour()

setForegroundColour

public void setForegroundColour(java.awt.Color colour)

getForegroundColour

public java.awt.Color getForegroundColour()

setTransparent

public void setTransparent(boolean state)
Specified by:
setTransparent in interface ViewI

isTransparent

public boolean isTransparent()
Specified by:
isTransparent in interface ViewI

clear

public void clear()
Specified by:
clear in interface ViewI

setStrand

public void setStrand(int strand)
I moved strand from FeatureView to here, because scrolling is different on reverse strand than forward strand. But this is funny for subclasses like SequenceView that are not stranded.


getStrand

public int getStrand()

getSelectionRectangle

protected java.awt.Rectangle getSelectionRectangle(java.awt.Point pnt)

addVisibilityListener

public void addVisibilityListener(VisibilityListener l)