|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
org.biojava.bio.gui.DistributionLogo
public class DistributionLogo
The GUI component for rendering a DistributionLogo. By default, this uses the text logo style - with letters stacked on top of one another, scaled by the total information in the dist, and uses a PlainStyle colorer that outlines in black, and fills in grey.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
DistributionLogo()
Create a new DistributionLogo object. |
Method Summary | |
---|---|
static double |
entropy(Distribution dist,
Symbol s)
Calculate the information content of a symbol in bits. |
BlockPainter |
getBlockPainter()
|
Distribution |
getDistribution()
Retrieve the currently rendered dist. |
LogoPainter |
getLogoPainter()
Retrieve the current logo painter. |
RenderingHints |
getRenderingHints()
|
SymbolStyle |
getStyle()
Retrieve the current style. |
boolean |
isScaleByInformation()
|
void |
paintComponent(Graphics g)
Transforms the graphics context so that it is in bits space, and then requests the logo painter to fill the area. |
void |
setBlockPainter(BlockPainter blockPainter)
|
void |
setDistribution(Distribution dist)
Set the dist to render. |
void |
setLogoPainter(LogoPainter logoPainter)
Set the logo painter. |
void |
setRenderingHints(RenderingHints renderingHints)
|
void |
setScaleByInformation(boolean scale)
|
void |
setStyle(SymbolStyle style)
Set the symbol style. |
static double |
totalBits(Distribution dist)
Retrieve the maximal number of bits possible for this type of dist. |
static double |
totalInformation(Distribution dist)
Calculates the total information of the dist in bits. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DistributionLogo()
Method Detail |
---|
public Distribution getDistribution()
public void setDistribution(Distribution dist) throws IllegalAlphabetException
Set the dist to render.
The dist must be over a FiniteAlphabet so that we can draw the numbers for each Symbol.
dist
- the new Distribution to render
IllegalAlphabetException
public LogoPainter getLogoPainter()
public void setLogoPainter(LogoPainter logoPainter)
Set the logo painter.
This will alter the way that the dist is rendered to screen.
logoPainter
- the new logoPainterpublic SymbolStyle getStyle()
public void setStyle(SymbolStyle style)
Set the symbol style.
This will change the outline and fill paints for the logos
style
- the new SymbolStyle to usepublic boolean isScaleByInformation()
public void setScaleByInformation(boolean scale)
public BlockPainter getBlockPainter()
public void setBlockPainter(BlockPainter blockPainter)
public static double entropy(Distribution dist, Symbol s) throws IllegalSymbolException
s
- the symbol to calculate fordist
- the Distribution
that the symbol comes from and
in whose context the information content will be calculated.
IllegalSymbolException
- if r is not within the dist.public static double totalBits(Distribution dist)
public static double totalInformation(Distribution dist)
Calculates the total information of the dist in bits.
This calculates totalBits - sum_r(entropy(r))
public void paintComponent(Graphics g)
paintComponent
in class JComponent
public RenderingHints getRenderingHints()
public void setRenderingHints(RenderingHints renderingHints)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |