Package net.sf.jasperreports.engine

Examples of net.sf.jasperreports.engine.JRPrintElement


  public JRPrintElement convert(ReportConverter reportConverter,
      JRElement element)
  {
    JRComponentElement componentElement = (JRComponentElement) element;
    JRPrintElement converted = null;
    ComponentKey componentKey = componentElement.getComponentKey();
    if (componentKey != null)
    {
      ComponentManager manager = ComponentsEnvironment.getComponentManager(
          componentKey);
View Full Code Here


   */
  private void mirrorElements(List elements, int x, int width)
  {
    for (Iterator it = elements.iterator(); it.hasNext();)
    {
      JRPrintElement element = (JRPrintElement) it.next();
      int mirrorX = width - element.getX() - element.getWidth();
      element.setX(mirrorX);
    }
  }
View Full Code Here

  {
    if(elements != null && elements.size() > 0)
    {
      for(Iterator it = elements.iterator(); it.hasNext();)
      {
        JRPrintElement element = (JRPrintElement)it.next();

        JRImageMapRenderer imageMap = null;
        if (element instanceof JRPrintImage)
        {
          JRRenderable renderer = ((JRPrintImage) element).getRenderer();
          if (renderer instanceof JRImageMapRenderer)
          {
            imageMap = (JRImageMapRenderer) renderer;
            if (!imageMap.hasImageAreaHyperlinks())
            {
              imageMap = null;
            }
          }
        }
        boolean hasImageMap = imageMap != null;

        JRPrintHyperlink hyperlink = null;
        if (element instanceof JRPrintHyperlink)
        {
          hyperlink = (JRPrintHyperlink) element;
        }
        boolean hasHyperlink = !hasImageMap
          && hyperlink != null && hyperlink.getHyperlinkTypeValue() != HyperlinkTypeEnum.NONE;
        boolean hasTooltip = hyperlink != null && hyperlink.getHyperlinkTooltip() != null;

        if (hasHyperlink || hasImageMap || hasTooltip)
        {
          JPanel link;
          if (hasImageMap)
          {
            Rectangle renderingArea = new Rectangle(0, 0, element.getWidth(), element.getHeight());
            link = new ImageMapPanel(renderingArea, imageMap);
          }
          else //hasImageMap
          {
            link = new JPanel();
            if (hasHyperlink)
            {
              link.addMouseListener(mouseListener);
            }
          }

          if (hasHyperlink)
          {
            link.setCursor(new Cursor(Cursor.HAND_CURSOR));
          }

          link.setLocation(
            (int)((element.getX() + offsetX) * realZoom),
            (int)((element.getY() + offsetY) * realZoom)
            );
          link.setSize(
            (int)(element.getWidth() * realZoom),
            (int)(element.getHeight() * realZoom)
            );
          link.setOpaque(false);

          String toolTip = getHyperlinkTooltip(hyperlink);
          if (toolTip == null && hasImageMap)
View Full Code Here

  {
    if (elements != null && elements.size() > 0)
    {
      for(Iterator it = elements.iterator(); it.hasNext();)
      {
        JRPrintElement element = (JRPrintElement)it.next();

        if (filter == null || filter.isToExport(element))
        {
          tagHelper.startElement(element);
View Full Code Here

  protected int getXLimit(List printElements)
  {
    int limit = Integer.MIN_VALUE;
    for (Iterator it = printElements.iterator(); it.hasNext();)
    {
      JRPrintElement element = (JRPrintElement) it.next();
      if (element.getX() + element.getWidth() > limit)
      {
        limit = element.getX() + element.getWidth();
      }
    }
    return limit;
  }
View Full Code Here

  protected void mirrorPrintElements(List printElements)
  {
    for (Iterator it = printElements.iterator(); it.hasNext();)
    {
      JRPrintElement element = (JRPrintElement) it.next();
      int mirrorX = getWidth() - element.getX() - element.getWidth();
      element.setX(mirrorX);
    }
  }
View Full Code Here

      JRLineBox lineBox = gridCell.getBox();
      if (lineBox != null)
      {
        setBox(lineBox);
      }
      JRPrintElement element = gridCell.getElement();
      if (element instanceof JRCommonGraphicElement)
      {
        setPen(((JRCommonGraphicElement)element).getLinePen());
      }
      hash = computeHash();
View Full Code Here

  {
    java.util.List elements = band.getElements();

    if (elements != null && elements.size() > 0)
    {
      JRPrintElement element = null;
      for(Iterator it = elements.iterator(); it.hasNext();)
      {
        element = (JRPrintElement)it.next();
        element.setX(element.getX() + offsetX);
        element.setY(element.getY() + offsetY);
        printPage.addElement(element);
      }
    }
  }
View Full Code Here

  /**
   *
   */
  public int compare(Object obj1, Object obj2)
  {
    JRPrintElement elem1 = (JRPrintElement)obj1;
    JRPrintElement elem2 = (JRPrintElement)obj2;
   
    if (elem1.getY() == elem2.getY())
    {
      return elem1.getX() - elem2.getX();
    }
    else
    {
      return elem1.getY() - elem2.getY();
    }
  }
View Full Code Here

       
        element.setAlreadyPrinted(element.isToPrint() || element.isAlreadyPrinted());
       
        if (element.isToPrint())
        {
          JRPrintElement printElement = element.fill();
          //printElement.setY(printElement.getY() - firstY);

          if (printElement != null)
          {
            //FIXME not all elements affect height
View Full Code Here

TOP

Related Classes of net.sf.jasperreports.engine.JRPrintElement

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.