本文整理汇总了Java中com.androidplot.ui.SizeMetrics类的典型用法代码示例。如果您正苦于以下问题:Java SizeMetrics类的具体用法?Java SizeMetrics怎么用?Java SizeMetrics使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SizeMetrics类属于com.androidplot.ui包,在下文中一共展示了SizeMetrics类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onPreInit
import com.androidplot.ui.SizeMetrics; //导入依赖的package包/类
@Override
protected void onPreInit() {
pieWidget = new PieWidget(
getLayoutManager(),
this,
new SizeMetrics(
PixelUtils.dpToPix(DEFAULT_PIE_WIDGET_H_DP),
SizeLayoutType.FILL,
PixelUtils.dpToPix(DEFAULT_PIE_WIDGET_W_DP),
SizeLayoutType.FILL));
pieWidget.position(
PixelUtils.dpToPix(DEFAULT_PIE_WIDGET_X_OFFSET_DP),
XLayoutStyle.ABSOLUTE_FROM_CENTER,
PixelUtils.dpToPix(DEFAULT_PIE_WIDGET_Y_OFFSET_DP),
YLayoutStyle.ABSOLUTE_FROM_CENTER,
AnchorPosition.CENTER);
pieWidget.setPadding(10, 10, 10, 10);
// TODO: can't remember why this getClass() check is neccessary. test if it actually is...
/*if (getClass().equals(PieChart.class) && attrs != null) {
loadAttrs(context, attrs);
}*/
}
示例2: XYLegendWidget
import com.androidplot.ui.SizeMetrics; //导入依赖的package包/类
public XYLegendWidget(LayoutManager layoutManager, XYPlot plot,
SizeMetrics widgetSizeMetrics,
TableModel tableModel,
SizeMetrics iconSizeMetrics) {
super(layoutManager, widgetSizeMetrics);
this.plot = plot;
setTableModel(tableModel);
this.iconSizeMetrics = iconSizeMetrics;
}
示例3: dibujarGrafica
import com.androidplot.ui.SizeMetrics; //导入依赖的package包/类
@SuppressWarnings("deprecation")
private void dibujarGrafica(Calibrado cal){
ArrayList<String> listaCons=cal.getPuntosCal();
Number[] rgb=new Number[cal.getNumeroPuntos()];
Number[] concentracion=new Number[cal.getNumeroPuntos()];
for(int i=0; i<listaCons.size();i++){
String[] dos=listaCons.get(i).split(";");
rgb[i]=Double.parseDouble(dos[0]);
concentracion[i]=Double.parseDouble(dos[1]);
}
XYSeries series1 = new SimpleXYSeries(
Arrays.asList(concentracion), // Array de datos
Arrays.asList(rgb), // Sólo valores verticales-- otro array
""); // Nombre de la primera serie
LineAndPointFormatter series1Format = new LineAndPointFormatter(
null, // Color de la línea si pones null no hay linea
Color.rgb(0, 100, 0), // Color del punto
null); // Relleno
// Una vez definida la serie (datos y estilo), la añadimos al panel
mySimpleXYPlot.addSeries(series1, series1Format);
Number[] lineaX={0, 500};
Number[] lineaY={cal.getOrdenadaOrigen(), m.calcularRGBaPartirdeConcentracion(500, cal)};
XYSeries series2 = new SimpleXYSeries(Arrays.asList(lineaX), Arrays.asList(lineaY), "");
mySimpleXYPlot.addSeries(series2, new LineAndPointFormatter(Color.rgb(0, 0, 100), null, null));
mySimpleXYPlot.setDomainLabel("[Furfural] (µg/L)");
mySimpleXYPlot.setRangeLabel("RGB");
mySimpleXYPlot.setTitle("");
mySimpleXYPlot.setTicksPerRangeLabel(1);
mySimpleXYPlot.setTicksPerDomainLabel(1);
mySimpleXYPlot.setDomainValueFormat(new DecimalFormat("0"));
mySimpleXYPlot.setRangeValueFormat(new DecimalFormat("0.00"));
mySimpleXYPlot.setDomainBoundaries(0, 600, BoundaryMode.FIXED);
mySimpleXYPlot.setDomainStep(XYStepMode.SUBDIVIDE, 7);
mySimpleXYPlot.getLegendWidget().setSize(new SizeMetrics(0, SizeLayoutType.ABSOLUTE, 0, SizeLayoutType.ABSOLUTE));
mySimpleXYPlot.setPlotPadding(10, 10, 10, 10);
mySimpleXYPlot.setDomainLabelWidget(null);
}
示例4: EmptyWidget
import com.androidplot.ui.SizeMetrics; //导入依赖的package包/类
public EmptyWidget(LayoutManager layoutManager, SizeMetrics sizeMetrics) {
super(layoutManager, sizeMetrics);
}
示例5: PieWidget
import com.androidplot.ui.SizeMetrics; //导入依赖的package包/类
public PieWidget(LayoutManager layoutManager, PieChart pieChart, SizeMetrics metrics) {
super(layoutManager, metrics);
this.pieChart = pieChart;
}
示例6: XYGraphWidget
import com.androidplot.ui.SizeMetrics; //导入依赖的package包/类
public XYGraphWidget(LayoutManager layoutManager, XYPlot plot, SizeMetrics sizeMetrics) {
super(layoutManager, sizeMetrics);
this.plot = plot;
}
示例7: getIconSizeMetrics
import com.androidplot.ui.SizeMetrics; //导入依赖的package包/类
public SizeMetrics getIconSizeMetrics() {
return iconSizeMetrics;
}
示例8: setIconSizeMetrics
import com.androidplot.ui.SizeMetrics; //导入依赖的package包/类
/**
* Set the size of each legend's icon. Note that when using relative sizing,
* the size is calculated against the countaining cell's size, not the plot's size.
* @param iconSizeMetrics
*/
public void setIconSizeMetrics(SizeMetrics iconSizeMetrics) {
this.iconSizeMetrics = iconSizeMetrics;
}