org.tigris.gef.base
Class CmdSaveGIF

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

public class CmdSaveGIF
extends CmdSaveGraphics

Cmd to save a diagram as a GIF image in a supplied OutputStream. Requires the Acme.JPM.Encoders.GifEncoder class. Operates on the diagram in the current editor. Code loosely adapted from CmdPrint.

Author:
Steve Poole, stevep@wrq.com
See Also:
Serialized Form

Field Summary
static int TRANSPARENT_BG_COLOR
          Used as background color in image and set transparent.
 
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
CmdSaveGIF()
           
 
Method Summary
protected  void saveGraphics(java.io.OutputStream s, Editor ce, java.awt.Rectangle drawingArea)
          Write the diagram contained by the current editor into an OutputStream as a GIF image.
 
Methods inherited from class org.tigris.gef.base.CmdSaveGraphics
doIt, setStream, undoIt
 
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
 

Field Detail

TRANSPARENT_BG_COLOR

public static final int TRANSPARENT_BG_COLOR
Used as background color in image and set transparent. Chosen because it's unlikely to be selected by the user, and leaves the diagram readable if viewed without transparency.

See Also:
Constant Field Values
Constructor Detail

CmdSaveGIF

public CmdSaveGIF()
Method Detail

saveGraphics

protected void saveGraphics(java.io.OutputStream s,
                            Editor ce,
                            java.awt.Rectangle drawingArea)
                     throws java.io.IOException
Write the diagram contained by the current editor into an OutputStream as a GIF image.

Specified by:
saveGraphics in class CmdSaveGraphics
Throws:
java.io.IOException