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
This commit is contained in:
@@ -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();
|
||||
|
Reference in New Issue
Block a user