Examples of IntervalMarker


Examples of org.jfree.chart.plot.IntervalMarker

    /**
     * Confirm that cloning works.
     */
    public void testCloning() {
        IntervalMarker m1 = new IntervalMarker(45.0, 50.0);
        IntervalMarker m2 = null;
        try {
            m2 = (IntervalMarker) m1.clone();
        }
        catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        assertTrue(m1 != m2);
        assertTrue(m1.getClass() == m2.getClass());
        assertTrue(m1.equals(m2));
    }
View Full Code Here

Examples of org.jfree.chart.plot.IntervalMarker

   /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {

        IntervalMarker m1 = new IntervalMarker(45.0, 50.0);
        IntervalMarker m2 = null;
        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(m1);
            out.close();
View Full Code Here

Examples of org.jfree.chart.plot.IntervalMarker

    /**
     * Some checks for the getStartValue() and setStartValue() methods.
     */
    public void testGetSetStartValue() {
        IntervalMarker m = new IntervalMarker(1.0, 2.0);
        m.addChangeListener(this);
        this.lastEvent = null;
        assertEquals(1.0, m.getStartValue(), EPSILON);
        m.setStartValue(0.5);
        assertEquals(0.5, m.getStartValue(), EPSILON);
        assertEquals(m, this.lastEvent.getMarker());
    }
View Full Code Here

Examples of org.jfree.chart.plot.IntervalMarker

    /**
     * Some checks for the getEndValue() and setEndValue() methods.
     */
    public void testGetSetEndValue() {
        IntervalMarker m = new IntervalMarker(1.0, 2.0);
        m.addChangeListener(this);
        this.lastEvent = null;
        assertEquals(2.0, m.getEndValue(), EPSILON);
        m.setEndValue(0.5);
        assertEquals(0.5, m.getEndValue(), EPSILON);
        assertEquals(m, this.lastEvent.getMarker());
    }
View Full Code Here

Examples of org.jfree.chart.plot.IntervalMarker

        JFreeChart chart = ChartFactory.createBarChart(
                "Test Chart", "Category Axis", "Value Axis",
                dataset, PlotOrientation.VERTICAL, true, true, false);
        CategoryPlot plot = (CategoryPlot) chart.getPlot();
        plot.addRangeMarker(new ValueMarker(1.1), Layer.FOREGROUND);
        plot.addRangeMarker(new IntervalMarker(2.2, 3.3), Layer.BACKGROUND);
        JFreeChart chart2 = null;

        // serialize and deserialize the chart....
        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
View Full Code Here

Examples of org.jfree.chart.plot.IntervalMarker

       
        //sets different marks
        for (Iterator iterator = intervals.iterator(); iterator.hasNext();) {
      KpiInterval interval = (KpiInterval) iterator.next();
      // add the marks
            IntervalMarker marker = new IntervalMarker(interval.getMin(), interval.getMax(), interval.getColor());
            plot.addRangeMarker(marker, Layer.BACKGROUND);
      logger.debug("Added new interval to the plot");
    }
       
        // customize axes
View Full Code Here

Examples of org.jfree.chart.plot.IntervalMarker

    private void _addDarknessMarker(XYPlot xyPlot, Date startDate, Date endDate, float alpha, Color color) {
        double start = startDate.getTime();
        double end = endDate.getTime();

        if (start < end) {
            IntervalMarker m = new IntervalMarker(start, end, color, DARKNESS_STROKE,
                    color, DARKNESS_STROKE, alpha);
            xyPlot.addDomainMarker(m);
        } else {
            double first = _model.getDateForHour(0.).getTime();
            double last = _model.getDateForHour(24.).getTime();
            IntervalMarker m1 = new IntervalMarker(start, last, color, DARKNESS_STROKE,
                    color, DARKNESS_STROKE, alpha);
            xyPlot.addDomainMarker(m1);
            IntervalMarker m2 = new IntervalMarker(first, end, color, DARKNESS_STROKE,
                    color, DARKNESS_STROKE, alpha);
            xyPlot.addDomainMarker(m2);
        }
    }
View Full Code Here

Examples of org.jfree.chart.plot.IntervalMarker

    private void _addDarknessMarker(CategoryPlot plot, Date startDate, Date endDate, float alpha, Color color) {
        double start = startDate.getTime();
        double end = endDate.getTime();

        if (start < end) {
            IntervalMarker m = new IntervalMarker(start, end, color, DARKNESS_STROKE,
                    color, DARKNESS_STROKE, alpha);
            plot.addRangeMarker(m);
        } else {
            double first = _model.getDateForHour(0.).getTime();
            double last = _model.getDateForHour(24.).getTime();
            IntervalMarker m1 = new IntervalMarker(start, last, color, DARKNESS_STROKE,
                    color, DARKNESS_STROKE, alpha);
            plot.addRangeMarker(m1);
            IntervalMarker m2 = new IntervalMarker(first, end, color, DARKNESS_STROKE,
                    color, DARKNESS_STROKE, alpha);
            plot.addRangeMarker(m2);
        }
    }
View Full Code Here

Examples of org.jfree.chart.plot.IntervalMarker

       
        //sets different marks
        for (Iterator iterator = intervals.iterator(); iterator.hasNext();) {
      KpiInterval interval = (KpiInterval) iterator.next();
      // add the marks
            IntervalMarker marker = new IntervalMarker(interval.getMin(), interval.getMax(), interval.getColor());
            plot.addRangeMarker(marker, Layer.BACKGROUND);
      logger.debug("Added new interval to the plot");
    }
       
        // customize axes
View Full Code Here

Examples of org.jfree.chart.plot.IntervalMarker

    }
   
    
     // add un interval  marker for the Y axis...
    if (yMarkerStartInt != null && yMarkerEndInt != null && !yMarkerStartInt.equals("") && !yMarkerEndInt.equals("")){
        Marker intMarkerY = new IntervalMarker(Double.parseDouble(yMarkerStartInt), Double.parseDouble(yMarkerEndInt));
        intMarkerY.setLabelOffsetType(LengthAdjustmentType.EXPAND);
        intMarkerY.setPaint(new Color(Integer.decode((yMarkerIntColor.equals(""))?"0":yMarkerIntColor).intValue()));
        //intMarkerY.setLabel(yMarkerLabel);
        intMarkerY.setLabelAnchor(RectangleAnchor.BOTTOM_RIGHT);
        intMarkerY.setLabelTextAnchor(TextAnchor.TOP_RIGHT);
          plot.addDomainMarker (intMarkerY, Layer.BACKGROUND);
    }
     // add un interval  marker for the X axis...
        if (xMarkerStartInt != null && xMarkerEndInt != null && !xMarkerStartInt.equals("") && !xMarkerEndInt.equals("")){
          Marker intMarkerX = new IntervalMarker(Double.parseDouble(xMarkerStartInt), Double.parseDouble(xMarkerEndInt));
          intMarkerX.setLabelOffsetType(LengthAdjustmentType.EXPAND);
          intMarkerX.setPaint(new Color(Integer.decode((xMarkerIntColor.equals(""))?"0":xMarkerIntColor).intValue()));
        //intMarkerX.setLabel(xMarkerLabel);
        intMarkerX.setLabelAnchor(RectangleAnchor.BOTTOM_RIGHT);
        intMarkerX.setLabelTextAnchor(TextAnchor.TOP_RIGHT);
          plot.addRangeMarker(intMarkerX, Layer.BACKGROUND);
        }
     // add a labelled marker for the Y axis...
        if (yMarkerValue != null && !yMarkerValue.equals("")){         
          Marker markerY = new ValueMarker(Double.parseDouble(yMarkerValue));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.