|
JHotDraw 7.5.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
@NotNull public interface OutputFormat
An output format implements a strategy for writing a Drawing
using a specific format into an OutputStream, an URI or a
Transferable.
Typically a format can be identified by a Mime type or by a file extension.
To identify the format used by a file, an appropriate FileFilter
for a javax.swing.JFileChooser component can be requested from OutputFormat.
This interface intentionally contains many identical operations like InputFormat to make it easy, to write classes that implement both interfaces.
Strategy
OutputFormat encapsulates a strategy for writing drawings to output
streams.
Strategy: OutputFormat; Context: Drawing.
| Method Summary | |
|---|---|
java.awt.datatransfer.Transferable |
createTransferable(Drawing drawing,
java.util.List<Figure> figures,
double scaleFactor)
Creates a Transferable for the specified list of Figures. |
java.lang.String |
getFileExtension()
Returns the file extension for the output format. |
javax.swing.filechooser.FileFilter |
getFileFilter()
Return a FileFilter that can be used to identify files which can be stored with this output format. |
javax.swing.JComponent |
getOutputFormatAccessory()
Return a JFileChooser accessory that can be used to customize the output format. |
void |
write(java.io.OutputStream out,
Drawing drawing)
Writes a Drawing into an output stream. |
void |
write(java.net.URI uri,
Drawing drawing)
Writes a Drawing into an URI. |
| Method Detail |
|---|
javax.swing.filechooser.FileFilter getFileFilter()
java.lang.String getFileExtension()
@Nullable javax.swing.JComponent getOutputFormatAccessory()
void write(java.net.URI uri,
Drawing drawing)
throws java.io.IOException
uri - The uri.drawing - The drawing.
java.io.IOException
void write(java.io.OutputStream out,
Drawing drawing)
throws java.io.IOException
out - The output stream.drawing - The drawing.
java.io.IOException
java.awt.datatransfer.Transferable createTransferable(Drawing drawing,
java.util.List<Figure> figures,
double scaleFactor)
throws java.io.IOException
drawing - The drawing.figures - A list of figures of the drawing.scaleFactor - The factor to be used, when the Transferable creates
an image with a fixed size from the figures.
java.io.IOException
|
Copyright 1996-2010 (c) by the authors and contributors of the JHotDraw project. Some rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||