Package org.biojava.bio.gui.sequence
Class SubSequenceRenderContext
- java.lang.Object
- 
- org.biojava.bio.gui.sequence.SubSequenceRenderContext
 
- 
- All Implemented Interfaces:
- SwingConstants,- SequenceRenderContext
 
 public class SubSequenceRenderContext extends Object implements SequenceRenderContext Allows a new renderer to "wrap" another one, replacing one or more values.Use this when implementing SequenceRenderer classes that modify the data that is passed on to delegate renderers e.g. filtering the features, transforming the sequence or moving the rendering co-ordinates. - Author:
- Matthew Pocock
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.biojava.bio.gui.sequence.SequenceRenderContextSequenceRenderContext.Border
 
- 
 - 
Field Summary- 
Fields inherited from interface org.biojava.bio.gui.sequence.SequenceRenderContextLAYOUT, REPAINT
 - 
Fields inherited from interface javax.swing.SwingConstantsBOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
- 
 - 
Constructor SummaryConstructors Constructor Description SubSequenceRenderContext(SequenceRenderContext src, SymbolList symbols, FeatureHolder features, RangeLocation range)SubSequenceRenderContext(SequenceRenderContext src, SymbolList symbols, FeatureHolder features, RangeLocation range, int symOffset)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetDirection()Gets the direction in which this context expects sequences to be rendered - HORIZONTAL or VERTICAL.FeatureHoldergetFeatures()The features to render.FontgetFont()Gets the Font attribute of the SequenceRenderContext objectSequenceRenderContext.BordergetLeadingBorder()Gets the LeadingBorder attribute of the SequenceRenderContext object.RangeLocationgetRange()The range of the SymbolList to render.doublegetScale()Gets the scale as pixels per SymbolSymbolListgetSymbols()The SymbolList that is currently rendered by this SequenceRenderContext.SequenceRenderContext.BordergetTrailingBorder()Gets the TrailingBorder attribute of the SequenceRenderContext object.intgraphicsToSequence(double d)Converts a graphical position into a sequence coordinate.intgraphicsToSequence(Point2D point)Converts a graphical position into a sequence coordinate.doublesequenceToGraphics(int i)Converts a sequence index into a graphical coordinate.
 
- 
- 
- 
Constructor Detail- 
SubSequenceRenderContextpublic SubSequenceRenderContext(SequenceRenderContext src, SymbolList symbols, FeatureHolder features, RangeLocation range) 
 - 
SubSequenceRenderContextpublic SubSequenceRenderContext(SequenceRenderContext src, SymbolList symbols, FeatureHolder features, RangeLocation range, int symOffset) 
 
- 
 - 
Method Detail- 
getDirectionpublic int getDirection() Description copied from interface:SequenceRenderContextGets the direction in which this context expects sequences to be rendered - HORIZONTAL or VERTICAL.- Specified by:
- getDirectionin interface- SequenceRenderContext
- Returns:
- The Direction value
 
 - 
getScalepublic double getScale() Description copied from interface:SequenceRenderContextGets the scale as pixels per Symbol- Specified by:
- getScalein interface- SequenceRenderContext
- Returns:
- The scale value
 
 - 
sequenceToGraphicspublic double sequenceToGraphics(int i) Description copied from interface:SequenceRenderContextConverts a sequence index into a graphical coordinate. You will need to use this in conjunction with getDirection to correctly lay graphics out.- Specified by:
- sequenceToGraphicsin interface- SequenceRenderContext
- Parameters:
- i- Index within the sequence
- Returns:
- Equivalent graphical position in pixels
 
 - 
graphicsToSequencepublic int graphicsToSequence(double d) Description copied from interface:SequenceRenderContextConverts a graphical position into a sequence coordinate. You will need to have used getDirection to decide whether to use the x or y coordinate.- Specified by:
- graphicsToSequencein interface- SequenceRenderContext
- Parameters:
- d- A pixel position
- Returns:
- The corresponding sequence index
 
 - 
graphicsToSequencepublic int graphicsToSequence(Point2D point) Description copied from interface:SequenceRenderContextConverts a graphical position into a sequence coordinate. This will use getDirection to decide whether to use the x or y coordinate.- Specified by:
- graphicsToSequencein interface- SequenceRenderContext
- Parameters:
- point- a point representing the position
- Returns:
- the corresponding sequence index
 
 - 
getSymbolspublic SymbolList getSymbols() Description copied from interface:SequenceRenderContextThe SymbolList that is currently rendered by this SequenceRenderContext.- Specified by:
- getSymbolsin interface- SequenceRenderContext
- Returns:
- The Sequence value
 
 - 
getFeaturespublic FeatureHolder getFeatures() Description copied from interface:SequenceRenderContextThe features to render.- Specified by:
- getFeaturesin interface- SequenceRenderContext
- Returns:
- a FeatureHolder with the Features to render
 
 - 
getRangepublic RangeLocation getRange() Description copied from interface:SequenceRenderContextThe range of the SymbolList to render.- Specified by:
- getRangein interface- SequenceRenderContext
- Returns:
- the RangeLocation specifying which indices (inclusive) to render
 
 - 
getLeadingBorderpublic SequenceRenderContext.Border getLeadingBorder() Description copied from interface:SequenceRenderContextGets the LeadingBorder attribute of the SequenceRenderContext object. This represents the space between the beginning of the rendering area and the beginning of the sequence.- Specified by:
- getLeadingBorderin interface- SequenceRenderContext
- Returns:
- The LeadingBorder value
 
 - 
getTrailingBorderpublic SequenceRenderContext.Border getTrailingBorder() Description copied from interface:SequenceRenderContextGets the TrailingBorder attribute of the SequenceRenderContext object. This represents the space between the end of the sequence and the end of the rendering area.- Specified by:
- getTrailingBorderin interface- SequenceRenderContext
- Returns:
- The TrailingBorder value
 
 - 
getFontpublic Font getFont() Description copied from interface:SequenceRenderContextGets the Font attribute of the SequenceRenderContext object- Specified by:
- getFontin interface- SequenceRenderContext
- Returns:
- The Font value
 
 
- 
 
-