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


Java PointLabelFormatter类代码示例

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


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

示例1: onCreate

import com.androidplot.xy.PointLabelFormatter; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    DsSensorManager.checkBtLePermissions(this, true);

    mPlot = (XYPlot) findViewById(R.id.plotViewA);
    mPlotData = new SimpleXYSeries("Sensor Values");
    mPlotData.useImplicitXVals();
    mPlot.addSeries(mPlotData, new LineAndPointFormatter(Color.rgb(100, 100, 200), null, null, new PointLabelFormatter(Color.DKGRAY)));
    mPlot.setDomainLabel("Sample Index");
    mPlot.setRangeLabel("Value");
}
 
开发者ID:gradlman,项目名称:SensorLib,代码行数:15,代码来源:MainActivity.java

示例2: updatePlot

import com.androidplot.xy.PointLabelFormatter; //导入依赖的package包/类
/**
 * Method changes which points and what color is rendered
 */
public void updatePlot() {
	// Remove all current series from each plot
	Iterator<XYSeries> iterator1 = audiogram.getSeriesSet().iterator();
	while (iterator1.hasNext()) {
		XYSeries setElement = iterator1.next();
		audiogram.removeSeries(setElement);
	}
	drawBackground();

	if (leftEarButton.isChecked()) {
		// Create a formatter to use for drawing a series using
		// LineAndPointRenderer
		// and configure it from xml:
		LineAndPointFormatter series1Format = new LineAndPointFormatter();
		series1Format.setPointLabelFormatter(new PointLabelFormatter());
		series1Format.configure(getApplicationContext(),
				R.xml.line_point_formatter_with_plf1);
		audiogram.clear();
		series1 = (SimpleXYSeries) getSeries(); // call getSeries function
		// add a new series' to the xyplot:
		audiogram.addSeries(series1, series1Format);
		audiogram.redraw(); // redraw series
	}

	else {
		LineAndPointFormatter series2Format = new LineAndPointFormatter();
		series2Format.setPointLabelFormatter(new PointLabelFormatter());
		series2Format.configure(getApplicationContext(),
				R.xml.line_point_formatter_with_plf2);
		audiogram.clear();
		series2 = (SimpleXYSeries) getSeries(); // call getSeries function
		// add a new series' to the xyplot:
		audiogram.addSeries(series2, series2Format);
		audiogram.redraw();
	}
}
 
开发者ID:JunSoftware109,项目名称:AndroidProjectHearing,代码行数:40,代码来源:HearingTestActivity.java

示例3: addSeriesPlot

import com.androidplot.xy.PointLabelFormatter; //导入依赖的package包/类
/**
 * Add a series to the plot.
 * 
 * @param seriesName
 *            The name of the series.
 * @param key
 *            The unique series key.
 * @param color
 *            The series color.
 */
public void addSeriesPlot(String seriesName, int key, int color)
{
	history.append(key, new LinkedList<Number>());

	series.append(key, new SimpleXYSeries(seriesName));

	LineAndPointFormatter formatter = new LineAndPointFormatter(Color.rgb(
			0, 153, 204), Color.rgb(0, 153, 204), Color.TRANSPARENT,
			new PointLabelFormatter(Color.TRANSPARENT));

	Paint linePaint = new Paint();
	linePaint.setAntiAlias(true);
	linePaint.setStyle(Paint.Style.STROKE);
	linePaint.setColor(color);
	linePaint.setStrokeWidth(LINE_WIDTH);

	formatter.setLinePaint(linePaint);

	Paint vertexPaint = new Paint();
	vertexPaint.setAntiAlias(true);
	vertexPaint.setStyle(Paint.Style.STROKE);
	vertexPaint.setColor(color);
	vertexPaint.setStrokeWidth(VERTEX_WIDTH);

	formatter.setVertexPaint(vertexPaint);

	dynamicPlot.addSeries(series.get(key), formatter);
}
 
开发者ID:KalebKE,项目名称:AccelerationAlert,代码行数:39,代码来源:DynamicPlot.java

示例4: onCreate

import com.androidplot.xy.PointLabelFormatter; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_serial_console);

    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    mTitleTextView = (TextView) findViewById(R.id.demoTitle);
    mDumpTextView = (TextView) findViewById(R.id.consoleText);
    mScrollView = (ScrollView) findViewById(R.id.demoScroller);

    // Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    // setSupportActionBar(toolbar);

    plot = (XYPlot) findViewById(R.id.plot);

    plot.setRangeBoundaries(1,1, BoundaryMode.AUTO);
    // create a couple arrays of y-values to plot:
    // Number[] series1Numbers = {1, 4, 2, 8, 4, 16, 8, 32, 16, 64};

    // turn the above arrays into XYSeries':
    // (Y_VALS_ONLY means use the element index as the x value)
    // series1 = new SimpleXYSeries(Arrays.asList(series1Numbers), SimpleXYSeries.ArrayFormat.Y_VALS_ONLY, "Nesto1");

    series1 = new SimpleXYSeries("Values");
    series1.useImplicitXVals();

    // create formatters to use for drawing a series using LineAndPointRenderer
    // and configure them from xml:
    LineAndPointFormatter series1Format = new LineAndPointFormatter();
    series1Format.setPointLabelFormatter(new PointLabelFormatter());
    series1Format.configure(getApplicationContext(),
            R.xml.line_point_formatter_with_labels);

    LineAndPointFormatter series2Format = new LineAndPointFormatter();
    series2Format.setPointLabelFormatter(new PointLabelFormatter());
    series2Format.configure(getApplicationContext(),
            R.xml.line_point_formatter_with_labels_2);

    // see: http://androidplot.com/smooth-curves-and-androidplot/
    series1Format.setInterpolationParams(
            new CatmullRomInterpolator.Params(10, CatmullRomInterpolator.Type.Centripetal));

    // add a new series' to the xyplot:
    plot.addSeries(series1, series1Format);

    // reduce the number of range labels
    plot.setTicksPerRangeLabel(3);

    // rotate domain labels 45 degrees to make them more compact horizontally:
    plot.getGraphWidget().setDomainLabelOrientation(-45);

    if (savedInstanceState != null) {
        savedInstanceState.getSerializable("sport");
        savedInstanceState.getBoolean("chDetect");
    }

}
 
开发者ID:kost,项目名称:DroidMeter,代码行数:59,代码来源:SerialConsoleActivity.java

示例5: CustomPointFormatter

import com.androidplot.xy.PointLabelFormatter; //导入依赖的package包/类
public CustomPointFormatter(Integer lineColor, Integer vertexColor, Integer fillColor, PointLabelFormatter plf)
{
    super(lineColor, vertexColor, fillColor, plf, FillDirection.BOTTOM);
}
 
开发者ID:sztyler,项目名称:sensordatacollector,代码行数:5,代码来源:CustomPointFormatter.java

示例6: createLineAndPointFormatter

import com.androidplot.xy.PointLabelFormatter; //导入依赖的package包/类
private LineAndPointFormatter createLineAndPointFormatter(int color,float width, boolean line) {
	LineAndPointFormatter series1Format = new LineAndPointFormatter();
       PointLabelFormatter pointLabelFormatter = new PointLabelFormatter();
       series1Format.setPointLabeler(new PointLabeler() {
		
		@Override
		public String getLabel(XYSeries series, int index) {
			
			return "";
		}
	});
	series1Format.setPointLabelFormatter(pointLabelFormatter);
       series1Format.configure(getApplicationContext(),
               R.xml.line_point_formatter_with_plf1);
       Paint lp = series1Format.getLinePaint();
       lp.setColor(color);
       lp.setAntiAlias(false);
       lp.setStrokeWidth(width);
       if(line) {
       	series1Format.setVertexPaint(null);
       	series1Format.setLinePaint(lp);
       } else {
       	Paint linep = new Paint(lp);
       	linep.setStrokeWidth(1);
       	linep.setColor(color);
       	series1Format.setLinePaint(null);
       	series1Format.setVertexPaint(lp);
       }
       series1Format.setPointLabelFormatter(null);
	return series1Format;
}
 
开发者ID:LoriLori,项目名称:androidCgmMonitor,代码行数:32,代码来源:MainActivity.java


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