Package ptolemy.data

Examples of ptolemy.data.AWTImageToken


    /** Output the data read in the prefire.
     *  @exception IllegalActionException If there's no director.
     */
    public void fire() throws IllegalActionException {
        super.fire();
        output.broadcast(new AWTImageToken(_image));
    }
View Full Code Here


        for (int i = 0; i < width; i++) {
            if (input.hasToken(i)) {
                ImageToken imageToken = (ImageToken) input.get(i);
                Image image = imageToken.asAWTImage();
                Image rotatedImage = Transform.rotate(image, rotation);
                output.broadcast(new AWTImageToken(rotatedImage));
            }
        }
    }
View Full Code Here

        StringToken urlToken = (StringToken) input.get(0);

        try {
            URL url = new URL(urlToken.stringValue());
            Image image = new ImageIcon(url).getImage();
            output.send(0, new AWTImageToken(image));
        } catch (MalformedURLException ex) {
            throw new IllegalActionException("'" + urlToken.stringValue()
                    + "' is malformed: " + ex);
        }
    }
View Full Code Here

            // of graphical context here.  This is a huge shortcoming of
            // awt.  Just because I'm operating on images, I should not
            // need a frame.
            Image image = _frame.getContentPane().createImage(imageSource);

            AWTImageToken token = new AWTImageToken(image);
            List tokens = new LinkedList();
            tokens.add(token);

            try {
                _effigy.setTokens(tokens);
View Full Code Here

TOP

Related Classes of ptolemy.data.AWTImageToken

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.