Package org.pentaho.reporting.engine.classic.core.imagemap

Examples of org.pentaho.reporting.engine.classic.core.imagemap.ImageMap


    if (version < '6')
    {
      return;
    }

    final ImageMap imageMap = RenderUtility.extractImageMap(content);
    // only generate a image map, if the user does not specify their own onw via the override.
    // Of course, they would have to provide the map by other means as well.

    if (imageMap == null)
    {
      return;
    }

    final ImageMapEntry[] imageMapEntries = imageMap.getMapEntries();
    for (int i = 0; i < imageMapEntries.length; i++)
    {
      final ImageMapEntry imageMapEntry = imageMapEntries[i];
      final String link = imageMapEntry.getAttribute(LibXmlInfo.XHTML_NAMESPACE, "href");
      final String tooltip = imageMapEntry.getAttribute(LibXmlInfo.XHTML_NAMESPACE, "title");
View Full Code Here


      if (node instanceof RenderableReplacedContentBox == false)
      {
        continue;
      }

      final ImageMap imageMap = RenderUtility.extractImageMap((RenderableReplacedContentBox) node);
      if (imageMap == null)
      {
        continue;
      }

      final PageFormat pf = physicalPageDrawable.getPageFormat();
      final float imageMapX = (float) (x1 - pf.getImageableX() - StrictGeomUtility.toExternalValue(node.getX()));
      final float imageMapY = (float) (y1 - pf.getImageableY() - StrictGeomUtility.toExternalValue(node.getY()));

      final ImageMapEntry[] imageMapEntries = imageMap.getEntriesForPoint(imageMapX, imageMapY);
      for (int j = 0; j < imageMapEntries.length; j++)
      {
        final ImageMapEntry imageMapEntry = imageMapEntries[j];
        final Object imageMapTooltip = imageMapEntry.getAttribute(LibXmlInfo.XHTML_NAMESPACE, "title");
        if (imageMapTooltip != null)
View Full Code Here

  private ArrayList readHandlerArrayList;
 
  public ImageMapReadHandler()
  {
    readHandlerArrayList = new ArrayList();
    imageMap = new ImageMap();
  }
View Full Code Here

      final Graphics2D graphics = image.createGraphics();
      draw(graphics, bounds);
      graphics.dispose();
    }

    final ImageMap map = new ImageMap();
    final EntityCollection entityCollection = chartRenderingInfo.getEntityCollection();
    final int count = entityCollection.getEntityCount();
    for (int i = 0; i < count; i++)
    {
      final ChartEntity chartEntity = entityCollection.getEntity(i);
      final Shape area = chartEntity.getArea();
      final String hrefValue = chartEntity.getURLText();
      final String tooltipValue = chartEntity.getToolTipText();
      if (StringUtils.isEmpty(tooltipValue) == false ||
          StringUtils.isEmpty(hrefValue) == false)
      {
        final AbstractImageMapEntry entry;
        if (chartEntity instanceof XYItemEntity ||
            chartEntity instanceof CategoryItemEntity ||
            chartEntity instanceof PieSectionEntity)
        {
          entry = createMapEntry(area, dataArea);
        }
        else
        {
          entry = createMapEntry(area, otherArea);
        }
        if (entry == null)
        {
          continue;
        }
        if (StringUtils.isEmpty(hrefValue) == false)
        {
          entry.setAttribute(LibXmlInfo.XHTML_NAMESPACE, "href", hrefValue);
        }
        else
        {
          entry.setAttribute(LibXmlInfo.XHTML_NAMESPACE, "href", "#");
        }
        if (StringUtils.isEmpty(tooltipValue) == false)
        {
          entry.setAttribute(LibXmlInfo.XHTML_NAMESPACE, "title", tooltipValue);
        }
        map.addMapEntry(entry);
      }
    }

    return map;
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.imagemap.ImageMap

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.