Package org.jfree.layouting.util

Examples of org.jfree.layouting.util.AttributeMap


      return vlc;
    }


    final Element node = (Element) getNode();
    final AttributeMap vdSection = node.getAttributeMap();
    target.startElement(vdSection);

    final FormattedTextElement[] variables = collection.getVariables();
    for (int i = 0; i < variables.length; i++)
    {
      final FormattedTextElement variable = variables[i];
      final String varName = collection.getNamePrefix() + (i + 1);
      final AttributeMap map = generateVariableSetSection(variable);
      map.setAttribute(OfficeNamespaces.TEXT_NS, "name", varName);
      target.startElement(map);
      target.endElement(map);

    }
    target.endElement(vdSection);
View Full Code Here


  }

  private AttributeMap generateVariableSetSection(final FormattedTextElement variable)
      throws DataSourceException
  {
    final AttributeMap variableSection = new AttributeMap();
    variableSection.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.NAMESPACE_ATTRIBUTE, OfficeNamespaces.TEXT_NS);
    variableSection.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.TYPE_ATTRIBUTE, "variable-set");
    variableSection.setAttribute(OfficeNamespaces.TEXT_NS, "display", "none");

    final FormulaExpression valueExpression = variable.getValueExpression();
    final Object value = LayoutControllerUtil.evaluateExpression(getFlowController(), variable, valueExpression);
    String formula = FormatValueUtility.applyValueForVariable(value, variableSection);
    if ( formula == null )
        formula = "" + value;
    if (value instanceof java.sql.Date)
    {
        final Date date = (Date)value;
        final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy;MM;dd");
        formula = "Date(" + dateFormat.format(date) + ")";
    }
    variableSection.setAttribute(OfficeNamespaces.TEXT_NS, "formula", "ooow:" + formula);
   
    return variableSection;
  }
View Full Code Here

  }

  protected AttributeMap computeAttributes(final FlowController fc, final Element element, final ReportTarget target)
      throws DataSourceException
  {
    final AttributeMap map = new AttributeMap( super.computeAttributes(fc, element, target) );
    map.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, "iteration-count", Integer.valueOf(getIterationCount()));
    map.makeReadOnly();
    return map;
  }
View Full Code Here

        if (linkTarget == null)
        {
            return;
        }

        final AttributeMap image = new AttributeMap();
        image.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.NAMESPACE_ATTRIBUTE, JFreeReportInfo.REPORT_NAMESPACE);
        image.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.TYPE_ATTRIBUTE, OfficeToken.IMAGE);
        image.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, OfficeToken.SCALE, scale);
        image.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, OfficeToken.PRESERVE_IRI, String.valueOf(preserveIri));
        image.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, "image-context", createContext());
        image.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, OfficeToken.IMAGE_DATA, linkTarget);
        target.startElement(image);
        target.endElement(image);
    }
View Full Code Here

  protected void performStartElement(final String namespace, final String name)
  {
    this.namespace = namespace;
    this.tagName = name;
    this.currentAttributes = new AttributeMap();
  }
View Full Code Here

                                              final LayoutContext parent)
  {
    final LayoutElement parentElement = new LayoutElement(null, null, parent);
    final DefaultLayoutContext anonymousContext = new DefaultLayoutContext
            (id, Namespaces.LIBLAYOUT_NAMESPACE,
                    "anonymous-context", null, new AttributeMap());
    final LayoutElement anonymousElement = new LayoutElement
            (parentElement, null, anonymousContext);
    resolveOutOfContext(anonymousElement);
    return anonymousContext;
  }
View Full Code Here

    if (params.length >= 3)
    {
      type = FunctionUtilities.resolveString(layoutProcess, element, params[2]);
    }

    final AttributeMap attributes = element.getLayoutContext().getAttributes();
    if (namespace == null || "".equals(namespace))
    {
      final Object value = attributes.getAttribute
              (element.getLayoutContext().getNamespace(), name);
      return convertValue(layoutProcess, value, type);

    }
    else if ("*".equals(namespace))
    {
      // this is a lot of work. Query all attributes in all namespaces...
      final Object value = attributes.getFirstAttribute(name);
      return convertValue(layoutProcess, value, type);
    }
    else
    {
      // thats easy.
      final Object value = attributes.getAttribute
              (namespace, name);
      return convertValue(layoutProcess, value, type);
    }
  }
View Full Code Here

        if (namespaceURI == null)
        {
          namespaceURI = layoutContext.getNamespace();
        }

        final AttributeMap attributes = layoutContext.getAttributes();
        final Object attr = attributes.getAttribute
            (namespaceURI, ac.getLocalName());
        if (ac.getValue() == null)
        {
          // dont care what's inside, as long as there is a value ..
          return attr != null;
        }
        else
        {
          return ObjectUtilities.equal(attr, ac.getValue());
        }
      }
      case Condition.SAC_CLASS_CONDITION:
      {
        final AttributeCondition ac = (AttributeCondition) condition;
        final LayoutContext layoutContext = node.getLayoutContext();
        final String namespace = layoutContext.getNamespace();
        if (namespace == null)
        {
          return false;
        }
        final NamespaceDefinition ndef = namespaces.getDefinition(namespace);
        if (ndef == null)
        {
          return false;
        }
        final String[] classAttribute = ndef.getClassAttribute(
            layoutContext.getTagName());
        for (int i = 0; i < classAttribute.length; i++)
        {
          final String attr = classAttribute[i];
          final String htmlAttr = (String)
              layoutContext.getAttributes().getAttribute(
                  namespace, attr);
          if (isOneOfAttributes(htmlAttr, ac.getValue()))
          {
            return true;
          }
        }
        return false;
      }
      case Condition.SAC_ID_CONDITION:
      {
        final AttributeCondition ac = (AttributeCondition) condition;
        final LayoutContext layoutContext = node.getLayoutContext();
        final AttributeMap attributes = layoutContext.getAttributes();
        final Object id = attributes.getAttribute(Namespaces.XML_NAMESPACE,
            "id");
        return ObjectUtilities.equal(ac.getValue(), id);
      }
      case Condition.SAC_LANG_CONDITION:
      {
View Full Code Here

   * which always returns null.
   */
  protected Element()
  {
    this.style = new CSSStyleRule(null, null);
    this.attributes = new AttributeMap();
    this.enabled = true;
    setNamespace(JFreeReportInfo.REPORT_NAMESPACE);
  }
View Full Code Here

    {
      if (function == null)
      {
        return;
      }
      this.attributeExpressions = new AttributeMap();
    }
    attributeExpressions.setAttribute(namespace, attr, function);
    readOnlyAttributeExpressions = null;
  }
View Full Code Here

TOP

Related Classes of org.jfree.layouting.util.AttributeMap

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.