|
JHotDraw 7.0.9 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jhotdraw.draw.DOMStorableInputOutputFormat
public class DOMStorableInputOutputFormat
An OutputFormat that can write Drawings with DOMStorable Figure's.
Constructor Summary | |
---|---|
DOMStorableInputOutputFormat(DOMFactory factory)
Creates a new instance with format name "Drawing", file extension "xml" and mime type "image/x-jhotdraw". |
|
DOMStorableInputOutputFormat(DOMFactory factory,
java.lang.String description,
java.lang.String fileExtension,
java.lang.String mimeType)
Creates a new instance using the specified parameters. |
Method Summary | |
---|---|
java.awt.datatransfer.Transferable |
createTransferable(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 restored with this Storage Format. |
javax.swing.JComponent |
getInputFormatAccessory()
Return a JFileChooser accessory that can be used to customize the input format. |
javax.swing.JComponent |
getOutputFormatAccessory()
Return a JFileChooser accessory that can be used to customize the output 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. |
protected void |
read(java.net.URL url,
java.io.InputStream in,
Drawing drawing,
java.util.LinkedList<Figure> figures)
Reads a list of figures into the specified drawing. |
java.util.List<Figure> |
readFigures(java.awt.datatransfer.Transferable t)
Reads figures from the specified Transferable. |
void |
write(java.io.File file,
Drawing drawing)
Writes a Drawing into a file. |
void |
write(java.io.OutputStream out,
Drawing drawing)
Writes a Drawing into an output stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DOMStorableInputOutputFormat(DOMFactory factory)
public DOMStorableInputOutputFormat(DOMFactory factory, java.lang.String description, java.lang.String fileExtension, java.lang.String mimeType)
factory
- The factory for creating Figures from XML elements.description
- The format description to be used for the file filter.fileExtension
- The file extension to be used for file filter.mimeType
- The Mime Type is used for clipboard access.Method Detail |
---|
public javax.swing.filechooser.FileFilter getFileFilter()
InputFormat
getFileFilter
in interface InputFormat
getFileFilter
in interface OutputFormat
public javax.swing.JComponent getOutputFormatAccessory()
OutputFormat
getOutputFormatAccessory
in interface OutputFormat
public javax.swing.JComponent getInputFormatAccessory()
InputFormat
getInputFormatAccessory
in interface InputFormat
protected void read(java.net.URL url, java.io.InputStream in, Drawing drawing, java.util.LinkedList<Figure> figures) throws java.io.IOException
java.io.IOException
public java.lang.String getFileExtension()
OutputFormat
getFileExtension
in interface OutputFormat
public void write(java.io.File file, Drawing drawing) throws java.io.IOException
OutputFormat
write
in interface OutputFormat
file
- The file.drawing
- The drawing.
java.io.IOException
public void write(java.io.OutputStream out, Drawing drawing) throws java.io.IOException
OutputFormat
write
in interface OutputFormat
out
- The output stream.drawing
- The drawing.
java.io.IOException
public void read(java.io.File file, Drawing drawing) throws java.io.IOException
InputFormat
read
in interface InputFormat
file
- The file.drawing
- The drawing.
java.io.IOException
public void read(java.io.InputStream in, Drawing drawing) throws java.io.IOException
InputFormat
read
in interface InputFormat
in
- The input stream.drawing
- The drawing.
java.io.IOException
public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
InputFormat
isDataFlavorSupported
in interface InputFormat
flavor
- A DataFlavor.public java.util.List<Figure> readFigures(java.awt.datatransfer.Transferable t) throws java.awt.datatransfer.UnsupportedFlavorException, java.io.IOException
InputFormat
readFigures
in interface InputFormat
t
- The Transferable.
java.awt.datatransfer.UnsupportedFlavorException
java.io.IOException
public java.awt.datatransfer.Transferable createTransferable(java.util.List<Figure> figures, double scaleFactor) throws java.io.IOException
OutputFormat
createTransferable
in interface OutputFormat
figures
- The figures.scaleFactor
- The factor to be used, when the Transferable creates
an image with a fixed size from the figures.
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 |