Package org.biojava.bio.gui.sequence
Interface SequenceRenderContext
-
- All Superinterfaces:
SwingConstants
- All Known Subinterfaces:
PairwiseRenderContext
- All Known Implementing Classes:
HeadlessRenderContext,PairwiseSequencePanel,SequencePanel,SequencePoster,SubPairwiseRenderContext,SubSequenceRenderContext,TranslatedSequencePanel
public interface SequenceRenderContext extends SwingConstants
A context within which sequence information may be rendered. It encapsulates the rendering direction, the size of the leading and trailing (header/footer, left/right areas), scale and the currently rendered symbols, features and region.- Author:
- Thomas Down, Matthew Pocock
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classSequenceRenderContext.BorderThe metric object for the 'border' area - the area between the extent of the rendered area and the beginning or end of the sequence.
-
Field Summary
Fields Modifier and Type Field Description static ChangeTypeLAYOUTstatic ChangeTypeREPAINT-
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
-
-
Method Summary
All Methods Instance Methods Abstract 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.
-
-
-
Field Detail
-
REPAINT
static final ChangeType REPAINT
-
LAYOUT
static final ChangeType LAYOUT
-
-
Method Detail
-
getDirection
int getDirection()
Gets the direction in which this context expects sequences to be rendered - HORIZONTAL or VERTICAL.- Returns:
- The Direction value
-
getScale
double getScale()
Gets the scale as pixels per Symbol- Returns:
- The scale value
-
sequenceToGraphics
double sequenceToGraphics(int i)
Converts a sequence index into a graphical coordinate. You will need to use this in conjunction with getDirection to correctly lay graphics out.- Parameters:
i- Index within the sequence- Returns:
- Equivalent graphical position in pixels
-
graphicsToSequence
int graphicsToSequence(double d)
Converts a graphical position into a sequence coordinate. You will need to have used getDirection to decide whether to use the x or y coordinate.- Parameters:
d- A pixel position- Returns:
- The corresponding sequence index
-
graphicsToSequence
int graphicsToSequence(Point2D point)
Converts a graphical position into a sequence coordinate. This will use getDirection to decide whether to use the x or y coordinate.- Parameters:
point- a point representing the position- Returns:
- the corresponding sequence index
-
getSymbols
SymbolList getSymbols()
The SymbolList that is currently rendered by this SequenceRenderContext.- Returns:
- The Sequence value
-
getFeatures
FeatureHolder getFeatures()
The features to render.- Returns:
- a FeatureHolder with the Features to render
-
getRange
RangeLocation getRange()
The range of the SymbolList to render.- Returns:
- the RangeLocation specifying which indices (inclusive) to render
-
getLeadingBorder
SequenceRenderContext.Border getLeadingBorder()
Gets the LeadingBorder attribute of the SequenceRenderContext object. This represents the space between the beginning of the rendering area and the beginning of the sequence.- Returns:
- The LeadingBorder value
-
getTrailingBorder
SequenceRenderContext.Border getTrailingBorder()
Gets the TrailingBorder attribute of the SequenceRenderContext object. This represents the space between the end of the sequence and the end of the rendering area.- Returns:
- The TrailingBorder value
-
-