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

Java Series类代码示例

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

本文整理汇总了Java中com.jjoe64.graphview.series.Series的典型用法代码示例。如果您正苦于以下问题:Java Series类的具体用法?Java Series怎么用?Java Series使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Series类属于com.jjoe64.graphview.series包,在下文中一共展示了Series类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: init

import com.jjoe64.graphview.series.Series; //导入依赖的package包/类
/**
 * initialize the internal objects.
 * This method has to be called directly
 * in the constructors.
 */
protected void init() {
    mPreviewPaint = new Paint();
    mPreviewPaint.setTextAlign(Paint.Align.CENTER);
    mPreviewPaint.setColor(Color.BLACK);
    mPreviewPaint.setTextSize(50);

    mStyles = new Styles();
    mViewport = new Viewport(this);
    mGridLabelRenderer = new GridLabelRenderer(this);
    mLegendRenderer = new LegendRenderer(this);

    mSeries = new ArrayList<Series>();
    mPaintTitle = new Paint();

    mTapDetector = new TapDetector();

    loadStyles();
}
 
开发者ID:Popati,项目名称:Android-BluetoothSPPLibrary-master,代码行数:24,代码来源:GraphView.java


示例2: SecondScale

import com.jjoe64.graphview.series.Series; //导入依赖的package包/类
/**
 * creates the second scale.
 * normally you do not call this contructor.
 * Use {@link com.jjoe64.graphview.GraphView#getSecondScale()}
 * in order to get the instance.
 */
SecondScale(Viewport viewport) {
    mViewport = viewport;
    mSeries = new ArrayList<Series>();
    mLabelFormatter = new DefaultLabelFormatter();
    mLabelFormatter.setViewport(mViewport);
}
 
开发者ID:Popati,项目名称:Android-BluetoothSPPLibrary-master,代码行数:13,代码来源:SecondScale.java


示例3: onTap

import com.jjoe64.graphview.series.Series; //导入依赖的package包/类
@Override
public void onTap(@NonNull Series series, @NonNull DataPointInterface dataPoint) {
    WiFiDetail wiFiDetail = seriesCache.find(series);
    if (wiFiDetail != null) {
        View popupView = getAccessPointDetail().makeViewDetailed(wiFiDetail);
        getAccessPointPopup().show(popupView);
    }
}
 
开发者ID:VREMSoftwareDevelopment,项目名称:WiFiAnalyzer,代码行数:9,代码来源:GraphViewWrapper.java


示例4: onTap

import com.jjoe64.graphview.series.Series; //导入依赖的package包/类
@Override
public void onTap(Series series, DataPointInterface dataPointInterface) {
	Logger.add(TAG, ": onTap: series title=" + series.getTitle());
	if(dialog == null || !dialog.isShowing()) {
		dialog = GrandExchangePointDialog.showDialog(getContext(), series.getTitle(), dataPointInterface);
	}
}
 
开发者ID:OSRSHelper,项目名称:OSRSHelper,代码行数:8,代码来源:GrandExchangePeriodFragment.java


示例5: addSeriesWithoutInvalidate

import com.jjoe64.graphview.series.Series; //导入依赖的package包/类
private void addSeriesWithoutInvalidate(GraphView bgGraph, Series s) {
    if (!s.isEmpty()) {
        s.onGraphViewAttached(bgGraph);
        bgGraph.getSeries().add(s);
    }
}
 
开发者ID:MilosKozak,项目名称:AndroidAPS,代码行数:7,代码来源:GraphData.java


示例6: addSeries

import com.jjoe64.graphview.series.Series; //导入依赖的package包/类
/**
 * Add a new series to the graph. This will
 * automatically redraw the graph.
 * @param s the series to be added
 */
public void addSeries(Series s) {
    s.onGraphViewAttached(this);
    mSeries.add(s);
    onDataChanged(false, false);
}
 
开发者ID:Popati,项目名称:Android-BluetoothSPPLibrary-master,代码行数:11,代码来源:GraphView.java


示例7: draw

import com.jjoe64.graphview.series.Series; //导入依赖的package包/类
/**
 * draws the legend if it is visible
 *
 * @param canvas canvas
 * @see #setVisible(boolean)
 */
public void draw(Canvas canvas) {
    if (!mIsVisible) return;

    mPaint.setTextSize(mStyles.textSize);

    int shapeSize = (int) (mStyles.textSize*0.8d);

    List<Series> allSeries = new ArrayList<Series>();
    allSeries.addAll(mGraphView.getSeries());
    if (mGraphView.mSecondScale != null) {
        allSeries.addAll(mGraphView.getSecondScale().getSeries());
    }

    // width
    int legendWidth = mStyles.width;
    if (legendWidth == 0) {
        // auto
        legendWidth = cachedLegendWidth;

        if (legendWidth == 0) {
            Rect textBounds = new Rect();
            for (Series s : allSeries) {
                if (s.getTitle() != null) {
                    mPaint.getTextBounds(s.getTitle(), 0, s.getTitle().length(), textBounds);
                    legendWidth = Math.max(legendWidth, textBounds.width());
                }
            }
            if (legendWidth == 0) legendWidth = 1;

            // add shape size
            legendWidth += shapeSize+mStyles.padding*2 + mStyles.spacing;
            cachedLegendWidth = legendWidth;
        }
    }

    // rect
    float legendHeight = (mStyles.textSize+mStyles.spacing)*allSeries.size() -mStyles.spacing;
    float lLeft;
    float lTop;
    if (mStyles.fixedPosition != null) {
        // use fied position
        lLeft = mGraphView.getGraphContentLeft() + mStyles.margin + mStyles.fixedPosition.x;
        lTop = mGraphView.getGraphContentTop() + mStyles.margin + mStyles.fixedPosition.y;
    } else {
        lLeft = mGraphView.getGraphContentLeft() + mGraphView.getGraphContentWidth() - legendWidth - mStyles.margin;
        switch (mStyles.align) {
            case TOP:
                lTop = mGraphView.getGraphContentTop() + mStyles.margin;
                break;
            case MIDDLE:
                lTop = mGraphView.getHeight() / 2 - legendHeight / 2;
                break;
            default:
                lTop = mGraphView.getGraphContentTop() + mGraphView.getGraphContentHeight() - mStyles.margin - legendHeight - 2*mStyles.padding;
        }
    }
    float lRight = lLeft+legendWidth;
    float lBottom = lTop+legendHeight+2*mStyles.padding;
    mPaint.setColor(mStyles.backgroundColor);
    canvas.drawRoundRect(new RectF(lLeft, lTop, lRight, lBottom), 8, 8, mPaint);

    int i=0;
    for (Series series : allSeries) {
        mPaint.setColor(series.getColor());
        canvas.drawRect(new RectF(lLeft+mStyles.padding, lTop+mStyles.padding+(i*(mStyles.textSize+mStyles.spacing)), lLeft+mStyles.padding+shapeSize, lTop+mStyles.padding+(i*(mStyles.textSize+mStyles.spacing))+shapeSize), mPaint);
        if (series.getTitle() != null) {
            mPaint.setColor(mStyles.textColor);
            canvas.drawText(series.getTitle(), lLeft+mStyles.padding+shapeSize+mStyles.spacing, lTop+mStyles.padding+mStyles.textSize+(i*(mStyles.textSize+mStyles.spacing)), mPaint);
        }
        i++;
    }
}
 
开发者ID:Popati,项目名称:Android-BluetoothSPPLibrary-master,代码行数:79,代码来源:LegendRenderer.java


示例8: getSeries

import com.jjoe64.graphview.series.Series; //导入依赖的package包/类
/**
 * @return the series of the second scale
 */
public List<Series> getSeries() {
    return mSeries;
}
 
开发者ID:Popati,项目名称:Android-BluetoothSPPLibrary-master,代码行数:7,代码来源:SecondScale.java


示例9: setOnGraphTapListeners

import com.jjoe64.graphview.series.Series; //导入依赖的package包/类
private void setOnGraphTapListeners() {
    for (Series<DataPoint> series: graphDrawer.graph.getSeries()) {
        series.setOnDataPointTapListener(new MyTapListener());
    }
}
 
开发者ID:nogalavi,项目名称:Bikeable,代码行数:6,代码来源:GraphToMapConnector.java


示例10: onTap

import com.jjoe64.graphview.series.Series; //导入依赖的package包/类
@Override
public void onTap(Series series, DataPointInterface dataPoint) {
    int tappedSeriesIndex = Integer.parseInt(series.getTitle()); //series index

    if ( tappedSeriesIndex != graphDrawer.getSelectedSeriesIndex() ) { // make only selected route clickable
        return;
    }

    int tappedDatePointIndex = 0;
    Iterator<DataPoint> iter = series.getValues(0, 100000);
    int dataPointIndex = 0;
    while ( iter.hasNext() ) {
        if ( dataPoint.equals(iter.next())) {
            tappedDatePointIndex = dataPointIndex;
            break;
        }
        dataPointIndex ++;
    }
    ElevationResult tappedElevationResult = graphDrawer.allElevationResults.get(tappedSeriesIndex)[tappedDatePointIndex];
    com.google.maps.model.LatLng tappedLatLng = tappedElevationResult.location;

    // Instantiates a new CircleOptions object and defines the center and radius
    CircleOptions circleOptions = new CircleOptions()
            .center(new LatLng(tappedLatLng.lat, tappedLatLng.lng))
            .radius(60) // In meters
            .fillColor(0x40FFFF00)
            .strokeColor(Color.BLACK)
            .strokeWidth(5)
            .zIndex(1000); //todo max Z index

    // Get back the mutable Circle
    LatLng gmsLatLng = MapUtils.getGmsLatLngFromModel(tappedLatLng);
    Circle circle = googleMap.addCircle(circleOptions);
    boolean doesGraphHideCircle = googleMap.getProjection().toScreenLocation(gmsLatLng).y > PhoneUtils.getScreenHeight()/2;
    if (!googleMap.getProjection().getVisibleRegion().latLngBounds.contains(gmsLatLng) || doesGraphHideCircle) {
        if (doesGraphHideCircle) {
            Log.i("INFO", "graph hides circle so moving");
        }
        googleMap.moveCamera(CameraUpdateFactory.newLatLng(gmsLatLng));
    }
    removeCircleAfterSomeTime(circle);
}
 
开发者ID:nogalavi,项目名称:Bikeable,代码行数:43,代码来源:GraphToMapConnector.java


示例11: find

import com.jjoe64.graphview.series.Series; //导入依赖的package包/类
WiFiDetail find(@NonNull Series series) {
    return IterableUtils.find(cache.keySet(), new FindPredicate(series));
}
 
开发者ID:VREMSoftwareDevelopment,项目名称:WiFiAnalyzer,代码行数:4,代码来源:SeriesCache.java


示例12: FindPredicate

import com.jjoe64.graphview.series.Series; //导入依赖的package包/类
private FindPredicate(@NonNull Series series) {
    this.series = series;
}
 
开发者ID:VREMSoftwareDevelopment,项目名称:WiFiAnalyzer,代码行数:4,代码来源:SeriesCache.java


示例13: getSeries

import com.jjoe64.graphview.series.Series; //导入依赖的package包/类
/**
 * important: do not do modifications on the list
 * object that will be returned.
 * Use {@link #removeSeries(com.jjoe64.graphview.series.Series)} and {@link #addSeries(com.jjoe64.graphview.series.Series)}
 *
 * @return all series
 */
public List<Series> getSeries() {
    // TODO immutable array
    return mSeries;
}
 
开发者ID:Popati,项目名称:Android-BluetoothSPPLibrary-master,代码行数:12,代码来源:GraphView.java


示例14: removeSeries

import com.jjoe64.graphview.series.Series; //导入依赖的package包/类
/**
 * Remove a specific series of the graph.
 * This will also re-render the graph, but
 * without recalculating the viewport and
 * label sizes.
 * If you want this, you have to call {@link #onDataChanged(boolean, boolean)}
 * manually.
 *
 * @param series
 */
public void removeSeries(Series<?> series) {
    mSeries.remove(series);
    onDataChanged(false, false);
}
 
开发者ID:Popati,项目名称:Android-BluetoothSPPLibrary-master,代码行数:15,代码来源:GraphView.java


示例15: addSeries

import com.jjoe64.graphview.series.Series; //导入依赖的package包/类
/**
 * add a series to the second scale.
 * Don't add this series also to the GraphView
 * object.
 *
 * @param s the series
 */
public void addSeries(Series s) {
    mSeries.add(s);
}
 
开发者ID:Popati,项目名称:Android-BluetoothSPPLibrary-master,代码行数:11,代码来源:SecondScale.java



注:本文中的com.jjoe64.graphview.series.Series类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java ToolTipRelativeLayout类代码示例发布时间:2022-05-23
下一篇:
Java ContentTypeImpl类代码示例发布时间: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