|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectlt.monarch.chart.AbstractView<LegendPaintTags>
lt.monarch.chart.engine.AbstractLegend
lt.monarch.chart.legend.ColorScaleLegend
public class ColorScaleLegend extends AbstractLegend
ColorScaleLegend view. Maintains a list of legend entries and renders a legend.
| Modifier and Type | Class and Description |
|---|
| Nested classes/interfaces inherited from class lt.monarch.chart.engine.AbstractLegend |
|---|
AbstractLegend.LegendEntryEntity |
| Modifier and Type | Field and Description |
|---|---|
protected Alignment |
horizontalLabelAlignment
Horizontal label alignment |
protected lt.monarch.chart.legend.ColorScaleLegend.MouseEvents |
mouseEvents
Mouse event listener |
protected java.util.ArrayList<LegendEntry> |
sortedEntries
Sorted legend entries, which requires special treatment to be represented correctly |
protected Alignment |
verticalLabelAlignment
Vertical label alignment |
| Fields inherited from class lt.monarch.chart.engine.AbstractLegend |
|---|
actualSize, currentSelection, cursorChanged, dimension, drawBounds, entries, labelSorting, lastPt, layout, margin, mouseClick, moveCursor, orientation, scrollRange, style, tempCursor, textPainter, textStyle, wordWrappingEnabled |
| Fields inherited from class lt.monarch.chart.AbstractView |
|---|
layoutInvalid, paintStyle |
| Constructor and Description |
|---|
ColorScaleLegend()
Creates an empty ColorScaleLegend object |
ColorScaleLegend(Chart chart)
Creates a ColorScaleLegend object and initializes it with data from the chart object |
ColorScaleLegend(LegendEntry[] entries)
Creates a ColorScaleLegend object and initializes it with the entry list |
| Modifier and Type | Method and Description |
|---|---|
protected void |
activate()
Activates the legend. |
void |
addEntries(LegendEntry[] ll)
Adds a list of entries the the legend at once. |
void |
addEntry(LegendEntry entry)
Adds a new entry to the legend. |
void |
addEntry(java.lang.String text,
LegendSymbol symbol)
Constructs and adds a new entry to the legend. |
void |
addSeparator()
Adds a separator to the legend. |
void |
addSeparator(java.lang.String label)
Adds a separator to the legend. |
protected void |
deactivate()
Deactivates the legend. |
java.util.List<LegendEntry> |
getContainingObjects()
Returns all containing legend entries |
protected java.awt.Dimension[] |
getEntryDimensions(AbstractGraphics g)
Computes and returns dimensions of legend entries. |
Alignment |
getLabelHAlignment()
Returns horizontal alignment for ColorScaleLegend labels. |
Alignment |
getLabelVAlignment()
Returns vertical alignment for ColorScaleLegend labels. |
protected int |
getMaxKeyWidth(AbstractGraphics g)
Returns the width of the widest legend symbol. |
java.awt.Dimension |
getPreferredSize(AbstractGraphics g)
Gets the preferred size of this legend. |
protected void |
layout(AbstractGraphics g)
Layouts the legend. |
protected void |
paint(AbstractGraphics g)
Paints the legend in the specified Graphics context. |
void |
setLabelAlignment(Alignment hAlign,
Alignment vAlign)
Sets alignment for ColorScaleLegend labels. |
| Methods inherited from class lt.monarch.chart.engine.AbstractLegend |
|---|
dispose, getEntries, getEntry, getLabelSorting, getLayout, getOrientation, getStyle, getTextStyle, getWordWrappingEnabled, initCursor, isHorizontallyExpandable, isVerticallyExpandable, readObject, removeAllEntries, removeEntry, setCurrentSelection, setHorizontalAlignment, setLabelSorting, setLayout, setOrientation, setPreferredSize, setPreferredSize, setVerticalAlignment, setWordWrappingEnabled, sortLabels |
| Methods inherited from class lt.monarch.chart.AbstractView |
|---|
addViewListener, clone, container, finalize, getAlignmentX, getAlignmentY, getBounds, getChartObjectBounds, getContainer, getGraphicsType, getHeight, getMaximumSize, getMinimumSize, getPaintMode, getPaintStyle, getParent, getSize, getSize, getStyle, getWidth, getX, getY, invalidate, isLayoutValid, removeViewListener, render, repaint, repaint, setAlignmentX, setAlignmentY, setBounds, setBounds, setContainer, setLocation, setMaximumSize, setMinimumSize, setPaintMode, setSize, validate |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.ArrayList<LegendEntry> sortedEntries
protected lt.monarch.chart.legend.ColorScaleLegend.MouseEvents mouseEvents
protected Alignment horizontalLabelAlignment
protected Alignment verticalLabelAlignment
| Constructor Detail |
|---|
public ColorScaleLegend()
public ColorScaleLegend(Chart chart)
chart - chart object to be usedpublic ColorScaleLegend(LegendEntry[] entries)
entries - legend entries| Method Detail |
|---|
public void addEntry(LegendEntry entry)
addEntry in class AbstractLegendentry - new legend entry
public void addEntry(java.lang.String text,
LegendSymbol symbol)
addEntry in class AbstractLegendtext - legend entry labelsymbol - legend entry symbolpublic void addEntries(LegendEntry[] ll)
addEntries in class AbstractLegendll - array of legend entriespublic void addSeparator()
addSeparator in class AbstractLegendpublic void addSeparator(java.lang.String label)
addSeparator in class AbstractLegendlabel - Separator labelprotected int getMaxKeyWidth(AbstractGraphics g)
g - the Graphics context in which legend will be paintedprotected java.awt.Dimension[] getEntryDimensions(AbstractGraphics g)
g - the Graphics context in which legend will be paintedDimension objects, representing dimensions of the legend
entriespublic java.awt.Dimension getPreferredSize(AbstractGraphics g)
getPreferredSize in interface ViewgetPreferredSize in class AbstractLegendg - the Graphics context in which legend will be paintedprotected void layout(AbstractGraphics g)
layout in class AbstractView<LegendPaintTags>g - the Graphics context in which legend will be painted
public void setLabelAlignment(Alignment hAlign,
Alignment vAlign)
setLabelAlignment in class AbstractLegendhAlign - - horizontal alignment value.vAlign - - vertical alignment value.public Alignment getLabelVAlignment()
getLabelVAlignment in class AbstractLegendpublic Alignment getLabelHAlignment()
getLabelHAlignment in class AbstractLegendprotected void paint(AbstractGraphics g)
paint in class AbstractView<LegendPaintTags>g - the Graphics context in which to paint legendprotected void activate()
activate in class AbstractView<LegendPaintTags>protected void deactivate()
deactivate in class AbstractView<LegendPaintTags>public java.util.List<LegendEntry> getContainingObjects()
getContainingObjects in interface ViewgetContainingObjects in class AbstractLegend
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||