Texture tex = ((TextureState)particleGeom.getRenderState( RenderState.RS_TEXTURE)).getTexture(); try { if (tex != null) { if (tex.getTextureKey() != null && tex.getTextureKey().getLocation() != null) imageLabel.setIcon( new ImageIcon(tex.getTextureKey().getLocation())); else imageLabel.setIcon( new ImageIcon(new URL(tex.getImageLocation()))); } else { imageLabel.setIcon(null);
if (getTexturePanel().isVisible()) { Texture tex = null; try { tex = ((TextureState)particleGeom.getRenderState( RenderState.RS_TEXTURE)).getTexture(); if (tex != null) { if (tex.getTextureKey() != null && tex.getTextureKey().getLocation() != null) imageLabel.setIcon( new ImageIcon(tex.getTextureKey().getLocation())); else imageLabel.setIcon( new ImageIcon(new URL(tex.getImageLocation()))); } else { imageLabel.setIcon(null); } } catch (Exception e) { System.err.println("image: "+tex+" : "+ tex != null ? tex.getImageLocation() : ""); e.printStackTrace();
    public void updateWidgets() {        ParticleGeometry particleGeom = getEdittedParticles();        updateCountLabels();        geomTypeBox.setSelectedIndex(particleGeom.getParticleType());        velocityAlignedBox.setSelected(particleGeom.isVelocityAligned());        startColorPanel.setBackground(makeColor(particleGeom                .getStartColor(), false));        endColorPanel.setBackground(makeColor(particleGeom                .getEndColor(), false));        startAlphaSpinner.setValue(new Integer(makeColor(                particleGeom.getStartColor(), true).getAlpha()));        endAlphaSpinner.setValue(new Integer(makeColor(                particleGeom.getEndColor(), true).getAlpha()));        updateColorLabels();        AlphaState as = (AlphaState)particleGeom.getRenderState(            RenderState.RS_ALPHA);        additiveBlendingBox.setSelected(as == null ||            as.getDstFunction() == AlphaState.DB_ONE);        startSizePanel.setValue(particleGeom.getStartSize());        endSizePanel.setValue(particleGeom.getEndSize());        renderQueueCB.setSelectedIndex(particleGeom.getRenderQueueMode());        Texture tex = ((TextureState)particleGeom.getRenderState(            RenderState.RS_TEXTURE)).getTexture();        try {            if (tex != null) {                if (tex.getTextureKey() != null && tex.getTextureKey().getLocation() != null)                    imageLabel.setIcon(                            new ImageIcon(tex.getTextureKey().getLocation()));                else                    imageLabel.setIcon(                        new ImageIcon(new URL(tex.getImageLocation())));            } else {                imageLabel.setIcon(null);            }        } catch (Exception e) {            System.err.println("image: "+tex+" : "+tex.getImageLocation());            e.printStackTrace();        }    }