net.sf.sdedit.diagram
Class PaintDevice

java.lang.Object
  extended by net.sf.sdedit.diagram.PaintDevice
All Implemented Interfaces:
Iterable<Drawable>
Direct Known Subclasses:
Graphics2DPaintDevice, MultipagePaintDevice, PanelPaintDevice

public abstract class PaintDevice
extends Object
implements Iterable<Drawable>

A PaintDevice is an intelligent container of Drawable objects, computing their layout and displaying them in a way that is to be made concrete by a subclass.

Author:
Markus Strauch

Constructor Summary
protected PaintDevice()
           
 
Method Summary
 void addOtherDrawable(Drawable drawable)
           
 void addSequenceElement(SequenceElement elem)
           
 void announce(int height)
           
 void clear()
           
 void close()
          This method is called once when no Drawable object will be added anymore.
 void computeAxes(int leftAxis)
           
 void computeBounds()
          Computes the width and height of this PaintDevice (this is necessary before a frame and a descriptive text can be set).
 Color getColor(String name)
           
 Diagram getDiagram()
           
 Font getFont(boolean bold)
           
 int getHeight()
           
 Line getRightBound()
           
 int getTextHeight()
           
abstract  int getTextHeight(boolean bold)
           
 int getTextWidth(String text)
           
abstract  int getTextWidth(String text, boolean bold)
           
 int getWidth()
           
 boolean isEmpty()
           
 Iterator<Drawable> iterator()
          Returns an iterator over the visible drawable elements that are displayed by this PanelPaintDevice.
 void reinitialize()
          This method is called by the diagram when all objects/lifelines are known.
 void setDiagram(Diagram diagram)
           
 void writeToStream(OutputStream stream)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PaintDevice

protected PaintDevice()
Method Detail

setDiagram

public void setDiagram(Diagram diagram)

getColor

public Color getColor(String name)

reinitialize

public void reinitialize()
This method is called by the diagram when all objects/lifelines are known.


getFont

public Font getFont(boolean bold)

getRightBound

public Line getRightBound()

addOtherDrawable

public void addOtherDrawable(Drawable drawable)

addSequenceElement

public void addSequenceElement(SequenceElement elem)

isEmpty

public boolean isEmpty()

computeAxes

public void computeAxes(int leftAxis)

getTextWidth

public abstract int getTextWidth(String text,
                                 boolean bold)

getTextWidth

public int getTextWidth(String text)

getTextHeight

public abstract int getTextHeight(boolean bold)

getTextHeight

public int getTextHeight()

getWidth

public int getWidth()

getHeight

public int getHeight()

clear

public void clear()

computeBounds

public void computeBounds()
Computes the width and height of this PaintDevice (this is necessary before a frame and a descriptive text can be set).


close

public void close()
This method is called once when no Drawable object will be added anymore. Its default implementation is empty.


announce

public void announce(int height)

getDiagram

public Diagram getDiagram()

writeToStream

public void writeToStream(OutputStream stream)
                   throws IOException
Throws:
IOException

iterator

public Iterator<Drawable> iterator()
Returns an iterator over the visible drawable elements that are displayed by this PanelPaintDevice.

Specified by:
iterator in interface Iterable<Drawable>
Returns:
an iterator over the visible drawable elements that are displayed by this PanelPaintDevice


Copyright © 2011. All Rights Reserved.