apollo.gui.genomemap
Class ContainerView

java.lang.Object
  extended by apollo.gui.genomemap.LinearView
      extended by apollo.gui.genomemap.ContainerView
All Implemented Interfaces:
ControlledObjectI, ContainerViewI, PickViewI, ViewI, java.io.Serializable
Direct Known Subclasses:
LaidoutViewContainer, SplitterView

public abstract class ContainerView
extends LinearView
implements ContainerViewI, PickViewI

See Also:
Serialized Form

Field Summary
protected  Controller controller
           
protected  java.util.Vector views
           
 
Fields inherited from class apollo.gui.genomemap.LinearView
apollo_panel, backgroundColour, debug, foregroundColour, graphics, limitsSet, logger, transformer, transparent, viewBounds, visibilityListeners, visible
 
Fields inherited from interface apollo.gui.genomemap.ViewI
LEFTSIDE, NONE, RIGHTSIDE
 
Constructor Summary
ContainerView(javax.swing.JComponent ap, java.lang.String name, boolean visible)
           
 
Method Summary
 Selection findFeaturesForSelection(java.awt.Point p, boolean selectParents)
          Find features for selection.
 Selection findFeaturesForSelection(java.awt.Rectangle rect)
          Same as above for rectangle, no selectParents needed
 ViewI getContainedViewAt(java.awt.Point p)
           
 Controller getController()
          Gets the Controller for the object
 java.lang.Object getControllerWindow()
          Shouldnt this return Window - would we ever want a non-window?
 java.util.Vector getViews()
           
 java.util.Vector getViewsOfClass(java.lang.Class c)
           
 boolean needsAutoRemoval()
          If getControllerWindow is non null, and needsAutoRemoval is true then Controller will automatically remove the ControlledObjectI as a listener when its ControllerWindow is closing.
 void paintView()
          paintView draws a cross in the centre of the View and a small cross in the upper left quadrant
 void setCentre(int centre)
          Set the centre position.
 void setComponent(javax.swing.JComponent ap)
          Set the component the view belongs to.
 void setController(Controller c)
          Sets the Controller for the object
 void setDrawBounds(java.awt.Rectangle rect)
           
 void setGraphics(java.awt.Graphics g)
          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
abstract  java.awt.Rectangle setScrollSpace(int where)
           
 void setZoomFactor(double factor)
          Set the ZoomFactor along the linear axis
 
Methods inherited from class apollo.gui.genomemap.LinearView
addViewListener, addVisibilityListener, areLimitsSet, clear, fireViewEvent, getBackgroundColour, getBounds, getCentre, getComponent, getDrawBounds, getForegroundColour, getGraphics, getLimits, getMaximum, getMinimum, getName, getPreferredSize, getSelectionRectangle, getStrand, getTransform, getVisibleRange, init, isInvalid, isTransparent, isVisible, setBackgroundColour, setBounds, setDebug, setForegroundColour, setName, setStrand, setTransform, setTransparent, setVisible, 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.ViewI
addViewListener, areLimitsSet, clear, getBounds, getCentre, getComponent, getLimits, getMaximum, getMinimum, getName, getPreferredSize, getTransform, getVisibleRange, isInvalid, isTransparent, isVisible, setBounds, setName, setTransparent, setVisible
 

Field Detail

controller

protected Controller controller

views

protected java.util.Vector views
Constructor Detail

ContainerView

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

setController

public void setController(Controller c)
Description copied from interface: ControlledObjectI
Sets the Controller for the object

Specified by:
setController in interface ControlledObjectI

getController

public Controller getController()
Description copied from interface: ControlledObjectI
Gets the Controller for the object

Specified by:
getController in interface ControlledObjectI

getControllerWindow

public java.lang.Object getControllerWindow()
Description copied from interface: ControlledObjectI
Shouldnt this return Window - would we ever want a non-window?

Specified by:
getControllerWindow in interface ControlledObjectI

needsAutoRemoval

public boolean needsAutoRemoval()
Description copied from interface: ControlledObjectI
If getControllerWindow is non null, and needsAutoRemoval is true then Controller will automatically remove the ControlledObjectI as a listener when its ControllerWindow is closing. If getControllerWindow is null needsAutoRemoval is meaningless. Rename this removeAsListenerOnWindowClose?

Specified by:
needsAutoRemoval in interface ControlledObjectI

paintView

public void paintView()
Description copied from class: LinearView
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
Overrides:
paintView in class LinearView

getViews

public java.util.Vector getViews()
Specified by:
getViews in interface ContainerViewI

getViewsOfClass

public java.util.Vector getViewsOfClass(java.lang.Class c)
Specified by:
getViewsOfClass in interface ContainerViewI

getContainedViewAt

public ViewI getContainedViewAt(java.awt.Point p)
Specified by:
getContainedViewAt in interface ContainerViewI

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
Overrides:
setInvalidity in class LinearView

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
Overrides:
setLimits in class LinearView

setMinimum

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

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

setMaximum

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

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

setDrawBounds

public void setDrawBounds(java.awt.Rectangle rect)
Overrides:
setDrawBounds in class LinearView

setScrollSpace

public abstract java.awt.Rectangle setScrollSpace(int where)

setGraphics

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

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

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
Overrides:
setComponent in class LinearView

setCentre

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

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

setZoomFactor

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

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

setLimitsSet

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

findFeaturesForSelection

public Selection findFeaturesForSelection(java.awt.Point p,
                                          boolean selectParents)
Description copied from interface: PickViewI
Find features for selection. Returns selection with SelectionItems that have model as data and drawables as listeners. This replaces findFeatures that only returned model, the problem there being we then would hafta refind the drawables later on which was awkward and inefficient. If selectParents is true then return the parents of the features under the point.

Specified by:
findFeaturesForSelection in interface PickViewI

findFeaturesForSelection

public Selection findFeaturesForSelection(java.awt.Rectangle rect)
Description copied from interface: PickViewI
Same as above for rectangle, no selectParents needed

Specified by:
findFeaturesForSelection in interface PickViewI