Package org.jfree.layouting.input.style

Examples of org.jfree.layouting.input.style.StyleKey


    public void addKeys (final StyleKey[] keys)
    {
      boolean haveAdded = false;
      for (int i = 0; i < keys.length; i++)
      {
        final StyleKey styleKey = keys[i];
        if (dependentKeySet.add(styleKey))
        {
          haveAdded = true;
        }
      }
View Full Code Here


    final StyleBuilder inialBuilder = new StyleBuilder(false);
    final StyleKey[] keys = StyleKeyRegistry.getRegistry().getKeys();
    for (int i = 0; i < keys.length; i++)
    {
      final StyleKey key = keys[i];
      if (key.isInherited())
      {
        inialBuilder.append(key, initialStyle.getValue(key));
      }
    }
    contexts.push(new ContextElement(inialBuilder));
View Full Code Here

    keys.addAll(compHandlers.keySet());
    keys.addAll(percHandlers.keySet());

    for (Iterator iterator = keys.iterator(); iterator.hasNext();)
    {
      final StyleKey key = (StyleKey) iterator.next();
      final ResolveHandler autoHandler = (ResolveHandler) autoHandlers.get(key);
      final ResolveHandler compHandler = (ResolveHandler) compHandlers.get(key);
      final ResolveHandler percHandler = (ResolveHandler) percHandlers.get(key);
      handlerList.add(new ResolveHandlerModule(key, autoHandler, compHandler,
              percHandler));
View Full Code Here

    final int length = configPrefix.length();
    while (sit.hasNext())
    {
      final String configkey = (String) sit.next();
      final String name = configkey.substring(length).toLowerCase();
      final StyleKey key = registry.findKeyByName(name);
      if (key == null)
      {
        continue;
      }
View Full Code Here

  {
    final LayoutContext layoutContext = node.getLayoutContext();
    for (int i = 0; i < handlers.length; i++)
    {
      final ResolveHandlerModule handler = handlers[i];
      final StyleKey key = handler.getKey();
      final CSSValue value = layoutContext.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

    {
      for (int i = 0; i < entries.length; i++)
      {
        final Map.Entry entry = entries[i];
        final CSSValueReadHandler valueReadHandler = (CSSValueReadHandler) entry.getValue();
        final StyleKey key = (StyleKey) entry.getKey();
        final CSSValue value = valueReadHandler.createValue(key, unit);
        if (value != null)
        {
          map.put(key, value);
          break;
View Full Code Here

  protected CSSValue resolveValue (final LayoutProcess 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

    final StyleBuilder inialBuilder = new StyleBuilder(false);
    final StyleKey[] keys = StyleKeyRegistry.getRegistry().getKeys();
    for (int i = 0; i < keys.length; i++)
    {
      final StyleKey key = keys[i];
      if (key.isInherited())
      {
        inialBuilder.append(key, initialStyle.getValue(key));
      }
    }
    contexts.push(new ContextElement(inialBuilder));
View Full Code Here

    {
      // ok, manual copy ..
      Log.debug ("Failed to use fast-copy");
      for (int i = 0; i < keys.length; i++)
      {
        final StyleKey key = keys[i];
        layoutContext.setValue(key, initialStyle.getValue(key));
      }
    }

    final LayoutStyle parentStyle;
    if (parent != null)
    {
      parentStyle = parent.getLayoutContext();
      final StyleKey[] inheritedKeys = getInheritedKeys();
      for (int i = 0; i < inheritedKeys.length; i++)
      {
        final StyleKey key = inheritedKeys[i];
        layoutContext.setValue(key, parentStyle.getValue(key));
      }
    }
    else
    {
      parentStyle = initialStyle;
    }

    // Stage 1b: Find all matching stylesheets for the given element
    performSelectionStep(element, layoutContext);

    // Stage 1c: Add the contents of the style attribute, if there is one ..
    // the libLayout style is always added: This is a computed style and the hook
    // for a element neutral user defined tweaking ..

    final AttributeMap attributes = layoutContext.getAttributes();
    final Object libLayoutStyleValue = attributes.getAttribute
            (Namespaces.LIBLAYOUT_NAMESPACE, "style");
    // You cannot override element specific styles with that. So an HTML-style
    // attribute has move value than a LibLayout-style attribute.
    addStyleFromAttribute(element, libLayoutStyleValue);

    if (strictStyleMode)
    {
      performStrictStyleAttr(element);
    }
    else
    {
      performCompleteStyleAttr(element);
    }

    // Stage 2: Compute the 'specified' set of values.
    // Find all explicitly inherited styles and add them from the parent.
    final CSSInheritValue inheritInstance = CSSInheritValue.getInstance();
    for (int i = 0; i < keys.length; i++)
    {
      final StyleKey key = keys[i];
      final Object value = layoutContext.getValue(key);
      if (inheritInstance.equals(value))
      {
        layoutContext.setValue(key, parentStyle.getValue(key));
      }
View Full Code Here

TOP

Related Classes of org.jfree.layouting.input.style.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.