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


Java Line.setStrokeWidth方法代码示例

本文整理汇总了Java中lecho.lib.hellocharts.model.Line.setStrokeWidth方法的典型用法代码示例。如果您正苦于以下问题:Java Line.setStrokeWidth方法的具体用法?Java Line.setStrokeWidth怎么用?Java Line.setStrokeWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lecho.lib.hellocharts.model.Line的用法示例。


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

示例1: tempValuesLine

import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
public Line tempValuesLine(TempWatchData twd, float offset, double factor, boolean isHighlightLine, int strokeWidth) {
    List<PointValue> lineValues = new ArrayList<PointValue>();
    long begin = (long) Math.max(start_time, twd.startTime);
    lineValues.add(new PointValue(fuzz(begin), offset + (float) (factor * twd.startBasal)));
    lineValues.add(new PointValue(fuzz(begin), offset + (float) (factor * twd.amount)));
    lineValues.add(new PointValue(fuzz(twd.endTime), offset + (float) (factor * twd.amount)));
    lineValues.add(new PointValue(fuzz(twd.endTime), offset + (float) (factor * twd.endBasal)));
    Line valueLine = new Line(lineValues);
    valueLine.setHasPoints(false);
    if (isHighlightLine){
        valueLine.setColor(basalCenterColor);
        valueLine.setStrokeWidth(1);
    }else {
        valueLine.setColor(basalBackgroundColor);
        valueLine.setStrokeWidth(strokeWidth);
    }
    return valueLine;
}
 
开发者ID:MilosKozak,项目名称:AndroidAPS,代码行数:19,代码来源:BgGraphBuilder.java

示例2: filteredLines

import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
public ArrayList<Line> filteredLines() {
    ArrayList<Line> line_array = new ArrayList<Line>();
    float last_x_pos = -999999; // bogus mark value
    final float jump_threshold = 15; // in minutes
    List<PointValue> local_points = new ArrayList<PointValue>();

    if (filteredValues.size() > 0) {
        final float end_marker = filteredValues.get(filteredValues.size() - 1).getX();

        for (PointValue current_point : filteredValues) {
            // a jump too far for a line? make it a new one
            if (((last_x_pos != -999999) && (Math.abs(current_point.getX() - last_x_pos) > jump_threshold))
                    || current_point.getX() == end_marker) {
                Line line = new Line(local_points);
                line.setHasPoints(true);
                line.setPointRadius(2);
                line.setStrokeWidth(1);
                line.setColor(Color.parseColor("#a0a0a0"));
                line.setCubic(true);
                line.setHasLines(true);
                line_array.add(line);
                local_points = new ArrayList<PointValue>();
            }
            last_x_pos = current_point.getX();
            local_points.add(current_point); // grow current line list
        }
    }
    return line_array;
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:30,代码来源:BgGraphBuilder.java

示例3: filteredLines

import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
public ArrayList<Line> filteredLines() {
    ArrayList<Line> linearray = new ArrayList<Line>();
    float lastx = -999999; // bogus mark value
    final float jumpthresh = 15; // in minutes
    List<PointValue> thesepoints = new ArrayList<PointValue>();

    if (filteredValues.size() > 0) {

        final float endmarker = filteredValues.get(filteredValues.size() - 1).getX();

        for (PointValue thispoint : filteredValues) {
            // a jump too far for a line? make it a new one
            if (((lastx != -999999) && (Math.abs(thispoint.getX() - lastx) > jumpthresh))
                    || thispoint.getX() == endmarker) {
                Line line = new Line(thesepoints);
                line.setHasPoints(true);
                line.setPointRadius(2);
                line.setStrokeWidth(1);
                line.setColor(getCol(X.color_filtered));
                line.setCubic(true);
                line.setHasLines(true);
                linearray.add(line);
                thesepoints = new ArrayList<PointValue>();
            }

            lastx = thispoint.getX();
            thesepoints.add(thispoint); // grow current line list
        }
    } else {
        UserError.Log.i(TAG, "Raw points size is zero");
    }


    //UserError.Log.i(TAG, "Returning linearray: " + Integer.toString(linearray.size()));
    return linearray;
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:37,代码来源:BgGraphBuilder.java

示例4: avg1Line

import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
public Line avg1Line() {
    List<PointValue> myLineValues = new ArrayList<PointValue>();
    myLineValues.add(new PointValue((float) avg1startfuzzed, (float) unitized(avg1value)));
    myLineValues.add(new PointValue((float) end_time, (float) unitized(avg1value)));
    Line myLine = new Line(myLineValues);
    myLine.setHasPoints(false);
    myLine.setStrokeWidth(1);
    myLine.setColor(getCol(X.color_average1_line));
    myLine.setPathEffect(new DashPathEffect(new float[]{10.0f, 10.0f}, 0));
    myLine.setAreaTransparency(50);
    return myLine;
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:13,代码来源:BgGraphBuilder.java

示例5: avg2Line

import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
public Line avg2Line() {
    List<PointValue> myLineValues = new ArrayList<PointValue>();
    myLineValues.add(new PointValue((float) start_time, (float) unitized(avg2value)));
    myLineValues.add(new PointValue((float) end_time, (float) unitized(avg2value)));
    Line myLine = new Line(myLineValues);
    myLine.setHasPoints(false);
    myLine.setStrokeWidth(1);
    myLine.setColor(getCol(X.color_average2_line));
    myLine.setPathEffect(new DashPathEffect(new float[]{30.0f, 10.0f}, 0));
    myLine.setAreaTransparency(50);
    return myLine;
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:13,代码来源:BgGraphBuilder.java

示例6: idealLine

import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
public Line idealLine() {
    // if profile has more than 1 target bg value then we need to iterate those and plot them for completeness
    List<PointValue> myLineValues = new ArrayList<PointValue>();
    myLineValues.add(new PointValue((float) start_time, (float)  Profile.getTargetRangeInUnits(start_time)));
    myLineValues.add(new PointValue((float) predictive_end_time, (float) Profile.getTargetRangeInUnits(predictive_end_time)));
    Line myLine = new Line(myLineValues);
    myLine.setHasPoints(false);
    myLine.setStrokeWidth(1);
    myLine.setColor(getCol(X.color_target_line));
    myLine.setPathEffect(new DashPathEffect(new float[]{5f, 5f}, 0));
    myLine.setAreaTransparency(50);
    return myLine;
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:14,代码来源:BgGraphBuilder.java

示例7: predictiveHighLine

import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
public Line predictiveHighLine() {
    List<PointValue> predictiveHighLineValues = new ArrayList<PointValue>();
    predictiveHighLineValues.add(new PointValue((float) end_time, (float) highMark));
    predictiveHighLineValues.add(new PointValue((float) predictive_end_time, (float) highMark));
    Line highLine = new Line(predictiveHighLineValues);
    highLine.setHasPoints(false);
    highLine.setStrokeWidth(1);
    highLine.setColor(ChartUtils.darkenColor(ChartUtils.darkenColor(ChartUtils.darkenColor(getCol(X.color_high_values)))));
    return highLine;
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:11,代码来源:BgGraphBuilder.java

示例8: predictiveLowLine

import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
public Line predictiveLowLine() {
    List<PointValue> lowLineValues = new ArrayList<PointValue>();
    lowLineValues.add(new PointValue((float) end_time, (float) lowMark));
    lowLineValues.add(new PointValue((float) predictive_end_time, (float) lowMark));
    Line lowLine = new Line(lowLineValues);
    lowLine.setHasPoints(false);
    lowLine.setAreaTransparency(40);
    lowLine.setColor(ChartUtils.darkenColor(ChartUtils.darkenColor(ChartUtils.darkenColor(getCol(X.color_low_values)))));
    lowLine.setStrokeWidth(1);
    lowLine.setFilled(true);
    return lowLine;
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:13,代码来源:BgGraphBuilder.java

示例9: motionLine

import lecho.lib.hellocharts.model.Line; //导入方法依赖的package包/类
private List<Line> motionLine() {

        final ArrayList<ActivityRecognizedService.motionData> motion_datas = ActivityRecognizedService.getForGraph((long) start_time * FUZZER, (long) end_time * FUZZER);
        List<PointValue> linePoints = new ArrayList<>();

        final float ypos = (float)highMark;
        int last_type = -9999;


        final ArrayList<Line> line_array = new ArrayList<>();

        Log.d(TAG,"Motion datas size: "+motion_datas.size());
        if (motion_datas.size() > 0) {
            motion_datas.add(new ActivityRecognizedService.motionData((long) end_time * FUZZER, DetectedActivity.UNKNOWN)); // terminator

            for (ActivityRecognizedService.motionData item : motion_datas) {

                Log.d(TAG, "Motion detail: " + JoH.dateTimeText(item.timestamp) + " activity: " + item.activity);
                if ((last_type != -9999) && (last_type != item.activity)) {
                    extend_line(linePoints, item.timestamp / FUZZER, ypos);
                    Line new_line = new Line(linePoints);
                    new_line.setHasLines(true);
                    new_line.setPointRadius(0);
                    new_line.setStrokeWidth(1);
                    new_line.setAreaTransparency(40);
                    new_line.setHasPoints(false);
                    new_line.setFilled(true);

                    switch (last_type) {
                        case DetectedActivity.IN_VEHICLE:
                            new_line.setColor(Color.parseColor("#70445599"));
                            break;
                        case DetectedActivity.ON_FOOT:
                            new_line.setColor(Color.parseColor("#70995599"));
                            break;
                    }
                    line_array.add(new_line);
                    linePoints = new ArrayList<>();
                }
                //current
                switch (item.activity) {
                    case DetectedActivity.ON_FOOT:
                    case DetectedActivity.IN_VEHICLE:
                        extend_line(linePoints, item.timestamp / FUZZER, ypos);
                        last_type = item.activity;
                        break;

                    default:
                        // do nothing?
                        break;
                }
            }

        }
        Log.d(TAG,"Motion array size: "+line_array.size());
            return line_array;
    }
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:58,代码来源:BgGraphBuilder.java


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