Package com.lightcrafts.media.jai.util

Examples of com.lightcrafts.media.jai.util.CaselessStringArrayTable


    public ParameterListDescriptorImpl() {
  this.numParams        = 0;
  this.paramNames       = null;
  this.paramClasses     = null;
  this.paramDefaults    = null;
  this.paramIndices     = new CaselessStringArrayTable();
  this.validParamValues = null;
    }
View Full Code Here


      this.numParams        = 0;
      this.paramNames       = null;
      this.paramClasses     = null;
      this.paramDefaults    = null;
      this.paramIndices     = new CaselessStringArrayTable();
      this.validParamValues = null;

  } else {

      if ((paramClasses == null) || (paramClasses.length != numParams))
         throw new IllegalArgumentException("paramClasses" +
                      JaiI18N.getString("ParameterListDescriptorImpl3"));

      this.numParams    = numParams;
      this.paramNames       = paramNames;
      this.paramClasses     = paramClasses;
      this.validParamValues = validParamValues;

      //
      // If the defaults are null, fill in NO_PARAMETER_DEFAULT
      // Else, make sure they belong to the right class.
      //
      if (paramDefaults == null) {
    this.paramDefaults = new Object[numParams];

    for (int i = 0; i < numParams; i++)
        this.paramDefaults[i] =
          ParameterListDescriptor.NO_PARAMETER_DEFAULT;
      } else {

    this.paramDefaults = paramDefaults;

    for (int i = 0; i < numParams; i++) {
        if ((paramDefaults[i] == null) ||
      (paramDefaults[i] ==
          ParameterListDescriptor.NO_PARAMETER_DEFAULT))
      continue;

        if (!paramClasses[i].isInstance(paramDefaults[i])) {
      throw new IllegalArgumentException(
            JaiI18N.formatMsg("ParameterListDescriptorImpl4",
            new Object[]
        { paramDefaults[i].getClass().getName(),
          paramClasses [i].getName(),
          paramNames[i] }));
        }
    }
      }

      //
      // Make sure that validParamValues belongs to the right class.
      //
      if (validParamValues != null) {

    Class enumeratedClass = EnumeratedParameter.class;

    for (int i = 0; i < numParams; i++) {

        if (validParamValues[i] == null)
      continue;

        if (enumeratedClass.isAssignableFrom(paramClasses[i])) {

      // If paramClass[i] is an enumerated parameter, then
      // the validParamValues[i] has to be a Set
      if (!(validParamValues[i] instanceof Set))
          throw new IllegalArgumentException(
            JaiI18N.formatMsg("ParameterListDescriptorImpl5",
            new Object[] { paramNames[i] }));

        } else if (validParamValues[i] instanceof Range) {

      Range range = (Range)validParamValues[i];

      // If the validParamValues[i] is a Range, then
      // the Range's class must match with paramClass[i]
      if (!paramClasses[i].isAssignableFrom(
              range.getElementClass()))
          throw new IllegalArgumentException(
            JaiI18N.formatMsg("ParameterListDescriptorImpl6",
            new Object[]
        { range.getElementClass().getName(),
          paramClasses[i].getName(),
          paramNames[i] }));

        } else {

      // Otherwise, the validParamValues[i] has to be
      // an instance of the paramClasses[i]
      if (!paramClasses[i].isInstance(validParamValues[i]))
          throw new IllegalArgumentException(
            JaiI18N.formatMsg("ParameterListDescriptorImpl7",
            new Object[]
        { validParamValues[i].getClass().getName(),
          paramClasses[i].getName(),
          paramNames[i] }));
        }
    }
      }

      paramIndices = new CaselessStringArrayTable(paramNames);
  }
    }
View Full Code Here

  this.supportedModes = supportedModes;
  this.sourceNames    = sourceNames;
  this.sourceClasses  = sourceClasses;
  this.paramNames     = paramNames;

  this.modeIndices   = new CaselessStringArrayTable(supportedModes);
  this.sourceIndices = new CaselessStringArrayTable(sourceNames);

  // Validate parameter related arguments.

  int numParams = (paramNames == null) ? 0 : paramNames.length;
  int numModes = supportedModes.length;
View Full Code Here

  this.supportedModes = supportedModes;
  this.sourceNames    = sourceNames;
  this.sourceClasses  = sourceClasses;
  this.paramNames     = paramNames;

  this.modeIndices   = new CaselessStringArrayTable(supportedModes);
  this.sourceIndices = new CaselessStringArrayTable(sourceNames);

  // Create one ParameterListDescriptor and use the same for each mode.

  ParameterListDescriptor pld = new ParameterListDescriptorImpl(
    this, paramNames, paramClasses, paramDefaults, validParamValues);
View Full Code Here

  this.supportedModes = supportedModes;
  this.sourceNames    = sourceNames;
  this.sourceClasses  = sourceClasses;
  this.paramNames     = paramNames;

  this.modeIndices   = new CaselessStringArrayTable(supportedModes);
  this.sourceIndices = new CaselessStringArrayTable(sourceNames);

  // Create one ParameterListDescriptor and use the same for each mode.

  ParameterListDescriptor pld = new ParameterListDescriptorImpl(
    this, paramNames, paramClasses, paramDefaults, validParamValues);
View Full Code Here

  this.resources      = resources;
  this.supportedModes = supportedModes;
  this.sourceNames    = sourceNames;
  this.sourceClasses  = sourceClasses;

  this.modeIndices   = new CaselessStringArrayTable(supportedModes);
  this.sourceIndices = new CaselessStringArrayTable(sourceNames);

  if ((pld != null) && (pld.length != supportedModes.length)) {
     throw new IllegalArgumentException(
      JaiI18N.formatMsg("OperationDescriptorImpl0",
      new Object[]
View Full Code Here

  this.resources      = resources;
  this.supportedModes = supportedModes;
  this.sourceNames    = sourceNames;
  this.sourceClasses  = sourceClasses;

  this.modeIndices   = new CaselessStringArrayTable(supportedModes);
  this.sourceIndices = new CaselessStringArrayTable(sourceNames);

  if (pld == null)
     pld = new ParameterListDescriptorImpl();

  this.paramNames    = pld.getParamNames();
View Full Code Here

  this.supportedModes = supportedModes;
  this.sourceNames    = sourceNames;
  this.sourceClasses  = sourceClassList;
  this.paramNames     = paramNames;

  this.modeIndices   = new CaselessStringArrayTable(supportedModes);
  this.sourceIndices = new CaselessStringArrayTable(sourceNames);

  // Create one ParameterListDescriptor and use the same for each mode.

  ParameterListDescriptor pld = new ParameterListDescriptorImpl(
    this, paramNames, paramClasses, paramDefaults, validParamValues);
View Full Code Here

  this.supportedModes = supportedModes;
  this.sourceNames    = sourceNames;
  this.sourceClasses  = sourceClassList;
  this.paramNames     = paramNames;

  this.modeIndices   = new CaselessStringArrayTable(supportedModes);
  this.sourceIndices = new CaselessStringArrayTable(sourceNames);

  // Create one ParameterListDescriptor and use the same for each mode.

  ParameterListDescriptor pld = new ParameterListDescriptorImpl(
    this, paramNames, paramClasses, paramDefaults, validParamValues);
View Full Code Here

  if (numParams > 0) {
      // Fill in the parameter defaults.
      Object[] paramDefaults = pld.getParamDefaults();

      paramClasses = pld.getParamClasses();
      paramIndices = new CaselessStringArrayTable(pld.getParamNames());
      paramValues  = new Object[numParams];

      for (int i = 0; i < numParams; i++) {
    paramValues[i] = paramDefaults[i];
      }
View Full Code Here

TOP

Related Classes of com.lightcrafts.media.jai.util.CaselessStringArrayTable

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.