|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectapollo.gui.genomemap.LinearView
apollo.gui.genomemap.ManagedView
apollo.gui.genomemap.TierView
public abstract class TierView
This class is the base class for FeatureView and SiteView. It is abstract because it doesn't implement getTierData() and would be non functional even if it did because it doesn't create the manager object anywhere. The reason it has been separated from FeatureView is to enable the use of the Scrolling and Tier functionality in the SequenceView, which although different to the FeatureView is basically a TierView where each tier is a piece of the sequence, so we can use the Tier and Scroll functionality and just change the meaning of tiers by creating a new TierManager and changing all the draw methods. Presently scrolling is done by mapping the scroll value to a tier number. Tiers run in opposite directions on forward and reverse strands. The tier number has to be inverted on the forward strand to be consistent with how the reverse strand is scrolled. Also this means that ScrollableTierView has to know about strand, which is a little funny because its subclass SequenceView is unstranded. This makes the code a bit confusing. I think a better way would be to not scroll by tier, but just by y values. A view would set itself according to the y values put out by the scroll bar. Im guessing that one of the reasons to do scrolling by tier was to have a unit of scrolling be a tier, but this can still be achieved with scrolling by y value, it would just round it to the nearest tier. This would be a bit of a work I think so Im putting it off for now. I'm also curious what others think. - MG
| Field Summary | |
|---|---|
protected Controller |
controller
|
protected java.util.Vector |
dragSources
|
protected boolean |
rightSide
|
protected SelectionManager |
selectionManager
|
protected javax.swing.JScrollBar |
vScroll
|
protected boolean |
vscrollable
|
| Fields inherited from class apollo.gui.genomemap.ManagedView |
|---|
dropSpaceSize, leadSpaceSize, logger, manager, visibleDrawables |
| Fields inherited from class apollo.gui.genomemap.LinearView |
|---|
apollo_panel, backgroundColour, debug, foregroundColour, graphics, limitsSet, transformer, transparent, viewBounds, visibilityListeners, visible |
| Constructor Summary | |
|---|---|
TierView(javax.swing.JComponent ap,
java.lang.String name,
SelectionManager selectionManager)
|
|
| Method Summary | |
|---|---|
protected void |
addScrollBar()
|
void |
adjustmentValueChanged(java.awt.event.AdjustmentEvent evt)
|
boolean |
allowsTierDrags()
Whether this view allows tier dragging |
boolean |
beginTierDrag(java.awt.event.MouseEvent evt)
Start a tier drag |
protected void |
changeTierHeight(int change)
|
void |
clear()
|
DragViewI |
createDragView(java.awt.event.MouseEvent evt,
Selection view_selection)
Interface of method required for starting a drag from this TierView |
void |
decrementTierHeight()
|
protected java.util.Vector |
drawablesForDrag(Selection selection)
Returns a FeatureSet of Drawables/view, not a model FeatureSet. |
void |
endTierDrag(java.awt.event.MouseEvent evt)
end a tier drag |
java.util.Vector |
findDrawables(java.awt.Point pnt)
CANT do selection here as this is called for mouse over as well! |
java.util.Vector |
findDrawables(java.awt.Rectangle rect)
Finds all the sites in rect and creates SiteCodon for them. |
protected abstract java.util.Vector |
findDrawables(java.awt.Rectangle rect,
boolean select_filter)
|
FeatureList |
findFeatures(java.awt.Point pnt)
returns a FeatureList of SeqFeatureI instances that fall beneath the point passed in |
FeatureList |
findFeatures(java.awt.Rectangle rect)
returns a FeatureList of SeqFeatureI instances (model not drawables) overlap any of the areas in the Vector of rectangles that is passed in |
FeatureList |
findFeatures(java.util.Vector rects)
returns a FeatureList of SeqFeatureI instances that overlap any of the areas in the Vector of rectangles that is passed in |
Selection |
findFeaturesForSelection(java.awt.Point p,
boolean selectParents)
Find geared to selection. |
Selection |
findFeaturesForSelection(java.awt.Rectangle rect)
Same as above for rectangle, no selectParents needed |
protected abstract Selection |
findFeaturesForSelection(java.awt.Rectangle rect,
boolean selectParents)
|
void |
fireViewEvent(int type)
|
Controller |
getController()
Gets the Controller for the object |
java.lang.Object |
getControllerWindow()
Shouldnt this return Window - would we ever want a non-window? |
protected int |
getInvertedScrollbarValue()
|
int |
getLowestVisibleTier()
Get the lowest visible tier. |
protected int |
getMaxScrollbarValue()
|
protected int |
getMinScrollbarValue()
|
protected int |
getScrollbarValue()
|
abstract 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. |
protected int |
getVisibleScrollbarValue()
|
boolean |
handleTierManagerEvent(TierManagerEvent evt)
|
void |
incrementTierHeight()
|
boolean |
interpretDrop(DragViewI dragView,
java.awt.event.MouseEvent evt)
|
boolean |
interpretDrop(DragViewI dragView,
java.awt.event.MouseEvent evt,
boolean doFlag,
java.lang.StringBuffer action)
|
protected boolean |
isDownOrientation()
Down Orientation happens with reverse strand normal and forward strand in reverse comp (below axis) |
protected boolean |
isUpOrientation()
Up orientation happens with forward strand normal and reverse strand in rev comp, its above the axis |
boolean |
isValidDragSource(TierViewI view)
|
void |
moveScrollbarByWheelAmount(int nClick)
|
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()
Just repaints scrollbars |
void |
printScrollValues()
|
protected void |
putScrollAtStart()
This is to set a view in its vertical "start" position, which is opposite for the 2 strands. |
void |
registerDragSource(TierViewI view)
|
void |
setController(Controller c)
Sets the Controller for the object |
void |
setLowestVisibleTier(long tier)
Set the lowest visible tier. |
protected void |
setScrollbarValue(int val)
|
void |
setScrollHack(boolean value)
|
void |
setScrollSide(int side)
|
void |
setScrollValues()
|
void |
setScrollVisibility(boolean state)
|
void |
setSelectionManager(SelectionManager selectionManager)
|
void |
setTierManager(FeatureTierManager ftm)
|
void |
setVisible(boolean state)
Set whether or not a view is visible |
void |
setVScrollable(boolean state)
|
void |
setYOrientation(int direction)
YOrientation gets flipped with revcomping |
protected void |
updateManagerHeight()
|
void |
updateTierDrag(java.awt.event.MouseEvent evt)
continue a tier drag |
| Methods inherited from class apollo.gui.genomemap.ManagedView |
|---|
getDropSpaceSize, getLeadSpaceSize, getTierManager, getVisibleDrawables, getYRange, paintDrawables, 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, getPreferredSize, getSelectionRectangle, getStrand, getTransform, getVisibleRange, init, isInvalid, isTransparent, isVisible, setBackgroundColour, setCentre, setComponent, setDebug, setDrawBounds, setForegroundColour, setGraphics, setInvalidity, setLimits, setLimitsSet, setMaximum, setMinimum, setName, setStrand, setTransform, setTransparent, setVisible, setZoomFactor |
| 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 |
|---|
protected javax.swing.JScrollBar vScroll
protected boolean vscrollable
protected boolean rightSide
protected Controller controller
protected java.util.Vector dragSources
protected SelectionManager selectionManager
| Constructor Detail |
|---|
public TierView(javax.swing.JComponent ap,
java.lang.String name,
SelectionManager selectionManager)
| Method Detail |
|---|
public void setSelectionManager(SelectionManager selectionManager)
public void setTierManager(FeatureTierManager ftm)
protected void updateManagerHeight()
updateManagerHeight in class ManagedViewpublic void moveScrollbarByWheelAmount(int nClick)
public void setYOrientation(int direction)
setYOrientation in class ManagedViewprotected void addScrollBar()
public void setVisible(boolean state)
ViewI
setVisible in interface ViewIsetVisible in class LinearViewpublic void paintView()
paintView in interface ViewIpaintView in class ManagedViewpublic void setScrollSide(int side)
public void incrementTierHeight()
incrementTierHeight in interface TierViewIpublic void decrementTierHeight()
decrementTierHeight in interface TierViewIprotected void changeTierHeight(int change)
public void setLowestVisibleTier(long tier)
TierViewI
setLowestVisibleTier in interface TierViewIpublic int getLowestVisibleTier()
TierViewI
getLowestVisibleTier in interface TierViewIpublic boolean allowsTierDrags()
TierViewI
allowsTierDrags in interface TierViewIpublic boolean beginTierDrag(java.awt.event.MouseEvent evt)
TierViewI
beginTierDrag in interface TierViewIpublic void updateTierDrag(java.awt.event.MouseEvent evt)
TierViewI
updateTierDrag in interface TierViewIpublic void endTierDrag(java.awt.event.MouseEvent evt)
TierViewI
endTierDrag in interface TierViewIpublic boolean handleTierManagerEvent(TierManagerEvent evt)
handleTierManagerEvent in interface TierManagerListener
public boolean interpretDrop(DragViewI dragView,
java.awt.event.MouseEvent evt)
interpretDrop in interface DropTargetViewI
public boolean interpretDrop(DragViewI dragView,
java.awt.event.MouseEvent evt,
boolean doFlag,
java.lang.StringBuffer action)
interpretDrop in interface DropTargetViewIpublic void registerDragSource(TierViewI view)
registerDragSource in interface DropTargetViewIpublic boolean isValidDragSource(TierViewI view)
isValidDragSource in interface DropTargetViewIpublic void adjustmentValueChanged(java.awt.event.AdjustmentEvent evt)
adjustmentValueChanged in interface java.awt.event.AdjustmentListenerprotected boolean isDownOrientation()
protected boolean isUpOrientation()
protected void putScrollAtStart()
protected void setScrollbarValue(int val)
protected int getMaxScrollbarValue()
protected int getVisibleScrollbarValue()
protected int getMinScrollbarValue()
protected int getScrollbarValue()
protected int getInvertedScrollbarValue()
public void setScrollHack(boolean value)
public void setVScrollable(boolean state)
public void fireViewEvent(int type)
public void setScrollValues()
public void printScrollValues()
public void setScrollVisibility(boolean state)
public Controller getController()
ControlledObjectI
getController in interface ControlledObjectIpublic java.lang.Object getControllerWindow()
ControlledObjectI
getControllerWindow in interface ControlledObjectIpublic boolean needsAutoRemoval()
ControlledObjectI
needsAutoRemoval in interface ControlledObjectIpublic void setController(Controller c)
ControlledObjectI
setController in interface ControlledObjectIpublic FeatureList findFeatures(java.awt.Point pnt)
public FeatureList findFeatures(java.util.Vector rects)
public FeatureList findFeatures(java.awt.Rectangle rect)
public Selection findFeaturesForSelection(java.awt.Point p,
boolean selectParents)
findFeaturesForSelection in interface PickViewIpublic Selection findFeaturesForSelection(java.awt.Rectangle rect)
PickViewI
findFeaturesForSelection in interface PickViewI
protected abstract Selection findFeaturesForSelection(java.awt.Rectangle rect,
boolean selectParents)
public java.util.Vector findDrawables(java.awt.Point pnt)
public java.util.Vector findDrawables(java.awt.Rectangle rect)
protected abstract java.util.Vector findDrawables(java.awt.Rectangle rect,
boolean select_filter)
public void clear()
clear in interface ViewIclear in class ManagedViewprotected java.util.Vector drawablesForDrag(Selection selection)
public abstract Selection getViewSelection(Selection selection)
getViewSelection in interface TierViewI
public DragViewI createDragView(java.awt.event.MouseEvent evt,
Selection view_selection)
TierViewI
createDragView in interface TierViewI
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||