Package org.jfree.resourceloader

Examples of org.jfree.resourceloader.ResourceManager


                          SACMediaList media,
                          String defaultNamespaceURI)
      throws CSSException
  {
    //  instantiate a new parser and parse the stylesheet.
    final ResourceManager manager = getResourceManager();
    if (manager == null)
    {
      // there is no source set, so we have no resource manager, and thus
      // we do no parsing.
      //
      // This should only be the case if we parse style-values; in that case
      // include-statement are not supported anyway.
      return;
    }
    try
    {
      CSSParserContext.getContext().setDefaultNamespace(defaultNamespaceURI);
      final ResourceKey key;
      if (source == null)
      {
        key = manager.createKey(uri);
      }
      else
      {
        key = manager.deriveKey(source, uri);
      }

      final Resource res = manager.create(key, source, StyleSheet.class);
      if (res == null)
      {
        return;
      }
      final StyleSheet styleSheet = (StyleSheet) res.getResource();
View Full Code Here


        final ResourceKey baseKey =

            DocumentContextUtility.getBaseResource(process.getDocumentContext());

        final ResourceManager resourceManager =

            DocumentContextUtility.getResourceManager(process.getDocumentContext());

        final URL url = resourceManager.toURL(baseKey);

        if (url != null)

        {
View Full Code Here

          final ResourceKey baseKey =

              DocumentContextUtility.getBaseResource(process.getDocumentContext());

          final ResourceManager resourceManager =

              DocumentContextUtility.getResourceManager(process.getDocumentContext());

          final URL url = resourceManager.toURL(baseKey);

          if (url != null)

          {
View Full Code Here

        final ResourceKey baseKey =

            DocumentContextUtility.getBaseResource(process.getDocumentContext());

        final ResourceManager resourceManager =

            DocumentContextUtility.getResourceManager(process.getDocumentContext());

        final URL url = resourceManager.toURL(baseKey);

        if (url != null)

        {
View Full Code Here

  public ResourceManager getResourceManager()
  {
    final Object o = getMetaAttribute(RESOURCE_MANAGER_ATTR);
    if (o instanceof ResourceManager == false)
    {
      ResourceManager value = new ResourceManager();
      value.registerDefaults();
      setMetaAttribute(RESOURCE_MANAGER_ATTR, value);
      return value;
    }
    return (ResourceManager) o;
  }
View Full Code Here

                                              final Object value,
                                              final Class[] type)
          throws FunctionEvaluationException
  {
    // ok, this is going to be expensive. Kids, you dont wanna try this at home ...
    final ResourceManager manager = process.getResourceManager();
    final ResourceKey baseKey = DocumentContextUtility.getBaseResource
            (process.getDocumentContext());
    try
    {
      final ResourceKey key;
      if (value instanceof ResourceKey)
      {
        key = (ResourceKey) value;
      }
      else if (baseKey == null)
      {
        key = manager.createKey(value);
      }
      else if (value instanceof String)
      {
        key = manager.deriveKey(baseKey, (String) value);
      }
      else
      {
        throw new FunctionEvaluationException
                ("Failed to create URI: Resource loading failed: Key not derivable");
      }

      final Resource res = manager.create(key, baseKey, type);
      return new CSSResourceValue(res);
    }
    catch (Exception e)
    {
      throw new FunctionEvaluationException
View Full Code Here

  {
    try
    {
      final DocumentContext context = layoutProcess.getDocumentContext();
      final ResourceKey base = DocumentContextUtility.getBaseResource(context);
      final ResourceManager resourceManager =
              layoutProcess.getResourceManager();

      if (base != null)
      {
        try
        {
          return resourceManager.deriveKey(base, uri);
        }
        catch(ResourceKeyCreationException ex)
        {
          // ignore ..
        }
      }
      return resourceManager.createKey(uri);
    }
    catch (Exception e)
    {
      return null;
    }
View Full Code Here

        final LayoutProcess layoutProcess = getLayoutProcess();
        final byte[] bytes = styleText.getBytes("UTF-8");
        final ResourceKey baseKey =
                DocumentContextUtility.getBaseResource
                        (layoutProcess.getDocumentContext());
        final ResourceManager manager = layoutProcess.getResourceManager();
        final ResourceKey key = manager.createKey(bytes);
        final Resource resource = manager.create(key, baseKey, StyleRule.class);

        final CSSDeclarationRule rule =
                (CSSDeclarationRule) resource.getResource();
        if (rule != null)
        {
View Full Code Here

  protected static synchronized ResourceManager getResourceManager ()
  {
    if (resourceManager == null)
    {
      resourceManager = new ResourceManager();
      resourceManager.registerDefaults();
      resourceManager.registerFactory(new BaseFontResourceFactory());
    }
    return resourceManager;
  }
View Full Code Here

      throw new NullPointerException();
    }

    final StyleSheet parentStyle = getParentStyle();
    final ResourceKey source;
    final ResourceManager resourceManager;
    if (parentStyle == null)
    {
      source = null;
      resourceManager = null;
    }
View Full Code Here

TOP

Related Classes of org.jfree.resourceloader.ResourceManager

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.