本文整理汇总了Java中com.androidplot.ui.AnchorPosition类的典型用法代码示例。如果您正苦于以下问题:Java AnchorPosition类的具体用法?Java AnchorPosition怎么用?Java AnchorPosition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AnchorPosition类属于com.androidplot.ui包,在下文中一共展示了AnchorPosition类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onPreInit
import com.androidplot.ui.AnchorPosition; //导入依赖的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);
}*/
}
开发者ID:LoriLori,项目名称:androidCgmMonitor,代码行数:26,代码来源:PieChart.java
示例2: initGraph
import com.androidplot.ui.AnchorPosition; //导入依赖的package包/类
protected void initGraph(final boolean isEmpty) {
int greyColor = getAppResouces().getColor(android.R.color.secondary_text_light_nodisable);
xyPlot.getGraphWidget().getDomainGridLinePaint().setColor(greyColor);
xyPlot.getGraphWidget().getRangeSubGridLinePaint().setColor(greyColor);
xyPlot.getGraphWidget().getRangeGridLinePaint().setColor(greyColor);
xyPlot.getGraphWidget().getDomainSubGridLinePaint().setColor(greyColor);
xyPlot.getBackgroundPaint().setColor(Color.WHITE);
xyPlot.setPlotMargins(0, 0, 0, 0);
xyPlot.getGraphWidget().getGridBackgroundPaint().setColor(Color.WHITE);
xyPlot.getGraphWidget().getBackgroundPaint().setColor(Color.WHITE);
xyPlot.getGraphWidget().getCursorLabelBackgroundPaint().setColor(greyColor);
xyPlot.getGraphWidget().getDomainOriginLabelPaint().setColor(Color.WHITE);
xyPlot.getGraphWidget().getRangeOriginLabelPaint().setColor(greyColor);
xyPlot.getGraphWidget().getDomainOriginLinePaint().setColor(greyColor);
xyPlot.getGraphWidget().getRangeOriginLinePaint().setColor(greyColor);
xyPlot.getGraphWidget().getDomainLabelPaint().setColor(greyColor);
xyPlot.getGraphWidget().getRangeLabelPaint().setColor(greyColor);
xyPlot.getDomainLabelWidget().getLabelPaint().setColor(greyColor);
xyPlot.getRangeLabelWidget().getLabelPaint().setColor(greyColor);
xyPlot.getDomainLabelWidget().position(0, XLayoutStyle.ABSOLUTE_FROM_CENTER,
0, YLayoutStyle.RELATIVE_TO_BOTTOM, AnchorPosition.BOTTOM_MIDDLE);
xyPlot.getTitleWidget().getLabelPaint().setColor(Color.TRANSPARENT);
xyPlot.getTitleWidget().setVisible(false);
xyPlot.getLegendWidget().setVisible(false);
float domainLabelWidth = getAppResouces().getDimensionPixelSize(R.dimen.domainLabelWidth);
float rangeLabelWidth = getAppResouces().getDimensionPixelSize(R.dimen.rangeLabelWidth);
float rangeLabelVerticalOffset = getAppResouces().getDimensionPixelSize(R.dimen.rangeLabelVerticalOffset);
float domainLabelMarginLeft = getAppResouces().getDimensionPixelSize(R.dimen.domainLabelMarginLeft);
float domainLabelMarginRight = getAppResouces().getDimensionPixelSize(R.dimen.domainLabelMarginRight);
float rangeLabelMargin = getAppResouces().getDimensionPixelSize(R.dimen.rangeLabelMargin);
float gridPaddingMargin = getAppResouces().getDimensionPixelSize(R.dimen.gridPaddingMargin);
float gridPaddingMarginRight = getAppResouces().getDimensionPixelSize(R.dimen.gridPaddingMarginRight);
xyPlot.getDomainLabelWidget().setMargins(domainLabelMarginLeft, 0, domainLabelMarginRight, 0);
xyPlot.getRangeLabelWidget().setMargins(rangeLabelMargin, 0, rangeLabelMargin, 0);
xyPlot.getGraphWidget().setGridPadding(gridPaddingMargin, gridPaddingMargin, gridPaddingMarginRight, gridPaddingMargin);
xyPlot.getGraphWidget().setDomainLabelWidth(domainLabelWidth);
xyPlot.getGraphWidget().setRangeLabelWidth(rangeLabelWidth);
xyPlot.getGraphWidget().setDomainLabelHorizontalOffset(0);
xyPlot.getGraphWidget().setRangeLabelVerticalOffset(rangeLabelVerticalOffset);
xyPlot.getDomainLabelWidget().pack();
xyPlot.getRangeLabelWidget().pack();
final String secStr = getContext().getString(R.string.seconds);
final DecimalFormat domainFmt = new DecimalFormat("#.#");
xyPlot.setDomainValueFormat(new NumberFormat() {
@Override
public StringBuffer format(double d, StringBuffer sb, FieldPosition fp) {
return sb.append(domainFmt.format(d / 50f)).append(secStr);
}
@Override
public StringBuffer format(long l, StringBuffer stringBuffer, FieldPosition fieldPosition) {
return null;
}
@Override
public Number parse(String s, ParsePosition parsePosition) {
return null;
}
});
xyPlot.setRangeValueFormat(new DecimalFormat("#.#G"));
xyPlot.setDomainBoundaries(0, 100, BoundaryMode.FIXED);
xyPlot.setDomainStepValue(2);
xyPlot.setRangeStepValue(11);
xyPlot.setRangeBoundaries(-0.5f, 0.5f, BoundaryMode.FIXED);
DashPathEffect dashFx = new DashPathEffect(new float[] {PixelUtils.dpToPix(3), PixelUtils.dpToPix(3)}, 0);
xyPlot.getGraphWidget().getDomainGridLinePaint().setPathEffect(dashFx);
xyPlot.getGraphWidget().getRangeGridLinePaint().setPathEffect(dashFx);
setGraphData(null);
}
开发者ID:WorldBank-Transport,项目名称:RoadLab-Pro,代码行数:72,代码来源:StartMeasurementFragment.java
注:本文中的com.androidplot.ui.AnchorPosition类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论