com.tensegrity.graphics.device
Class AbstractDevice

java.lang.Object
  extended bycom.tensegrity.graphics.device.AbstractDevice
All Implemented Interfaces:
Device
Direct Known Subclasses:
AWTDevice, SVGDevice, SWTDeviceNonAWTDependent

public abstract class AbstractDevice
extends java.lang.Object
implements Device

Class AbstractDevice is the base class for all current Device implementations and handles Format objects in the same way for all derived classes. This abstract class declares protected fields to hold these various Format objects. It implements all relevant getter() and setter() methods for this purpose.

Version:
$Id: AbstractDevice.java,v 1.12 2005/11/14 14:59:02 KevinCVS Exp $
Author:
MichaelKegel

Field Summary
protected  FontFormat fontFormat
          instance variable for the FontFormat used by the Device
protected  java.lang.Object[] fontFormatData
          instance variable for the FontFormat rendering data used by the Device
protected  PaintFormat paintFormat
          instance variable for the PaintFormat used by the Device
protected  java.lang.Object[] paintFormatData
          instance variable for the PaintFormat rendering data used by the Device
protected  StrokeFormat strokeFormat
          instance variable for the StrokeFormat used by the Device
protected  java.lang.Object[] strokeFormatData
          instance variable for the StrokeFormat rendering data used by the Device
protected  boolean visibleFont
          instance variable that indicated whether the current fontformat / fontformat rendering data is visible or not
protected  boolean visiblePaint
          instance variable that indicated whether the current paintformat / paintformat rendering data is visible or not
protected  boolean visibleStroke
          instance variable that indicates whether the current strokeformat / strokeformat rendering data is visible or not
 
Fields inherited from interface com.tensegrity.graphics.device.Device
DRAW_FILL, DRAW_OUTLINE
 
Constructor Summary
AbstractDevice()
          Constructor for AbstractDevice.
 
Method Summary
 FontFormat getFontFormat()
          Returns the FontFormat currently used for text drawing operations.
 PaintFormat getPaintFormat()
          Returns the current PaintFormat the Device uses to fill areas.
 StrokeFormat getStrokeFormat()
          Returns the current StrokeFormat the Device uses for drawing lines.
 void setFontFormat(FontFormat fontFormat)
          Sets the FontFormat that will be used for all subsequent text drawing operations.
 void setFontFormatData(java.lang.Object[] fontFormatData)
          Because all formats get pooled, illustrators and users need an easy way to change them.
 void setPaintFormat(PaintFormat paintFormat)
          Sets the PaintFormat the Device should use for filling areas.
 void setPaintFormatData(java.lang.Object[] paintFormatData)
          Sets the PaintFormat rendering data the Device should use for filling areas.
 void setStrokeFormat(StrokeFormat strokeFormat)
          Sets the StrokeFormat the Device should use for drawing lines or borders around rectangles and polygons.
 void setStrokeFormatData(java.lang.Object[] strokeFormatData)
          Sets the StrokeFormat rendering data the Device should use for drawing lines or borders around rectangles and polygons.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.tensegrity.graphics.device.Device
clearClip, clearRect, clipRect, dispose, drawArc, drawLine, drawOval, drawPolygon, drawPolyline, drawRect, drawRoundRect, drawString, getClipBounds, getClipBounds, getTransform, hitClip, initiate, isAntialiasing, isInhibitLT2RBFlip, isInhibitYFlip, isPrinting, setAntialiasing, setClip, setClipBounds, setInhibitLT2RBFlip, setInhibitYFlip, setIsPrinting, setPaintMode, setTransform, setXORMode, translate
 

Field Detail

strokeFormat

protected StrokeFormat strokeFormat
instance variable for the StrokeFormat used by the Device


strokeFormatData

protected java.lang.Object[] strokeFormatData
instance variable for the StrokeFormat rendering data used by the Device


visibleStroke

protected boolean visibleStroke
instance variable that indicates whether the current strokeformat / strokeformat rendering data is visible or not


paintFormat

protected PaintFormat paintFormat
instance variable for the PaintFormat used by the Device


paintFormatData

protected java.lang.Object[] paintFormatData
instance variable for the PaintFormat rendering data used by the Device


visiblePaint

protected boolean visiblePaint
instance variable that indicated whether the current paintformat / paintformat rendering data is visible or not


fontFormat

protected FontFormat fontFormat
instance variable for the FontFormat used by the Device


fontFormatData

protected java.lang.Object[] fontFormatData
instance variable for the FontFormat rendering data used by the Device


visibleFont

protected boolean visibleFont
instance variable that indicated whether the current fontformat / fontformat rendering data is visible or not

Constructor Detail

AbstractDevice

public AbstractDevice()
Constructor for AbstractDevice.

Method Detail

getStrokeFormat

public StrokeFormat getStrokeFormat()
Description copied from interface: Device
Returns the current StrokeFormat the Device uses for drawing lines.

Specified by:
getStrokeFormat in interface Device
Returns:
the current used StrokeFormat or null

setStrokeFormat

public void setStrokeFormat(StrokeFormat strokeFormat)
Description copied from interface: Device
Sets the StrokeFormat the Device should use for drawing lines or borders around rectangles and polygons. When invoking this method the StrokeFormat is used instead of the color value the Device currently uses. If the Device should use the current color value, this method has to be called with a null parameter.

Specified by:
setStrokeFormat in interface Device
Parameters:
strokeFormat - the StrokeFormat to use when drawing lines or borders, or null

setStrokeFormatData

public void setStrokeFormatData(java.lang.Object[] strokeFormatData)
Description copied from interface: Device
Sets the StrokeFormat rendering data the Device should use for drawing lines or borders around rectangles and polygons. When invoking this method the StrokeFormat is used instead of the color value the Device currently uses. If the Device should use the current color value, this method has to be called with a null parameter. The given array has to consist of three Integer objects. The meaning of the value is defined by its position in the array. The following list specifies the valid index positions:

Specified by:
setStrokeFormatData in interface Device
Parameters:
strokeFormatData - the StrokeFormat rendering data to use when drawing lines or borders, or null
See Also:
Device.setStrokeFormatData(java.lang.Object[])

getPaintFormat

public PaintFormat getPaintFormat()
Description copied from interface: Device
Returns the current PaintFormat the Device uses to fill areas.

Specified by:
getPaintFormat in interface Device
Returns:
the current PaintFormat or null
See Also:
Device.getPaintFormat()

setPaintFormat

public void setPaintFormat(PaintFormat paintFormat)
Description copied from interface: Device
Sets the PaintFormat the Device should use for filling areas. If the current color should be used, this method has to be called with a null parameter.

Specified by:
setPaintFormat in interface Device
Parameters:
paintFormat - the PaintFormat to use when filling areas, or null

setPaintFormatData

public void setPaintFormatData(java.lang.Object[] paintFormatData)
Description copied from interface: Device
Sets the PaintFormat rendering data the Device should use for filling areas. When invoking this method the PaintFormat is used instead of the color value the Device> currently uses. If the Device should use the current color value, this method has to be called with a null parameter. Overall eight values of the given array are estimated. REVIEWJAVADOC: Device.java : what do you mean by "estimated"??? The meaning of each value is defined by its position in the array. The following table specifies the valid index positions and object types:
IndexType
RenderingData.VALUEINDEX_PAINT_STYLE Integer
RenderingData.VALUEINDEX_PAINT_COLORBACK Integer
RenderingData.VALUEINDEX_PAINT_COLORFORE Integer
RenderingData.VALUEINDEX_PAINT_GRADIENTTYPE Integer
RenderingData.VALUEINDEX_PAINT_PATTERNTYPE Integer
RenderingData.VALUEINDEX_PAINT_TEXTURE Texture
RenderingData.VALUEINDEX_PAINT_TRANSPARENCY Integer
RenderingData.VALUEINDEX_PAINT_TRANSPARENT Boolean

Specified by:
setPaintFormatData in interface Device
Parameters:
paintFormatData - the PaintFormat rendering data to use when filling areas, or null

getFontFormat

public FontFormat getFontFormat()
Description copied from interface: Device
Returns the FontFormat currently used for text drawing operations.

Specified by:
getFontFormat in interface Device
Returns:
FontFormat the currently used FontFormat

setFontFormat

public void setFontFormat(FontFormat fontFormat)
Description copied from interface: Device
Sets the FontFormat that will be used for all subsequent text drawing operations. When the default color and font of the Device should be used, the method has to be called with a null parameter.

Specified by:
setFontFormat in interface Device
Parameters:
fontFormat - the FontFormat to use when drawing text, or null

setFontFormatData

public void setFontFormatData(java.lang.Object[] fontFormatData)
Description copied from interface: Device
Because all formats get pooled, illustrators and users need an easy way to change them. This method sets the FontFormat rendering data that will be used for all subsequent text drawing operations. When the Device should use the current color value and the default font of the device, however, this method has to be called with a null parameter. At this time, four values of the given array are estimated. REVIEWJAVADOC: There is that word "estimated" again!!! The meaning of each value is defined by its position in the array. The following list specifies the valid index positions and object types:
IndexType
RenderingData.VALUEINDEX_FONT_SIZE Integer
RenderingData.VALUEINDEX_FONT_WEIGHT Integer
RenderingData.VALUEINDEX_FONT_FAMILY String
RenderingData.VALUEINDEX_FONT_ITALIC Boolean

Specified by:
setFontFormatData in interface Device
Parameters:
fontFormatData - the FontFormat rendering data to use when drawing text, or null


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.