Class JAIWriter

    • Field Detail

      • fileName

        public FileParameter fileName
        The file name to which to write. This is a string with any form accepted by FileParameter.
        See Also:
        FileParameter
      • confirmOverwrite

        public Parameter confirmOverwrite
        If false, then overwrite the specified file if it exists without asking. If true (the default), then if the file exists, ask for confirmation before overwriting.
      • _alreadyReadImageToken

        protected boolean _alreadyReadImageToken
        Set to true if the input was read in by the derived class. Certain derived classes want to read in the JAIImageToken so they can adjust the output format accordingly. These actors read the input, set the value of _jaiImageToken and _image set _alreadyReadImageToken to true and then call super.postfire(), which acts accordingly.
        See Also:
        _jaiImageToken, JAIPNGWriter
      • _image

        protected javax.media.jai.RenderedOp _image
        The image that was optionally read in by the derived class.
        See Also:
        _alreadyReadImageToken
      • _imageEncoderName

        protected java.lang.String _imageEncoderName
        The name of the encoder in a format suitable for com.sun.media.jai.codec.ImageCodec, for example "BMP", or "JPG".
      • _imageEncodeParam

        protected com.sun.media.jai.codec.ImageEncodeParam _imageEncodeParam
        The encoder parameters. Derived classes usually instantiate a format specific subclass of ImageEncodeParam and then set _imageEncodeParam to the format specific instance and then call super.postfire().
    • Method Detail

      • postfire

        public boolean postfire()
                         throws IllegalActionException
        Read an input JAIImageToken and write it to the file. If the file does not exist then create it. If the file already exists, then query the user for overwrite.
        Specified by:
        postfire in interface Executable
        Overrides:
        postfire in class AtomicActor<TypedIOPort>
        Returns:
        True if the execution can continue.
        Throws:
        IllegalActionException - If the file cannot be opened or created, if the user refuses to overwrite an existing file, of if the image in unable to be encoded.