Package org.pentaho.reporting.libraries.css.model

Examples of org.pentaho.reporting.libraries.css.model.StyleKey


    node.getLayoutStyle().setValue(InternalStyleKeys.INTERNAL_CONTENT, new ContentSpecification());

    for (int i = 0; i < handlers.length; i++)
    {
      final ResolveHandlerModule handler = handlers[i];
      final StyleKey key = handler.getKey();
      final CSSValue value = node.getLayoutStyle().getValue(key);

      final ResolveHandler autoValueHandler = handler.getAutoValueHandler();
      if (autoValueHandler != null)
      {
View Full Code Here


    if (autoValueHandler != null)
    {
      final StyleKey[] keys = autoValueHandler.getRequiredStyles();
      for (int i = 0; i < keys.length; i++)
      {
        final StyleKey styleKey = keys[i];
        dependentKeys.add(styleKey);
      }
    }

    if (computedValueHandler != null)
    {
      final StyleKey[] keys = computedValueHandler.getRequiredStyles();
      for (int i = 0; i < keys.length; i++)
      {
        final StyleKey styleKey = keys[i];
        dependentKeys.add(styleKey);
      }
    }

    if (percentagesValueHandler != null)
    {
      final StyleKey[] keys = percentagesValueHandler.getRequiredStyles();
      for (int i = 0; i < keys.length; i++)
      {
        final StyleKey styleKey = keys[i];
        dependentKeys.add(styleKey);
      }
    }

    this.dependentKeys = (StyleKey[])
View Full Code Here

      if (element == null)
      {
        final StyleKey[] propertyKeys = rule.getPropertyKeysAsArray();
        for (int i = 0; i < propertyKeys.length; i++)
        {
          final StyleKey key = propertyKeys[i];
          final CSSValue propertyCSSValue = rule.getPropertyCSSValue(key);
          if (propertyCSSValue != null)
          {
            target.setValue(key, propertyCSSValue);
          }
        }
        return;
      }

      final StyleKey[] propertyKeys = rule.getPropertyKeysAsArray();
      final CSSValue[] values = rule.getStyleValues();
      for (int i = 0; i < values.length; i++)
      {
        final StyleKey key = propertyKeys[i];
        final CSSValue value = rule.getPropertyCSSValue(key);
        if (ContentStyleKeys.CONTENT.equals(key) ||
            ContentStyleKeys.STRING_DEFINE.equals(key) ||
            ContentStyleKeys.STRING_SET.equals(key))
        {
          // dont resolve that one ..
          values[i] = value;
        }
        else
        {
          values[i] = resolveValue(value, element);
        }
      }

      for (int i = 0; i < values.length; i++)
      {
        final StyleKey key = propertyKeys[i];

        final CSSValue value = values[i];
        if (value != null)
        {
          target.setValue(key, value);
View Full Code Here

  protected CSSValue resolveValue (final DocumentContext process,
                                   final LayoutElement currentNode,
                                   final StyleKey key)
  {
    final StyleKey borderStyleKey = (StyleKey) keyMapping.get(key);
    if (borderStyleKey == null)
    {
      // invalid
      throw new IllegalArgumentException("This is not a valid key: " + key);
    }
View Full Code Here

  /**
   * Tests the style resolution to make sure the <code>StyleResolver</code> class is initialized correctly
   */
  public void testStyleResolver() throws ResourceException
  {
    final StyleKey fontFamily = StyleKeyRegistry.getRegistry().findKeyByName("font-family");
    final StyleKey fontSize = StyleKeyRegistry.getRegistry().findKeyByName("font-size");
    final StyleKey fontWeight = StyleKeyRegistry.getRegistry().findKeyByName("font-weight");
    final StyleKey fontStyle = StyleKeyRegistry.getRegistry().findKeyByName("font-style");
    final StyleKey textAlign = StyleKeyRegistry.getRegistry().findKeyByName("text-align");
    final StyleKey color = StyleKeyRegistry.getRegistry().findKeyByName("color");
    final StyleKey backgroundColor = StyleKeyRegistry.getRegistry().findKeyByName("background-color");
    assertNotNull("Could not retrieve the StyleKey for [font-family]", fontFamily);
    assertNotNull("Could not retrieve the StyleKey for [font-size]", fontSize);
    assertNotNull("Could not retrieve the StyleKey for [font-weight]", fontWeight);
    assertNotNull("Could not retrieve the StyleKey for [font-style]", fontStyle);
    assertNotNull("Could not retrieve the StyleKey for [text-align]", textAlign);
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.css.model.StyleKey

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.