⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 reportdetailsbean.java

📁 report trafiic for java bean
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
                    if (Intersection == 1) {
                        for(int kkk = 0; kkk < 10; kkk++)
                        {
                            long temp1 = (long)kkk;
                            double temp2 = (double)kkk;
                            long timeperiods1 = timeperiods/10;
                            double length1 = length/10.0D;
                            dats = dat1 + temp1*timeperiods/10;
                            dubs = dub1 + temp2*length/10.0D;
                            inTime.add(new Millisecond(new Date(dats)), dubs,
                                       "IN");
                            for (int ii = 1; ii < controlnum; ii++) {
                                long dd = (long) ii;
                                long totalnum = (long) controlnum;
                                double angles = (double) ((double) dd) *
                                                doublepai / 12.0D;
                                double randomnum = Math.sin(angles);
                                randomnum = Math.abs(randomnum);
                                double randomlen = length1 * randomnum;
                                dat = dats + (dd * timeperiods1) / totalnum;
                                dub = dubs + randomlen;
                                inTime.add(new Millisecond(new Date(dat)), dub,
                                           "IN");
                            }
                        }
                        //dat = dat2;
                        //dub = dub2;
                        //inTime.add(new Millisecond(new Date(dat)), dub,"IN");
                    } else
                    if (Intersection == 3) {
                        for(int kkk = 0; kkk < 10; kkk++)
                        {
                            long temp1 = (long)kkk;
                            double temp2 = (double)kkk;
                            long timeperiods1 = timeperiods/10;
                            double length1 = length/10.0D;
                            dats = dat1 + temp1 * timeperiods / 10;
                            dubs = dub1 + temp2 * length / 10.0D;
                            inTime.add(new Millisecond(new Date(dats)), dubs,
                                       "IN");
                            for (int ii = 1; ii < controlnum; ii++) {
                                long dd = (long) ii;
                                long totalnum = (long) controlnum;
                                double angles = (double) ((double) dd) *
                                                doublepai / 12.0D;
                                double randomnum = Math.sin(angles);
                                randomnum = Math.abs(randomnum);
                                double randomlen = length1 * randomnum;
                                dat = dats + (dd * timeperiods1) / totalnum;
                                dub = dubs - randomlen;
                                inTime.add(new Millisecond(new Date(dat)), dub,
                                           "IN");
                            }
                        }
                        //dat = dat2;
                        //dub = dub2;
                        //inTime.add(new Millisecond(new Date(dat)), dub,"IN");
                    }
                }
                if (inOut == 2) {
                    if (Intersection == 1) {
                        for(int kkk = 0; kkk < 10; kkk++)
                        {
                            long temp1 = (long)kkk;
                            double temp2 = (double)kkk;
                            long timeperiods1 = timeperiods/10;
                            double length1 = length/10.0D;
                            dats = dat1 + temp1 * timeperiods / 10;
                            dubs = dub1 - temp2 * length / 10.0D;
                            outTime.add(new Millisecond(new Date(dats)), dubs,
                                       "OUT");
                            for (int ii = 1; ii < controlnum; ii++) {
                                long dd = (long) ii;
                                long totalnum = (long) controlnum;
                                double angles = (double) ((double) dd) *
                                                doublepai / 12.0D;
                                double randomnum = Math.sin(angles);
                                randomnum = Math.abs(randomnum);
                                double randomlen = length1 * randomnum;
                                dat = dats + (dd * timeperiods1) / totalnum;
                                dub = dubs + randomlen;
                                outTime.add(new Millisecond(new Date(dat)), dub,
                                            "OUT");
                            }
                        }
                        //dat = dat2;
                        //dub = dub2;
                        //outTime.add(new Millisecond(new Date(dat)), dub,"OUT");
                    } else
                    if (Intersection == 3) {
                        for(int kkk = 0; kkk < 10; kkk++)
                        {
                            long temp1 = (long)kkk;
                            double temp2 = (double)kkk;
                            long timeperiods1 = timeperiods/10;
                            double length1 = length/10.0D;
                            dats = dat1 + temp1 * timeperiods / 10;
                            dubs = dub1 - temp2 * length / 10.0D;
                            outTime.add(new Millisecond(new Date(dats)), dubs,
                                       "OUT");
                            for (int ii = 1; ii < controlnum; ii++) {
                                long dd = (long) ii;
                                long totalnum = (long) controlnum;
                                double angles = (double) ((double) dd) *
                                                doublepai / 12.0D;
                                double randomnum = Math.sin(angles);
                                randomnum = Math.abs(randomnum);
                                double randomlen = length1 * randomnum;
                                dat = dats + (dd * timeperiods1) / totalnum;
                                dub = dubs - randomlen;
                                outTime.add(new Millisecond(new Date(dat)), dub,
                                            "OUT");
                            }
                        }
                        //dat = dat2;
                        //dub = dub2;
                        //outTime.add(new Millisecond(new Date(dat)), dub,"OUT");
                    }
                }
            }
            if (signlabel == 3) {
                long dats = 0L;
                double dubs = 0.0D;

                if (inOut == 1) {
                    if (Intersection == 1) {
                        for(int kkk = 0; kkk < 20; kkk++)
                        {
                            long temp1 = (long)kkk;
                            double temp2 = (double)kkk;
                            long timeperiods1 = timeperiods/20;
                            double length1 = length/20.0D;
                            dats = dat1 + temp1*timeperiods/20;
                            dubs = dub1 + temp2*length/20.0D;
                            inTime.add(new Millisecond(new Date(dats)), dubs,
                                       "IN");
                            for (int ii = 1; ii < controlnum; ii++) {
                                long dd = (long) ii;
                                long totalnum = (long) controlnum;
                                double angles = (double) ((double) dd) *
                                                doublepai / 12.0D;
                                double randomnum = Math.sin(angles);
                                randomnum = Math.abs(randomnum);
                                double randomlen = length1 * randomnum;
                                dat = dats + (dd * timeperiods1) / totalnum;
                                dub = dubs + randomlen;
                                inTime.add(new Millisecond(new Date(dat)), dub,
                                           "IN");
                            }
                        }
                        //dat = dat2;
                        //dub = dub2;
                        //inTime.add(new Millisecond(new Date(dat)), dub,"IN");
                    } else
                    if (Intersection == 3) {
                        for(int kkk = 0; kkk < 20; kkk++)
                        {
                            long temp1 = (long)kkk;
                            double temp2 = (double)kkk;
                            long timeperiods1 = timeperiods/20;
                            double length1 = length/20.0D;
                            dats = dat1 + temp1 * timeperiods / 20;
                            dubs = dub1 + temp2 * length / 20.0D;
                            inTime.add(new Millisecond(new Date(dats)), dubs,
                                       "IN");
                            for (int ii = 1; ii < controlnum; ii++) {
                                long dd = (long) ii;
                                long totalnum = (long) controlnum;
                                double angles = (double) ((double) dd) *
                                                doublepai / 12.0D;
                                double randomnum = Math.sin(angles);
                                randomnum = Math.abs(randomnum);
                                double randomlen = length1 * randomnum;
                                dat = dats + (dd * timeperiods1) / totalnum;
                                dub = dubs - randomlen;
                                inTime.add(new Millisecond(new Date(dat)), dub,
                                           "IN");
                            }
                        }
                        //dat = dat2;
                        //dub = dub2;
                        //inTime.add(new Millisecond(new Date(dat)), dub,"IN");
                    }
                }
                if (inOut == 2) {
                    if (Intersection == 1) {
                        for(int kkk = 0; kkk < 20; kkk++)
                        {
                            long temp1 = (long)kkk;
                            double temp2 = (double)kkk;
                            long timeperiods1 = timeperiods/20;
                            double length1 = length/20.0D;
                            dats = dat1 + temp1 * timeperiods / 20;
                            dubs = dub1 - temp2 * length / 20.0D;
                            outTime.add(new Millisecond(new Date(dats)), dubs,
                                       "OUT");
                            for (int ii = 1; ii < controlnum; ii++) {
                                long dd = (long) ii;
                                long totalnum = (long) controlnum;
                                double angles = (double) ((double) dd) *
                                                doublepai / 12.0D;
                                double randomnum = Math.sin(angles);
                                randomnum = Math.abs(randomnum);
                                double randomlen = length1 * randomnum;
                                dat = dats + (dd * timeperiods1) / totalnum;
                                dub = dubs + randomlen;
                                outTime.add(new Millisecond(new Date(dat)), dub,
                                            "OUT");
                            }
                        }
                        //dat = dat2;
                        //dub = dub2;
                        //outTime.add(new Millisecond(new Date(dat)), dub,"OUT");
                    } else
                    if (Intersection == 3) {
                        for(int kkk = 0; kkk < 20; kkk++)
                        {
                            long temp1 = (long)kkk;
                            double temp2 = (double)kkk;
                            long timeperiods1 = timeperiods/20;
                            double length1 = length/20.0D;
                            dats = dat1 + temp1 * timeperiods / 20;
                            dubs = dub1 - temp2 * length / 20.0D;
                            outTime.add(new Millisecond(new Date(dats)), dubs,
                                       "OUT");
                            for (int ii = 1; ii < controlnum; ii++) {
                                long dd = (long) ii;
                                long totalnum = (long) controlnum;
                                double angles = (double) ((double) dd) *
                                                doublepai / 12.0D;
                                double randomnum = Math.sin(angles);
                                randomnum = Math.abs(randomnum);
                                double randomlen = length1 * randomnum;
                                dat = dats + (dd * timeperiods1) / totalnum;
                                dub = dubs - randomlen;
                                outTime.add(new Millisecond(new Date(dat)), dub,
                                            "OUT");
                            }
                        }
                        //dat = dat2;
                        //dub = dub2;
                        //outTime.add(new Millisecond(new Date(dat)), dub,"OUT");
                    }
                }
            }
        }
    }

    //Create Traffic Trend Graphics
    public String generateGraphTimeSeries(TableXYDataset dataset, DateAxis xAxis, String yAUnit, HttpSession session, String graphOption, long stTime,
            long edTime)
    {
        Hashtable myHash = splitTimeTableXYDataset(dataset);
        org.jfree.data.XYDataset dataset1 = null;
        org.jfree.data.XYDataset dataset2 = null;
        if(myHash != null && myHash.containsKey("IN"))
            dataset1 = (TimeTableXYDataset)myHash.get("IN");
        if(myHash != null && myHash.containsKey("OUT"))
            dataset2 = (TimeTableXYDataset)myHash.get("OUT");
        StandardXYItemLabelGenerator labelGenerator = new StandardXYItemLabelGenerator(new SimpleDateFormat("dd-MMM-yyyy", Locale.UK));
        String yAxisUnit = "Traffic (" + yAUnit + ")";
        NumberAxis yAxis = new NumberAxis(yAxisUnit);
        yAxis.setAutoRangeIncludesZero(true);
        yAxis.setLabelAngle(50.25D);
        if(graphOption.equalsIgnoreCase("percentage"))
        {
            yAxis.setMinimumAxisValue(0.0D);
            yAxis.setMaximumAxisValue(100D);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -