org.tigris.gef.base
Class CmdSaveGraphics

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by org.tigris.gef.base.Cmd
          extended by org.tigris.gef.base.CmdSaveGraphics
All Implemented Interfaces:
java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action
Direct Known Subclasses:
CmdSaveEPS, CmdSaveGIF, CmdSavePNG, CmdSavePS, CmdSaveSVG

public abstract class CmdSaveGraphics
extends Cmd

Abstract Cmd to save a diagram as Graphics in a supplied OutputStream. Operates on the diagram in the current editor.

Author:
Frank Wienberg, wienberg@informatik.uni-hamburg.de
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.tigris.gef.base.Cmd
_args, _resource
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
protected CmdSaveGraphics(java.lang.String name)
           
 
Method Summary
 void doIt()
          Write the diagram contained by the current editor into an OutputStream as a GIF image.
protected abstract  void saveGraphics(java.io.OutputStream s, Editor ce, java.awt.Rectangle drawingArea)
           
 void setStream(java.io.OutputStream s)
          Set the outputStream argument.
 void undoIt()
          Undo stub.
 
Methods inherited from class org.tigris.gef.base.Cmd
about, actionPerformed, cmdAtIndex, containsArg, getArg, getArg, getName, getResource, register, registeredCmds, setArg, setName, setResource, shouldBeEnabled, updateEnabled
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmdSaveGraphics

protected CmdSaveGraphics(java.lang.String name)
Method Detail

saveGraphics

protected abstract void saveGraphics(java.io.OutputStream s,
                                     Editor ce,
                                     java.awt.Rectangle drawingArea)
                              throws java.io.IOException
Throws:
java.io.IOException

setStream

public void setStream(java.io.OutputStream s)
Set the outputStream argument. This must be done prior to saving the image.

Parameters:
s - the OutputStream into which the image will be saved

doIt

public void doIt()
Write the diagram contained by the current editor into an OutputStream as a GIF image. The "outputStream" argument must have been previously set with setStream().

Specified by:
doIt in class Cmd

undoIt

public void undoIt()
Undo stub. No useful implementation.

Specified by:
undoIt in class Cmd