本文整理汇总了Java中com.androidplot.ui.YLayoutStyle类的典型用法代码示例。如果您正苦于以下问题:Java YLayoutStyle类的具体用法?Java YLayoutStyle怎么用?Java YLayoutStyle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
YLayoutStyle类属于com.androidplot.ui包,在下文中一共展示了YLayoutStyle类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onPreInit
import com.androidplot.ui.YLayoutStyle; //导入依赖的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: validatePair
import com.androidplot.ui.YLayoutStyle; //导入依赖的package包/类
/**
* Throws IllegalArgumentException if there is a problem.
* @param value
*/
protected void validatePair(float value, YLayoutStyle layoutStyle) {
switch(layoutStyle) {
case ABSOLUTE_FROM_TOP:
case ABSOLUTE_FROM_BOTTOM:
case ABSOLUTE_FROM_CENTER:
validateValue(value, PositionMetric.LayoutMode.ABSOLUTE);
break;
case RELATIVE_TO_TOP:
case RELATIVE_TO_BOTTOM:
case RELATIVE_TO_CENTER:
validateValue(value, PositionMetric.LayoutMode.RELATIVE);
}
}
开发者ID:LoriLori,项目名称:androidCgmMonitor,代码行数:18,代码来源:YPositionMetric.java
示例3: initGraph
import com.androidplot.ui.YLayoutStyle; //导入依赖的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
示例4: init
import com.androidplot.ui.YLayoutStyle; //导入依赖的package包/类
private void init(Context context, AttributeSet attrs, int defStyle) {
PixelUtils.init(getContext());
layoutManager = new LayoutManager();
titleWidget = new TextLabelWidget(layoutManager, new SizeMetrics(25,
SizeLayoutType.ABSOLUTE, 100,
SizeLayoutType.ABSOLUTE),
TextOrientationType.HORIZONTAL);
titleWidget.position(0, XLayoutStyle.RELATIVE_TO_CENTER, 0,
YLayoutStyle.ABSOLUTE_FROM_TOP, AnchorPosition.TOP_MIDDLE);
// initialize attr defaults:
titleWidget.getLabelPaint().setTextSize(
PixelUtils.spToPix(DEFAULT_TITLE_WIDGET_TEXT_SIZE_SP));
onPreInit();
// make sure the title widget is always the topmost widget:
layoutManager.moveToTop(titleWidget);
if(context != null && attrs != null) {
loadAttrs(attrs, defStyle);
}
layoutManager.onPostInit();
//Log.d(TAG, "AndroidPlot RenderMode: " + renderMode);
if (renderMode == RenderMode.USE_BACKGROUND_THREAD) {
renderThread = new Thread(new Runnable() {
@Override
public void run() {
keepRunning = true;
while (keepRunning) {
isIdle = false;
synchronized (pingPong) {
Canvas c = pingPong.getCanvas();
renderOnCanvas(c);
pingPong.swap();
}
synchronized (renderSynch) {
postInvalidate();
// prevent this thread from becoming an orphan
// after the view is destroyed
if (keepRunning) {
try {
renderSynch.wait();
} catch (InterruptedException e) {
keepRunning = false;
}
}
}
}
System.out.println("AndroidPlot render thread finished.");
}
});
}
}
开发者ID:LoriLori,项目名称:androidCgmMonitor,代码行数:55,代码来源:Plot.java
示例5: setLayoutType
import com.androidplot.ui.YLayoutStyle; //导入依赖的package包/类
@Override
public void setLayoutType(YLayoutStyle layoutType) {
super.setLayoutType(layoutType);
}
开发者ID:LoriLori,项目名称:androidCgmMonitor,代码行数:5,代码来源:YPositionMetric.java
示例6: YPositionMetric
import com.androidplot.ui.YLayoutStyle; //导入依赖的package包/类
public YPositionMetric(float value, YLayoutStyle layoutStyle) {
super(value, layoutStyle);
//this.layoutStyle = layoutStyle;
}
开发者ID:LoriLori,项目名称:androidCgmMonitor,代码行数:7,代码来源:YPositionMetric.java
示例7: position
import com.androidplot.ui.YLayoutStyle; //导入依赖的package包/类
/**
* Same as {@link #position(float, com.androidplot.ui.XLayoutStyle, float, com.androidplot.ui.YLayoutStyle, com.androidplot.ui.AnchorPosition)}
* but with the anchor parameter defaulted to the upper left corner.
* @param x
* @param xLayoutStyle
* @param y
* @param yLayoutStyle
*/
public void position(float x, XLayoutStyle xLayoutStyle, float y, YLayoutStyle yLayoutStyle) {
position(x, xLayoutStyle, y, yLayoutStyle, AnchorPosition.LEFT_TOP);
}
开发者ID:LoriLori,项目名称:androidCgmMonitor,代码行数:12,代码来源:Widget.java
示例8: XValueMarker
import com.androidplot.ui.YLayoutStyle; //导入依赖的package包/类
/**
*
* @param value
* @param text Set to null to use the plot's default formatter.
*/
public XValueMarker(Number value, String text) {
super(value, text, new YPositionMetric(3, YLayoutStyle.ABSOLUTE_FROM_TOP));
}
开发者ID:LoriLori,项目名称:androidCgmMonitor,代码行数:9,代码来源:XValueMarker.java
注:本文中的com.androidplot.ui.YLayoutStyle类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论