/** * Registers a variable of primitive type char in the universe. * * @param varName the name of the variable to assign * @param c the char value to assign to the variable */ public void setVar(String varName, char c) { setVar(varName, Character.valueOf(c)); }
/** Registers a variable of primitive type boolean in the universe. */ public void setVar(String varName, boolean b) { setVar(varName, new Boolean(b)); }
/** * Registers a variable of primitive type int in the universe. * * @param varName the name of the variable to assign * @param i the int value to assign to the variable */ public void setVar(String varName, int i) { setVar(varName, Integer.valueOf(i)); }
/** * Registers a variable of primitive type long in the universe. * * @param varName the name of the variable to assign * @param l the long value to assign to the variable */ public void setVar(String varName, long l) { setVar(varName, Long.valueOf(l)); }
/** * Registers a variable of primitive type double in the universe. * * @param varName the name of the variable to assign * @param d the double value to assign to the variable */ public void setVar(String varName, double d) { setVar(varName, new Double(d)); }
/** * Registers a variable of primitive type float in the universe. * * @param varName the name of the variable to assign * @param f the float value to assign to the variable */ public void setVar(String varName, float f) { setVar(varName, new Float(f)); }
/** * Registers a variable of primitive type short in the universe. * * @param varName the name of the variable to assign * @param s the short value to assign to the variable */ public void setVar(String varName, short s) { setVar(varName, Short.valueOf(s)); }
/** * Registers a variable of primitive type boolean in the universe. * * @param varName the name of the variable to assign * @param b the boolean value to assign to the variable */ public void setVar(String varName, boolean b) { setVar(varName, new Boolean(b)); }
/** * Registers a variable of primitive type byte in the universe. * * @param varName the name of the variable to assign * @param b the byte value to assign to the variable */ public void setVar(String varName, byte b) { setVar(varName, new Byte(b)); }
/** Registers a variable of primitive type float in the universe. */ public void setVar(String varName, float f) { setVar(varName, new Float(f)); }
/** Registers a variable of primitive type int in the universe. */ public void setVar(String varName, int i) { setVar(varName, Integer.valueOf(i)); }
/** Registers a variable of primitive type long in the universe. */ public void setVar(String varName, long l) { setVar(varName, Long.valueOf(l)); }
/** Registers a variable of primitive type short in the universe. */ public void setVar(String varName, short s) { setVar(varName, Short.valueOf(s)); }
/** Registers a variable of primitive type byte in the universe. */ public void setVar(String varName, byte b) { setVar(varName, new Byte(b)); }
/** Registers a variable of primitive type char in the universe. */ public void setVar(String varName, char c) { setVar(varName, Character.valueOf(c)); }
/** Registers a variable of primitive type double in the universe. */ public void setVar(String varName, double d) { setVar(varName, new Double(d)); }
/** Obtains a BufferedImage from the given data source using JAI. */ protected BufferedImage openBufferedImage(int no) throws FormatException { r.setVar("no", no); RenderedImage img; try { r.exec("img = dec.decodeAsRenderedImage(no)"); img = (RenderedImage) r.exec("new NullOpImage(img, null, OpImage.OP_IO_BOUND, null)"); } catch (ReflectException exc) { throw new FormatException(exc); } return AWTImageTools.convertRenderedImage(img); }
/** Obtains a BufferedImage from the given data source using JAI. */ protected BufferedImage openBufferedImage(int no) throws FormatException { r.setVar("no", no); RenderedImage img; try { r.exec("img = dec.decodeAsRenderedImage(no)"); img = (RenderedImage) r.exec("new NullOpImage(img, null, OpImage.OP_IO_BOUND, null)"); } catch (ReflectException exc) { throw new FormatException(exc); } return AWTImageTools.convertRenderedImage(img); }
/** Gets width and height for the given PICT bytes. */ public Dimension getPictDimensions(byte[] bytes) throws FormatException, ReflectException { checkQTLibrary(); try { r.exec("QTSession.open()"); r.setVar("bytes", bytes); r.exec("pict = new Pict(bytes)"); r.exec("box = pict.getPictFrame()"); int width = ((Integer) r.exec("box.getWidth()")).intValue(); int height = ((Integer) r.exec("box.getHeight()")).intValue(); r.exec("QTSession.close()"); return new Dimension(width, height); } catch (ReflectException e) { r.exec("QTSession.close()"); throw new FormatException("PICT height determination failed", e); } }
@Override public Object openPlane(int no, int x, int y, int w, int h) throws FormatException, IOException { FormatTools.checkPlaneParameters(this, no, -1, x, y, w, h); // paint frame into image try { r.setVar("time", times[no]); r.exec("moviePlayer.setTime(time)"); r.exec("qtip.redraw(null)"); r.exec("qtip.updateConsumers(null)"); } catch (ReflectException re) { throw new FormatException("Open movie failed", re); } return AWTImageTools.getSubimage(AWTImageTools.makeBuffered(image), isLittleEndian(), x, y, w, h); }