public class FlashOutput extends Output
Graph graph = makeMyGraph(); FlashOutput out = new FlashOutput(100, 100); graph.draw(out); out.writeFlash(new FileOutputStream("Graph.swf"));
Constructor and Description |
---|
FlashOutput(int width,
int height)
Creates a new Flash movie with the default white background
|
FlashOutput(int width,
int height,
Color background)
Creates a new Flash movie with the specified background color
|
Modifier and Type | Method and Description |
---|---|
protected void |
doSetPaint(Paint paint)
Set the paint in the output
|
void |
setDetailLevel(int detailLevel)
Set the level of detail to draw.
|
void |
setFont(String name,
Font font)
Define a font for use in the movie.
|
void |
writeFlash(OutputStream out)
Write the completed SWF file to the specified OutputStream.
|
getAreas, storeAreas
public FlashOutput(int width, int height)
width
- the width of the image in user unitsheight
- the height of the image in user unitspublic FlashOutput(int width, int height, Color background)
width
- the width of the imageheight
- the height of the imagebackground
- the background color of the moviepublic void setFont(String name, Font font)
Define a font for use in the movie. This method can be used to define non-standard fonts for use in Graphs. Without calling this method the "Default" font is available and set to a sans-serif font. Additionally since 2.0.4 any fonts available to the Java process may be referenced by name without having to call this method.
For example, to use a font called "myfont" in a style:
output.setFont("myfont", Font.createFont("myfont.ttf"));
name
- the name of the font, as passed to TextStyle.setFont(java.lang.String, double)
.
A name of "Default" will override the default font. The name is case-insensitive.font
- the Font to useprotected void doSetPaint(Paint paint)
Output
paint
- the Paint to use for drawing, text etc.public void writeFlash(OutputStream out) throws IOException
out
- the OutputStream to write the movie toIOException
public void setDetailLevel(int detailLevel)
detailLevel
- the level of detail to display. The default value
is 30, and lower values give more detail, with 0 meaning "display
everything"Copyright © 2001-2016 Big Faceless Organization