Tabnine Logo
ParameterList
Code IndexAdd Tabnine to your IDE (free)

How to use
ParameterList
in
javax.media.jai

Best Java code snippets using javax.media.jai.ParameterList (Showing top 20 results out of 315)

origin: geotools/geotools

/** Returns the string value of an operation parameter. */
public String stringValue() throws InvalidParameterTypeException {
  final String name = getName();
  try {
    // Really cast to CharSequence (even if not needed for toString())
    // because we want the ClassCastException if the type mismatch.
    return ((CharSequence) parameters.getObjectParameter(name)).toString();
  } catch (ClassCastException exception) {
    throw invalidType(exception);
  }
}
origin: geotools/geotools

/** Set the parameter value as an integer. */
public void setValue(final int value) throws InvalidParameterValueException {
  final String name = getName();
  final Class type = getType();
  try {
    if (type.equals(Short.class)) {
      parameters.setParameter(name, (short) value);
      return;
    }
    if (type.equals(Byte.class)) {
      parameters.setParameter(name, (byte) value);
      return;
    }
    parameters.setParameter(name, value);
  } catch (ClassCastException exception) {
    throw invalidType(exception);
  }
}
origin: geotools/geotools

/** Returns the numeric value of the coordinate operation parameter. */
public double doubleValue() throws InvalidParameterTypeException {
  final String name = getName();
  final Class type = getType();
  try {
    if (type.equals(Float.class)) parameters.getFloatParameter(name);
    if (type.equals(Long.class)) parameters.getLongParameter(name);
    if (type.equals(Integer.class)) parameters.getIntParameter(name);
    if (type.equals(Short.class)) parameters.getShortParameter(name);
    if (type.equals(Byte.class)) parameters.getByteParameter(name);
    return parameters.getDoubleParameter(name);
  } catch (ClassCastException exception) {
    throw invalidType(exception);
  }
}
origin: geotools/geotools

/** Returns the positive integer value of an operation parameter. */
public int intValue() throws InvalidParameterTypeException {
  final String name = getName();
  final Class type = getType();
  try {
    if (type.equals(Short.class)) parameters.getShortParameter(name);
    if (type.equals(Byte.class)) parameters.getByteParameter(name);
    return parameters.getIntParameter(name);
  } catch (ClassCastException exception) {
    throw invalidType(exception);
  }
}
origin: geotools/geotools

final ParameterValue before = values.parameter("constants");
if ((i % 5) == 0) {
  values.parameters.setParameter("constants", new double[] {i});
} else {
  values.parameter("constants").setValue(new double[] {i});
    Arrays.equals(
        values.parameter("constants").doubleValueList(),
        (double[]) values.parameters.getObjectParameter("constants")));
assertSame(before, values.parameter("constants"));
origin: geotools/geotools

assertSame(pl, pl.setParameter("xPeriod", 2));
assertSame(pl, pl.setParameter("yPeriod", 2));
assertEquals(2, pl.getIntParameter("xPeriod"));
assertEquals(2, pl.getIntParameter("yPeriod"));
assertEquals(
    "Setting 'xPeriod' on ParameterList should have no effect on ParameterValue.",
origin: geotools/geotools

/**
 * Constructs a parameter group wrapping the specified JAI parameters. A default {@link
 * ImagingParameterDescriptors} is created.
 *
 * @param properties Set of properties. Should contains at least {@code "name"}.
 * @param parameters The JAI's parameters.
 */
public ImagingParameters(final Map<String, ?> properties, final ParameterList parameters) {
  super(new ImagingParameterDescriptors(properties, parameters.getParameterListDescriptor()));
  this.parameters = parameters;
  ensureNonNull("parameters", parameters);
}
origin: geotools/geotools

/** Returns the boolean value of an operation parameter. */
public boolean booleanValue() throws InvalidParameterTypeException {
  final String name = getName();
  try {
    return parameters.getBooleanParameter(name);
  } catch (ClassCastException exception) {
    throw invalidType(exception);
  }
}
origin: org.geotools/gt-coverage

KernelJAI mask1 = (KernelJAI) block.getObjectParameter("Mask1");
KernelJAI mask2 = (KernelJAI) block.getObjectParameter("Mask2");
block.setParameter("Mask1", divide(mask1, factor*scaleMask1));
block.setParameter("Mask2", divide(mask2, factor*scaleMask2));
origin: geotools/geotools

final ImagingParameterDescriptors descriptor =
    (ImagingParameterDescriptors) this.descriptor;
final ParameterListDescriptor listDescriptor = parameters.getParameterListDescriptor();
final String[] names = listDescriptor.getParamNames();
final Class[] types = listDescriptor.getParamClasses();
origin: org.geotools/gt2-coverage

KernelJAI mask1 = (KernelJAI) block.getObjectParameter("Mask1");
KernelJAI mask2 = (KernelJAI) block.getObjectParameter("Mask2");
block.setParameter("Mask1", divide(mask1, factor*scaleMask1));
block.setParameter("Mask2", divide(mask2, factor*scaleMask2));
origin: geotools/geotools

/** Returns an ordered sequence of two or more numeric values of an operation parameter list. */
public double[] doubleValueList() throws InvalidParameterTypeException {
  final String name = getName();
  try {
    return (double[]) parameters.getObjectParameter(name);
  } catch (ClassCastException exception) {
    throw invalidType(exception);
  }
}
origin: geotools/geotools

/** Set the parameter value as a floating point. */
public void setValue(final double value) throws InvalidParameterValueException {
  final String name = getName();
  final Class type = getType();
  try {
    if (type.equals(Float.class)) {
      parameters.setParameter(name, (float) value);
      return;
    }
    if (type.equals(Long.class)) {
      parameters.setParameter(name, (long) value);
      return;
    }
    if (type.equals(Integer.class)) {
      parameters.setParameter(name, (int) value);
      return;
    }
    if (type.equals(Short.class)) {
      parameters.setParameter(name, (short) value);
      return;
    }
    if (type.equals(Byte.class)) {
      parameters.setParameter(name, (byte) value);
      return;
    }
    parameters.setParameter(name, value);
  } catch (ClassCastException exception) {
    throw invalidType(exception);
  }
}
origin: org.geotools/gt2-widgets-swing

final ParameterListDescriptor descriptor;
if (param instanceof ParameterList) {
  descriptor = ((ParameterList) param).getParameterListDescriptor();
} else {
  final String name = operation.getOperationName();
origin: geotools/geotools

/** Returns an ordered sequence of two or more integer values of an operation parameter list. */
public int[] intValueList() throws InvalidParameterTypeException {
  final String name = getName();
  try {
    return (int[]) parameters.getObjectParameter(name);
  } catch (ClassCastException exception) {
    throw invalidType(exception);
  }
}
origin: geotools/geotools

/**
 * Loads an image using the provided file name and the {@linkplain #getRenderingHints current
 * hints}, which are used to control caching and layout.
 *
 * @param source Filename of the source image to read.
 * @param imageChoice Image index in multipage images.
 * @param readMatadata If {@code true}, metadata will be read.
 */
public final void load(final String source, final int imageChoice, final boolean readMetadata) {
  final ParameterBlockJAI pbj = new ParameterBlockJAI("ImageRead");
  pbj.setParameter("Input", source)
      .setParameter("ImageChoice", Integer.valueOf(imageChoice))
      .setParameter("ReadMetadata", Boolean.valueOf(readMetadata))
      .setParameter("VerifyInput", Boolean.TRUE);
  image = JAI.create("ImageRead", pbj, getRenderingHints());
}
origin: geotools/geotools

/**
 * Returns a reference to a file or a part of a file containing one or more parameter value.
 *
 * @todo Add automatic conversions, if it appears usefull for JAI parameters.
 */
public URI valueFile() throws InvalidParameterTypeException {
  final String name = getName();
  try {
    return (URI) parameters.getObjectParameter(name);
  } catch (ClassCastException exception) {
    throw invalidType(exception);
  }
}
origin: geotools/geotools

/** Set the parameter value as a boolean. */
public void setValue(final boolean value) throws InvalidParameterValueException {
  final String name = getName();
  try {
    parameters.setParameter(name, value);
  } catch (ClassCastException exception) {
    throw invalidType(exception);
  }
}
origin: geotools/geotools

/**
 * Returns the parameter value as an object. The object type is typically a {@link Double},
 * {@link Integer}, {@link Boolean}, {@link String}, {@link URI}, {@code double[]} or {@code
 * int[]}.
 */
public T getValue() {
  final String name = getName();
  final Object value;
  try {
    value = parameters.getObjectParameter(name);
  } catch (IllegalStateException ignore) {
    /*
     * Thrown when the value still ParameterListDescriptor.NO_PARAMETER_DEFAULT.
     * In this framework, the desired behavior in this case is to returns null.
     */
    return null;
  }
  return getType().cast(value);
}
origin: geotools/geotools

/**
 * Set the parameter value as an object. The object type is typically a {@link Double}, {@link
 * Integer}, {@link Boolean}, {@link String}, {@link URI}, {@code double[]} or {@code int[]}.
 */
public void setValue(final Object value) throws InvalidParameterValueException {
  final String name = getName();
  try {
    parameters.setParameter(name, value);
  } catch (ClassCastException exception) {
    throw invalidType(exception);
  }
}
javax.media.jaiParameterList

Most used methods

  • getObjectParameter
  • setParameter
  • getIntParameter
  • getParameterListDescriptor
  • getBooleanParameter
  • getByteParameter
  • getDoubleParameter
  • getFloatParameter
  • getLongParameter
  • getShortParameter

Popular in Java

  • Making http post requests using okhttp
  • onRequestPermissionsResult (Fragment)
  • onCreateOptionsMenu (Activity)
  • getResourceAsStream (ClassLoader)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Kernel (java.awt.image)
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • JOptionPane (javax.swing)
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now