apollo.gui.genomemap
Class SiteView

java.lang.Object
  extended by apollo.gui.genomemap.LinearView
      extended by apollo.gui.genomemap.ManagedView
          extended by apollo.gui.genomemap.TierView
              extended by apollo.gui.genomemap.SiteView
All Implemented Interfaces:
ControlledObjectI, TierManagerListener, DropTargetViewI, ManagedViewI, PickViewI, TierViewI, ViewI, java.awt.event.AdjustmentListener, java.io.Serializable, java.util.EventListener

public class SiteView
extends TierView

A view to display sites (start and stop codons). Displays 3 stop tiers/Sites and 3 start tiers/Sites. Took out implementing of SelectViewI. SelectViewI is for handling external selections, but presently there is no way to externally select a codon, except that codons will select when transcripts are selected, but this is handled through handlefeatureSelection(it's easier that way)

See Also:
Serialized Form

Field Summary
protected  CurationSet curation
           
protected  int height
           
protected static org.apache.log4j.Logger logger
           
protected  ResultView resultView
          For TranslationStartStopSelectionListener
protected  Sites[] sitesArray
          [0,1,2] start sites, [3,4,5] for stop sites (3 frames for each)
static char[] startCodon
           
static int startCodonHashCode
           
 
Fields inherited from class apollo.gui.genomemap.TierView
controller, dragSources, rightSide, selectionManager, vScroll, vscrollable
 
Fields inherited from class apollo.gui.genomemap.ManagedView
dropSpaceSize, leadSpaceSize, manager, visibleDrawables
 
Fields inherited from class apollo.gui.genomemap.LinearView
apollo_panel, backgroundColour, debug, foregroundColour, graphics, limitsSet, transformer, transparent, viewBounds, visibilityListeners, visible
 
Constructor Summary
SiteView(javax.swing.JComponent ap, java.lang.String name, Controller controller, SelectionManager selectionManager)
          component is ApolloPanel
 
Method Summary
 void _createSites(int[] visRange)
          visRange[] has 2 ints which are the start and stop in basepair of what is currently visible.
 boolean allowsTierDrags()
          Whether this view allows tier dragging
 void clearSelections()
          Clear all selections in all Sites
protected  java.util.Vector findDrawables(java.awt.Rectangle rect, boolean selected_only)
          Finds all the sites in rect and creates SiteCodon for them.
 Selection findFeaturesForSelection(java.awt.Rectangle rect, boolean selectParents)
          From PickViewI for selection, selectParents is ignored here
 java.awt.Rectangle getPreferredSize()
          Get the preferred size for the view
 ResultView getResultView()
           
 Selection getViewSelection(Selection selection)
          given the entirety of what is currently selected, remove anything that doesn't belong to this view and return the remaining selections.
 boolean handleTierManagerEvent(TierManagerEvent evt)
           
protected  boolean needsTextAvoidUpdate()
           
 void paintDrawables()
           
 void selectParents(Selection selection)
           
 void setCentre(int val)
          Set the centre position.
 void setCurationSet(CurationSet set)
           
 void setResultView(ResultView rv)
           
 void setVisible(boolean state)
          Set whether or not a view is visible
 void setZoomFactor(double fac)
          Set the ZoomFactor along the linear axis
 
Methods inherited from class apollo.gui.genomemap.TierView
addScrollBar, adjustmentValueChanged, beginTierDrag, changeTierHeight, clear, createDragView, decrementTierHeight, drawablesForDrag, endTierDrag, findDrawables, findDrawables, findFeatures, findFeatures, findFeatures, findFeaturesForSelection, findFeaturesForSelection, fireViewEvent, getController, getControllerWindow, getInvertedScrollbarValue, getLowestVisibleTier, getMaxScrollbarValue, getMinScrollbarValue, getScrollbarValue, getVisibleScrollbarValue, incrementTierHeight, interpretDrop, interpretDrop, isDownOrientation, isUpOrientation, isValidDragSource, moveScrollbarByWheelAmount, needsAutoRemoval, paintView, printScrollValues, putScrollAtStart, registerDragSource, setController, setLowestVisibleTier, setScrollbarValue, setScrollHack, setScrollSide, setScrollValues, setScrollVisibility, setSelectionManager, setTierManager, setVScrollable, setYOrientation, updateManagerHeight, updateTierDrag
 
Methods inherited from class apollo.gui.genomemap.ManagedView
getDropSpaceSize, getLeadSpaceSize, getTierManager, getVisibleDrawables, getYRange, setBounds, setDropSpaceSize, setLeadSpaceSize, setTierManager, setXOrientation
 
Methods inherited from class apollo.gui.genomemap.LinearView
addViewListener, addVisibilityListener, areLimitsSet, fireViewEvent, getBackgroundColour, getBounds, getCentre, getComponent, getDrawBounds, getForegroundColour, getGraphics, getLimits, getMaximum, getMinimum, getName, getSelectionRectangle, getStrand, getTransform, getVisibleRange, init, isInvalid, isTransparent, isVisible, setBackgroundColour, setComponent, setDebug, setDrawBounds, setForegroundColour, setGraphics, setInvalidity, setLimits, setLimitsSet, setMaximum, setMinimum, setName, setStrand, setTransform, setTransparent, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface apollo.gui.genomemap.TierViewI
getVisibleDrawables
 
Methods inherited from interface apollo.gui.genomemap.ManagedViewI
getTierManager, setTierManager
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger

startCodon

public static final char[] startCodon

startCodonHashCode

public static final int startCodonHashCode

height

protected int height

sitesArray

protected Sites[] sitesArray
[0,1,2] start sites, [3,4,5] for stop sites (3 frames for each)


curation

protected CurationSet curation

resultView

protected ResultView resultView
For TranslationStartStopSelectionListener

Constructor Detail

SiteView

public SiteView(javax.swing.JComponent ap,
                java.lang.String name,
                Controller controller,
                SelectionManager selectionManager)
component is ApolloPanel

Method Detail

setCurationSet

public void setCurationSet(CurationSet set)

paintDrawables

public void paintDrawables()
Overrides:
paintDrawables in class ManagedView

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
Overrides:
setVisible in class TierView

setCentre

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

Specified by:
setCentre in interface ViewI
Overrides:
setCentre in class LinearView

needsTextAvoidUpdate

protected boolean needsTextAvoidUpdate()

setZoomFactor

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

Specified by:
setZoomFactor in interface ViewI
Overrides:
setZoomFactor in class LinearView

_createSites

public void _createSites(int[] visRange)
visRange[] has 2 ints which are the start and stop in basepair of what is currently visible. Changed _createSites to modify directly sitesArray rather than returning a newly made Sites array. It now clears out the positions on the old Sites and resuses them. This was needed to preserve the selection state.


allowsTierDrags

public boolean allowsTierDrags()
Description copied from interface: TierViewI
Whether this view allows tier dragging

Specified by:
allowsTierDrags in interface TierViewI
Overrides:
allowsTierDrags in class TierView

getPreferredSize

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

Specified by:
getPreferredSize in interface ViewI
Overrides:
getPreferredSize in class LinearView

setResultView

public void setResultView(ResultView rv)

getResultView

public ResultView getResultView()

handleTierManagerEvent

public boolean handleTierManagerEvent(TierManagerEvent evt)
Specified by:
handleTierManagerEvent in interface TierManagerListener
Overrides:
handleTierManagerEvent in class TierView

findFeaturesForSelection

public Selection findFeaturesForSelection(java.awt.Rectangle rect,
                                          boolean selectParents)
From PickViewI for selection, selectParents is ignored here

Specified by:
findFeaturesForSelection in class TierView

findDrawables

protected java.util.Vector findDrawables(java.awt.Rectangle rect,
                                         boolean selected_only)
Finds all the sites in rect and creates SiteCodon for them. Returns vector of SiteCodons The SiteCodons are not drawn. Sites are notified when a SiteCodon is selected.

Specified by:
findDrawables in class TierView

clearSelections

public void clearSelections()
Clear all selections in all Sites


selectParents

public void selectParents(Selection selection)

getViewSelection

public Selection getViewSelection(Selection selection)
Description copied from class: TierView
given the entirety of what is currently selected, remove anything that doesn't belong to this view and return the remaining selections. This used to be handled in the Selection class, but it didn't quite work, because the 'source'=='where it was originally selected' which, may or may not be, the same as this view.

Specified by:
getViewSelection in interface TierViewI
Specified by:
getViewSelection in class TierView