Package org.jfree.layouting.layouter.i18n

Examples of org.jfree.layouting.layouter.i18n.LocalizationContext


    {
      throw new FunctionEvaluationException("Illegal parameter count");
    }
    final CSSValue rawValue = FunctionUtilities.resolveParameter(layoutProcess, element, params[0]);
    final String typeValue = FunctionUtilities.resolveString(layoutProcess, element, params[1]);
    final LocalizationContext localizationContext =
            DocumentContextUtility.getLocalizationContext
                    (layoutProcess.getDocumentContext());
    final LayoutContext layoutContext = element.getLayoutContext();
    if ("date".equals(typeValue))
    {
      if (params.length < 3)
      {
        return getDateValue(rawValue,
                localizationContext.getDateFormat(layoutContext.getLanguage()));
      }
      else
      {
        final String format = FunctionUtilities.resolveString(layoutProcess, element, params[2]);
        return getDateValue(rawValue,
                localizationContext.getDateFormat(format, layoutContext.getLanguage()));
      }
    }
    else if ("time".equals(typeValue))
    {
      if (params.length != 2)
      {
        throw new FunctionEvaluationException();
      }
      return getDateValue(rawValue,
              localizationContext.getTimeFormat(layoutContext.getLanguage()));
    }
    else if ("number".equals(typeValue))
    {
      if (params.length < 3)
      {
        return getNumberValue(rawValue,
                localizationContext.getDateFormat(layoutContext.getLanguage()));
      }
      else
      {
        final String format = FunctionUtilities.resolveString(layoutProcess, element, params[2]);
        return getNumberValue(rawValue,
                localizationContext.getNumberFormat(format, layoutContext.getLanguage()));
      }
    }
    else if ("integer".equals(typeValue))
    {
      if (params.length != 2)
      {
        throw new FunctionEvaluationException();
      }
      return getNumberValue(rawValue,
              localizationContext.getIntegerFormat(layoutContext.getLanguage()));
    }
    throw new FunctionEvaluationException("FormatType not recognized");
  }
View Full Code Here


  {

    final Date date = DocumentContextUtility.getDate
            (layoutProcess.getDocumentContext());
    final CSSValue[] parameters = function.getParameters();
    final LocalizationContext localizationContext =
            DocumentContextUtility.getLocalizationContext
                    (layoutProcess.getDocumentContext());

    final DateFormat format = getDateFormat
            (parameters, localizationContext,
View Full Code Here

    {
      throw new FunctionEvaluationException("Illegal parameter count");
    }
    final CSSValue rawValue = FunctionUtilities.resolveParameter(layoutProcess, element, params[0]);
    final String typeValue = FunctionUtilities.resolveString(layoutProcess, element, params[1]);
    final LocalizationContext localizationContext =
            DocumentContextUtility.getLocalizationContext
                    (layoutProcess.getDocumentContext());
    final LayoutContext layoutContext = element.getLayoutContext();
    if ("date".equals(typeValue))
    {
      if (params.length < 3)
      {
        return getDateValue(rawValue,
                localizationContext.getDateFormat(layoutContext.getLanguage()));
      }
      else
      {
        final String format = FunctionUtilities.resolveString(layoutProcess, element, params[2]);
        return getDateValue(rawValue,
                localizationContext.getDateFormat(format, layoutContext.getLanguage()));
      }
    }
    else if ("time".equals(typeValue))
    {
      if (params.length != 2)
      {
        throw new FunctionEvaluationException();
      }
      return getDateValue(rawValue,
              localizationContext.getTimeFormat(layoutContext.getLanguage()));
    }
    else if ("number".equals(typeValue))
    {
      if (params.length < 3)
      {
        return getNumberValue(rawValue,
                localizationContext.getDateFormat(layoutContext.getLanguage()));
      }
      else
      {
        final String format = FunctionUtilities.resolveString(layoutProcess, element, params[2]);
        return getNumberValue(rawValue,
                localizationContext.getNumberFormat(format, layoutContext.getLanguage()));
      }
    }
    else if ("integer".equals(typeValue))
    {
      if (params.length != 2)
      {
        throw new FunctionEvaluationException();
      }
      return getNumberValue(rawValue,
              localizationContext.getIntegerFormat(layoutContext.getLanguage()));
    }
    throw new FunctionEvaluationException("FormatType not recognized");
  }
View Full Code Here

  {

    final Date date = DocumentContextUtility.getDate
            (layoutProcess.getDocumentContext());
    final CSSValue[] parameters = function.getParameters();
    final LocalizationContext localizationContext =
            DocumentContextUtility.getLocalizationContext
                    (layoutProcess.getDocumentContext());

    final DateFormat format = getDateFormat
            (parameters, localizationContext,
View Full Code Here

    {
      throw new FunctionEvaluationException("Illegal parameter count");
    }
    final CSSValue rawValue = FunctionUtilities.resolveParameter(layoutProcess, element, params[0]);
    final String typeValue = FunctionUtilities.resolveString(layoutProcess, element, params[1]);
    final LocalizationContext localizationContext =
            DocumentContextUtility.getLocalizationContext
                    (layoutProcess.getDocumentContext());
    final LayoutContext layoutContext = element.getLayoutContext();
    if ("date".equals(typeValue))
    {
      if (params.length < 3)
      {
        return getDateValue(rawValue,
                localizationContext.getDateFormat(layoutContext.getLanguage()));
      }
      else
      {
        final String format = FunctionUtilities.resolveString(layoutProcess, element, params[2]);
        return getDateValue(rawValue,
                localizationContext.getDateFormat(format, layoutContext.getLanguage()));
      }
    }
    else if ("time".equals(typeValue))
    {
      if (params.length != 2)
      {
        throw new FunctionEvaluationException();
      }
      return getDateValue(rawValue,
              localizationContext.getTimeFormat(layoutContext.getLanguage()));
    }
    else if ("number".equals(typeValue))
    {
      if (params.length < 3)
      {
        return getNumberValue(rawValue,
                localizationContext.getDateFormat(layoutContext.getLanguage()));
      }
      else
      {
        final String format = FunctionUtilities.resolveString(layoutProcess, element, params[2]);
        return getNumberValue(rawValue,
                localizationContext.getNumberFormat(format, layoutContext.getLanguage()));
      }
    }
    else if ("integer".equals(typeValue))
    {
      if (params.length != 2)
      {
        throw new FunctionEvaluationException();
      }
      return getNumberValue(rawValue,
              localizationContext.getIntegerFormat(layoutContext.getLanguage()));
    }
    throw new FunctionEvaluationException("FormatType not recognized");
  }
View Full Code Here

  {

    final Date date = DocumentContextUtility.getDate
            (layoutProcess.getDocumentContext());
    final CSSValue[] parameters = function.getParameters();
    final LocalizationContext localizationContext =
            DocumentContextUtility.getLocalizationContext
                    (layoutProcess.getDocumentContext());

    DateFormat format = getDateFormat
            (parameters, localizationContext,
View Full Code Here

TOP

Related Classes of org.jfree.layouting.layouter.i18n.LocalizationContext

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.