imagegraphicsbaseimpl.java

来自「java 3d game jme 工程开发源代码」· Java 代码 · 共 777 行 · 第 1/2 页

JAVA
777
字号
    }    public void drawPolyline( int[] xPoints, int[] yPoints, int nPoints ) {        if ( mipMapChild != null ) {            mipMapChild.drawPolyline( xPoints, yPoints, nPoints );        }        synchronized ( dirty ) {            makeDirty();            delegate.drawPolyline( xPoints, yPoints, nPoints );        }    }    public void drawPolygon( int[] xPoints, int[] yPoints, int nPoints ) {        if ( mipMapChild != null ) {            mipMapChild.drawPolygon( xPoints, yPoints, nPoints );        }        synchronized ( dirty ) {            makeDirty();            delegate.drawPolygon( xPoints, yPoints, nPoints );        }    }    public void fillPolygon( int[] xPoints, int[] yPoints, int nPoints ) {        if ( mipMapChild != null ) {            mipMapChild.fillPolygon( xPoints, yPoints, nPoints );        }        synchronized ( dirty ) {            makeDirty();            delegate.fillPolygon( xPoints, yPoints, nPoints );        }    }    public boolean drawImage( java.awt.Image img, int x, int y, ImageObserver observer ) {        makeDirty( x, y, img.getWidth( observer ), img.getHeight( observer ) );        synchronized ( dirty ) {            if ( mipMapChild != null ) {                mipMapChild.drawImage( img, x, y, observer );            }            return delegate.drawImage( img, x, y, observer );        }    }    public boolean drawImage( java.awt.Image img, int x, int y, int width, int height, ImageObserver observer ) {        if ( mipMapChild != null ) {            mipMapChild.drawImage( img, x, y, width, height, observer );        }        synchronized ( dirty ) {            makeDirty( x, y, width, height );            return delegate.drawImage( img, x, y, width, height, observer );        }    }    public boolean drawImage( java.awt.Image img, int x, int y, Color bgcolor, ImageObserver observer ) {        if ( mipMapChild != null ) {            mipMapChild.drawImage( img, x, y, bgcolor, observer );        }        synchronized ( dirty ) {            makeDirty( x, y, img.getWidth( observer ), img.getHeight( observer ) );            return delegate.drawImage( img, x, y, bgcolor, observer );        }    }    public boolean drawImage( java.awt.Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer ) {        if ( mipMapChild != null ) {            mipMapChild.drawImage( img, x, y, width, height, bgcolor, observer );        }        synchronized ( dirty ) {            makeDirty( x, y, width, height );            return delegate.drawImage( img, x, y, width, height, bgcolor, observer );        }    }    public boolean drawImage( java.awt.Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer ) {        if ( mipMapChild != null ) {            mipMapChild.drawImage( img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, observer );        }        synchronized ( dirty ) {            makeDirty( dx1, dy1, dx2 - dx1, dy2 - dy1 );            return delegate.drawImage( img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, observer );        }    }    public boolean drawImage( java.awt.Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer ) {        if ( mipMapChild != null ) {            mipMapChild.drawImage( img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, bgcolor, observer );        }        synchronized ( dirty ) {            makeDirty( dx1, dy1, dx2 - dx1, dy2 - dy1 );            return delegate.drawImage( img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, bgcolor, observer );        }    }    public void dispose() {        if ( mipMapChild != null ) {            mipMapChild.dispose();        }        delegate.dispose();    }    public void draw( Shape s ) {        if ( mipMapChild != null ) {            mipMapChild.draw( s );        }        synchronized ( dirty ) {            makeDirty( s.getBounds() );            delegate.draw( s );        }    }    public boolean drawImage( java.awt.Image img, AffineTransform xform, ImageObserver obs ) {        if ( mipMapChild != null ) {            mipMapChild.drawImage( img, xform, obs );        }        synchronized ( dirty ) {            makeDirty();            return delegate.drawImage( img, xform, obs );        }    }    public void drawImage( BufferedImage img, BufferedImageOp op, int x, int y ) {        if ( mipMapChild != null ) {            mipMapChild.drawImage( img, op, x, y );        }        synchronized ( dirty ) {            makeDirty( x, y, img.getWidth( null ), img.getHeight( null ) );            delegate.drawImage( img, op, x, y );        }    }    public void drawRenderedImage( RenderedImage img, AffineTransform xform ) {        if ( mipMapChild != null ) {            mipMapChild.drawRenderedImage( img, xform );        }        synchronized ( dirty ) {            makeDirty();            delegate.drawRenderedImage( img, xform );        }    }    public void drawRenderableImage( RenderableImage img, AffineTransform xform ) {        if ( mipMapChild != null ) {            mipMapChild.drawRenderableImage( img, xform );        }        synchronized ( dirty ) {            makeDirty();            delegate.drawRenderableImage( img, xform );        }    }    public void drawString( String str, int x, int y ) {        if ( mipMapChild != null ) {            mipMapChild.drawString( str, x, y );        }        synchronized ( dirty ) {            makeDirty();            delegate.drawString( str, x, y );        }    }    public void drawString( String s, float x, float y ) {        if ( mipMapChild != null ) {            mipMapChild.drawString( s, x, y );        }        synchronized ( dirty ) {            makeDirty();            delegate.drawString( s, x, y );        }    }    public void drawString( AttributedCharacterIterator iterator, int x, int y ) {        if ( mipMapChild != null ) {            mipMapChild.drawString( iterator, x, y );        }        synchronized ( dirty ) {            makeDirty();            delegate.drawString( iterator, x, y );        }    }    public void drawString( AttributedCharacterIterator iterator, float x, float y ) {        if ( mipMapChild != null ) {            mipMapChild.drawString( iterator, x, y );        }        synchronized ( dirty ) {            makeDirty();            delegate.drawString( iterator, x, y );        }    }    public void drawGlyphVector( GlyphVector g, float x, float y ) {        if ( mipMapChild != null ) {            mipMapChild.drawGlyphVector( g, x, y );        }        synchronized ( dirty ) {            makeDirty();            delegate.drawGlyphVector( g, x, y );        }    }    public void fill( Shape s ) {        if ( mipMapChild != null ) {            mipMapChild.fill( s );        }        synchronized ( dirty ) {            makeDirty( s.getBounds() );            delegate.fill( s );        }    }    public boolean hit( Rectangle rect, Shape s, boolean onStroke ) {        return delegate.hit( rect, s, onStroke );    }    public GraphicsConfiguration getDeviceConfiguration() {        return delegate.getDeviceConfiguration();    }    public void setComposite( Composite comp ) {        if ( mipMapChild != null ) {            mipMapChild.setComposite( comp );        }        delegate.setComposite( comp );    }    public void setPaint( Paint paint ) {        if ( mipMapChild != null ) {            mipMapChild.setPaint( paint );        }        delegate.setPaint( paint );    }    public void setStroke( Stroke s ) {        if ( mipMapChild != null ) {            mipMapChild.setStroke( s );        }        delegate.setStroke( s );    }    public void setRenderingHint( RenderingHints.Key hintKey, Object hintValue ) {        if ( mipMapChild != null ) {            mipMapChild.setRenderingHint( hintKey, hintValue );        }        delegate.setRenderingHint( hintKey, hintValue );    }    public Object getRenderingHint( RenderingHints.Key hintKey ) {        return delegate.getRenderingHint( hintKey );    }    public void setRenderingHints( Map<?,?> hints ) {        if ( mipMapChild != null ) {            mipMapChild.setRenderingHints( hints );        }        delegate.setRenderingHints( hints );    }    public void addRenderingHints( Map<?,?> hints ) {        if ( mipMapChild != null ) {            mipMapChild.addRenderingHints( hints );        }        delegate.addRenderingHints( hints );    }    public RenderingHints getRenderingHints() {        return delegate.getRenderingHints();    }    public void translate( int x, int y ) {        translation.x += x * scaleX;        translation.y += y * scaleY;        if ( mipMapChild != null ) {            mipMapChild.translate( x, y );        }        delegate.translate( x, y );    }    public void translate( double tx, double ty ) {        translation.x += tx * scaleX;        translation.y += ty * scaleY;        if ( mipMapChild != null ) {            mipMapChild.translate( tx, ty );        }        delegate.translate( tx, ty );    }    public void rotate( double theta ) {        throw new UnsupportedOperationException();//        delegate.rotate( theta );    }    public void rotate( double theta, double x, double y ) {        throw new UnsupportedOperationException();//        delegate.rotate( theta, x, y );    }    public void scale( double sx, double sy ) {        scaleX *= sx;        scaleY *= sy;        if ( mipMapChild != null ) {            mipMapChild.scale( sx, sy );        }        delegate.scale( sx, sy );    }    public void shear( double shx, double shy ) {        throw new UnsupportedOperationException();//        delegate.shear( shx, shy );    }    public void transform( AffineTransform Tx ) {        throw new UnsupportedOperationException();//        delegate.transform( Tx );    }    public void setTransform( AffineTransform Tx ) {        throw new UnsupportedOperationException();//        delegate.setTransform( Tx );    }    public AffineTransform getTransform() {        return delegate.getTransform();    }    public Paint getPaint() {        return delegate.getPaint();    }    public Composite getComposite() {        return delegate.getComposite();    }    public void setBackground( Color color ) {        if ( mipMapChild != null ) {            mipMapChild.setBackground( color );        }        delegate.setBackground( color );    }    public Color getBackground() {        return delegate.getBackground();    }    public Stroke getStroke() {        return delegate.getStroke();    }    public void clip( Shape s ) {        if ( mipMapChild != null ) {            mipMapChild.clip( s );        }        delegate.clip( s );    }    public FontRenderContext getFontRenderContext() {        return delegate.getFontRenderContext();    }    public void update() {        synchronized (dirty) {            if (dirty == null) {                awtImage.getRaster().getDataElements(0, 0, awtImage.getWidth(),                        awtImage.getHeight(), data);                ByteBuffer scratch = getImage().getData(0);                scratch.clear();                scratch.put(data);                scratch.flip();            } else {                awtImage.getRaster().getDataElements(dirty.x, dirty.y,                        dirty.width, dirty.height, data);                ByteBuffer scratch = getImage().getData(0);                int pixLen = awtImage.getRaster().getNumDataElements();                for (int dirtyRow = 0; dirtyRow < dirty.height; ++dirtyRow) {                    scratch                            .position(((image.getWidth() * (dirty.y + dirtyRow)) + dirty.x)                                    * pixLen);                    scratch.put(data, dirty.width * dirtyRow * pixLen,                            dirty.width * pixLen);                }            }        }    }}/* * $Log$ */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?