org.jhotdraw.samples.svg.io
Class ImageMapOutputFormat
- java.lang.Object
-
- org.jhotdraw.samples.svg.io.ImageMapOutputFormat
-
- All Implemented Interfaces:
- OutputFormat
public class ImageMapOutputFormat extends java.lang.Object implements OutputFormat
ImageMapOutputFormat exports a SVG drawing as an HTML 4.01MAPelement. For more information see: http://www.w3.org/TR/html401/struct/objects.html#h-13.6.2
-
-
Constructor Summary
Constructors Constructor and Description ImageMapOutputFormat()Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.awt.datatransfer.TransferablecreateTransferable(Drawing drawing, java.util.List<Figure> figures, double scaleFactor)Creates a Transferable for the specified list of Figures.java.lang.StringgetFileExtension()Returns the file extension for the output format.javax.swing.filechooser.FileFiltergetFileFilter()Return a FileFilter that can be used to identify files which can be stored with this output format.javax.swing.JComponentgetOutputFormatAccessory()Return a JFileChooser accessory that can be used to customize the output format.voidwrite(java.io.File file, Drawing drawing)voidwrite(java.io.OutputStream out, Drawing drawing)Writes a Drawing into an output stream.voidwrite(java.io.OutputStream out, Drawing drawing, java.awt.geom.AffineTransform drawingTransform, java.awt.Dimension imageSize)Writes the drawing to the specified output stream.voidwrite(java.io.OutputStream out, java.util.List<Figure> figures)All other write methods delegate their work to here.voidwrite(java.io.OutputStream out, java.util.List<Figure> figures, java.awt.geom.AffineTransform drawingTransform, java.awt.Dimension imageSize)Writes the figures to the specified output stream.voidwrite(java.net.URI uri, Drawing drawing)Writes a Drawing into an URI.
-
-
-
Method Detail
-
getFileFilter
public javax.swing.filechooser.FileFilter getFileFilter()
Description copied from interface:OutputFormatReturn a FileFilter that can be used to identify files which can be stored with this output format. Typically, each output format has its own recognizable file extension.- Specified by:
getFileFilterin interfaceOutputFormat- Returns:
- FileFilter to be used with a javax.swing.JFileChooser
-
getFileExtension
public java.lang.String getFileExtension()
Description copied from interface:OutputFormatReturns the file extension for the output format. The file extension should be appended to a file name when storing a Drawing with the specified file format.- Specified by:
getFileExtensionin interfaceOutputFormat
-
getOutputFormatAccessory
public javax.swing.JComponent getOutputFormatAccessory()
Description copied from interface:OutputFormatReturn a JFileChooser accessory that can be used to customize the output format.- Specified by:
getOutputFormatAccessoryin interfaceOutputFormat- Returns:
- A JFileChooser accessory to be used with a javax.swing.JFileChooser Returns null, if no accessory is provided for this format.
-
write
public void write(java.net.URI uri, Drawing drawing) throws java.io.IOExceptionDescription copied from interface:OutputFormatWrites a Drawing into an URI.- Specified by:
writein interfaceOutputFormat- Parameters:
uri- The uri.drawing- The drawing.- Throws:
java.io.IOException
-
write
public void write(java.io.File file, Drawing drawing) throws java.io.IOException- Throws:
java.io.IOException
-
write
public void write(java.io.OutputStream out, Drawing drawing) throws java.io.IOExceptionDescription copied from interface:OutputFormatWrites a Drawing into an output stream.- Specified by:
writein interfaceOutputFormat- Parameters:
out- The output stream.drawing- The drawing.- Throws:
java.io.IOException
-
write
public void write(java.io.OutputStream out, Drawing drawing, java.awt.geom.AffineTransform drawingTransform, java.awt.Dimension imageSize) throws java.io.IOExceptionWrites the drawing to the specified output stream. This method applies the specified drawingTransform to the drawing, and draws it on an image of the specified getChildCount.- Throws:
java.io.IOException
-
write
public void write(java.io.OutputStream out, java.util.List<Figure> figures, java.awt.geom.AffineTransform drawingTransform, java.awt.Dimension imageSize) throws java.io.IOExceptionWrites the figures to the specified output stream. This method applies the specified drawingTransform to the drawing, and draws it on an image of the specified getChildCount. All other write methods delegate their work to here.- Throws:
java.io.IOException
-
write
public void write(java.io.OutputStream out, java.util.List<Figure> figures) throws java.io.IOExceptionAll other write methods delegate their work to here.- Throws:
java.io.IOException
-
createTransferable
public java.awt.datatransfer.Transferable createTransferable(Drawing drawing, java.util.List<Figure> figures, double scaleFactor) throws java.io.IOException
Description copied from interface:OutputFormatCreates a Transferable for the specified list of Figures.- Specified by:
createTransferablein interfaceOutputFormat- Parameters:
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.- Returns:
- The Transferable.
- Throws:
java.io.IOException
-
-
DataMelt 3.0 © DataMelt by jWork.ORG