- java.lang.Object
-
- org.knowm.xchart.internal.chartpart.Legend_<ST,S>
-
- All Implemented Interfaces:
ChartPart
- Direct Known Subclasses:
Legend_Bubble,Legend_HeatMap,Legend_Marker,Legend_OHLC,Legend_Pie
public abstract class Legend_<ST extends Styler,S extends Series> extends java.lang.Object implements ChartPart
-
-
Field Summary
Fields Modifier and Type Field Description private java.awt.geom.Rectangle2Dbounds(package private) static intBOX_OUTLINE_WIDTH(package private) static intBOX_SIZE(package private) Chart<ST,S>chartprivate static intLEGEND_MARGINprivate static intMULTI_LINE_SPACE(package private) doublexOffset(package private) doubleyOffset-
Fields inherited from interface org.knowm.xchart.internal.chartpart.ChartPart
SOLID_STROKE
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voiddoPaint(java.awt.Graphics2D g)java.awt.geom.Rectangle2DgetBounds()private java.awt.geom.Rectangle2DgetBoundsHintHorizontal()determine the width and height of the chart legend with horizontal layoutprivate java.awt.geom.Rectangle2DgetBoundsHintVertical()determine the width and height of the chart legend(package private) floatgetLegendEntryHeight(java.util.Map<java.lang.String,java.awt.geom.Rectangle2D> seriesTextBounds, int markerSize)(package private) floatgetLegendEntryWidth(java.util.Map<java.lang.String,java.awt.geom.Rectangle2D> seriesTextBounds, int markerSize)protected abstract doublegetSeriesLegendRenderGraphicHeight(S series)(package private) java.util.Map<java.lang.String,java.awt.geom.Rectangle2D>getSeriesTextBounds(S series)Normally each legend entry just has one line of text, but it can be made multi-line by adding "\\n".voidpaint(java.awt.Graphics2D g)(package private) voidpaintSeriesText(java.awt.Graphics2D g, java.util.Map<java.lang.String,java.awt.geom.Rectangle2D> seriesTextBounds, int markerSize, double x, double starty)
-
-
-
Field Detail
-
BOX_SIZE
static final int BOX_SIZE
- See Also:
- Constant Field Values
-
BOX_OUTLINE_WIDTH
static final int BOX_OUTLINE_WIDTH
- See Also:
- Constant Field Values
-
LEGEND_MARGIN
private static final int LEGEND_MARGIN
- See Also:
- Constant Field Values
-
MULTI_LINE_SPACE
private static final int MULTI_LINE_SPACE
- See Also:
- Constant Field Values
-
xOffset
double xOffset
-
yOffset
double yOffset
-
bounds
private java.awt.geom.Rectangle2D bounds
-
-
Method Detail
-
getSeriesLegendRenderGraphicHeight
protected abstract double getSeriesLegendRenderGraphicHeight(S series)
-
doPaint
protected abstract void doPaint(java.awt.Graphics2D g)
-
getBoundsHintVertical
private java.awt.geom.Rectangle2D getBoundsHintVertical()
determine the width and height of the chart legend
-
getBoundsHintHorizontal
private java.awt.geom.Rectangle2D getBoundsHintHorizontal()
determine the width and height of the chart legend with horizontal layout
-
getSeriesTextBounds
java.util.Map<java.lang.String,java.awt.geom.Rectangle2D> getSeriesTextBounds(S series)
Normally each legend entry just has one line of text, but it can be made multi-line by adding "\\n". This method returns a Map for each single legend entry, which is normally just a Map with one single entry.- Parameters:
series-- Returns:
-
getLegendEntryHeight
float getLegendEntryHeight(java.util.Map<java.lang.String,java.awt.geom.Rectangle2D> seriesTextBounds, int markerSize)
-
getLegendEntryWidth
float getLegendEntryWidth(java.util.Map<java.lang.String,java.awt.geom.Rectangle2D> seriesTextBounds, int markerSize)
-
paintSeriesText
void paintSeriesText(java.awt.Graphics2D g, java.util.Map<java.lang.String,java.awt.geom.Rectangle2D> seriesTextBounds, int markerSize, double x, double starty)
-
-