Package org.jfree.resourceloader

Examples of org.jfree.resourceloader.Resource


    final CSSValue value = FunctionUtilities.resolveParameter(layoutProcess, element, params[0]);
    if (value instanceof CSSResourceValue)
    {
      final CSSResourceValue cssResourceValue =
              (CSSResourceValue) value;
      final Resource resource = cssResourceValue.getValue();
      return new ResourceContentToken(resource);
    }
    if (value instanceof CSSStringValue == false)
    {
      throw new FunctionEvaluationException
              ("Not even remotely an URI: " + value);
    }
    final CSSStringValue strval = (CSSStringValue) value;
    final CSSResourceValue cssResourceValue =
            FunctionUtilities.loadResource(layoutProcess, strval.getValue());
    final Resource resource = cssResourceValue.getValue();
    return new ResourceContentToken(resource);
  }
View Full Code Here


      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();
      this.styleSheet.addStyleSheet(styleSheet);
    }
    catch (ResourceException e)
    {
      // ignore ..
View Full Code Here

        final ResourceKey baseResource = root.getBaseResource();
        final ResourceManager resourceManager = root.getResourceManager();

        final byte[] bytes = styleText.getBytes("UTF-8");
        final ResourceKey key = resourceManager.createKey(bytes);
        final Resource resource = resourceManager.create
            (key, baseResource, StyleRule.class);

        final CSSDeclarationRule parsedRule =
            (CSSDeclarationRule) resource.getResource();
        mergeDeclarationRule(targetRule, parsedRule);
      }
      catch (Exception e)
      {
        // ignore ..
View Full Code Here

    ResourceManager resourceManager = new ResourceManager();
    resourceManager.registerDefaults();
    try
    {
      final Resource res = resourceManager.createDirectly
              ("res://com/sun/star/report/pentaho/parser/selectors.properties", Properties.class);
      final Properties resProps = (Properties) res.getResource();
      props.putAll(resProps);
    }
    catch (ResourceException e)
    {
      Log.warn("Unable to load mapping rules. Parsing services may not be available.", e);
View Full Code Here

  }

  public static StyleMapper loadInstance (final ResourceManager resourceManager)
      throws ResourceException
  {
    final Resource resource = resourceManager.createDirectly
        ("res://com/sun/star/report/pentaho/styles/stylemapper.xml", StyleMapper.class);
    return (StyleMapper) resource.getResource();
  }
View Full Code Here

    if (reportResource == null)
    {
      throw new JobDefinitionException("Report definition name must be given");
    }

    final Resource res = resourceManager.createDirectly
            ("sun:oo://" + reportResource, OfficeDocument.class);
    final OfficeDocument report = (OfficeDocument) res.getResource();
    report.setDataFactory(new StarReportDataFactory(dataSourceFactory));
    final ReportParameters inputParameters = report.getInputParameters();

    final ParameterMap queryParameters = definition.getQueryParameters();
    final String[] paramKeys = queryParameters.keys();
View Full Code Here

  private StyleSheet parseStyleSheet(final ResourceKey key,
                                     final ResourceKey context)
  {
    try
    {
      final Resource resource = resourceManager.create
          (key, context, StyleSheet.class);
      return (StyleSheet) resource.getResource();
    }
    catch (ResourceException e)
    {
      Log.info("Unable to parse StyleSheet: " + e.getLocalizedMessage());
    }
View Full Code Here

    CSSValue value = FunctionUtilities.resolveParameter(layoutProcess, element, params[0]);
    if (value instanceof CSSResourceValue)
    {
      final CSSResourceValue cssResourceValue =
              (CSSResourceValue) value;
      final Resource resource = cssResourceValue.getValue();
      return new ResourceContentToken(resource);
    }
    if (value instanceof CSSStringValue == false)
    {
      throw new FunctionEvaluationException
              ("Not even remotely an URI: " + value);
    }
    final CSSStringValue strval = (CSSStringValue) value;
    final CSSResourceValue cssResourceValue =
            FunctionUtilities.loadResource(layoutProcess, strval.getValue());
    final Resource resource = cssResourceValue.getValue();
    return new ResourceContentToken(resource);
  }
View Full Code Here

  {
    this.initialStyle = new LayoutStyleImpl();
    try
    {
      final ResourceManager manager = layoutProcess.getResourceManager();
      final Resource resource = manager.createDirectly
              ("res://org/jfree/layouting/initial.css", StyleSheet.class);
      final StyleSheet initialStyleSheet = (StyleSheet) resource.getResource();

      int rc = initialStyleSheet.getRuleCount();
      for (int i = 0; i < rc; i++)
      {
        final StyleRule rule = initialStyleSheet.getRule(i);
View Full Code Here

  {
    if (backgroundImages == null)
    {
      return null;
    }
    Resource retval = (Resource)
            backgroundImages.get(i % backgroundImages.size());
    if (retval == null)
    {
      return null;
    }
View Full Code Here

TOP

Related Classes of org.jfree.resourceloader.Resource

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.