Example usage for org.jfree.data.time Second getEnd

List of usage examples for org.jfree.data.time Second getEnd

Introduction

In this page you can find the example usage for org.jfree.data.time Second getEnd.

Prototype

@Override
public Date getEnd() 

Source Link

Document

Returns the date/time that marks the end of the time period.

Usage

From source file:org.jfree.data.time.SecondTest.java

/**
 * Some checks for the getEnd() method.//from   w w w . j a v  a 2 s .com
 */
@Test
public void testGetEnd() {
    Locale saved = Locale.getDefault();
    Locale.setDefault(Locale.ITALY);
    Calendar cal = Calendar.getInstance(Locale.ITALY);
    cal.set(2006, Calendar.JANUARY, 16, 3, 47, 55);
    cal.set(Calendar.MILLISECOND, 999);
    Second s = new Second(55, 47, 3, 16, 1, 2006);
    assertEquals(cal.getTime(), s.getEnd());
    Locale.setDefault(saved);
}

From source file:org.jfree.data.time.junit.SecondTest.java

/**
 * Some checks for the getEnd() method.//  w  w  w.j  ava  2  s.  co m
 */
public void testGetEnd() {
    Locale saved = Locale.getDefault();
    Locale.setDefault(Locale.ITALY);
    Calendar cal = Calendar.getInstance(Locale.ITALY);
    cal.set(2006, Calendar.JANUARY, 16, 3, 47, 55);
    cal.set(Calendar.MILLISECOND, 999);
    Second s = new Second(55, 47, 3, 16, 1, 2006);
    assertEquals(cal.getTime(), s.getEnd());
    Locale.setDefault(saved);
}

From source file:net.atomique.ksar.graph.Graph.java

private JFreeChart makegraph(LocalDateTime start, LocalDateTime end) {

    long begingenerate = System.currentTimeMillis();

    CombinedDomainXYPlot plot = new CombinedDomainXYPlot(axisofdate);
    // do the stacked stuff
    for (PlotStackConfig tmp : graphconfig.getStacklist().values()) {
        if (tmp == null) {
            continue;
        }//from   ww w  .  j  av a 2s. com
        TimeTableXYDataset tmp2 = StackListbyName.get(tmp.getTitle());

        if (tmp2 != null) {
            StackedXYAreaRenderer2 renderer = new StackedXYAreaRenderer2();
            NumberAxis graphaxistitle = tmp.getAxis();
            XYPlot temp_plot = new XYPlot(tmp2, axisofdate, graphaxistitle, renderer);
            for (int i = 0; i < tmp2.getSeriesCount(); i++) {
                Color color = GlobalOptions.getDataColor(tmp2.getSeriesKey(i).toString());
                if (color != null) {
                    renderer.setSeriesPaint(i, color);
                    renderer.setDefaultStroke(new BasicStroke(1.0F));
                }
            }
            plot.add(temp_plot, tmp.getSize());
        }
    }
    // do the line stuff
    for (PlotStackConfig tmp : graphconfig.getPlotlist().values()) {
        XYItemRenderer renderer = new StandardXYItemRenderer();
        ArrayList<String> t = new ArrayList<>();
        String[] s = tmp.getHeaderStr().split("\\s+");
        Collections.addAll(t, s);

        XYDataset c = create_collection(t);
        NumberAxis graphaxistitle = tmp.getAxis();
        XYPlot tmpplot = new XYPlot(c, axisofdate, graphaxistitle, renderer);

        for (int i = 0; i < s.length; i++) {
            Color color = GlobalOptions.getDataColor(s[i]);
            if (color != null) {
                renderer.setSeriesPaint(i, color);
                renderer.setDefaultStroke(new BasicStroke(1.0F));
            }
        }
        plot.add(tmpplot, tmp.getSize());
    }
    if (plot.getSubplots().isEmpty()) {
        return null;
    }
    if (start != null && end != null) {
        Second g_start = convertLocalDateTimeToSecond(start);
        Second g_end = convertLocalDateTimeToSecond(end);
        axisofdate.setRange(g_start.getStart(), g_end.getEnd());
    }

    plot.setOrientation(PlotOrientation.VERTICAL);
    JFreeChart mychart = new JFreeChart(graphtitle, Config.getDEFAULT_FONT(), plot, true);
    long endgenerate = System.currentTimeMillis();
    mychart.setBackgroundPaint(Color.white);
    if (GlobalOptions.isDodebug()) {
        log.debug("graph generation: {} ms", (endgenerate - begingenerate));
    }
    return mychart;
}