org.tigris.gef.base
Class CmdSavePNG
java.lang.Object
javax.swing.AbstractAction
org.tigris.gef.base.Cmd
org.tigris.gef.base.CmdSaveGraphics
org.tigris.gef.base.CmdSavePNG
- All Implemented Interfaces:
- javax.swing.Action, java.awt.event.ActionListener, java.lang.Cloneable, java.util.EventListener, java.io.Serializable
- public class CmdSavePNG
- extends CmdSaveGraphics
This is a rewrite of CmdSaveGIF to use the JDK 1.4 ImageIO library to write
PNG files, with both better performance and memory efficiency. Unfortunately
though, this is only available to those with JRE1.4 and above.
- See Also:
- Serialized Form
Field Summary |
static int |
TRANSPARENT_BG_COLOR
Used as background color in image and set transparent. |
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 |
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 PNG image. |
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 |
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
CmdSavePNG
public CmdSavePNG()
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 PNG image.
- Specified by:
saveGraphics
in class CmdSaveGraphics
- Throws:
java.io.IOException