net.sf.sdedit.ui
Class ImagePaintDevice

java.lang.Object
  extended by net.sf.sdedit.diagram.PaintDevice
      extended by net.sf.sdedit.ui.Graphics2DPaintDevice
          extended by net.sf.sdedit.ui.ImagePaintDevice
All Implemented Interfaces:
Iterable<Drawable>, Constants

public class ImagePaintDevice
extends Graphics2DPaintDevice
implements Constants


Field Summary
 
Fields inherited from interface net.sf.sdedit.Constants
ACTIVE_LIFELINE_COLOR, ANTI_ALIAS, dashed, DEFAULT_CODE_FONT, DEFAULT_CURSOR, DEFAULT_ENCODING_SCHEME, dotted, emptyStroke, GLOBAL_CONF_FILE, HAND_CURSOR, MOVE_CURSOR, SAVE_AS_FILE_PROPERTY, SAVE_AS_TYPE_PROPERTY, solid, TEST_FREEHEP_CLASSNAME, thick, thick_dashed, THREAD_COLORS
 
Constructor Summary
ImagePaintDevice()
           
 
Method Summary
protected  Graphics2D createDummyGraphics(boolean bold)
          Creates a small-sized dummy graphics context that is used to gain information about the font metrics (which should be the same as in the final graphics context)
protected  Graphics2D createGraphics()
          Creates a graphics context belonging to a back-end that has a size that suffices to display the whole of the diagram.
 Image getImage()
           
 void saveImage(File file)
           
 void saveImage(String fileName)
           
 void writeToStream(OutputStream stream)
           
 
Methods inherited from class net.sf.sdedit.ui.Graphics2DPaintDevice
close, drawAll, getTextHeight, getTextWidth
 
Methods inherited from class net.sf.sdedit.diagram.PaintDevice
addOtherDrawable, addSequenceElement, announce, clear, computeAxes, computeBounds, getColor, getDiagram, getFont, getHeight, getRightBound, getTextHeight, getTextWidth, getWidth, isEmpty, iterator, reinitialize, setDiagram
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImagePaintDevice

public ImagePaintDevice()
Method Detail

getImage

public Image getImage()

writeToStream

public void writeToStream(OutputStream stream)
                   throws IOException
Overrides:
writeToStream in class PaintDevice
Throws:
IOException

saveImage

public void saveImage(String fileName)
               throws IOException
Throws:
IOException

saveImage

public void saveImage(File file)
               throws IOException
Throws:
IOException

createDummyGraphics

protected Graphics2D createDummyGraphics(boolean bold)
Description copied from class: Graphics2DPaintDevice
Creates a small-sized dummy graphics context that is used to gain information about the font metrics (which should be the same as in the final graphics context)

Specified by:
createDummyGraphics in class Graphics2DPaintDevice
Parameters:
bold - flag denoting if the bold font is set
Returns:
a small-sized dummy graphics context

createGraphics

protected Graphics2D createGraphics()
Description copied from class: Graphics2DPaintDevice
Creates a graphics context belonging to a back-end that has a size that suffices to display the whole of the diagram. This method should be called after PaintDevice.computeBounds() has finished and the diagram's dimension is known.

Specified by:
createGraphics in class Graphics2DPaintDevice
Returns:
a graphics context belonging to a back-end that has a size that suffices to display the whole of the diagram


Copyright © 2011. All Rights Reserved.