|
JHotDraw 7.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface InputFormat
Interface to define an input format for a Drawing. An InputFormat is a strategy that knows how to restore a Drawing according to a specific encoding. Typically it can be recognized by a Mime type or by a file extension. To identify a valid file format for a Drawing an appropriate FileFilter for a javax.swing.JFileChooser component can be requested.
This interface intentionally contains many identical operations like OutputFormat to make it easy, to write classes that implement both interfaces.
| Method Summary | |
|---|---|
javax.swing.filechooser.FileFilter |
getFileFilter()
Return a FileFilter that can be used to identify files which can be restored with this Storage Format. |
javax.swing.JComponent |
getInputFormatAccessory()
Return a JFileChooser accessory that can be used to customize the input format. |
boolean |
isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
Returns true, if this InputFormat can readFigures TransferData using the specified DataFlavor. |
void |
read(java.io.File file,
Drawing drawing)
Reads figures from a file and adds them to the specified drawing. |
void |
read(java.io.InputStream in,
Drawing drawing)
Reads figures from a file and adds them to the specified drawing. |
void |
read(java.awt.datatransfer.Transferable t,
Drawing drawing)
Reads figures from the specified Transferable and adds them to the specified drawing. |
| Method Detail |
|---|
javax.swing.filechooser.FileFilter getFileFilter()
javax.swing.JComponent getInputFormatAccessory()
void read(java.io.File file,
Drawing drawing)
throws java.io.IOException
file - The file.drawing - The drawing.
java.io.IOException
void read(java.io.InputStream in,
Drawing drawing)
throws java.io.IOException
in - The input stream.drawing - The drawing.
java.io.IOExceptionboolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
flavor - A DataFlavor.
void read(java.awt.datatransfer.Transferable t,
Drawing drawing)
throws java.awt.datatransfer.UnsupportedFlavorException,
java.io.IOException
t - The Transferable.drawing - The drawing.
java.awt.datatransfer.UnsupportedFlavorException
java.io.IOException
|
Copyright 1996-2007 (c) JHotDraw.org. Some rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||