y.io
Class TiledImageOutputHandler

java.lang.Object
  |
  +--y.io.IOHandler
        |
        +--y.io.TiledImageOutputHandler

public class TiledImageOutputHandler
extends IOHandler

This output handler is responsible for exporting a diagram to mutliple image tiles that make up a complete image. The genration of the single image tiles will be handled by a output handler delegate. Optionally this class can also generate a html page that displays the tiles in one large table.


Constructor Summary
TiledImageOutputHandler(IOHandler delegate)
          Creates a new instance of TiledImageOutputHandler.
 
Method Summary
 boolean canRead()
          Returns false.
 boolean canWrite()
          This method is delegated to the internal IOHandler.
 String getFileFormatString()
          This method is delegated to the internal IOHandler.
 String getFileNameExtension()
          This method is delegated to the internal IOHandler.
 boolean isHTMLTableGenerationActive()
          Returns whether or not to produce an HTL page.
 void read(Graph2D graph, InputStream in)
          This method is delegated to the internal IOHandler.
 void setColumnCount(int cols)
          Sets the number of columns the output image will be split into.
 void setHTMLTableGenerationActive(boolean generate)
          Whether or not to generate an HTML page that displays the image tiles in one large table.
 void setMaximumTileSize(int width, int height)
          Sets the maximum size for each output image tile.
 void setRowCount(int rows)
          Sets the number of rows the output image will be split into.
 void write(Graph2D graph, OutputStream out)
          This method is delegated to the internal IOHandler.
 void write(Graph2D graph, String name)
          Exports a diagramm to multiple output files.
 
Methods inherited from class y.io.IOHandler
canWriteSubset, createObjectInputStream, createObjectOutputStream, hide, read, read, shouldSerialize, shouldSerialize, writeSubset, writeSubset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TiledImageOutputHandler

public TiledImageOutputHandler(IOHandler delegate)
Creates a new instance of TiledImageOutputHandler.

Parameters:
delegate - the delgate IOHandler that will be invoked for each image tile with a different viewport.
Method Detail

getFileFormatString

public String getFileFormatString()
This method is delegated to the internal IOHandler.

Specified by:
getFileFormatString in class IOHandler

setHTMLTableGenerationActive

public void setHTMLTableGenerationActive(boolean generate)
Whether or not to generate an HTML page that displays the image tiles in one large table. The name of the generated HTML file will bear the ending .html Its basename will be the same as the output file. By default this feature is deactivated.


isHTMLTableGenerationActive

public boolean isHTMLTableGenerationActive()
Returns whether or not to produce an HTL page.

See Also:
TiledImageOutputHandler.setHTMLTableGenerationActive(boolean)

setMaximumTileSize

public void setMaximumTileSize(int width,
                               int height)
Sets the maximum size for each output image tile. Invoking this method will invalidate the values set by the methods TiledImageOutputHandler.setRowCount(int) and TiledImageOutputHandler.setColumnCount(int).


setRowCount

public void setRowCount(int rows)
Sets the number of rows the output image will be split into. The height of each tile will be the height of the original image divided by row count. Invoking this method will invalidate the values set by the method TiledImageOutputHandler.setMaximumTileSize(int,int).


setColumnCount

public void setColumnCount(int cols)
Sets the number of columns the output image will be split into. The width of each tile will be the width of the original image divided by column count. Invoking this method will invalidate the values set by the method TiledImageOutputHandler.setMaximumTileSize(int,int).


canRead

public boolean canRead()
Returns false.

Overrides:
canRead in class IOHandler

canWrite

public boolean canWrite()
This method is delegated to the internal IOHandler.

Overrides:
canWrite in class IOHandler

write

public void write(Graph2D graph,
                  String name)
           throws IOException
Exports a diagramm to multiple output files. The file format of the output files is determined by the delegate IOHandler of this class.

The number of generated output files can be controlled by either the methods TiledImageOutputHandler.setRowCount(int) and TiledImageOutputHandler.setColumnCount(int) or the method TiledImageOutputHandler.setMaximumTileSize(int, int).

The names of the output files will have the form {basename}{row}_{column}.{extension} given that the name parameter has the form {basename}.{extension}.

Additionally this method creates HTML file when requested.

Overrides:
write in class IOHandler
IOException
Parameters:
name - The name of the output file

getFileNameExtension

public String getFileNameExtension()
This method is delegated to the internal IOHandler.

Specified by:
getFileNameExtension in class IOHandler

read

public void read(Graph2D graph,
                 InputStream in)
          throws IOException
This method is delegated to the internal IOHandler.

Specified by:
read in class IOHandler
IOException

write

public void write(Graph2D graph,
                  OutputStream out)
           throws IOException
This method is delegated to the internal IOHandler.

Specified by:
write in class IOHandler
IOException

© Copyright 2000-2003,
yWorks GmbH.
All rights reserved.

2003