Examples of XYAnnotation


Examples of org.jfree.chart.annotations.XYAnnotation

                    new Integer(domainIndex)));
            if (domainIndex == 0) {
                // grab the plot's annotations
                Iterator iterator = this.annotations.iterator();
                while (iterator.hasNext()) {
                    XYAnnotation annotation = (XYAnnotation) iterator.next();
                    if (annotation instanceof XYAnnotationBoundsInfo) {
                        includedAnnotations.add(annotation);
                    }
                }
            }
        }

        // or is it a range axis?
        int rangeIndex = getRangeAxisIndex(axis);
        if (rangeIndex >= 0) {
            isDomainAxis = false;
            mappedDatasets.addAll(getDatasetsMappedToRangeAxis(
                    new Integer(rangeIndex)));
            if (rangeIndex == 0) {
                Iterator iterator = this.annotations.iterator();
                while (iterator.hasNext()) {
                    XYAnnotation annotation = (XYAnnotation) iterator.next();
                    if (annotation instanceof XYAnnotationBoundsInfo) {
                        includedAnnotations.add(annotation);
                    }
                }
            }
        }

        // iterate through the datasets that map to the axis and get the union
        // of the ranges.
        Iterator iterator = mappedDatasets.iterator();
        while (iterator.hasNext()) {
            XYDataset d = (XYDataset) iterator.next();
            if (d != null) {
                XYItemRenderer r = getRendererForDataset(d);
                if (isDomainAxis) {
                    if (r != null) {
                        result = Range.combine(result, r.findDomainBounds(d));
                    }
                    else {
                        result = Range.combine(result,
                                DatasetUtilities.findDomainBounds(d));
                    }
                }
                else {
                    if (r != null) {
                        result = Range.combine(result, r.findRangeBounds(d));
                    }
                    else {
                        result = Range.combine(result,
                                DatasetUtilities.findRangeBounds(d));
                    }
                }
                // FIXME: the XYItemRenderer interface doesn't specify the
                // getAnnotations() method but it should
                if (r instanceof AbstractXYItemRenderer) {
                    AbstractXYItemRenderer rr = (AbstractXYItemRenderer) r;
                    Collection c = rr.getAnnotations();
                    Iterator i = c.iterator();
                    while (i.hasNext()) {
                        XYAnnotation a = (XYAnnotation) i.next();
                        if (a instanceof XYAnnotationBoundsInfo) {
                            includedAnnotations.add(a);
                        }
                    }
                }
View Full Code Here

Examples of org.jfree.chart.annotations.XYAnnotation

     *
     * @see #addAnnotation(XYAnnotation)
     */
    public void clearAnnotations() {
        for(int i = 0; i < this.annotations.size(); i++){
            XYAnnotation annotation = (XYAnnotation) this.annotations.get(i);
            annotation.removeChangeListener(this);
        }
        this.annotations.clear();
        fireChangeEvent();
    }
View Full Code Here

Examples of org.jfree.chart.annotations.XYAnnotation

                                Rectangle2D dataArea,
                                PlotRenderingInfo info) {

        Iterator iterator = this.annotations.iterator();
        while (iterator.hasNext()) {
            XYAnnotation annotation = (XYAnnotation) iterator.next();
            ValueAxis xAxis = getDomainAxis();
            ValueAxis yAxis = getRangeAxis();
            annotation.draw(g2, this, dataArea, xAxis, yAxis, 0, info);
        }

    }
View Full Code Here

Examples of org.jfree.chart.annotations.XYAnnotation

                    new Integer(domainIndex)));
            if (domainIndex == 0) {
                // grab the plot's annotations
                Iterator iterator = this.annotations.iterator();
                while (iterator.hasNext()) {
                    XYAnnotation annotation = (XYAnnotation) iterator.next();
                    if (annotation instanceof XYAnnotationBoundsInfo) {
                        includedAnnotations.add(annotation);
                    }
                }
            }
        }

        // or is it a range axis?
        int rangeIndex = getRangeAxisIndex(axis);
        if (rangeIndex >= 0) {
            isDomainAxis = false;
            mappedDatasets.addAll(getDatasetsMappedToRangeAxis(
                    new Integer(rangeIndex)));
            if (rangeIndex == 0) {
                Iterator iterator = this.annotations.iterator();
                while (iterator.hasNext()) {
                    XYAnnotation annotation = (XYAnnotation) iterator.next();
                    if (annotation instanceof XYAnnotationBoundsInfo) {
                        includedAnnotations.add(annotation);
                    }
                }
            }
        }

        // iterate through the datasets that map to the axis and get the union
        // of the ranges.
        Iterator iterator = mappedDatasets.iterator();
        while (iterator.hasNext()) {
            XYDataset d = (XYDataset) iterator.next();
            if (d != null) {
                XYItemRenderer r = getRendererForDataset(d);
                if (isDomainAxis) {
                    if (r != null) {
                        result = Range.combine(result, r.findDomainBounds(d));
                    }
                    else {
                        result = Range.combine(result,
                                DatasetUtilities.findDomainBounds(d));
                    }
                }
                else {
                    if (r != null) {
                        result = Range.combine(result, r.findRangeBounds(d));
                    }
                    else {
                        result = Range.combine(result,
                                DatasetUtilities.findRangeBounds(d));
                    }
                }
                // FIXME: the XYItemRenderer interface doesn't specify the
                // getAnnotations() method but it should
                if (r instanceof AbstractXYItemRenderer) {
                    AbstractXYItemRenderer rr = (AbstractXYItemRenderer) r;
                    Collection c = rr.getAnnotations();
                    Iterator i = c.iterator();
                    while (i.hasNext()) {
                        XYAnnotation a = (XYAnnotation) i.next();
                        if (a instanceof XYAnnotationBoundsInfo) {
                            includedAnnotations.add(a);
                        }
                    }
                }
View Full Code Here

Examples of org.jfree.chart.annotations.XYAnnotation

                     * label around the right point
                     */
                    CircleDrawer cd = new CircleDrawer(
                            Color.red, new BasicStroke(1.0f), null
                            );
                    XYAnnotation locationSelected = new XYDrawableAnnotation( xx, yy, 11, 11, cd );
                    plot.addAnnotation(locationSelected);
                    XYPointerAnnotation pointer = new XYPointerAnnotation(
                            formatAnnotation( xx,  yy).toString(), xx, yy, Math.PI - knob.getAngle() );
                    pointer.setBaseRadius(35.0);
                    pointer.setTipRadius(10.0);
View Full Code Here

Examples of org.jfree.chart.annotations.XYAnnotation

    */
   public void clearAnnotations()
   {
      for (int i = 0; i < this.annotations.size(); i++)
      {
         XYAnnotation annotation = (XYAnnotation) this.annotations.get(i);
         annotation.removeChangeListener(this);
      }
      this.annotations.clear();
      fireChangeEvent();
   }
View Full Code Here

Examples of org.jfree.chart.annotations.XYAnnotation

   {

      Iterator iterator = this.annotations.iterator();
      while (iterator.hasNext())
      {
         XYAnnotation annotation = (XYAnnotation) iterator.next();
         ValueAxis xAxis = getDomainAxis();
         ValueAxis yAxis = getRangeAxis();
         annotation.draw(g2, this, dataArea, xAxis, yAxis, 0, info);
      }

   }
View Full Code Here

Examples of org.jfree.chart.annotations.XYAnnotation

         {
            // grab the plot's annotations
            Iterator iterator = this.annotations.iterator();
            while (iterator.hasNext())
            {
               XYAnnotation annotation = (XYAnnotation) iterator.next();
               if (annotation instanceof XYAnnotationBoundsInfo)
               {
                  includedAnnotations.add(annotation);
               }
            }
         }
      }

      // or is it a range axis?
      int rangeIndex = getRangeAxisIndex(axis);
      if (rangeIndex >= 0)
      {
         isDomainAxis = false;
         mappedDatasets.addAll(getDatasetsMappedToRangeAxis(
                 new Integer(rangeIndex)));
         if (rangeIndex == 0)
         {
            Iterator iterator = this.annotations.iterator();
            while (iterator.hasNext())
            {
               XYAnnotation annotation = (XYAnnotation) iterator.next();
               if (annotation instanceof XYAnnotationBoundsInfo)
               {
                  includedAnnotations.add(annotation);
               }
            }
         }
      }

      // iterate through the datasets that map to the axis and get the union
      // of the ranges.
      Iterator iterator = mappedDatasets.iterator();
      while (iterator.hasNext())
      {
         XYDataset d = (XYDataset) iterator.next();
         if (d != null)
         {
            XYItemRenderer r = getRendererForDataset(d);
            if (isDomainAxis)
            {
               if (r != null)
               {
                  result = Range.combine(result, r.findDomainBounds(d));
               }
               else
               {
                  result = Range.combine(result,
                          DatasetUtilities.findDomainBounds(d));
               }
            }
            else
            {
               if (r != null)
               {
                  result = Range.combine(result, r.findRangeBounds(d));
               }
               else
               {
                  result = Range.combine(result,
                          DatasetUtilities.findRangeBounds(d));
               }
            }
            // FIXME: the XYItemRenderer interface doesn't specify the
            // getAnnotations() method but it should
            if (r instanceof AbstractXYItemRenderer)
            {
               AbstractXYItemRenderer rr = (AbstractXYItemRenderer) r;
               List c = rr.getAnnotations();
               Iterator i = c.iterator();
               while (i.hasNext())
               {
                  XYAnnotation a = (XYAnnotation) i.next();
                  if (a instanceof XYAnnotationBoundsInfo)
                  {
                     includedAnnotations.add(a);
                  }
               }
View Full Code Here

Examples of org.jfree.chart.annotations.XYAnnotation

                                Rectangle2D dataArea,
                                PlotRenderingInfo info) {

        Iterator iterator = this.annotations.iterator();
        while (iterator.hasNext()) {
            XYAnnotation annotation = (XYAnnotation) iterator.next();
            ValueAxis xAxis = getDomainAxis();
            ValueAxis yAxis = getRangeAxis();
            annotation.draw(g2, this, dataArea, xAxis, yAxis, 0, info);
        }

    }
View Full Code Here

Examples of org.jfree.chart.annotations.XYAnnotation

                    new Integer(domainIndex)));
            if (domainIndex == 0) {
                // grab the plot's annotations
                Iterator iterator = this.annotations.iterator();
                while (iterator.hasNext()) {
                    XYAnnotation annotation = (XYAnnotation) iterator.next();
                    if (annotation instanceof XYAnnotationBoundsInfo) {
                        includedAnnotations.add(annotation);
                    }
                }
            }
        }

        // or is it a range axis?
        int rangeIndex = getRangeAxisIndex(axis);
        if (rangeIndex >= 0) {
            isDomainAxis = false;
            mappedDatasets.addAll(getDatasetsMappedToRangeAxis(
                    new Integer(rangeIndex)));
            if (rangeIndex == 0) {
                Iterator iterator = this.annotations.iterator();
                while (iterator.hasNext()) {
                    XYAnnotation annotation = (XYAnnotation) iterator.next();
                    if (annotation instanceof XYAnnotationBoundsInfo) {
                        includedAnnotations.add(annotation);
                    }
                }
            }
        }

        // iterate through the datasets that map to the axis and get the union
        // of the ranges.
        Iterator iterator = mappedDatasets.iterator();
        while (iterator.hasNext()) {
            XYDataset d = (XYDataset) iterator.next();
            if (d != null) {
                XYItemRenderer r = getRendererForDataset(d);
                if (isDomainAxis) {
                    if (r != null) {
                        result = Range.combine(result, r.findDomainBounds(d));
                    }
                    else {
                        result = Range.combine(result,
                                DatasetUtilities.findDomainBounds(d));
                    }
                }
                else {
                    if (r != null) {
                        result = Range.combine(result, r.findRangeBounds(d));
                    }
                    else {
                        result = Range.combine(result,
                                DatasetUtilities.findRangeBounds(d));
                    }
                }
                // FIXME: the XYItemRenderer interface doesn't specify the
                // getAnnotations() method but it should
                if (r instanceof AbstractXYItemRenderer) {
                    AbstractXYItemRenderer rr = (AbstractXYItemRenderer) r;
                    Collection c = rr.getAnnotations();
                    Iterator i = c.iterator();
                    while (i.hasNext()) {
                        XYAnnotation a = (XYAnnotation) i.next();
                        if (a instanceof XYAnnotationBoundsInfo) {
                            includedAnnotations.add(a);
                        }
                    }
                }
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.