Package org.jfree.layouting.util

Examples of org.jfree.layouting.util.AttributeMap


  {
  }

  protected AttributeMap computeAttributes(final FlowController flowController, final Element element, final ReportTarget reportTarget) throws DataSourceException
  {
    final AttributeMap map = new AttributeMap( super.computeAttributes(flowController, element, reportTarget));
    map.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, "role", "spreadsheet-section");
    map.makeReadOnly();
    return map;
  }
View Full Code Here


        final FormattedTextElement element = (FormattedTextElement) getNode();
        final VariablesCollection vc = getVariablesCollection();
        if (vc != null)
        {
            final String name = vc.addVariable(element);
            final AttributeMap variablesGet = new AttributeMap();
            variablesGet.setAttribute(JFreeReportInfo.REPORT_NAMESPACE,
                    Element.TYPE_ATTRIBUTE, "variable-get");
            variablesGet.setAttribute(JFreeReportInfo.REPORT_NAMESPACE,
                    Element.NAMESPACE_ATTRIBUTE, OfficeNamespaces.TEXT_NS);
            variablesGet.setAttribute(OfficeNamespaces.TEXT_NS, "name", name);
            //variablesGet.setAttribute(OfficeNamespaces.TEXT_NS, "display", "value");

            final String dataStyleName = computeValueStyle();
            if (dataStyleName != null)
            {
                variablesGet.setAttribute(OfficeNamespaces.STYLE_NS, "data-style-name", dataStyleName);
            }

            final String valueType = computeValueType();
            variablesGet.setAttribute(OfficeNamespaces.OFFICE_NS, FormatValueUtility.VALUE_TYPE, valueType);
            target.startElement(variablesGet);

            target.endElement(variablesGet);
        }
        else
View Full Code Here

  public static void main(String[] args)
  {
    LibLayoutBoot.getInstance().start();
    DefaultLayoutContext layoutContext =
            new DefaultLayoutContext
                    (new ContextId(0, 0,0), "Bah", "buh", null, new AttributeMap());
    layoutContext.getStyle().setValue(FontStyleKeys.FONT_FAMILY, new CSSConstant("helvetica"));
    final FontSpecification fontSpecification = layoutContext.getFontSpecification();
    fontSpecification.setFontFamily("Arial");
    fontSpecification.setFontSize(12);
View Full Code Here

  public void testMarginCreation()
  {
    DefaultElementContext elementContext = new DefaultElementContext(null);
    DefaultLayoutContext layoutContext = new DefaultLayoutContext
            (new ContextId(0, 0, 0), "Bah", "buh", null, new AttributeMap());

    RenderableTextFactory tr = new CollapseTest.MarginRenderableTextFactory(null);


    int[] text = new int[]{' ', ' ', ' ', ' ', ' ', ' '};
View Full Code Here

  public void testMarginCreation()
  {
    DefaultElementContext elementContext = new DefaultElementContext(null);
    DefaultLayoutContext layoutContext = new DefaultLayoutContext
            (new ContextId(0, 0, 0), "Bah", "buh", null, new AttributeMap());

    RenderableTextFactory tr = new MarginRenderableTextFactory(null);


    int[] text = new int[]{' ', 'A', ' ', ' ', 'B', ' '};
View Full Code Here

  public void testChunkCreation()
  {
    DefaultElementContext elementContext = new DefaultElementContext(null);
    DefaultLayoutContext layoutContext = new DefaultLayoutContext
            (new ContextId(0, 0, 0), "Bah", "buh", null, new AttributeMap());

    RenderableTextFactory tr = new MarginRenderableTextFactory(null);


    int[] text0 = new int[]{'A'};
View Full Code Here

    {
        final ObjectOleElement element = (ObjectOleElement) getNode();
        final String url = element.getUrl();
        if (url != null)
        {
            final AttributeMap ole = new AttributeMap();
            ole.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.NAMESPACE_ATTRIBUTE, JFreeReportInfo.REPORT_NAMESPACE);
            ole.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.TYPE_ATTRIBUTE, OfficeToken.OBJECT_OLE);
            ole.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, "href", url);
            ole.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, "class-id", element.getClassid());
            final List masterfields = element.getMasterfields();
            final List values = new ArrayList();
            final DataRow view = getFlowController().getMasterRow().getGlobalView();
            for (final Iterator iter = masterfields.iterator(); iter.hasNext();)
            {
                final String master = (String) iter.next();
                try
                {
                    final DataFlags flags = view.getFlags(master);
                    if (flags != null)
                    {
                        values.add(flags.getValue());
                    }
                }
                catch (DataSourceException e)
                {
                // ignore .. assume that the reference has not changed.
                }
            }
            ole.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, SDBCReportDataFactory.MASTER_COLUMNS, masterfields);
            ole.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, SDBCReportDataFactory.MASTER_VALUES, values);
            ole.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, SDBCReportDataFactory.DETAIL_COLUMNS, element.getDetailfields());

            target.startElement(ole);
            target.endElement(ole);
        }
View Full Code Here

    }

    protected AttributeMap computeAttributes(final FlowController fc, final Element element, final ReportTarget target)
            throws DataSourceException
    {
        final AttributeMap attributeMap = new AttributeMap( super.computeAttributes(fc, element, target) );
        final Section s = (Section) element;
        int rowCount = 0;
        final Node[] nodeArray = s.getNodeArray();
        for (int i = 0; i < nodeArray.length; i++)
        {
            final Node node = nodeArray[i];
            if (node instanceof Element)
            {
                final Element child = (Element) node;
                if (OfficeNamespaces.TABLE_NS.equals(child.getNamespace()) &&
                        OfficeToken.TABLE_ROW.equals(child.getType()))
                {
                    rowCount += 1;
                }
            }
        }

        attributeMap.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, "table-row-count", IntegerCache.getInteger(rowCount));
        attributeMap.makeReadOnly();
        return attributeMap;
    }
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) );
    final String value = String.valueOf(repeatHeader || repeatFooter);
    map.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, "repeating-header-or-footer", value);
    map.makeReadOnly();
    return map;
  }
View Full Code Here

    protected AttributeMap computeAttributes(final FlowController fc,
            final Element element,
            final ReportTarget target)
            throws DataSourceException
    {
        final AttributeMap attributeMap = new AttributeMap(super.computeAttributes(fc, element, target));
        final String definedStyle = (String) attributeMap.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME);
        final String valueType = (String) attributeMap.getAttribute(OfficeNamespaces.OFFICE_NS, FormatValueUtility.VALUE_TYPE);
        attributeMap.setAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME, getDisplayStyleName((Section) element, definedStyle));

        try
        {
            final DataFlags value = computeValue();
            if (value != null)
            {
                FormatValueUtility.applyValueForCell(value.getValue(), attributeMap,valueType);
            }
        }
        catch (Exception e)
        {
        // ignore ..
        }
        attributeMap.makeReadOnly();
        return attributeMap;
    }
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.