Tabnine Logo
Jiffle.isCompiled
Code IndexAdd Tabnine to your IDE (free)

How to use
isCompiled
method
in
it.geosolutions.jaiext.jiffle.Jiffle

Best Java code snippets using it.geosolutions.jaiext.jiffle.Jiffle.isCompiled (Showing top 8 results out of 315)

origin: it.geosolutions.jaiext.jiffle/jt-jiffle-language

private JiffleRuntime createRuntimeInstance(RuntimeModel model, Class<? extends JiffleRuntime> runtimeClass, boolean scriptInDocs) throws
  if (!isCompiled()) {
    throw new it.geosolutions.jaiext.jiffle.JiffleException("The script has not been compiled");
origin: geosolutions-it/jai-ext

private JiffleRuntime createRuntimeInstance(RuntimeModel model, Class<? extends JiffleRuntime> runtimeClass, boolean scriptInDocs) throws
  if (!isCompiled()) {
    throw new it.geosolutions.jaiext.jiffle.JiffleException("The script has not been compiled");
origin: geosolutions-it/jai-ext

@Test
public void fileWithParamsConstructor() throws Exception {
  System.out.println("   Jiffle(scriptFile, imageParams)");
  
  URL url = JiffleBasicTest.class.getResource("constant.jfl");
  File file = new File(url.toURI());
  
  imageParams.put("dest", Jiffle.ImageRole.DEST);
  jiffle = new Jiffle(file, imageParams);
  
  assertTrue(jiffle.isCompiled());
}

origin: geosolutions-it/jai-ext

/**
 * Compiles a script read from a file and submits it for execution.
 * 
 * @param scriptFile file containing the Jiffle script
 * @throws Exception on an error in the Jiffle compiler
 */
public void compileAndRun(File scriptFile) throws Exception {
  Map<String, Jiffle.ImageRole> imageParams = new HashMap<>();
  imageParams.put("result", Jiffle.ImageRole.DEST);
  Jiffle jiffle = new Jiffle(scriptFile, imageParams);
  Map<String, RenderedImage> images = new HashMap<>();
  images.put("result",
      ImageUtilities.createConstantImage(WIDTH, HEIGHT, Double.valueOf(0d)));
  if (jiffle.isCompiled()) {
    JiffleDirectRuntime runtime = jiffle.getRuntimeInstance();
    final TiledImage destImg = ImageUtilities.createConstantImage(WIDTH, HEIGHT, 0d);
    runtime.setDestinationImage("result", destImg);
    
    runtime.evaluateAll(null);
    
    ImageFrame frame = new ImageFrame(destImg, "Jiffle image demo");
    frame.setVisible(true);
  }
}
origin: geosolutions-it/jai-ext

@Test
public void scriptWithParamsConstructor() throws Exception {
  System.out.println("   Jiffle(script, imageParams)");
  
  String script = "dest = 42;";
  imageParams.put("dest", Jiffle.ImageRole.DEST);
  jiffle = new Jiffle(script, imageParams);
  
  assertTrue(jiffle.isCompiled());
}

origin: geosolutions-it/jai-ext

@Test
public void compileValidScript() throws Exception {
  System.out.println("   compile valid script");
  
  String script = "dest = 42;";
  imageParams.put("dest", Jiffle.ImageRole.DEST);
  
  jiffle.setScript(script);
  jiffle.setImageParams(imageParams);
  jiffle.compile();
  
  assertTrue(jiffle.isCompiled());
}
origin: geosolutions-it/jai-ext

@Test
public void compileInvalidScriptAndCheckStatus() throws Exception {
  System.out.println("   compile invalid script and check status");
  
  // script with an uninitialized variable
  String script = "dest = x;";
  imageParams.put("dest", Jiffle.ImageRole.DEST);
  
  jiffle.setScript(script);
  jiffle.setImageParams(imageParams);
  
  try {
    jiffle.compile();
  } catch (JiffleParserException ignored) {}
  
  assertFalse(jiffle.isCompiled());
}

origin: geosolutions-it/jai-ext

@Test
public void blankInstance() {
  System.out.println("   creating an empty Jiffle object");
  
  assertEquals("", jiffle.getScript());
  assertTrue(jiffle.getImageParams().isEmpty());
  assertFalse(jiffle.isCompiled());
}

it.geosolutions.jaiext.jiffleJiffleisCompiled

Javadoc

Tests whether the script has been compiled successfully.

Popular methods of Jiffle

  • <init>
    Creates a new instance by compiling the provided script. Using this constructor is equivalent to: J
  • compile
    Compiles the script into Java source for the runtime class.
  • getRuntimeInstance
    Gets the runtime object for this script. The runtime object is an instance of JiffleRuntime. By defa
  • setImageParams
    Sets the image parameters. These define which variables in the script refer to images and their type
  • setScript
    Sets the script. Calling this method will clear any previous script and runtime objects.
  • getReadPositions
    A utility method returning the source positions used in a given script
  • getRuntimeSource
    Gets a copy of the Java source for the runtime class. The script must have been compiled before call
  • clearCompiledObjects
    Clears all compiler and runtime objects.
  • createRuntimeInstance
  • createRuntimeSource
  • getImageParams
    Gets the current image parameters. The parameters are returned as an unmodifiable map.
  • getName
    Gets the name assigned to this object. This will either be the default name or one assigned by the c
  • getImageParams,
  • getName,
  • getRuntimeBaseClass,
  • getScript,
  • getScriptImageParams,
  • init,
  • parseScript,
  • reportMessages,
  • setName

Popular in Java

  • Reading from database using SQL prepared statement
  • addToBackStack (FragmentTransaction)
  • getResourceAsStream (ClassLoader)
  • notifyDataSetChanged (ArrayAdapter)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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