Package net.sf.jiga.xtended.impl

Examples of net.sf.jiga.xtended.impl.Sprite


        super.doLoadOnGL(context);
        for (int i = 0; i < life.length; i++) {
            String leftRightBar = i >= (float) gui.NPLAYERS / 2f ? "_RIGHT" : "_LEFT";
            context._GLloadSprite((Sprite) gui.getCacheEntry("GFX_GAUGE_SPRITE" + leftRightBar), context);
            context._GLloadSprite((Sprite) gui.getCacheEntry("GFX_GAUGE_GLOW" + leftRightBar), context);
            Sprite sp = gui.getModelIconSprite(gui.getSelectedPlayer()[i]);
            playerIconID[i] = context._GLloadSprite(sp, context);
            playerIconDim = sp.getSize();
        }
    }
View Full Code Here


            character_selection_menu = new ArrayList<SelectionMenuIconCell>(FieldGui.getAvailablePlayerModels().size());
            synchronized (FieldGui.getAvailablePlayerModels()) {
                for (Iterator<XtendedModel> it = FieldGui.getAvailablePlayerModels().iterator(); it.hasNext();) {
                    XtendedModel model = it.next();
                    if (model instanceof XtendedModel) {
                        Sprite spIcon = gui.getModelIconSprite(model);
                        spIcon.setSize(FieldGui.ICONSIZE);
                        character_selection_menu.add(new SelectionMenuIconCell(gui, "", spIcon, new Runnable() {

                            public void run() {
                                int uiplr = player_selection_menu.selectable.getUISelectingPlayer();
                                int UISelectedPlayer = player_selection_menu.getFocusedMenu();
View Full Code Here

                    boolean onTheLeft = (i % 2) == 0;
                    float translateX = (float) vsLogoLoc.x + (onTheLeft ? -(float) (i + 2f) / 2f * (float) (bounds.getWidth() + pad)
                            : (float) vsLogoBds.getWidth() + (float) Math.floor((float) i / 2f) * (float) (bounds.getWidth() + pad));
                    bounds.setLocation((int) translateX, (int) vsLogoBds.getBounds().getMaxY() - (int) bounds.getHeight());
                    int transform = !onTheLeft ? GLHandler._GL_TRANSFORM_FLIP_HORIZONTAL_BIT : 0;
                    Sprite icon = (Sprite) gui.getModelIconSprite(gui.getSelectedPlayer()[i]);
                    icons[i] = RenderingScene._GLloadSprite(icon, context);
                    Sprite._GLRenderSprite(context, true, icons[i], bounds, z, GLFX.gfx.FX_DOWNREFLEXION_EXT, new Point(0, context.getHeight()), null, transform, null, null, null);

                }
            }
View Full Code Here

                                        try {
                                            w.addIIOWriteProgressListener(uiprg);
                                            w.addIIOWriteWarningListener(uiwarn);
                                            while (!newImg.empty()) {
                                                if (spriteIo) {
                                                    Sprite sp = new Sprite(newImg.peek(), selectedConversion, new Dimension(newImg.peek().getWidth(), newImg.peek().getHeight()));
                                                    sp.runValidate();
                                                    sp.writeImageToOutput(outputFile, compression_quality);
                                                } else {
                                                    raf = new RandomAccessFile(outputFile, "rw");
                                                    try {
                                                        raf.setLength(0);
                                                        w.setOutput(ios = new FileChannelImageOutputStream((raf = new RandomAccessFile(outputFile, "rw")).getChannel()));
View Full Code Here

            mt.addImage(((Image) data), 0);
            try {
                mt.waitForID(0);
                mt.removeImage((Image) data, 0);
                Dimension size = new Dimension(((Image) data).getWidth(applet), ((Image) data).getHeight(applet));
                Sprite sp = new Sprite(SpriteIO.createBufferedImage(size, BufferedImage.TYPE_4BYTE_ABGR), "image/x-png", size);
                File file = new File(DateFormat.getDateInstance(DateFormat.MEDIUM).format(new Date()) + ".png");
                file.deleteOnExit();
                importedFiles.add(file);
                sp.writeImageToOutput(file, 1f);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        if (!importedFiles.isEmpty()) {
View Full Code Here

            }
        }
        if (custom instanceof Custom) {
            if (iconFile != null) {
                try {
                    custom.setAttribute("icon", new Sprite(ImageIO.read(iconFile), "image/x-png", _iconSize));
                } catch (IOException ex) {
                    if (JXAenvUtils._debug) {
                        ex.printStackTrace();
                    }
                    UIMessage.showConfirmDialog(panel, ex, "The icon Sprite failed to load.", JOptionPane.OK_OPTION);
View Full Code Here

    }

    protected void renderToJava2D(Graphics2D graphics2D) {
        RenderingScene rsc = getRenderingScene();
        try {
            Sprite thanks = RenderingScene._getLogo(rsc, "/net/sf/jiga/xtended/impl/sf3jswing_thanks.png", new Dimension(276, 852), true);
            /*
             * thanks.setTileModeEnabled(false);
             */
            RenderingScene.__drawLogo(rsc, graphics2D, thanks,
                    new Dimension(276, 852), POS.CENTER, POS.CENTER,
View Full Code Here

        public final static String ATTRIBUTE_ORIG_DIMENSION = "orig-dimension";
        private transient ImageCollectionRenderer renderer = this;

        private JComponent makeThumbnailStore(File image, final String key, String mime, Map<String, Serializable> attrs) throws IOException {
                String m = _getImageMimeType(image, "r");
                Sprite picture = null;
                ImageReader r = null;
                try {
                        Map<String, Object> s = Sprite._loadImage(image, false, m, Sprite.MODE_JAVA2D | Sprite.MODE_TILE, _getBufferedType(m), false);
                        r = (ImageReader) s.get("reader");
                        picture = new Sprite(image, m, new Dimension(r.getWidth(0), r.getHeight(0)), true);
                } catch (Exception ex) {
                        if (JXAenvUtils._debug) {
                                ex.printStackTrace();
                        }
                        IOException e = new IOException(ex.getMessage());
                        e.initCause(ex);
                        throw e;
                } finally {
                        ((ImageInputStream) r.getInput()).flush();
                        r.dispose();
                        ((ImageInputStream) r.getInput()).close();
                        picture.setStoreMode(Sprite.MODE_JAVA2D | Sprite.MODE_TILE);
                        return makeThumbnailStore(picture, key, mime, attrs);
                }

        }
View Full Code Here

                }

        }

        private JComponent makeThumbnailStore(BufferedImage image, final String key, String mime, Map<String, Serializable> attrs) {
                Sprite picture = new Sprite(image, mime, new Dimension(image.getWidth(), image.getHeight()));
                picture.setStoreMode(Sprite.MODE_JAVA2D);
                return makeThumbnailStore(picture, key, mime, attrs);
        }
View Full Code Here

                return renderer.makeCollectionRendererComponent(this, key, true);
        }

        private JComponent makeStore(File image, final String key, String mime, Map<String, Serializable> attrs) throws IOException {
                String m = _getImageMimeType(image, "r");
                Sprite picture = null;
                ImageReader r = null;
                try {
                        Map<String, Object> s = Sprite._loadImage(image, false, m, Sprite.MODE_JAVA2D | Sprite.MODE_TILE, _getBufferedType(m), false);
                        r = (ImageReader) s.get("reader");
                        picture = new Sprite(image, m, new Dimension(r.getWidth(0), r.getHeight(0)), true);
                } catch (Exception ex) {
                        if (JXAenvUtils._debug) {
                                ex.printStackTrace();
                        }
                        IOException e = new IOException(ex.getMessage());
                        e.initCause(ex);
                        throw e;
                } finally {
                        ((ImageInputStream) r.getInput()).flush();
                        r.dispose();
                        ((ImageInputStream) r.getInput()).close();
                        picture.setStoreMode(Sprite.MODE_JAVA2D | Sprite.MODE_TILE);
                        return makeStore(picture, key, mime, attrs);
                }

        }
View Full Code Here

TOP

Related Classes of net.sf.jiga.xtended.impl.Sprite

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.