ItemT
- public abstract class LegendWidget<ItemT extends LegendItem> extends Widget
Plot
.Widget.Rotation
Constructor and Description |
---|
LegendWidget(TableModel tableModel,
LayoutManager layoutManager,
Size size,
Size iconSize) |
Modifier and Type | Method and Description |
---|---|
protected void |
beginDrawingCell(android.graphics.Canvas canvas,
android.graphics.RectF iconRect)
Done at the start of rendering a new cell.
|
protected void |
doOnDraw(android.graphics.Canvas canvas,
android.graphics.RectF widgetRect) |
protected abstract void |
drawIcon(android.graphics.Canvas canvas,
android.graphics.RectF iconRect,
ItemT item)
Draw the icon representing the legend item
|
protected void |
drawItem(android.graphics.Canvas canvas,
android.graphics.RectF iconRect,
ItemT item) |
protected void |
finishDrawingCell(android.graphics.Canvas canvas,
android.graphics.RectF cellRect,
android.graphics.RectF iconRect,
LegendItem legendItem)
Done at the end of rendering a new cell.
|
Size |
getIconSize() |
Comparator<ItemT> |
getLegendItemComparator() |
protected abstract List<ItemT> |
getLegendItems() |
protected static float |
getRectCenterY(android.graphics.RectF cellRect) |
android.graphics.Paint |
getTextPaint() |
boolean |
isDrawIconBackgroundEnabled() |
boolean |
isDrawIconBorderEnabled() |
void |
setDrawIconBackgroundEnabled(boolean drawIconBackgroundEnabled) |
void |
setDrawIconBorderEnabled(boolean drawIconBorderEnabled) |
void |
setIconSize(Size iconSize) |
void |
setLegendItemComparator(Comparator<ItemT> legendItemComparator)
Set a scheme for sorting the display order or legend items.
|
void |
setTableModel(TableModel tableModel) |
void |
setTextPaint(android.graphics.Paint textPaint) |
applyRotation, containsPoint, draw, drawBackground, drawBorder, getAnchor, getAnchorCoordinates, getAnchorCoordinates, getAnchorOffset, getBackgroundPaint, getBorderPaint, getElementCoordinates, getHeightMetric, getHeightPix, getMarginatedRect, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getPaddedRect, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getPositionMetrics, getRotation, getSize, getWidgetDimensions, getWidthMetric, getWidthPix, isClippingEnabled, isVisible, layout, onMetricsChanged, onPostInit, position, position, refreshLayout, setAnchor, setBackgroundPaint, setBorderPaint, setClippingEnabled, setHeight, setHeight, setMarginBottom, setMarginLeft, setMarginRight, setMargins, setMarginTop, setPadding, setPaddingBottom, setPaddingLeft, setPaddingRight, setPaddingTop, setPositionMetrics, setRotation, setSize, setVisible, setWidth, setWidth
public LegendWidget(TableModel tableModel, LayoutManager layoutManager, Size size, Size iconSize)
protected void doOnDraw(android.graphics.Canvas canvas, android.graphics.RectF widgetRect) throws PlotRenderException
doOnDraw
in class Widget
canvas
- The Canvas to draw ontowidgetRect
- the size and coordinates of this widgetPlotRenderException
protected void drawItem(android.graphics.Canvas canvas, android.graphics.RectF iconRect, ItemT item)
protected abstract void drawIcon(android.graphics.Canvas canvas, android.graphics.RectF iconRect, ItemT item)
canvas
- iconRect
- The space to be occupied by the icon.item
- protected abstract List<ItemT> getLegendItems()
protected void beginDrawingCell(android.graphics.Canvas canvas, android.graphics.RectF iconRect)
canvas
- iconRect
- protected void finishDrawingCell(android.graphics.Canvas canvas, android.graphics.RectF cellRect, android.graphics.RectF iconRect, LegendItem legendItem)
canvas
- cellRect
- iconRect
- legendItem
- protected static float getRectCenterY(android.graphics.RectF cellRect)
public void setTableModel(TableModel tableModel)
public android.graphics.Paint getTextPaint()
public void setTextPaint(android.graphics.Paint textPaint)
public boolean isDrawIconBackgroundEnabled()
public void setDrawIconBackgroundEnabled(boolean drawIconBackgroundEnabled)
public boolean isDrawIconBorderEnabled()
public void setDrawIconBorderEnabled(boolean drawIconBorderEnabled)
public Size getIconSize()
public void setIconSize(Size iconSize)
public Comparator<ItemT> getLegendItemComparator()
public void setLegendItemComparator(Comparator<ItemT> legendItemComparator)
Series
items typically appear in the order which the series was
added to the Plot
.legendItemComparator
-