Package javax.swing

Examples of javax.swing.ImageIcon


     * @param lon longitude in decimal degrees.
     * @param iconURL a URL for an image
     */
    public static OMRaster getIconRaster(float lat, float lon, URL iconURL) {

        ImageIcon icon = new ImageIcon(iconURL);
        if (icon == null)
            return null;

        int offX = icon.getIconWidth() / 2;
        int offY = icon.getIconHeight() / 2;
        return new OMRaster(lat, lon, -offX, -offY, icon);
    }
View Full Code Here


     * @param y vertical pixel screen location, from the top of the
     *        map.
     * @param iconURL a URL for an image
     */
    public static OMRaster getIconRaster(int x, int y, URL iconURL) {
        ImageIcon icon = new ImageIcon(iconURL);
        if (icon == null)
            return null;

        int offX = icon.getIconWidth() / 2;
        int offY = icon.getIconHeight() / 2;
        return new OMRaster(x - offX, y - offY, icon);
    }
View Full Code Here

     *        point.
     * @param iconURL a URL for an image
     */
    public static OMRaster getIconRaster(float lat, float lon, int x, int y,
                                         URL iconURL) {
        ImageIcon icon = new ImageIcon(iconURL);
        if (icon == null)
            return null;

        int offX = icon.getIconWidth() / 2;
        int offY = icon.getIconHeight() / 2;
        return new OMRaster(lat, lon, x - offX, y - offY, icon);
    }
View Full Code Here

            if (Debug.debugging("cis")){
                Debug.output("CorbaImagePlugIn: got image data length " +
                             imageData.length);
            }
            ImageIcon ii = new ImageIcon(imageData);
            OMRaster image = new OMRaster((int)0, (int)0, ii);
            list.add(image);

        } catch (org.omg.CORBA.SystemException e){
            handleCORBAError(e);
View Full Code Here

                while ((len = in.read(buf, 0, buflen)) != -1) {
                    out.write(buf, 0, len);
                }
                out.flush();
                out.close();
                ImageIcon ii = new ImageIcon(out.toByteArray());

                // -------- To here, replaced by two lines below...

                // DFD - I've seen problems with these lines below handling PNG
                // images, and with some servers with some coverages, like there
View Full Code Here

        for (Iterator it = getLoaders(); it.hasNext();) {
            LoaderHolder lh = (LoaderHolder) it.next();
            String pName = lh.prettyName;
            EditToolLoader etl = lh.loader;
            ImageIcon icon = etl.getIcon(getEditableClassName(pName));
            btn = new JToggleButton(icon);
            btn.setMargin(new Insets(0, 0, 0, 0));
            btn.setToolTipText(pName);
            btn.setActionCommand(pName);
            btn.addActionListener(new ActionListener() {
View Full Code Here

            }

            LoaderHolder lh = (LoaderHolder) it.next();
            String pName = lh.prettyName;
            EditToolLoader etl = lh.loader;
            ImageIcon icon = etl.getIcon(getEditableClassName(pName));

            btn = new JToggleButton(icon, !activeSet);
            btn.setToolTipText(pName);
            btn.setActionCommand(pName);
            btn.addActionListener(new ActionListener() {
View Full Code Here

    public Container getFace() {
        JToolBar jtb = null;
        if (getUseAsTool()) {
            jtb = new com.bbn.openmap.gui.GridBagToolBar();
            // "Drawing Tool Launcher";
            JButton drawingToolButton = new JButton(new ImageIcon(OMDrawingToolLauncher.class.getResource("Drawing.gif"), i18n.get(OMDrawingToolLauncher.class,
                    "drawingToolButton",
                    I18n.TOOLTIP,
                    "Drawing Tool Launcher")));
            drawingToolButton.setToolTipText(i18n.get(OMDrawingToolLauncher.class,
                    "drawingToolButton",
View Full Code Here

     */
    public Container getFace() {
        JButton layerButton = null;

        if (getUseAsTool()) {
            layerButton = new JButton(new ImageIcon(OMToolSet.class.getResource("layers.gif"), "Layer Controls"));
            layerButton.setBorderPainted(false);
            // layerButton.setToolTipText("Layer Controls");
            layerButton.setToolTipText(i18n.get(LayersPanel.class,
                    "layerButton",
                    I18n.TOOLTIP,
View Full Code Here

        BufferedImage bufferedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
        Graphics2D graphics = (Graphics2D) bufferedImage.getGraphics();
        graphics.setPaint(paint);
        graphics.fillRect(0, 0, width, height);

        return new ImageIcon(bufferedImage);
    }
View Full Code Here

TOP

Related Classes of javax.swing.ImageIcon

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.