y.module.io
Class IOHandlerModule

java.lang.Object
  |
  +--y.module.YModule
        |
        +--y.module.io.IOHandlerModule
Direct Known Subclasses:
GIFOutput, GMLInput, GMLOutput, JPGOutput, TGFInput, TGFOutput, YGFInput, YGFOutput

public abstract class IOHandlerModule
extends YModule

Base class of all modules that provide file based I/O services for diagrams.


Field Summary
static byte INPUT_MODE
          I/O mode specifier constant.
protected static String OPTION_CLIP_GRAPH
           
protected static String OPTION_CLIP_TYPE
           
protected static String OPTION_CLIP_VIEW
           
protected static String OPTION_CUSTOM_HEIGHT
           
protected static String OPTION_CUSTOM_WIDTH
           
protected static String OPTION_GENERATE_HTML_TABLE
           
protected static String OPTION_MARGIN
           
protected static String OPTION_SCALING_FACTOR
           
protected static String OPTION_SIZE_TYPE
           
protected static String OPTION_SIZE_USE_CUSTOM_HEIGHT
           
protected static String OPTION_SIZE_USE_CUSTOM_WIDTH
           
protected static String OPTION_SIZE_USE_ORIGINAL
           
protected static String OPTION_TILE_COLUMN_COUNT
           
protected static String OPTION_TILE_ROW_COUNT
           
protected static String OPTION_TILING_ACTIVE
           
static byte OUTPUT_MODE
          I/O mode specifier constant.
protected static String TAB_TILING
           
protected static String TAB_VIEWPORT
           
protected  ViewPortConfigurator vpc
           
 
Fields inherited from class y.module.YModule
FAILED, PRECONDITION_VIOLATED, SUCCESS
 
Constructor Summary
protected IOHandlerModule(String name, String author, String description)
           
 
Method Summary
protected  void addTilingOptions(OptionHandler options)
          Adds image-tiling specific options to the given option handler instance.
protected  void addViewPortOptions(OptionHandler options)
          Adds viewport specific options to the given option handler instance.
protected  void configureViewPort(Graph2DView viewPort, Graph2DView originalView)
          Configures the given viewPort.
protected abstract  IOHandler createIOHandler()
          Creates an IOHandler instance responsible for the actual I/O to be performed.
 IOHandler getIOHandler()
          Returns the IOHandler used by this module.
 byte getIOMode()
          Returns the I/O mode the module is working in.
 URL getURL()
          Returns the location of the file to which the module either will export or import the diagram.
protected  void mainrun()
          Read or writes a diagram in a specific format to a file.
protected  void setIOHandler(IOHandler ioh)
          Sets a specific IOHandler to be used by this module.
protected  void setIOMode(byte ioMode)
          Sets the I/O mode the module is working in.
 void setURL(URL url)
          Sets the location of the file to which the module either will export or import the diagram.
 
Methods inherited from class y.module.YModule
createOptionHandler, dispose, fitGraph2DView, getAuthor, getDescription, getExitStatus, getGraph2D, getGraph2DView, getModuleName, getOptionHandler, getTimer, getView, init, isAbortable, run, setExitStatus, setGraph2D, setModuleName, setOptionHandler, start, startAsThread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vpc

protected ViewPortConfigurator vpc

OUTPUT_MODE

public static final byte OUTPUT_MODE
I/O mode specifier constant. Specifies that the module is responsible for writing a diagram to a file.

See Also:
Constant Field Values

INPUT_MODE

public static final byte INPUT_MODE
I/O mode specifier constant. Specifies that the module is responsible for reading a diagram from a file.

See Also:
Constant Field Values

TAB_VIEWPORT

protected static final String TAB_VIEWPORT
See Also:
Constant Field Values

OPTION_SIZE_TYPE

protected static final String OPTION_SIZE_TYPE
See Also:
Constant Field Values

OPTION_SIZE_USE_ORIGINAL

protected static final String OPTION_SIZE_USE_ORIGINAL
See Also:
Constant Field Values

OPTION_SIZE_USE_CUSTOM_WIDTH

protected static final String OPTION_SIZE_USE_CUSTOM_WIDTH
See Also:
Constant Field Values

OPTION_SIZE_USE_CUSTOM_HEIGHT

protected static final String OPTION_SIZE_USE_CUSTOM_HEIGHT
See Also:
Constant Field Values

OPTION_CUSTOM_WIDTH

protected static final String OPTION_CUSTOM_WIDTH
See Also:
Constant Field Values

OPTION_CUSTOM_HEIGHT

protected static final String OPTION_CUSTOM_HEIGHT
See Also:
Constant Field Values

OPTION_MARGIN

protected static final String OPTION_MARGIN
See Also:
Constant Field Values

OPTION_SCALING_FACTOR

protected static final String OPTION_SCALING_FACTOR
See Also:
Constant Field Values

OPTION_CLIP_TYPE

protected static final String OPTION_CLIP_TYPE
See Also:
Constant Field Values

OPTION_CLIP_VIEW

protected static final String OPTION_CLIP_VIEW
See Also:
Constant Field Values

OPTION_CLIP_GRAPH

protected static final String OPTION_CLIP_GRAPH
See Also:
Constant Field Values

TAB_TILING

protected static final String TAB_TILING
See Also:
Constant Field Values

OPTION_TILING_ACTIVE

protected static final String OPTION_TILING_ACTIVE
See Also:
Constant Field Values

OPTION_TILE_COLUMN_COUNT

protected static final String OPTION_TILE_COLUMN_COUNT
See Also:
Constant Field Values

OPTION_TILE_ROW_COUNT

protected static final String OPTION_TILE_ROW_COUNT
See Also:
Constant Field Values

OPTION_GENERATE_HTML_TABLE

protected static final String OPTION_GENERATE_HTML_TABLE
See Also:
Constant Field Values
Constructor Detail

IOHandlerModule

protected IOHandlerModule(String name,
                          String author,
                          String description)
Method Detail

setIOMode

protected void setIOMode(byte ioMode)
Sets the I/O mode the module is working in. Subclasses should set the mode accodring to the service they are providing. By default IOHandlerModule.OUTPUT_MODE is set.

Parameters:
ioMode - one of IOHandlerModule.OUTPUT_MODE or IOHandlerModule.INPUT_MODE.

configureViewPort

protected void configureViewPort(Graph2DView viewPort,
                                 Graph2DView originalView)
Configures the given viewPort. Uses the origonalView and its Graph2D as reference objects.


addViewPortOptions

protected void addViewPortOptions(OptionHandler options)
Adds viewport specific options to the given option handler instance.


addTilingOptions

protected void addTilingOptions(OptionHandler options)
Adds image-tiling specific options to the given option handler instance.


getIOMode

public byte getIOMode()
Returns the I/O mode the module is working in.


setURL

public void setURL(URL url)
Sets the location of the file to which the module either will export or import the diagram.


getURL

public URL getURL()
Returns the location of the file to which the module either will export or import the diagram.


createIOHandler

protected abstract IOHandler createIOHandler()
Creates an IOHandler instance responsible for the actual I/O to be performed. Subclasses must implement this factory method.


getIOHandler

public IOHandler getIOHandler()
Returns the IOHandler used by this module.


setIOHandler

protected void setIOHandler(IOHandler ioh)
Sets a specific IOHandler to be used by this module.


mainrun

protected void mainrun()
Read or writes a diagram in a specific format to a file.

Specified by:
mainrun in class YModule

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

2003