本文整理汇总了Java中com.androidplot.exception.PlotRenderException类的典型用法代码示例。如果您正苦于以下问题:Java PlotRenderException类的具体用法?Java PlotRenderException怎么用?Java PlotRenderException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PlotRenderException类属于com.androidplot.exception包,在下文中一共展示了PlotRenderException类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: draw
import com.androidplot.exception.PlotRenderException; //导入依赖的package包/类
public void draw(Canvas canvas, RectF widgetRect) throws PlotRenderException {
//outlineRect = widgetRect;
if (isVisible()) {
if (backgroundPaint != null) {
drawBackground(canvas, widgetDimensions.canvasRect);
}
/* RectF marginatedRect = new RectF(outlineRect.left + marginLeft,
outlineRect.top + marginTop,
outlineRect.right - marginRight,
outlineRect.bottom - marginBottom);*/
/*RectF marginatedRect = boxModel.getMarginatedRect(widgetRect);
RectF paddedRect = boxModel.getPaddedRect(marginatedRect);*/
doOnDraw(canvas, widgetDimensions.paddedRect);
if (borderPaint != null) {
drawBorder(canvas, widgetDimensions.paddedRect);
}
}
}
示例2: doOnDraw
import com.androidplot.exception.PlotRenderException; //导入依赖的package包/类
@Override
protected void doOnDraw(Canvas canvas, RectF widgetRect)
throws PlotRenderException {
gridRect = getGridRect(widgetRect); // used for drawing the background
// of the grid
paddedGridRect = getPaddedGridRect(gridRect); // used for drawing lines
// etc.
//Log.v(TAG, "gridRect :" + gridRect);
//Log.v(TAG, "paddedGridRect :" + paddedGridRect);
// if (!plot.isEmpty()) {
// don't draw if we have no space to draw into
if ((paddedGridRect.height() > 0.0f) && (paddedGridRect.width() > 0.0f)) {
if (plot.getCalculatedMinX() != null
&& plot.getCalculatedMaxX() != null
&& plot.getCalculatedMinY() != null
&& plot.getCalculatedMaxY() != null) {
drawGrid(canvas);
drawData(canvas);
drawCursors(canvas);
if (isDrawMarkersEnabled()) {
drawMarkers(canvas);
}
}
}
// }
}
示例3: drawData
import com.androidplot.exception.PlotRenderException; //导入依赖的package包/类
/**
* Draws lines and points for each element in the series.
*
* @param canvas
* @throws PlotRenderException
*/
protected void drawData(Canvas canvas) throws PlotRenderException {
// TODO: iterate through a XYSeriesRenderer list
// int canvasState = canvas.save();
try {
canvas.save(Canvas.ALL_SAVE_FLAG);
canvas.clipRect(gridRect, android.graphics.Region.Op.INTERSECT);
for (XYSeriesRenderer renderer : plot.getRendererList()) {
renderer.render(canvas, paddedGridRect);
}
// canvas.restoreToCount(canvasState);
} finally {
canvas.restore();
}
}
示例4: onRender
import com.androidplot.exception.PlotRenderException; //导入依赖的package包/类
@Override
public void onRender(Canvas canvas, RectF plotArea) throws PlotRenderException {
float radius = getRadius(plotArea);
PointF origin = new PointF(plotArea.centerX(), plotArea.centerY());
double[] values = getValues();
double scale = calculateScale(values);
float offset = startDeg;
Set<Segment> segments = getPlot().getSeriesSet();
//PointF lastRadial = calculateLineEnd(origin, radius, offset);
RectF rec = new RectF(origin.x - radius, origin.y - radius, origin.x + radius, origin.y + radius);
int i = 0;
for (Segment segment : segments) {
float lastOffset = offset;
float sweep = (float) (scale * (values[i]) * 360);
offset += sweep;
//PointF radial = calculateLineEnd(origin, radius, offset);
drawSegment(canvas, rec, segment, getPlot().getFormatter(segment, getClass()),
radius, lastOffset, sweep);
//lastRadial = radial;
i++;
}
}
示例5: doOnDraw
import com.androidplot.exception.PlotRenderException; //导入依赖的package包/类
@Override
protected void doOnDraw(Canvas canvas, RectF widgetRect) throws PlotRenderException {
for(PieRenderer renderer : pieChart.getRendererList()) {
renderer.render(canvas, widgetRect);
}
}
示例6: onRender
import com.androidplot.exception.PlotRenderException; //导入依赖的package包/类
@Override
public void onRender(Canvas canvas, RectF plotArea) throws PlotRenderException {
List<XYSeries> seriesList = getPlot().getSeriesListForRenderer(this.getClass());
if (seriesList != null) {
for (XYSeries series : seriesList) {
//synchronized(series) {
drawSeries(canvas, plotArea, series, getFormatter(series));
//}
}
}
}
示例7: render
import com.androidplot.exception.PlotRenderException; //导入依赖的package包/类
public void render(Canvas canvas, RectF plotArea) throws PlotRenderException {
onRender(canvas, plotArea);
}
示例8: doOnDraw
import com.androidplot.exception.PlotRenderException; //导入依赖的package包/类
@Override
protected void doOnDraw(Canvas canvas, RectF widgetRect) throws PlotRenderException {
// nothing to do
}
示例9: draw
import com.androidplot.exception.PlotRenderException; //导入依赖的package包/类
public void draw(Canvas canvas) throws PlotRenderException {
if(isDrawMarginsEnabled()) {
drawSpacing(canvas, displayDims.canvasRect, displayDims.marginatedRect, marginPaint);
}
if (isDrawPaddingEnabled()) {
drawSpacing(canvas, displayDims.marginatedRect, displayDims.paddedRect, paddingPaint);
}
for (Widget widget : elements()) {
//int canvasState = canvas.save(Canvas.ALL_SAVE_FLAG); // preserve clipping etc
try {
canvas.save(Canvas.ALL_SAVE_FLAG);
PositionMetrics metrics = widget.getPositionMetrics();
float elementWidth = widget.getWidthPix(displayDims.paddedRect.width());
float elementHeight = widget.getHeightPix(displayDims.paddedRect.height());
PointF coords = widget.getElementCoordinates(elementHeight,
elementWidth, displayDims.paddedRect, metrics);
//RectF widgetRect = new RectF(coords.x, coords.y, coords.x + elementWidth, coords.y + elementHeight);
//DisplayDimensions dims = widgetRects.get(widget);
DisplayDimensions dims = widget.getWidgetDimensions();
//RectF widgetRect = widgetRects.get(widget);
if (drawOutlineShadowsEnabled) {
canvas.drawRect(dims.canvasRect, outlineShadowPaint);
}
// not positive why this is, but the rect clipped by clipRect is 1 less than the one drawn by drawRect.
// so this is necessary to avoid clipping borders. I suspect that its a floating point
// jitter issue.
if (widget.isClippingEnabled()) {
//RectF clipRect = new RectF(l-1, t-1, r + 1, b + 1);
//canvas.clipRect(clipRect, Region.Op.REPLACE);
canvas.clipRect(dims.canvasRect, Region.Op.INTERSECT);
}
widget.draw(canvas, dims.canvasRect);
//RectF marginatedWidgetRect = widget.getMarginatedRect(dims.canvasRect);
//RectF paddedWidgetRect = widget.getPaddedRect(marginatedWidgetRect);
if (drawMarginsEnabled) {
drawSpacing(canvas, dims.canvasRect, dims.marginatedRect, getMarginPaint());
}
if (drawPaddingEnabled) {
drawSpacing(canvas, dims.marginatedRect, dims.paddedRect, getPaddingPaint());
}
if (drawAnchorsEnabled) {
PointF anchorCoords =
Widget.getAnchorCoordinates(coords.x, coords.y, elementWidth,
elementHeight, metrics.getAnchor());
drawAnchor(canvas, anchorCoords);
}
if (drawOutlinesEnabled) {
outlinePaint.setAntiAlias(true);
canvas.drawRect(dims.canvasRect, outlinePaint);
}
} finally {
//canvas.restoreToCount(canvasState); // restore clipping etc.
canvas.restore();
}
}
}
示例10: doOnDraw
import com.androidplot.exception.PlotRenderException; //导入依赖的package包/类
/**
* @param canvas The Canvas to draw onto
* @param widgetRect the size and coordinates of this widget
*/
protected abstract void doOnDraw(Canvas canvas, RectF widgetRect) throws PlotRenderException;
示例11: onRender
import com.androidplot.exception.PlotRenderException; //导入依赖的package包/类
@Override
public void onRender(Canvas canvas, RectF plotArea) throws PlotRenderException {
}
示例12: onRender
import com.androidplot.exception.PlotRenderException; //导入依赖的package包/类
public abstract void onRender(Canvas canvas, RectF plotArea) throws PlotRenderException;