com.tensegrity.graphics.device
Class SVGDevice

java.lang.Object
  extended bycom.tensegrity.graphics.device.AbstractDevice
      extended bycom.tensegrity.graphics.device.SVGDevice
All Implemented Interfaces:
Device

public class SVGDevice
extends AbstractDevice
implements Device

This Device implementation is used to export graph documents to the scalable vector graphics (SVG) format.

Version:
$Id: SVGDevice.java,v 1.83 2006/02/20 15:56:05 BurkhardWick Exp $
Author:
MichaelKegel, BurkhardWick

Field Summary
static int IMGTYPE_JPG
          IMGTYPE_JPG: Constant for image type JPEG
static int IMGTYPE_PNG
          IMGTYPE_PNG: Constant for image type PNG
static int OPTIMIZE_COLORS
          Flag for optimizing colors, so that colors that differ less than the color tolerance value will be considered equal and no new style is created for each of them
static int OPTIMIZE_COMPRESS
          Constant for compression, if set the result will be gzipped
static int OPTIMIZE_MAPS
          Flag for optimizing rasters and try to gather as many pixels as possible in one drawRect
static int OPTIMIZE_STYLES
          Flag for optimizing styles and creating CSS items and reference them instead of storing the whole style string more than once
 
Fields inherited from class com.tensegrity.graphics.device.AbstractDevice
fontFormat, fontFormatData, paintFormat, paintFormatData, strokeFormat, strokeFormatData, visibleFont, visiblePaint, visibleStroke
 
Fields inherited from interface com.tensegrity.graphics.device.Device
DRAW_FILL, DRAW_OUTLINE
 
Method Summary
 void addCustomInfo(java.lang.String name, AttributeSet attributes)
          Adds custom information to the current group context
 void clearClip()
          Clears the currently used clip rectangle.
 void clearRect(int x, int y, int width, int height)
          Clears the specified rectangle by filling it with the background color of the current drawing surface.
 void clipRect(int x, int y, int width, int height)
          Intersects the current clip with the specified rectangle.
 void closeStream()
          Closes the output stream
 void dispose()
          MUST be called after finishing all drawing routines!
 void drawArc(int flags, int x, int y, int width, int height, int startAngle, int arcAngle)
          Draws a circular or elliptical arc covering the specified rectangle.
 void drawLine(int x1, int y1, int x2, int y2)
          This method draws a line from the starting coordinate given by x1 and y1 to the ending coordinate given by x2 and y2.
 void drawOval(int flags, int x, int y, int width, int height)
          Draws an oval.
 void drawPolygon(int flags, int[] ptX, int[] ptY, int ptCount)
          This method draws a closed polygon.
 void drawPolyline(int[] ptX, int[] ptY, int ptCount)
          This method draws a polyline.
 void drawRect(int flags, int x, int y, int width, int height)
          This methods draws the rectangle defined by the given parameters.
 void drawRoundRect(int flags, int x, int y, int width, int height, int arcWidth, int arcHeight)
          Draws a round-cornered rectangle using this graphic contexts currently set Stroke- and PaintFormat.
 void drawString(java.lang.String str, int x, int y)
          Draws the text given by the specified string, using this graphics context's current font and color.
 void enterGroup(java.lang.String name, java.util.Map attributes)
          Opens a new group context to that custom attributes can be added.
 void enterLinkGroup(java.lang.String title, java.lang.String hRef, java.lang.String targetFrame)
          Opens a new group context to that custom attributes can be added.
 Boundary getClipBounds()
          Returns the bounding rectangle of the current clipping area.
 Boundary getClipBounds(Boundary r)
          Returns the bounding rectangle of the current clipping area.
 int getColorTolerance()
          Returns the current color tolerance of this device.
static SVGDevice getDevice()
          Returns the reusable SVG device
static SVGDevice getDevice(int bgColor)
          Returns the reusable SVG device
static SVGDevice getDevice(int bgColor, Coordinate viewPos)
          Returns the reusable SVG device
static int getImgTypeForRasters()
          Returns the imgTypeForRasters.
 boolean getJPEGForceBaseline()
          Returns the force baseline option that is used for the jpg encoding when storing embedded textures
 float getJPEGQuality()
          Returns the quality setting that is used for JPEG encoding when storing embedded textures
 Transform2D getTransform()
          Returns a copy of the current AffineTransform in the Device.
 boolean hitClip(int x, int y, int width, int height)
          Returns true if the specified rectangular area intersects the bounding rectangle of the current clipping area.
 void initiate()
          MUST be called before any drawing routine!
 boolean isAntialiasing()
          Returns true if antialising is enabled for this Device, otherwise false is returned.
 boolean isInhibitLT2RBFlip()
           
 boolean isInhibitYFlip()
           
 boolean isInLinkGroup()
          Checks whether the device is currently in a link group context
 boolean isOptimizing2DMaps()
          Returns true, if the optimization of 2DMaps (textures, patterns) is turned on.
 boolean isOptimizingColors()
          Returns true, if the optimization of colors is turned on.
 boolean isOptimizingCompress()
          Returns true, if the compression is turned on.
 boolean isOptimizingStyles()
          Returns true, if the optimization of styles is turned on.
 boolean isPrinting()
           
 void leaveGroup()
          Leaves the current group context and enters the parent group context
 void leaveLinkGroup()
          Leaves the current group context and enters the parent group context
 void setAntialiasing(boolean antialiasing)
          Enables or disables antialiasing for this Device
 void setBackground(int colorRGB)
          Sets the background color
 void setClip(int x, int y, int width, int height)
          Sets the current clip to the rectangle specified by the given coordinates.
 void setClipBounds(Boundary boundary)
          Sets the current clip to the rectangle specified by the given coordinates.
 void setColorTolerance(int tolerance)
          Sets the color tolerance for this device.
 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.
static void setImgTypeForRasters(int imgTypeForRasters)
          Sets the value of imgTypeForRasters
 void setInhibitLT2RBFlip(boolean inhibitLT2RBFlip)
           
 void setInhibitYFlip(boolean inhibitYFlip)
           
 void setIsPrinting(boolean isPrinting)
           
 void setJPEGForceBaseline(boolean forceBaseline)
          Sets the force baseline option that is used for the jpg encoding when storing embedded textures
 void setJPEGQuality(float quality)
          Sets the quality setting that is used for JPEG encoding when storing embedded textures.
 void setOptimization(int optimizationMask)
          Sets the optimization setting to a selection of items and removes all others.
 void setOptimization(int optimizationMask, boolean enabled)
          Sets the optimization state of a single or a selection of items without changing the others.
 void setOutput(java.io.OutputStream os)
          Sets the output stream for this device.
 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 setPaintMode()
          Sets the paint mode of this graphics context to overwrite the destination with this graphics context's current color.
 void setStrokeFormat(StrokeFormat strokeFormat)
          Sets a new stroke format
 void setStrokeFormatData(java.lang.Object[] strokeFormatData)
          Sets the StrokeFormat rendering data the Device should use for drawing lines or borders around rectangles and polygons.
 void setTransform(Transform2D xform)
          Sets the Transform2D in the Device.
 void setXORMode(int xorAlternationColor)
          Sets mode to XOR mode (unsupported)
 void translate(int x, int y)
          This method translates the origin of this devise to the point given by x and y in the actual coordinate of this device.
 
Methods inherited from class com.tensegrity.graphics.device.AbstractDevice
getFontFormat, getPaintFormat, getStrokeFormat
 
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
getFontFormat, getPaintFormat, getStrokeFormat
 

Field Detail

OPTIMIZE_MAPS

public static final int OPTIMIZE_MAPS
Flag for optimizing rasters and try to gather as many pixels as possible in one drawRect

See Also:
Constant Field Values

OPTIMIZE_STYLES

public static final int OPTIMIZE_STYLES
Flag for optimizing styles and creating CSS items and reference them instead of storing the whole style string more than once

See Also:
Constant Field Values

OPTIMIZE_COMPRESS

public static final int OPTIMIZE_COMPRESS
Constant for compression, if set the result will be gzipped

See Also:
Constant Field Values

OPTIMIZE_COLORS

public static final int OPTIMIZE_COLORS
Flag for optimizing colors, so that colors that differ less than the color tolerance value will be considered equal and no new style is created for each of them

See Also:
Constant Field Values

IMGTYPE_JPG

public static final int IMGTYPE_JPG
IMGTYPE_JPG: Constant for image type JPEG

See Also:
Constant Field Values

IMGTYPE_PNG

public static final int IMGTYPE_PNG
IMGTYPE_PNG: Constant for image type PNG

See Also:
Constant Field Values
Method Detail

getDevice

public static SVGDevice getDevice()
Returns the reusable SVG device

Returns:
SVGDevice The SVG device

getDevice

public static SVGDevice getDevice(int bgColor)
Returns the reusable SVG device

Parameters:
bgColor - The background color
Returns:
SVGDevice The SVG device

getDevice

public static SVGDevice getDevice(int bgColor,
                                  Coordinate viewPos)
Returns the reusable SVG device

Parameters:
bgColor - The background color
viewPos - The view position to use for the SVG
Returns:
SVGDevice The SVG device

initiate

public void initiate()
MUST be called before any drawing routine! Initializes this instance of the device: - Resets status (paint, stroke, font, transform, ...) - Creates new document - Builds svg section - Builds dev section

Specified by:
initiate in interface Device

dispose

public void dispose()
MUST be called after finishing all drawing routines! Finishes the SVG, writes the document into the outputstream.

Specified by:
dispose in interface Device

setStrokeFormat

public void setStrokeFormat(StrokeFormat strokeFormat)
Sets a new stroke format

Specified by:
setStrokeFormat in interface Device
Overrides:
setStrokeFormat in class AbstractDevice
Parameters:
strokeFormat - The stroke format to set

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
Overrides:
setStrokeFormatData in class AbstractDevice
See Also:
Device.setStrokeFormatData(java.lang.Object[])

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
Overrides:
setPaintFormat in class AbstractDevice

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
Overrides:
setPaintFormatData in class AbstractDevice

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
Overrides:
setFontFormat in class AbstractDevice

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
Overrides:
setFontFormatData in class AbstractDevice

translate

public void translate(int x,
                      int y)
Description copied from interface: Device
This method translates the origin of this devise to the point given by x and y in the actual coordinate of this device. All coordinates in subsequent calls to drawing methods are assumed to be relative to the new origin.

Specified by:
translate in interface Device
Parameters:
x - the x coordinate of the new origin
y - the y coordinate of the new origin

getTransform

public Transform2D getTransform()
Description copied from interface: Device
Returns a copy of the current AffineTransform in the Device.

Specified by:
getTransform in interface Device
Returns:
the current AffineTransform in the Device.

setTransform

public void setTransform(Transform2D xform)
Description copied from interface: Device
Sets the Transform2D in the Device.

Specified by:
setTransform in interface Device
Parameters:
xform - the Transform2D object to be used in the rendering process

setPaintMode

public void setPaintMode()
Description copied from interface: Device
Sets the paint mode of this graphics context to overwrite the destination with this graphics context's current color. This sets the logical pixel operation function to the paint or overwrite mode. All subsequent rendering operations will overwrite the destination with the current color.

Specified by:
setPaintMode in interface Device

setXORMode

public void setXORMode(int xorAlternationColor)
Sets mode to XOR mode (unsupported)

Specified by:
setXORMode in interface Device
Parameters:
xorAlternationColor - The xor color to set
See Also:
Device.setXORMode(int)

setClip

public void setClip(int x,
                    int y,
                    int width,
                    int height)
Description copied from interface: Device
Sets the current clip to the rectangle specified by the given coordinates. Rendering operations have no effect outside of the clipping area.

Specified by:
setClip in interface Device
Parameters:
x - the left coordinate of the new clip rectangle
y - the top coordinate of the new clip rectangle
width - the extent of the new clip rectangle in x direction
height - the extent of the new clip rectangle in y direction

clipRect

public void clipRect(int x,
                     int y,
                     int width,
                     int height)
Description copied from interface: Device
Intersects the current clip with the specified rectangle. The resulting clipping area is the intersection of the current clipping area and the specified rectangle. If there is no current clipping area, either because the clip has never been set, or the clip has been cleared using setClip(Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE), the specified rectangle becomes the new clip. This method sets the user clip, which is independent of the clipping associated with device bounds and window visibility. This method can only be used to make the current clip smaller. To set the current clip larger, use any of the setClip methods. Rendering operations have no effect outside of the clipping area.

Specified by:
clipRect in interface Device
Parameters:
x - the x coordinate of the rectangle to intersect the clip with
y - the y coordinate of the rectangle to intersect the clip with
width - the width of the rectangle to intersect the clip with
height - the height of the rectangle to intersect the clip with

hitClip

public boolean hitClip(int x,
                       int y,
                       int width,
                       int height)
Description copied from interface: Device
Returns true if the specified rectangular area intersects the bounding rectangle of the current clipping area. The coordinates in the rectangle are relative to the coordinate system origin of this graphics context.

Specified by:
hitClip in interface Device
Parameters:
x - the x coordinate of the rectangle to test against the clip
y - the y coordinate of the rectangle to test against the clip
width - the width of the rectangle to test against the clip
height - the height of the rectangle to test against the clip
Returns:
true if the specified rectangular area intersects the bounding rectangle of the current clipping area.

getClipBounds

public Boundary getClipBounds()
Description copied from interface: Device
Returns the bounding rectangle of the current clipping area. This method refers to the user clip, which is independent of the clipping associated with device bounds and window visibility. If no clip has previously been set, or if the clip has been cleared using setClip(null), this method returns null. The coordinates in the rectangle are relative to the coordinate system origin of this graphics context.

Specified by:
getClipBounds in interface Device
Returns:
the bounding rectangle of the current clipping area, or null if no clip is set.

getClipBounds

public Boundary getClipBounds(Boundary r)
Description copied from interface: Device
Returns the bounding rectangle of the current clipping area. The coordinates in the rectangle are relative to the coordinate system origin of this graphics context. This method differs from Device.getClipBounds() in that an existing Boundary is used instead of allocating a new one. This method refers to the user clip, which is independent of the clipping associated with device bounds and window visibility. If no clip has previously been set, or if the clip has been cleared using setClip(null), this method returns the specified Boundary.

Specified by:
getClipBounds in interface Device
Parameters:
r - the rectangular boundary where the current clipping area is copied to. Any current values in this rectangle are overwritten.
Returns:
the bounding rectangle of the current clipping area.

setClipBounds

public void setClipBounds(Boundary boundary)
Description copied from interface: Device
Sets the current clip to the rectangle specified by the given coordinates. Rendering operations have no effect outside of the clipping area.

Specified by:
setClipBounds in interface Device
Parameters:
boundary - the new bounding rectangle to clip against

clearClip

public void clearClip()
Description copied from interface: Device
Clears the currently used clip rectangle.

Specified by:
clearClip in interface Device

drawLine

public void drawLine(int x1,
                     int y1,
                     int x2,
                     int y2)
Description copied from interface: Device
This method draws a line from the starting coordinate given by x1 and y1 to the ending coordinate given by x2 and y2.

Specified by:
drawLine in interface Device
Parameters:
x1 - the starting coordinate x value
y1 - the starting coordinate y value
x2 - the ending coordinate x value
y2 - the ending coordinate y value

drawRect

public void drawRect(int flags,
                     int x,
                     int y,
                     int width,
                     int height)
Description copied from interface: Device
This methods draws the rectangle defined by the given parameters. The rectangle starts at x and y. The right coordinates are calculated by x + width and the bottom coordinates are calculated by y + height.

Specified by:
drawRect in interface Device
Parameters:
flags - bitwise combined flags that determine what to draw.
x - the left coordinate of the rectangle.
y - the top coordinate of the rectangle.
width - the extent in x direction.
height - the extent in y direction.

drawRoundRect

public void drawRoundRect(int flags,
                          int x,
                          int y,
                          int width,
                          int height,
                          int arcWidth,
                          int arcHeight)
Description copied from interface: Device
Draws a round-cornered rectangle using this graphic contexts currently set Stroke- and PaintFormat. The left and right edges of the rectangle are at x and x + width, respectively. The top and bottom edges of the rectangle are at y and y + height.

Specified by:
drawRoundRect in interface Device
Parameters:
flags - bitwise combined flags that determine what to draw
x - the x coordinate of the rectangle to be drawn
y - the y coordinate of the rectangle to be drawn
width - the width of the rectangle to be drawn
height - the height of the rectangle to be drawn
arcWidth - the horizontal diameter of the arc at the four corners
arcHeight - the vertical diameter of the arc at the four corners

clearRect

public void clearRect(int x,
                      int y,
                      int width,
                      int height)
Description copied from interface: Device
Clears the specified rectangle by filling it with the background color of the current drawing surface.

Specified by:
clearRect in interface Device
Parameters:
x - the x coordinate of the rectangle to be clear
y - the y coordinate of the rectangle to be clear
width - the width of the rectangle to be clear
height - the height of the rectangle to be clear

drawOval

public void drawOval(int flags,
                     int x,
                     int y,
                     int width,
                     int height)
Description copied from interface: Device
Draws an oval. The result is a circle or ellipse that fits within the rectangle specified by the x, y, width, and height arguments. The oval covers an area that is width + 1 pixels wide and height + 1 pixels tall.

Specified by:
drawOval in interface Device
Parameters:
flags - bitwise combined flags that determine what to draw
x - the x coordinate of the upper left corner of the oval to be drawn
y - the y coordinate of the upper left corner of the oval to be drawn
width - the width of the oval to be drawn
height - the height of the oval to be drawn

drawArc

public void drawArc(int flags,
                    int x,
                    int y,
                    int width,
                    int height,
                    int startAngle,
                    int arcAngle)
Description copied from interface: Device
Draws a circular or elliptical arc covering the specified rectangle. The resulting arc starts at startAngle and extends for arcAngle degrees, using the current color of the Device. Angles are interpreted in such a manner that a degree of 0 belongs to the 3 o'clock position. A positive value indicates a counter-clockwise rotation while a negative value indicates a clockwise rotation. The center of the arc is the center of the rectangle whose origin is (x, y) and whose size is specified by the width and height arguments. The resulting arc covers an area width + 1 pixels wide by height + 1 pixels tall. The angles are specified relative to the non-square extents of the bounding rectangle such that 45 degrees always falls on the line from the center of the ellipse to the upper right corner of the bounding rectangle. As a result, if the bounding rectangle is noticeably longer in one axis than the other, the angles to the start and end of the arc segment will be skewed farther along the longer axis of the bounds.

Specified by:
drawArc in interface Device
Parameters:
flags - bitwise combined flags that determine what to draw
x - the x coordinate of the upper-left corner of the arc to be drawn
y - the y coordinate of the upper-left corner of the arc to be drawn
width - the width of the arc to be drawn
height - the height of the arc to be drawn
startAngle - the beginning angle
arcAngle - the angular extent of the arc, relative to the start angle

drawPolyline

public void drawPolyline(int[] ptX,
                         int[] ptY,
                         int ptCount)
Description copied from interface: Device
This method draws a polyline. The polyline is defined by the two given arrays of x and y coordinates. Each point of the polyline is defined by a pair. The points are taken from the arrays starting at index 0 up to index ptCount-1.

Specified by:
drawPolyline in interface Device
Parameters:
ptX - the x coordinates of the points
ptY - the y coordinates of the points
ptCount - the amount of points the polygon consist of

drawPolygon

public void drawPolygon(int flags,
                        int[] ptX,
                        int[] ptY,
                        int ptCount)
Description copied from interface: Device
This method draws a closed polygon. The polygon is defined by the two given arrays of x and y coordinates. Each point of the polygon is defined by a pair. The points are taken from the arrays starting at index 0 up to index ptCount-1. If the point at index 0 and the point at index ptCount-1 are different the polygon is automatically closed.

Specified by:
drawPolygon in interface Device
Parameters:
flags - bitwise combined flags that determine what to draw
ptX - the x coordinates of the points
ptY - the y coordinates of the points
ptCount - the amount of points the polygon consist of

drawString

public void drawString(java.lang.String str,
                       int x,
                       int y)
Description copied from interface: Device
Draws the text given by the specified string, using this graphics context's current font and color. The baseline of the leftmost character is at position (x, y) in this graphic contexts coordinate system.

Specified by:
drawString in interface Device
Parameters:
str - the string to be drawn
x - the x coordinate
y - the y coordinate

setIsPrinting

public void setIsPrinting(boolean isPrinting)
Specified by:
setIsPrinting in interface Device

isPrinting

public boolean isPrinting()
Specified by:
isPrinting in interface Device

setInhibitLT2RBFlip

public void setInhibitLT2RBFlip(boolean inhibitLT2RBFlip)
Specified by:
setInhibitLT2RBFlip in interface Device

isInhibitLT2RBFlip

public boolean isInhibitLT2RBFlip()
Specified by:
isInhibitLT2RBFlip in interface Device

setInhibitYFlip

public void setInhibitYFlip(boolean inhibitYFlip)
Specified by:
setInhibitYFlip in interface Device

isInhibitYFlip

public boolean isInhibitYFlip()
Specified by:
isInhibitYFlip in interface Device

setAntialiasing

public void setAntialiasing(boolean antialiasing)
Description copied from interface: Device
Enables or disables antialiasing for this Device

Specified by:
setAntialiasing in interface Device
Parameters:
antialiasing - true indicates that anti-aliasing should be enabled, false disables it.

isAntialiasing

public boolean isAntialiasing()
Description copied from interface: Device
Returns true if antialising is enabled for this Device, otherwise false is returned.

Specified by:
isAntialiasing in interface Device
Returns:
true if antialising is enabled for this Device, otherwise false is returned.

setImgTypeForRasters

public static void setImgTypeForRasters(int imgTypeForRasters)
Sets the value of imgTypeForRasters

Parameters:
imgTypeForRasters - The new value to set.

getImgTypeForRasters

public static int getImgTypeForRasters()
Returns the imgTypeForRasters.

Returns:
the imgTypeForRasters.

setOutput

public void setOutput(java.io.OutputStream os)
Sets the output stream for this device. MUST be called befor calling initiate()

Parameters:
os - The outputstream to use

closeStream

public void closeStream()
Closes the output stream


setBackground

public void setBackground(int colorRGB)
Sets the background color

Parameters:
colorRGB - The background color to set

isOptimizing2DMaps

public boolean isOptimizing2DMaps()
Returns true, if the optimization of 2DMaps (textures, patterns) is turned on.

Returns:
true, if the optimization of 2DMaps (textures, patterns) is turned on.

isOptimizingStyles

public boolean isOptimizingStyles()
Returns true, if the optimization of styles is turned on.

Returns:
true, if the optimization of styles is turned on.

isOptimizingColors

public boolean isOptimizingColors()
Returns true, if the optimization of colors is turned on.

Returns:
true, if the optimization of colors is turned on.

isOptimizingCompress

public boolean isOptimizingCompress()
Returns true, if the compression is turned on.

Returns:
true, if the compression is turned on.

setOptimization

public void setOptimization(int optimizationMask,
                            boolean enabled)
Sets the optimization state of a single or a selection of items without changing the others. If you want to explicitly set the optimization to a selection of items, use the setOptimization(int) instead!

Parameters:
optimizationMask - The flags to change
enabled - The new state of these items

setOptimization

public void setOptimization(int optimizationMask)
Sets the optimization setting to a selection of items and removes all others. If you only want to change one or some items, use the setOptimization(int, boolean) instead!

Parameters:
optimizationMask - The flags to enable, all others will be removed

setColorTolerance

public void setColorTolerance(int tolerance)
Sets the color tolerance for this device. Setting a higher color tolerance than 0 will result in a smaller SVG, but the color quality will be lower.

Parameters:
tolerance - The tolerance to set

setJPEGForceBaseline

public void setJPEGForceBaseline(boolean forceBaseline)
Sets the force baseline option that is used for the jpg encoding when storing embedded textures

Parameters:
forceBaseline - the force baseline option that is used for the jpg encoding

getJPEGForceBaseline

public boolean getJPEGForceBaseline()
Returns the force baseline option that is used for the jpg encoding when storing embedded textures

Returns:
the force baseline option that is used for the jpg encoding when storing embedded textures

getJPEGQuality

public float getJPEGQuality()
Returns the quality setting that is used for JPEG encoding when storing embedded textures

Returns:
the quality setting that is used for JPEG encoding when storing embedded textures

setJPEGQuality

public void setJPEGQuality(float quality)
Sets the quality setting that is used for JPEG encoding when storing embedded textures.

Parameters:
quality - the quality setting that is used for JPEG encoding when storing embedded textures

getColorTolerance

public int getColorTolerance()
Returns the current color tolerance of this device. A higher color tolerance than 0 will result in a smaller SVG, but the color quality will be lower.

Returns:
The current color tolerance

enterLinkGroup

public void enterLinkGroup(java.lang.String title,
                           java.lang.String hRef,
                           java.lang.String targetFrame)
Opens a new group context to that custom attributes can be added.

Parameters:
title - The title of the link
hRef - The URL of the link
targetFrame - The target frame to display the link in or null, to show the target in the current frame. Use "_new" to show the link in a new window

leaveLinkGroup

public void leaveLinkGroup()
Leaves the current group context and enters the parent group context


isInLinkGroup

public boolean isInLinkGroup()
Checks whether the device is currently in a link group context

Returns:
true, if the device is currently in a link group context

enterGroup

public void enterGroup(java.lang.String name,
                       java.util.Map attributes)
Opens a new group context to that custom attributes can be added.

Parameters:
name - The name of the group to open
attributes - The attributes to set (null is allowed to set no attributes)

leaveGroup

public void leaveGroup()
Leaves the current group context and enters the parent group context


addCustomInfo

public void addCustomInfo(java.lang.String name,
                          AttributeSet attributes)
Adds custom information to the current group context

Parameters:
name - The name of the info element to add
attributes - The attributes to add to the info element (null is allowed to set no attributes)


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