当前位置: 首页>>代码示例>>Java>>正文


Java BasicStroke类代码示例

本文整理汇总了Java中org.achartengine.renderer.BasicStroke的典型用法代码示例。如果您正苦于以下问题:Java BasicStroke类的具体用法?Java BasicStroke怎么用?Java BasicStroke使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BasicStroke类属于org.achartengine.renderer包,在下文中一共展示了BasicStroke类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: drawSeries

import org.achartengine.renderer.BasicStroke; //导入依赖的package包/类
/**
 * Draws the series.
 * 
 * @param series the series
 * @param canvas the canvas
 * @param paint the paint object
 * @param pointsList the points to be rendered
 * @param seriesRenderer the series renderer
 * @param yAxisValue the y axis value in pixels
 * @param seriesIndex the series index
 * @param or the orientation
 * @param startIndex the start index of the rendering points
 */
protected void drawSeries(XYSeries series, Canvas canvas, Paint paint, List<Float> pointsList,
    XYSeriesRenderer seriesRenderer, float yAxisValue, int seriesIndex, Orientation or,
    int startIndex) {
  BasicStroke stroke = seriesRenderer.getStroke();
  Cap cap = paint.getStrokeCap();
  Join join = paint.getStrokeJoin();
  float miter = paint.getStrokeMiter();
  PathEffect pathEffect = paint.getPathEffect();
  Style style = paint.getStyle();
  if (stroke != null) {
    PathEffect effect = null;
    if (stroke.getIntervals() != null) {
      effect = new DashPathEffect(stroke.getIntervals(), stroke.getPhase());
    }
    setStroke(stroke.getCap(), stroke.getJoin(), stroke.getMiter(), Style.FILL_AND_STROKE,
        effect, paint);
  }
  // float[] points = MathHelper.getFloats(pointsList);
  drawSeries(canvas, paint, pointsList, seriesRenderer, yAxisValue, seriesIndex, startIndex);
  drawPoints(canvas, paint, pointsList, seriesRenderer, yAxisValue, seriesIndex, startIndex);
  paint.setTextSize(seriesRenderer.getChartValuesTextSize());
  if (or == Orientation.HORIZONTAL) {
    paint.setTextAlign(Align.CENTER);
  } else {
    paint.setTextAlign(Align.LEFT);
  }
  if (seriesRenderer.isDisplayChartValues()) {
    paint.setTextAlign(seriesRenderer.getChartValuesTextAlign());
    drawChartValuesText(canvas, series, seriesRenderer, paint, pointsList, seriesIndex,
        startIndex);
  }
  if (stroke != null) {
    setStroke(cap, join, miter, style, pathEffect, paint);
  }
}
 
开发者ID:ddanny,项目名称:achartengine,代码行数:49,代码来源:XYChart.java

示例2: drawSeries

import org.achartengine.renderer.BasicStroke; //导入依赖的package包/类
/**
 * Draws the series.
 * 
 * @param series the series
 * @param canvas the canvas
 * @param paint the paint object
 * @param pointsList the points to be rendered
 * @param seriesRenderer the series renderer
 * @param yAxisValue the y axis value in pixels
 * @param seriesIndex the series index
 * @param or the orientation
 * @param startIndex the start index of the rendering points
 */
protected void drawSeries(XYSeries series, Canvas canvas, Paint paint, List<Float> pointsList,
    XYSeriesRenderer seriesRenderer, float yAxisValue, int seriesIndex, Orientation or,
    int startIndex) {
  BasicStroke stroke = seriesRenderer.getStroke();
  Cap cap = paint.getStrokeCap();
  Join join = paint.getStrokeJoin();
  float miter = paint.getStrokeMiter();
  PathEffect pathEffect = paint.getPathEffect();
  Style style = paint.getStyle();
  if (stroke != null) {
    PathEffect effect = null;
    if (stroke.getIntervals() != null) {
      effect = new DashPathEffect(stroke.getIntervals(), stroke.getPhase());
    }
    setStroke(stroke.getCap(), stroke.getJoin(), stroke.getMiter(), Style.FILL_AND_STROKE,
        effect, paint);
  }
  // float[] points = MathHelper.getFloats(pointsList);
  drawSeries(canvas, paint, pointsList, seriesRenderer, yAxisValue, seriesIndex, startIndex);
  if (isRenderPoints(seriesRenderer)) {
    ScatterChart pointsChart = getPointsChart();
    if (pointsChart != null) {
      pointsChart.drawSeries(canvas, paint, pointsList, seriesRenderer, yAxisValue, seriesIndex,
          startIndex);
    }
  }
  paint.setTextSize(seriesRenderer.getChartValuesTextSize());
  if (or == Orientation.HORIZONTAL) {
    paint.setTextAlign(Align.CENTER);
  } else {
    paint.setTextAlign(Align.LEFT);
  }
  if (seriesRenderer.isDisplayChartValues()) {
    paint.setTextAlign(seriesRenderer.getChartValuesTextAlign());
    drawChartValuesText(canvas, series, seriesRenderer, paint, pointsList, seriesIndex,
        startIndex);
  }
  if (stroke != null) {
    setStroke(cap, join, miter, style, pathEffect, paint);
  }
}
 
开发者ID:jrieke,项目名称:ioiometer,代码行数:55,代码来源:XYChart.java

示例3: drawSeries

import org.achartengine.renderer.BasicStroke; //导入依赖的package包/类
protected void drawSeries(XYSeries xyseries, Canvas canvas, Paint paint, List list, SimpleSeriesRenderer simpleseriesrenderer, float f1, int i, 
        org.achartengine.renderer.XYMultipleSeriesRenderer.Orientation orientation, int j)
{
    BasicStroke basicstroke = simpleseriesrenderer.getStroke();
    android.graphics.Paint.Cap cap = paint.getStrokeCap();
    android.graphics.Paint.Join join = paint.getStrokeJoin();
    float f2 = paint.getStrokeMiter();
    PathEffect patheffect = paint.getPathEffect();
    android.graphics.Paint.Style style = paint.getStyle();
    if (basicstroke != null)
    {
        float af[] = basicstroke.getIntervals();
        DashPathEffect dashpatheffect = null;
        if (af != null)
        {
            dashpatheffect = new DashPathEffect(basicstroke.getIntervals(), basicstroke.getPhase());
        }
        a(basicstroke.getCap(), basicstroke.getJoin(), basicstroke.getMiter(), android.graphics.Paint.Style.FILL_AND_STROKE, dashpatheffect, paint);
    }
    drawSeries(canvas, paint, list, simpleseriesrenderer, f1, i, j);
    if (isRenderPoints(simpleseriesrenderer))
    {
        ScatterChart scatterchart = getPointsChart();
        if (scatterchart != null)
        {
            scatterchart.drawSeries(canvas, paint, list, simpleseriesrenderer, f1, i, j);
        }
    }
    paint.setTextSize(simpleseriesrenderer.getChartValuesTextSize());
    if (orientation == org.achartengine.renderer.XYMultipleSeriesRenderer.Orientation.HORIZONTAL)
    {
        paint.setTextAlign(android.graphics.Paint.Align.CENTER);
    } else
    {
        paint.setTextAlign(android.graphics.Paint.Align.LEFT);
    }
    if (simpleseriesrenderer.isDisplayChartValues())
    {
        paint.setTextAlign(simpleseriesrenderer.getChartValuesTextAlign());
        drawChartValuesText(canvas, xyseries, simpleseriesrenderer, paint, list, i, j);
    }
    if (basicstroke != null)
    {
        a(cap, join, f2, style, patheffect, paint);
    }
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:47,代码来源:XYChart.java

示例4: drawSeries

import org.achartengine.renderer.BasicStroke; //导入依赖的package包/类
/**
 * Draws the series.
 * 
 * @param series the series
 * @param canvas the canvas
 * @param paint the paint object
 * @param pointsList the points to be rendered
 * @param seriesRenderer the series renderer
 * @param yAxisValue the y axis value in pixels
 * @param seriesIndex the series index
 * @param or the orientation
 * @param startIndex the start index of the rendering points
 */
protected void drawSeries(XYSeries series, Canvas canvas, Paint paint, List<Float> pointsList,
    SimpleSeriesRenderer seriesRenderer, float yAxisValue, int seriesIndex, Orientation or,
    int startIndex) {
  BasicStroke stroke = seriesRenderer.getStroke();
  Cap cap = paint.getStrokeCap();
  Join join = paint.getStrokeJoin();
  float miter = paint.getStrokeMiter();
  PathEffect pathEffect = paint.getPathEffect();
  Style style = paint.getStyle();
  if (stroke != null) {
    PathEffect effect = null;
    if (stroke.getIntervals() != null) {
      effect = new DashPathEffect(stroke.getIntervals(), stroke.getPhase());
    }
    setStroke(stroke.getCap(), stroke.getJoin(), stroke.getMiter(), Style.FILL_AND_STROKE,
        effect, paint);
  }
  // float[] points = MathHelper.getFloats(pointsList);
  drawSeries(canvas, mScreenR.top, mScreenR.bottom, paint, pointsList, seriesRenderer, yAxisValue, seriesIndex, startIndex);
  if (isRenderPoints(seriesRenderer)) {
    ScatterChart pointsChart = getPointsChart();
    if (pointsChart != null) {
      pointsChart.drawSeries(canvas, mScreenR.top, mScreenR.bottom, paint, pointsList, seriesRenderer, yAxisValue, seriesIndex,
          startIndex);
    }
  }
  paint.setTextSize(seriesRenderer.getChartValuesTextSize());
  if (or == Orientation.HORIZONTAL) {
    paint.setTextAlign(Align.CENTER);
  } else {
    paint.setTextAlign(Align.LEFT);
  }
  if (seriesRenderer.isDisplayChartValues()) {
    paint.setTextAlign(seriesRenderer.getChartValuesTextAlign());
    drawChartValuesText(canvas, series, seriesRenderer, paint, pointsList, seriesIndex,
        startIndex);
  }
  if (stroke != null) {
    setStroke(cap, join, miter, style, pathEffect, paint);
  }
}
 
开发者ID:InQBarna,项目名称:AChartEngine,代码行数:55,代码来源:XYChart.java

示例5: getStroke

import org.achartengine.renderer.BasicStroke; //导入依赖的package包/类
/**
 * get stroke for an ID number preferrably unique pid number
 * this is to get persistent coloring/lining for each id
 * @param id id to get color for
 * @return color for given ID
 */
public static BasicStroke getStroke(int id)
{
	return stroke[(id / colors.length) % stroke.length];
}
 
开发者ID:fr3ts0n,项目名称:AndrOBD,代码行数:11,代码来源:ChartActivity.java


注:本文中的org.achartengine.renderer.BasicStroke类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。