@Override public void setSourceImageBandTransform(String varName, BandTransform btr) throws JiffleException { SourceImage image = _images.get(varName); if (image == null) { throw new JiffleException("Unknown source image " + varName); } image.bandTransform = btr; }
/** * Creates a new instance with the given list of messages. * * @param errors list of error messages */ public JiffleException(List<String> errors) { super(listToString(errors)); }
private void loadScript(ImageChoice imageChoice) { try { String script = JiffleDemoHelper.getScript(imageChoice); runScript(script, imageChoice.getDestImageVarName()); } catch (JiffleException ex) { ex.printStackTrace(); JOptionPane.showMessageDialog(this, "Problem loading the example script", "Bummer", JOptionPane.ERROR_MESSAGE); } }
private void runScript(String script, String destVarName) { try { scriptPane.setText(script); JiffleBuilder builder = new JiffleBuilder(); builder.script(script).dest(destVarName, imageWidth, imageHeight); RenderedImage image = builder.run().getImage(destVarName); imagePane.setImage(image); } catch (JiffleException ex) { ex.printStackTrace(); JOptionPane.showMessageDialog(this, "Errors compiling or running the script", "Bummer", JOptionPane.ERROR_MESSAGE); } }
@Override public void setSourceImageBandTransform(String varName, BandTransform btr) throws JiffleException { SourceImage image = _images.get(varName); if (image == null) { throw new JiffleException("Unknown source image " + varName); } image.bandTransform = btr; }
/** * Creates a new instance with the given list of messages. * * @param errors list of error messages */ public JiffleException(List<String> errors) { super(listToString(errors)); }
public void setDestinationImage(String varName, CoordinateTransform tr) throws JiffleException { try { doSetDestinationImage(varName, tr); } catch (WorldNotSetException ex) { throw new JiffleException(String.format( "Setting a coordinate tranform for a source (%s) without" + "having first set the world bounds and resolution", varName)); } }
@Override public void setSourceImageCoordinateTransform(String varName, CoordinateTransform tr) throws JiffleException { SourceImage image = _images.get(varName); if (image == null) { throw new JiffleException("Unknown source image " + varName); } image.setTransform(tr, tr == null); }
@Override public void setSourceImageCoordinateTransform(String varName, CoordinateTransform tr) throws JiffleException { SourceImage image = _images.get(varName); if (image == null) { throw new JiffleException("Unknown source image " + varName); } image.setTransform(tr, tr == null); }
public void setDestinationImage(String varName, CoordinateTransform tr) throws JiffleException { try { doSetDestinationImage(varName, tr); } catch (WorldNotSetException ex) { throw new JiffleException(String.format( "Setting a coordinate tranform for a source (%s) without" + "having first set the world bounds and resolution", varName)); } }
/** * {@inheritDoc} */ public void setSourceImage(String varName, RenderedImage image, CoordinateTransform tr) throws JiffleException { try { doSetSourceImage(varName, image, tr); } catch (WorldNotSetException ex) { throw new JiffleException(String.format( "Setting a coordinate tranform for a source (%s) without" + "having first set the world bounds and resolution", varName)); } }
/** * {@inheritDoc} */ public void setSourceImage(String varName, RenderedImage image, CoordinateTransform tr) throws JiffleException { try { doSetSourceImage(varName, image, tr); } catch (WorldNotSetException ex) { throw new JiffleException(String.format( "Setting a coordinate tranform for a source (%s) without" + "having first set the world bounds and resolution", varName)); } }
/** {@inheritDoc} */ public void setDestinationImage( String varName, WritableRenderedImage image, CoordinateTransform tr) throws JiffleException { try { doSetDestinationImage(varName, image, tr); } catch (WorldNotSetException ex) { throw new JiffleException( String.format( "Setting a coordinate tranform for a destination (%s) without" + "having first set the world bounds and resolution", varName)); } }
/** {@inheritDoc} */ public void setDestinationImage( String varName, WritableRenderedImage image, CoordinateTransform tr) throws JiffleException { try { doSetDestinationImage(varName, image, tr); } catch (WorldNotSetException ex) { throw new JiffleException( String.format( "Setting a coordinate tranform for a destination (%s) without" + "having first set the world bounds and resolution", varName)); } }
/** * Sets the script. Calling this method will clear any previous script * and runtime objects. * * @param script a Jiffle script * @throws JiffleException if the script is empty or {@code null} */ public final void setScript(String script) throws it.geosolutions.jaiext.jiffle.JiffleException { if (script == null || script.trim().length() == 0) { throw new it.geosolutions.jaiext.jiffle.JiffleException("script is empty !"); } clearCompiledObjects(); // add extra new line just in case last statement hits EOF theScript = script + "\n"; }
/** * Sets the script. Calling this method will clear any previous script * and runtime objects. * * @param script a Jiffle script * @throws JiffleException if the script is empty or {@code null} */ public final void setScript(String script) throws it.geosolutions.jaiext.jiffle.JiffleException { if (script == null || script.trim().length() == 0) { throw new it.geosolutions.jaiext.jiffle.JiffleException("script is empty !"); } clearCompiledObjects(); // add extra new line just in case last statement hits EOF theScript = script + "\n"; }
private String readScriptFile(File scriptFile) throws JiffleException { BufferedReader reader = null; try { reader = new BufferedReader(new FileReader(scriptFile)); StringBuilder sb = new StringBuilder(); String line; while ((line = reader.readLine()) != null) { line = line.trim(); if (line.length() > 0) { sb.append(line); sb.append('\n'); // put the newline back on for the parser } } return sb.toString(); } catch (IOException ex) { throw new JiffleException("Could not read the script file", ex); } finally { if (reader != null) { try { reader.close(); } catch (IOException ignored) { } } } }
private String readScriptFile(File scriptFile) throws JiffleException { BufferedReader reader = null; try { reader = new BufferedReader(new FileReader(scriptFile)); StringBuilder sb = new StringBuilder(); String line; while ((line = reader.readLine()) != null) { line = line.trim(); if (line.length() > 0) { sb.append(line); sb.append('\n'); // put the newline back on for the parser } } return sb.toString(); } catch (IOException ex) { throw new JiffleException("Could not read the script file", ex); } finally { if (reader != null) { try { reader.close(); } catch (IOException ignored) { } } } }
throw new JiffleException("Could not read the script file", ex);
throw new JiffleException("Can't find script file:" + fileName);