Examples of XYItemEntity


Examples of org.jfree.chart.entity.XYItemEntity

    /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {
        XYItemEntity e1 = new XYItemEntity(new Rectangle2D.Double(1.0, 2.0,
                3.0, 4.0), new TimeSeriesCollection(), 1, 9, "ToolTip", "URL");
        XYItemEntity e2 = null;
        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(e1);
            out.close();
View Full Code Here

Examples of org.jfree.chart.entity.XYItemEntity

                }
                String url = null;
                if (getURLGenerator() != null) {
                    url = getURLGenerator().generateURL(dataset, series, item);
                }
                XYItemEntity entity = new XYItemEntity(hotspot, dataset,
                        series, item, tip, url);
                entities.add(entity);
            }
        }
View Full Code Here

Examples of org.jfree.chart.entity.XYItemEntity

                }
                String url = null;
                if (getURLGenerator() != null) {
                    url = getURLGenerator().generateURL(dataset, series, item);
                }
                XYItemEntity entity = new XYItemEntity(hotspot, dataset,
                        series, item, tip, url);
                entities.add(entity);
            }
        }
View Full Code Here

Examples of org.jfree.chart.entity.XYItemEntity

        }
        String url = null;
        if (getURLGenerator() != null) {
            url = getURLGenerator().generateURL(dataset, series, item);
        }
        XYItemEntity entity = new XYItemEntity(hotspot, dataset, series, item,
                tip, url);
        entities.add(entity);
    }
View Full Code Here

Examples of org.jfree.chart.entity.XYItemEntity

    Iterator iter = info.getEntityCollection().iterator();
    while ( iter.hasNext() ) {
      ChartEntity entity = (ChartEntity) iter.next();
      if ( entity instanceof XYItemEntity ) {
        if ( urlTemplate != null ) {
          XYItemEntity xyItemEntity = (XYItemEntity) entity;
          if ( paramName == null ) {
            xyItemEntity.setURLText( urlTemplate );
          } else {
            try {
              int seriesIndex = xyItemEntity.getSeriesIndex();
              int itemIndex = xyItemEntity.getItem();
              String xySeriesKey =
                  (String) ( (XYZSeriesCollectionChartDefinition) xyItemEntity.getDataset() )
                      .getSeriesKey( seriesIndex );
              String encodedVal = URLEncoder.encode( xySeriesKey, LocaleHelper.getSystemEncoding() );
              String drillURL = TemplateUtil.applyTemplate( urlTemplate, paramName, encodedVal );
              String itemValueStr =
                  ( (XYZSeriesCollectionChartDefinition) xyItemEntity.getDataset() ).getX( seriesIndex, itemIndex )
                      .toString();
              encodedVal = URLEncoder.encode( itemValueStr, LocaleHelper.getSystemEncoding() );
              if ( seriesName == null ) {
                drillURL = TemplateUtil.applyTemplate( drillURL, "SERIES", encodedVal ); //$NON-NLS-1$
              } else {
                drillURL = TemplateUtil.applyTemplate( drillURL, seriesName, encodedVal );
              }
              xyItemEntity.setURLText( drillURL );
            } catch ( UnsupportedEncodingException e ) {
              // TODO Auto-generated catch block
              e.printStackTrace();
            }
          }
View Full Code Here

Examples of org.jfree.chart.entity.XYItemEntity

    Iterator iter = info.getEntityCollection().iterator();
    while ( iter.hasNext() ) {
      ChartEntity entity = (ChartEntity) iter.next();
      if ( entity instanceof XYItemEntity ) {
        if ( urlTemplate != null ) {
          XYItemEntity xyItemEntity = (XYItemEntity) entity;
          if ( paramName == null ) {
            xyItemEntity.setURLText( urlTemplate );
          } else {
            try {
              int seriesIndex = xyItemEntity.getSeriesIndex();
              int itemIndex = xyItemEntity.getItem();
              String xySeriesKey =
                  (String) ( (XYSeriesCollection) xyItemEntity.getDataset() ).getSeriesKey( seriesIndex );
              String encodedVal = URLEncoder.encode( xySeriesKey, LocaleHelper.getSystemEncoding() );
              String drillURL = TemplateUtil.applyTemplate( urlTemplate, paramName, encodedVal );
              String itemValueStr =
                  ( (XYSeriesCollection) xyItemEntity.getDataset() ).getX( seriesIndex, itemIndex ).toString();
              encodedVal = URLEncoder.encode( itemValueStr, LocaleHelper.getSystemEncoding() );
              if ( seriesName == null ) {
                drillURL = TemplateUtil.applyTemplate( drillURL, "SERIES", encodedVal ); //$NON-NLS-1$
              } else {
                drillURL = TemplateUtil.applyTemplate( drillURL, seriesName, encodedVal );
              }
              xyItemEntity.setURLText( drillURL );
            } catch ( UnsupportedEncodingException e ) {
              // TODO Auto-generated catch block
              e.printStackTrace();
            }
          }
View Full Code Here

Examples of org.jfree.chart.entity.XYItemEntity

    Iterator iter = info.getEntityCollection().iterator();
    while ( iter.hasNext() ) {
      ChartEntity entity = (ChartEntity) iter.next();
      if ( entity instanceof XYItemEntity ) {
        if ( urlTemplate != null ) {
          XYItemEntity xyItemEntity = (XYItemEntity) entity;
          if ( paramName == null ) {
            xyItemEntity.setURLText( urlTemplate );
          } else {
            try {
              int seriesIndex = xyItemEntity.getSeriesIndex();
              int itemIndex = xyItemEntity.getItem();
              String xySeriesKey =
                  (String) ( (TimeSeriesCollection) xyItemEntity.getDataset() ).getSeriesKey( seriesIndex );
              String encodedVal = URLEncoder.encode( xySeriesKey, LocaleHelper.getSystemEncoding() );
              String drillURL = TemplateUtil.applyTemplate( urlTemplate, paramName, encodedVal );
              String itemValueStr =
                  ( (TimeSeriesCollection) xyItemEntity.getDataset() ).getX( seriesIndex, itemIndex ).toString();
              encodedVal = URLEncoder.encode( itemValueStr, LocaleHelper.getSystemEncoding() );
              if ( seriesName == null ) {
                drillURL = TemplateUtil.applyTemplate( drillURL, "SERIES", encodedVal ); //$NON-NLS-1$
              } else {
                drillURL = TemplateUtil.applyTemplate( drillURL, seriesName, encodedVal );
              }
              xyItemEntity.setURLText( drillURL );
            } catch ( UnsupportedEncodingException e ) {
              // TODO Auto-generated catch block
              e.printStackTrace();
            }
          }
View Full Code Here

Examples of org.jfree.chart.entity.XYItemEntity

            link = ((CategoryItemLinkGenerator) linkGenerator).generateLink(dataset, catEnt.getSeries(), catEnt.getCategory());
          }
        }
        if (linkGenerator instanceof XYItemLinkGenerator) {
          if (ce instanceof XYItemEntity) {
            XYItemEntity xyEnt = (XYItemEntity) ce;
            link = ((XYItemLinkGenerator) linkGenerator).generateLink(dataset, xyEnt.getSeriesIndex(), xyEnt.getItem());
          } else {
              // Note; there is a simple ChartEntity also passed since Jfreechart 1.0rc1, that is ignored
              LOG.debug("Link entity skipped, not XYItemEntity.class:" + ce);
          }
        }
View Full Code Here

Examples of org.jfree.chart.entity.XYItemEntity

        }
      }
       
      if (toolTipGenerator instanceof XYToolTipGenerator) {
        if (ce instanceof XYItemEntity) {
        XYItemEntity xyEnt = (XYItemEntity) ce;
        tooltip = ((XYToolTipGenerator) toolTipGenerator).generateToolTip((XYDataset) dataset, xyEnt.getSeriesIndex(), xyEnt.getItem());
        }
      }

      if (toolTipGenerator instanceof PieToolTipGenerator) {
        if (ce instanceof PieSectionEntity) {
View Full Code Here

Examples of org.jfree.chart.entity.XYItemEntity

        }
        String url = null;
        if ( getURLGenerator() != null ) {
          url = getURLGenerator().generateURL( dataset, series, item );
        }
        XYItemEntity entity = new XYItemEntity( circle, dataset, series, item, tip, url );
        entities.add( entity );
      }

      int domainAxisIndex = plot.getDomainAxisIndex( domainAxis );
      int rangeAxisIndex = plot.getRangeAxisIndex( rangeAxis );
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.