diff options
author | Rüdiger Timm <rt@openoffice.org> | 2004-11-26 16:05:57 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2004-11-26 16:05:57 +0000 |
commit | e956927f9df419db0c0fe8586ff349a47521a383 (patch) | |
tree | 7bc2ceb4885a8b83da38b81b5266121340c7e1f5 /canvas/source | |
parent | e7119701583fda213d9f2dc01a86ed49f783d35c (diff) |
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED
2004/11/17 17:00:24 thb 1.2.2.3: #118514# Canvas module reorg
2004/11/08 05:51:47 thb 1.2.2.2: #i36093# Added native gradients API
2004/10/26 23:36:57 thb 1.2.2.1: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally
Diffstat (limited to 'canvas/source')
-rw-r--r-- | canvas/source/java/CanvasGraphicDevice.java | 84 |
1 files changed, 81 insertions, 3 deletions
diff --git a/canvas/source/java/CanvasGraphicDevice.java b/canvas/source/java/CanvasGraphicDevice.java index 29d6aa2494fe..16ad7fc3ed3a 100644 --- a/canvas/source/java/CanvasGraphicDevice.java +++ b/canvas/source/java/CanvasGraphicDevice.java @@ -59,6 +59,7 @@ import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; import com.sun.star.uno.AnyConverter; +import com.sun.star.beans.XPropertySet; import com.sun.star.lib.uno.helper.WeakBase; // OOo AWT @@ -82,14 +83,17 @@ import com.sun.star.uno.Type; public class CanvasGraphicDevice extends com.sun.star.lib.uno.helper.ComponentBase implements com.sun.star.lang.XServiceInfo, + com.sun.star.beans.XPropertySet, drafts.com.sun.star.rendering.XGraphicDevice { - private java.awt.GraphicsConfiguration graphicsConfig; + private java.awt.Graphics2D graphics; + private java.awt.GraphicsConfiguration graphicsConfig; //---------------------------------------------------------------------------------- - public CanvasGraphicDevice( java.awt.Graphics2D graphics ) + public CanvasGraphicDevice( java.awt.Graphics2D _graphics ) { + graphics = _graphics; graphicsConfig = graphics.getDeviceConfiguration(); } @@ -144,7 +148,7 @@ public class CanvasGraphicDevice CanvasUtils.printLog( "createCompatibleBitmap called with size (" + size.Width + ", " + size.Height + ")" ); return new CanvasBitmap( graphicsConfig.createCompatibleImage( size.Width, size.Height, - Transparency.TRANSLUCENT ) ); + Transparency.OPAQUE ) ); } public synchronized drafts.com.sun.star.rendering.XVolatileBitmap createVolatileBitmap( IntegerSize2D size ) @@ -154,6 +158,80 @@ public class CanvasGraphicDevice return null; } + public synchronized drafts.com.sun.star.rendering.XBitmap createCompatibleAlphaBitmap( IntegerSize2D size ) + { + CanvasUtils.printLog( "createCompatibleBitmap called with size (" + size.Width + ", " + size.Height + ")" ); + return new CanvasBitmap( graphicsConfig.createCompatibleImage( size.Width, + size.Height, + Transparency.TRANSLUCENT ) ); + } + + public synchronized drafts.com.sun.star.rendering.XVolatileBitmap createVolatileAlphaBitmap( IntegerSize2D size ) + { + CanvasUtils.printLog( "createVolatileBitmap called with size (" + size.Width + ", " + size.Height + ")" ); + //return new CanvasBitmap( graphicsConfig.createCompatibleVolatileImage( size.Width, size.Height ) ); + return null; + } + + public synchronized drafts.com.sun.star.rendering.XParametricPolyPolygon2DFactory getParametricPolyPolygonFactory() + { + // TODO + return null; + } + + public synchronized com.sun.star.beans.XPropertySetInfo getPropertySetInfo() + { + // This is a stealth property set + return null; + } + + public synchronized void setPropertyValue( String aPropertyName, java.lang.Object aValue ) throws com.sun.star.beans.PropertyVetoException + { + // all our properties are read-only + throw new com.sun.star.beans.PropertyVetoException(); + } + + public synchronized java.lang.Object getPropertyValue( String PropertyName ) throws com.sun.star.beans.UnknownPropertyException + { + if( PropertyName == "DeviceHandle" ) + return graphics; + + throw new com.sun.star.beans.UnknownPropertyException(); + } + + public synchronized void addPropertyChangeListener( String aPropertyName, com.sun.star.beans.XPropertyChangeListener xListener ) throws com.sun.star.beans.UnknownPropertyException + { + if( aPropertyName == "DeviceHandle" ) + return; + + throw new com.sun.star.beans.UnknownPropertyException(); + } + + public synchronized void removePropertyChangeListener( String aPropertyName, com.sun.star.beans.XPropertyChangeListener aListener ) throws com.sun.star.beans.UnknownPropertyException + { + if( aPropertyName == "DeviceHandle" ) + return; + + throw new com.sun.star.beans.UnknownPropertyException(); + } + + public synchronized void addVetoableChangeListener( String PropertyName, com.sun.star.beans.XVetoableChangeListener aListener ) throws com.sun.star.beans.UnknownPropertyException + { + if( PropertyName == "DeviceHandle" ) + return; + + throw new com.sun.star.beans.UnknownPropertyException(); + } + + public synchronized void removeVetoableChangeListener( String PropertyName, com.sun.star.beans.XVetoableChangeListener aListener ) throws com.sun.star.beans.UnknownPropertyException + { + if( PropertyName == "DeviceHandle" ) + return; + + throw new com.sun.star.beans.UnknownPropertyException(); + } + + public synchronized boolean hasFullScreenMode() { return graphicsConfig.getDevice().isFullScreenSupported(); |