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


Java Redrawer类代码示例

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


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

示例1: initPlot

import com.androidplot.util.Redrawer; //导入依赖的package包/类
private void initPlot() {
        mXHistorySeries = new SimpleXYSeries( "X" );
        mXHistorySeries.useImplicitXVals();

        mYHistorySeries = new SimpleXYSeries( "Y" );
        mYHistorySeries.useImplicitXVals();

        mZHistorySeries = new SimpleXYSeries( "Z" );
        mZHistorySeries.useImplicitXVals();

        mHistoryPlot.setRangeBoundaries( -20, 20, BoundaryMode.AUTO );
        mHistoryPlot.setDomainBoundaries( 0, HISTORY_SIZE, BoundaryMode.FIXED );

//        int x_plotColor = getResources().getColor( R.color.plot_x, null );
//        int y_plotColor = getResources().getColor( R.color.plot_y, null );
//        int z_plotColor = getResources().getColor( R.color.plot_z, null );
//        mHistoryPlot.addSeries( mXHistorySeries, new LineAndPointFormatter( x_plotColor, null, null, null ) );
//        mHistoryPlot.addSeries( mYHistorySeries, new LineAndPointFormatter( y_plotColor, null, null, null ) );
//        mHistoryPlot.addSeries( mZHistorySeries, new LineAndPointFormatter( z_plotColor, null, null, null ) );

        float lineWidth = mPrefs.getFloatPreference( "plotLineWidth", R.string.settings_default_plot_line_width );

        mHistoryPlot.addSeries( mXHistorySeries, getLineAndPointFormatter( lineWidth, Color.RED   ) );
        mHistoryPlot.addSeries( mYHistorySeries, getLineAndPointFormatter( lineWidth, Color.GREEN ) );
        mHistoryPlot.addSeries( mZHistorySeries, getLineAndPointFormatter( lineWidth, Color.BLUE  ) );

        mHistoryPlot.setRangeValueFormat( new DecimalFormat( "#" ) );

        redrawer = new Redrawer( mHistoryPlot, 40, false );
    }
 
开发者ID:fbarriga,项目名称:sony-smartband-logger,代码行数:31,代码来源:MainActivity.java

示例2: PulsePlot

import com.androidplot.util.Redrawer; //导入依赖的package包/类
public PulsePlot(XYPlot aprHistoryPlot, TextView tv, Redrawer redrawer) {
	this.aprHistoryPlot = aprHistoryPlot;
	this.tv = tv;
	this.redrawer = redrawer;

	ds = DataManager.getStorageInstance();
	if (ds != null)
		ds.addPulseChangedListener(this);

	graphIt();
}
 
开发者ID:moguai2k,项目名称:ProjektWerkstatt13,代码行数:12,代码来源:PulsePlot.java

示例3: graphIt

import com.androidplot.util.Redrawer; //导入依赖的package包/类
public void graphIt() {
	rollHistorySeries = new SimpleXYSeries("Puls");
	rollHistorySeries.useImplicitXVals();

	// cosmetic
	aprHistoryPlot.setDrawDomainOriginEnabled(false);
	aprHistoryPlot.setBackgroundPaint(null);
	aprHistoryPlot.getGraphWidget().setBackgroundPaint(null);
	aprHistoryPlot.getGraphWidget().setGridBackgroundPaint(null);
	aprHistoryPlot.getGraphWidget().setDomainLabelPaint(null);
	aprHistoryPlot.getGraphWidget().setDomainOriginLabelPaint(null);
	aprHistoryPlot.getGraphWidget().setDomainGridLinePaint(null);
	aprHistoryPlot.getGraphWidget().setDomainOriginLinePaint(null);
	aprHistoryPlot.getGraphWidget().setRangeLabelWidth(50);
	aprHistoryPlot.getGraphWidget().getRangeOriginLinePaint() // lines
			.setColor(Color.rgb(192, 192, 192));
	aprHistoryPlot.getGraphWidget().getRangeOriginLabelPaint() // label/line
																// zero
			.setColor(Color.rgb(192, 192, 192));
	aprHistoryPlot.getGraphWidget().getRangeLabelPaint() // labeles
			.setColor(Color.rgb(192, 192, 192));
	aprHistoryPlot.setRangeBoundaries(25, PULSE, BoundaryMode.FIXED);
	aprHistoryPlot.setDomainBoundaries(0, SECONDS, BoundaryMode.FIXED);
	LineAndPointFormatter lineAndPointFormatter = new LineAndPointFormatter(
			Color.rgb(204, 0, 0), null, null, null);
	Paint paint = lineAndPointFormatter.getLinePaint();
	paint.setStrokeWidth(12);
	lineAndPointFormatter.setLinePaint(paint);
	aprHistoryPlot.addSeries(rollHistorySeries, lineAndPointFormatter);
	aprHistoryPlot.setDomainStepMode(XYStepMode.INCREMENT_BY_VAL);
	aprHistoryPlot.setDomainStepValue(SECONDS / 6);
	aprHistoryPlot.setRangeStepMode(XYStepMode.INCREMENT_BY_VAL);
	aprHistoryPlot.setRangeStepValue(10.0d);
	aprHistoryPlot.setRangeValueFormat(new DecimalFormat("#"));
	aprHistoryPlot.setDomainValueFormat(new DecimalFormat("#"));
	aprHistoryPlot.getDomainLabelWidget().pack();
	aprHistoryPlot.setRangeLabel("Puls");
	aprHistoryPlot.getRangeLabelWidget().pack();
	aprHistoryPlot.getLayoutManager().remove(
			aprHistoryPlot.getLegendWidget());

	// start drawing
	redrawer = new Redrawer(Arrays.asList(new Plot[] { aprHistoryPlot }),
			100, false);
	redrawer.start();

	aprHistoryPlot.redraw();

	dopt = new PulseOptimizer();
	dopt.execute();
}
 
开发者ID:moguai2k,项目名称:ProjektWerkstatt13,代码行数:52,代码来源:PulsePlot.java


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