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

Java Viewport类代码示例

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

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



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

示例1: setViewPortY

import com.jjoe64.graphview.Viewport; //导入依赖的package包/类
void setViewPortY(@NonNull GraphView graphView) {
    Viewport viewport = graphView.getViewport();
    viewport.setScrollable(true);
    viewport.setYAxisBoundsManual(true);
    viewport.setMinY(GraphConstants.MIN_Y);
    viewport.setMaxY(getMaximumY());
    viewport.setXAxisBoundsManual(true);
}
 
开发者ID:VREMSoftwareDevelopment,项目名称:WiFiAnalyzer,代码行数:9,代码来源:GraphViewBuilder.java


示例2: onCreate

import com.jjoe64.graphview.Viewport; //导入依赖的package包/类
protected void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    this.requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.wifi_details);


    HashMap<String, String> WifiInfoIntent;

    UseWifiDetector = false;
    StartWifiInfo = (HashMap<String, String>)(getIntent().getSerializableExtra("WifiInfo"));
    NetworkBSSID = StartWifiInfo.get("BSSID");

    txtBSSID = (TextView)this.findViewById(R.id.txtDetailsBSSID);
    txtESSID = (TextView)this.findViewById(R.id.txtDetailsESSID);
    txtFreq = (TextView)this.findViewById(R.id.txtDetailsFreq);
    txtSignal = (TextView)this.findViewById(R.id.txtDetailsSignal);
    txtChannel = (TextView)this.findViewById(R.id.txtDetailsChannel);
    chkbUseDetector = (CheckBox)this.findViewById(R.id.chkbUseDetector);
    llGrphView = (LinearLayout)this.findViewById(R.id.llGrphView);

    mSoundPool = new SoundPool(1, AudioManager.STREAM_MUSIC, 0);

    // Graph init
    iGraphPointCount = 0;
    graphSeries = new LineGraphSeries<>();
    graphView = new GraphView(this);
    graphView.getGridLabelRenderer().setNumVerticalLabels(2);
    graphView.getGridLabelRenderer().setHorizontalLabelsVisible(false);
    graphView.getViewport().setMinY(0);
    graphView.getViewport().setMaxY(100);
    graphView.getViewport().setYAxisBoundsStatus(Viewport.AxisBoundsStatus.FIX);
    graphView.getViewport().setYAxisBoundsManual(true);

    graphView.setTitle("Signal graph");
    graphView.addSeries(graphSeries);
    llGrphView.addView(graphView);

    chkbUseDetector.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            UseWifiDetector = isChecked;

            if (UseWifiDetector) {
                DetectorThread = new Thread(new Runnable() {
                    @Override
                    public void run() {
                        DetectorWorker();
                    }
                });
                DetectorThread.start();
            }
        }
    });

    setBSSID(StartWifiInfo.get("BSSID"));
    setESSID(StartWifiInfo.get("SSID"));
    setFreq(StartWifiInfo.get("Freq"));
    setSignal(StartWifiInfo.get("Signal"));

    WifiMgr = (WifiManager) getSystemService(Context.WIFI_SERVICE);

    ScanThread = new Thread(new Runnable() {
        @Override
        public void run() {
            ScanWorker();
        }
    });
    ScanThreadActive = true;
    ScanThread.start();
}
 
开发者ID:FusixGit,项目名称:WiFiPasswordSearcher,代码行数:72,代码来源:WifiDetails.java


示例3: setupGraph

import com.jjoe64.graphview.Viewport; //导入依赖的package包/类
private void setupGraph(
        Map<String, List<StatsService.DataPoint>> dataPointsByCollectionId,
        GraphView graph,
        boolean yFromZero,
        final Formatter yAxisFormatter) {

    double minX = System.currentTimeMillis() - TimeUnit.DAYS.toMillis(daysAgo) - TimeUnit.HOURS.toMillis(12);
    double maxX = System.currentTimeMillis() + TimeUnit.HOURS.toMillis(12);
    double minY = 0;
    double maxY = 0;

    int colorNo = 0;
    for (String collectionId : dataPointsByCollectionId.keySet()) {
        List<StatsService.DataPoint> points = dataPointsByCollectionId.get(collectionId);

        BarGraphSeries series = new BarGraphSeries<>(points.toArray(new DataPointInterface[points.size()]));
        series.setColor(ContextCompat.getColor(this, graphColors[(colorNo ++) % graphColors.length]));
        series.setTitle(collectionId);

        graph.addSeries(series);

        if (minY == 0) {
            minY = series.getLowestValueY();
        }
        if (maxY == 0) {
            maxY = series.getHighestValueY();
        }

        maxY = Math.max(maxY, series.getHighestValueY());
        minY = Math.min(minY, series.getLowestValueY());
    }

    if (yFromZero) {
        minY = 0;
    }

    if (minY == maxY) {
        minY = 0;
        maxY = 1 + maxY * 1.5;
    }

    graph.getViewport().setMinX(minX);
    graph.getViewport().setMaxX(maxX);
    graph.getViewport().setXAxisBoundsManual(true);

    graph.getViewport().setMinY(minY);
    graph.getViewport().setMaxY(maxY);
    graph.getViewport().setYAxisBoundsManual(true);

    graph.getLegendRenderer().setFixedPosition(0, 0);
    graph.getLegendRenderer().setVisible(true);

    graph.getGridLabelRenderer().setLabelFormatter(new LabelFormatter() {
        public String lattestFormatted;
        Calendar cal = Calendar.getInstance();
        @Override
        public String formatLabel(double value, boolean isValueX) {
            if (isValueX) {
                cal.setTimeInMillis((long) value);
                String formatted = String.valueOf(cal.get(Calendar.DAY_OF_MONTH));
                if (formatted.equals(lattestFormatted)) {
                    this.lattestFormatted = formatted;
                    return "";
                }
                this.lattestFormatted = formatted;
                return formatted;
            }
            return yAxisFormatter.format(value);
        }

        @Override
        public void setViewport(Viewport viewport) {}
    });
    graph.getGridLabelRenderer().setGridColor(Color.GRAY);
    graph.getGridLabelRenderer().setNumHorizontalLabels(daysAgo);
}
 
开发者ID:tkrajina,项目名称:10000sentences,代码行数:77,代码来源:StatsActivity.java


示例4: setViewport

import com.jjoe64.graphview.Viewport; //导入依赖的package包/类
/**
 * @param viewport the used viewport
 */
@Override
public void setViewport(Viewport viewport) {
    mViewport = viewport;
    adjust();
}
 
开发者ID:Popati,项目名称:Android-BluetoothSPPLibrary-master,代码行数:9,代码来源:StaticLabelsFormatter.java


示例5: setViewport

import com.jjoe64.graphview.Viewport; //导入依赖的package包/类
@Override
public void setViewport(Viewport viewport) {
    // ignore
}
 
开发者ID:VREMSoftwareDevelopment,项目名称:WiFiAnalyzer,代码行数:5,代码来源:ChannelAxisLabel.java


示例6: setViewport

import com.jjoe64.graphview.Viewport; //导入依赖的package包/类
public void setViewport() {
    Viewport viewport = graphView.getViewport();
    viewport.setMinX(0);
    viewport.setMaxX(getViewportCntX());
}
 
开发者ID:VREMSoftwareDevelopment,项目名称:WiFiAnalyzer,代码行数:6,代码来源:GraphViewWrapper.java


示例7: setViewport

import com.jjoe64.graphview.Viewport; //导入依赖的package包/类
@Override
public void setViewport(Viewport viewport) {
    // Do nothing
}
 
开发者ID:VREMSoftwareDevelopment,项目名称:WiFiAnalyzer,代码行数:5,代码来源:TimeAxisLabel.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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