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

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


  private ArrayList readHandlerArrayList;
 
  public ImageMapReadHandler()
  {
    readHandlerArrayList = new ArrayList();
    imageMap = new ImageMap();
  }
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

                               final ReportMouseEvent event)
    {
      if (node instanceof RenderableReplacedContentBox)
      {
        // process image map
        final ImageMap imageMap = RenderUtility.extractImageMap((RenderableReplacedContentBox) node);
        if (imageMap != null)
        {
          final PageDrawable physicalPageDrawable = drawablePanel.getPageDrawable();
          final PageFormat pf = physicalPageDrawable.getPageFormat();
          final float x1 = (float) (event.getSourceEvent().getX() / zoom);
          final float y1 = (float) (event.getSourceEvent().getY() / zoom);
          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 i = 0; i < imageMapEntries.length; i++)
          {
            final ImageMapEntry entry = imageMapEntries[i];
            final Object imageMapTarget = entry.getAttribute(LibXmlInfo.XHTML_NAMESPACE, "href");
            if (imageMapTarget != null)
View Full Code Here

        return;
      }

      //xmlWriter.writeComment("Drawable content:" + source);
      // Write image reference ..
      final ImageMap imageMap;
      final AttributeList attrList = new AttributeList();
      attrList.setAttribute(HtmlPrinter.XHTML_NAMESPACE, SRC_ATTR, name);
      attrList.setAttribute(HtmlPrinter.XHTML_NAMESPACE, "border", "0");

      final Object imageMapNameOverride = attributes.getAttribute
          (AttributeNames.Html.NAMESPACE, AttributeNames.Html.IMAGE_MAP_OVERRIDE);
      if (imageMapNameOverride != null)
      {
        attrList.setAttribute(HtmlPrinter.XHTML_NAMESPACE, USEMAP_ATTR, String.valueOf(imageMapNameOverride));
        imageMap = null;
      }
      else
      {
        // 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.
        imageMap = RenderUtility.extractImageMap(node);

        if (imageMap != null)
        {
          final String mapName = imageMap.getAttribute(HtmlPrinter.XHTML_NAMESPACE, "name");
          if (mapName != null)
          {
            attrList.setAttribute(HtmlPrinter.XHTML_NAMESPACE, USEMAP_ATTR, "#" + mapName);
          }
          else
          {
            final String generatedName = "generated_" + name + "_map"; //NON-NLS
            imageMap.setAttribute(HtmlPrinter.XHTML_NAMESPACE, "name", generatedName);
            //noinspection MagicCharacter
            attrList.setAttribute(HtmlPrinter.XHTML_NAMESPACE, USEMAP_ATTR, '#' + generatedName);//NON-NLS
          }
        }
      }
View Full Code Here

    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

      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);
        }
        if (StringUtils.isEmpty(tooltipValue) == false)
        {
          entry.setAttribute(LibXmlInfo.XHTML_NAMESPACE, "title", tooltipValue);
        }
        map.addMapEntry(entry);
      }
    }

    return map;
  }
View Full Code Here

    }
    // width and height and scaling and so on ..

    // BI-SERVER 11651: The extractImageMap function will fill the "attrList" parameter with the name
    // of the image map, if there is one. So we have to call this method first.
    final ImageMap imageMap = extractImageMap(attrs, drawable, width, height, name, attrList);

    writeImageTag(styleSheet, width, height, contentWidth, contentHeight, attrList);

    if (imageMap != null)
    {
View Full Code Here

  private ImageMap extractImageMap(final ReportAttributeMap attributes,
                                   final Object rawObject,
                                   final long width, final long height,
                                   final String name, final AttributeList attrList)
  {
    final ImageMap imageMap;
    final Object imageMapNameOverride = attributes.getAttribute
        (AttributeNames.Html.NAMESPACE, AttributeNames.Html.IMAGE_MAP_OVERRIDE);
    if (imageMapNameOverride != null)
    {
      attrList.setAttribute(HtmlPrinter.XHTML_NAMESPACE, USEMAP_ATTR, String.valueOf(imageMapNameOverride));
      imageMap = null;
    }
    else
    {
      // 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.
      imageMap = RenderUtility.extractImageMap(attributes, rawObject, width, height);

      if (imageMap != null)
      {
        final String mapName = imageMap.getAttribute(HtmlPrinter.XHTML_NAMESPACE, "name");
        if (mapName != null)
        {
          attrList.setAttribute(HtmlPrinter.XHTML_NAMESPACE, USEMAP_ATTR, "#" + mapName);
        }
        else
        {
          final String generatedName = "generated_" + name + "_map"; //NON-NLS
          imageMap.setAttribute(HtmlPrinter.XHTML_NAMESPACE, "name", generatedName);
          //noinspection MagicCharacter
          attrList.setAttribute(HtmlPrinter.XHTML_NAMESPACE, USEMAP_ATTR, '#' + generatedName);//NON-NLS
        }
      }
    }
View Full Code Here

      attrList.setAttribute(HtmlPrinter.XHTML_NAMESPACE, ALT_ATTR, String.valueOf(altText));
    }
    // width and height and scaling and so on ..
    writeImageTag(styleSheet, width, height, contentWidth, contentHeight, attrList);

    final ImageMap imageMap = extractImageMap(attributes, null, width, height, name, attrList);
    if (imageMap != null)
    {
      ImageMapWriter.writeImageMap(xmlWriter, imageMap, RenderUtility.getNormalizationScale(metaData));
    }
View Full Code Here

                               final ReportMouseEvent event)
    {
      if (node instanceof RenderableReplacedContentBox)
      {
        // process image map
        final ImageMap imageMap = RenderUtility.extractImageMap((RenderableReplacedContentBox) node);
        if (imageMap != null)
        {
          final PageDrawable physicalPageDrawable = drawablePanel.getPageDrawable();
          final PageFormat pf = physicalPageDrawable.getPageFormat();
          final float x1 = (float) (event.getSourceEvent().getX() / zoom);
          final float y1 = (float) (event.getSourceEvent().getY() / zoom);
          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 i = 0; i < imageMapEntries.length; i++)
          {
            final ImageMapEntry entry = imageMapEntries[i];
            final Object imageMapTarget = entry.getAttribute(LibXmlInfo.XHTML_NAMESPACE, "href");
            if (imageMapTarget != null)
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.