Package ca.grimoire.jnoise.config

Examples of ca.grimoire.jnoise.config.BuilderException


   * @see #setWhite(double)
   * @see ModuleBuilder#createModule()
   */
  public Checker createModule () throws BuilderException {
    if (!blackSet)
      throw new BuilderException ("No black value for checker module.");
    if (!whiteSet)
      throw new BuilderException ("No white value for checker module.");

    return new Checker (black, white);
  }
View Full Code Here


  public void addChild (Element child) throws BuilderException {
    assert (child != null);

    assert (sourceManager.getChildren ().size () <= REQUIRED_CHILDREN);
    if (sourceManager.getChildren ().size () == REQUIRED_CHILDREN)
      throw new BuilderException (
          "Select module requires three source modules.");

    sourceManager.addChild (child);
  }
View Full Code Here

  }

  private List<ModuleBuilder> checkSources () throws BuilderException {
    List<ModuleBuilder> builders = sourceManager.getChildren ();
    if (builders.size () != REQUIRED_CHILDREN)
      throw new BuilderException (
          "Displace module requires one sources and three displacement modules.");
    return builders;
  }
View Full Code Here

   * @throws BuilderException
   *           if the source module has not been provided.
   */
  public Clamp createModule () throws BuilderException {
    if (!hasLower)
      throw new BuilderException ("Clamp requires lower bound.");
    if (!hasUpper)
      throw new BuilderException ("Clamp requires upper bound.");
    if (lower > upper)
      throw new BuilderException (
          "Clamp requires lower bound less than or equal to upper bound.");

    return new Clamp (getSource ().createModule (), lower, upper);
  }
View Full Code Here

   * @throws BuilderException
   *           if the source module has not been provided.
   */
  public Exponent createModule () throws BuilderException {
    if (!hasPower)
      throw new BuilderException ("Exponent requires power.");

    return new Exponent (getSource ().createModule (), power);
  }
View Full Code Here

   * @see #setSeed(int)
   * @see ModuleBuilder#createModule()
   */
  public Gradient createModule () throws BuilderException {
    if (!seedSet)
      throw new BuilderException ("No seed for gradient module.");
    if (quality == null)
      throw new BuilderException ("No quality for gradient module.");

    return new Gradient (seed, quality);
  }
View Full Code Here

  public void addChild (Element child) throws BuilderException {
    assert (child != null);

    assert (sourceManager.getChildren ().size () <= REQUIRED_CHILDREN);
    if (sourceManager.getChildren ().size () == REQUIRED_CHILDREN)
      throw new BuilderException (
          "Select module requires three source modules.");

    sourceManager.addChild (child);
  }
View Full Code Here

    this.hasThreshold = true;
  }

  private void checkFalloff () throws BuilderException {
    if (falloff < 0.0 || !hasFalloff)
      throw new BuilderException (
          "Select module requires non-negative falloff rate.");
  }
View Full Code Here

  }

  private List<ModuleBuilder> checkSources () throws BuilderException {
    List<ModuleBuilder> builders = sourceManager.getChildren ();
    if (builders.size () != REQUIRED_CHILDREN)
      throw new BuilderException (
          "Select module requires two sources and a selector module.");
    return builders;
  }
View Full Code Here

    return builders;
  }

  private void checkThreshold () throws BuilderException {
    if (!hasThreshold)
      throw new BuilderException ("Select module requires threshold.");
  }
View Full Code Here

TOP

Related Classes of ca.grimoire.jnoise.config.BuilderException

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.