• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java AnchorPosition类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DfReflectionUtil类代码示例发布时间:2022-05-23
下一篇:
Java CognitoSyncManager类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap