Package org.jfree.chart.axis

Examples of org.jfree.chart.axis.SegmentedTimeline$Segment


    assertTrue(throwsException("name",-1,""));
    assertTrue(throwsException("name",1234,""));
  }
  public void testLayoutRU() throws Pack200Exception {
    AttributeLayout layout = new AttributeLayout("RU",AttributeLayout.CONTEXT_CLASS,"RU", 1);
    Segment segment = new TestSegment();
    assertNull(layout.getValue(-1, segment.getConstantPool()));
    assertEquals("Zero",layout.getValue(0, segment.getConstantPool()));
    assertEquals("One",layout.getValue(1, segment.getConstantPool()));
  }
View Full Code Here


    assertEquals("Zero",layout.getValue(0, segment.getConstantPool()));
    assertEquals("One",layout.getValue(1, segment.getConstantPool()));
  }
  public void testLayoutRUN() throws Pack200Exception {
    AttributeLayout layout = new AttributeLayout("RUN",AttributeLayout.CONTEXT_CLASS,"RUN", 1);
    Segment segment = new TestSegment();
    assertNull(layout.getValue(0, segment.getConstantPool()));
    assertEquals("Zero",layout.getValue(1, segment.getConstantPool()));
    assertEquals("One",layout.getValue(2, segment.getConstantPool()));
  }
View Full Code Here

    assertEquals("Zero",layout.getValue(1, segment.getConstantPool()));
    assertEquals("One",layout.getValue(2, segment.getConstantPool()));
  }
  public void testLayoutRS() throws Pack200Exception {
    AttributeLayout layout = new AttributeLayout("RS",AttributeLayout.CONTEXT_CLASS,"RS", 1);
    Segment segment = new TestSegment();
    assertNull(layout.getValue(-1, segment.getConstantPool()));
    assertEquals("Ein",layout.getValue(0, segment.getConstantPool()));
    assertEquals("Zwei",layout.getValue(1, segment.getConstantPool()));
  }
View Full Code Here

    assertEquals("Ein",layout.getValue(0, segment.getConstantPool()));
    assertEquals("Zwei",layout.getValue(1, segment.getConstantPool()));
  }
  public void testLayoutRSN() throws Pack200Exception {
    AttributeLayout layout = new AttributeLayout("RSN",AttributeLayout.CONTEXT_CLASS,"RSN", 1);
    Segment segment = new TestSegment();
    assertNull(layout.getValue(0, segment.getConstantPool()));
    assertEquals("Ein",layout.getValue(1, segment.getConstantPool()));
    assertEquals("Zwei",layout.getValue(2, segment.getConstantPool()));
  }
View Full Code Here

    public void testJustResources() throws Exception {
        in = Segment.class
                .getResourceAsStream("/org/apache/harmony/pack200/tests/JustResources.pack");
        file = File.createTempFile("just", "resources.jar");
        out = new JarOutputStream(new FileOutputStream(file));
        Segment segment = new Segment();
        segment.unpack(in, out);
    }
View Full Code Here

    public void testInterfaceOnly() throws Exception {
        in = Segment.class
                .getResourceAsStream("/org/apache/harmony/pack200/tests/InterfaceOnly.pack");
        file = File.createTempFile("Interface", "Only.jar");
        out = new JarOutputStream(new FileOutputStream(file));
        Segment segment = new Segment();
        segment.unpack(in, out);
    }
View Full Code Here

    public void testHelloWorld() throws Exception {
        in = Segment.class
                .getResourceAsStream("/org/apache/harmony/pack200/tests/HelloWorld.pack");
        file = File.createTempFile("hello", "world.jar");
        out = new JarOutputStream(new FileOutputStream(file));
        Segment segment = new Segment();
        segment.unpack(in, out);
        out.close();
        out = null;
        JarFile jarFile = new JarFile(file);
        file.deleteOnExit();
        JarEntry entry = jarFile
View Full Code Here

    public void testIndex() {
        pool.add(new CPUTF8("OtherThing", 1));
        CPUTF8 u1 = new CPUTF8("thing", 2);
        pool.add(u1);
        pool.resolve(new Segment());
        assertTrue(pool.indexOf(u1) > 0);
    }
View Full Code Here

    private void setupGaps(GapSkipTracker gapTracker, DateAxis dateAxis,
            XYPlot plot) {
        if (gapTracker.gaps.isEmpty())
            return;

        SegmentedTimeline timeline = new SegmentedTimeline(1000, 100, 0);
        timeline.setStartTime(gapTracker.leftEnd);

        for (Span gap : gapTracker.gaps) {
            timeline.addException(gap.start + GAP_SPACING, gap.end-1000);

            long annotationX = gap.start + GAP_SPACING / 2;
            plot.addAnnotation(new XYLineAnnotation(annotationX,
                    VERT_LINE_MIN_Y, annotationX, VERT_LINE_MAX_Y, GAP_STROKE,
                    Color.darkGray));
View Full Code Here

    /**
     * Tests a basic time line with one exception.
     */
    public void testSegmentedTimelineWithException1() {
        SegmentedTimeline stl = new SegmentedTimeline(10, 2, 3);
        stl.setStartTime(946684800000L)// 1-Jan-2000
        stl.addException(946684800050L);
        assertFalse(stl.containsDomainValue(946684799999L));
        assertTrue(stl.containsDomainValue(946684800000L));
        assertTrue(stl.containsDomainValue(946684800019L));
        assertFalse(stl.containsDomainValue(946684800020L));
        assertFalse(stl.containsDomainValue(946684800049L));
        assertFalse(stl.containsDomainValue(946684800050L));
        assertFalse(stl.containsDomainValue(946684800059L));
        assertTrue(stl.containsDomainValue(946684800060L));
        assertTrue(stl.containsDomainValue(946684800069L));
        assertFalse(stl.containsDomainValue(946684800070L));
        assertFalse(stl.containsDomainValue(946684800099L));
        assertTrue(stl.containsDomainValue(946684800100L));

        //long v = stl.toTimelineValue(946684800020L);
        assertEquals(0, stl.toTimelineValue(946684800000L));
        assertEquals(19, stl.toTimelineValue(946684800019L));
        assertEquals(20, stl.toTimelineValue(946684800020L));
        assertEquals(20, stl.toTimelineValue(946684800049L));
        assertEquals(20, stl.toTimelineValue(946684800050L));
        assertEquals(29, stl.toTimelineValue(946684800069L));
        assertEquals(30, stl.toTimelineValue(946684800070L));
        assertEquals(30, stl.toTimelineValue(946684800099L));
        assertEquals(30, stl.toTimelineValue(946684800100L));

        assertEquals(946684800000L, stl.toMillisecond(0));
        assertEquals(946684800019L, stl.toMillisecond(19));
        assertEquals(946684800060L, stl.toMillisecond(20));
        assertEquals(946684800069L, stl.toMillisecond(29));
        assertEquals(946684800100L, stl.toMillisecond(30));

    }
View Full Code Here

TOP

Related Classes of org.jfree.chart.axis.SegmentedTimeline$Segment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.