|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.faceless.graph2.Output
org.faceless.graph2.FlashOutput
public class FlashOutput
The FlashOutput class allows you to create simple Macromedia Flash movies which display the graph. In the current release these movies have no interaction - they're just a still frame - but we anticipate future releases will allow interaction with the graph. Here's a simple example:
Graph graph = makeMyGraph(); FlashOutput out = new FlashOutput(100, 100); graph.draw(out); out.writeFlash(new FileOutputStream("Graph.swf"));
Graph.draw(org.faceless.graph2.Output)
,
Graph.setMetaData(java.lang.String, java.lang.String)
Constructor Summary | |
---|---|
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 |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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 movieMethod Detail |
---|
public 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 usepublic void writeFlash(OutputStream out) throws IOException
out
- the OutputStream to write the movie to
IOException
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"
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |