net.refractions.udig.printing.model
Class AbstractBoxPrinter

java.lang.Object
  extended by net.refractions.udig.printing.model.AbstractBoxPrinter
All Implemented Interfaces:
BoxPrinter

public abstract class AbstractBoxPrinter
extends java.lang.Object
implements BoxPrinter

Provides simple/stupid implementation for the optional methods in BoxPrinter.

Nothing is saved when save is called. So everything must be hard coded. Preview simply calls draw() and only does so once.

Since:
1.1.0
Author:
Jesse

Constructor Summary
AbstractBoxPrinter()
           
 
Method Summary
 void createPreview(java.awt.Graphics2D graphics, IProgressMonitor monitor)
          By default this method calls draw and sets dirty to be false.
 Box getBox()
          Returns the box the box set when the setBox method is called.
 boolean isNewPreviewNeeded()
          By default this will return false when ever the size of location of the box has been changed.
 void load(IMemento memento)
          By default this method does nothing
 void save(IMemento memento)
          By default this method does nothing
 void setBox(Box box2)
          Sets the owning box.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.refractions.udig.printing.model.BoxPrinter
draw, getExtensionPointID
 

Constructor Detail

AbstractBoxPrinter

public AbstractBoxPrinter()
Method Detail

save

public void save(IMemento memento)
By default this method does nothing

Specified by:
save in interface BoxPrinter
See Also:
AbstractBox

load

public void load(IMemento memento)
By default this method does nothing

Specified by:
load in interface BoxPrinter
Parameters:
memento - the new value of the 'IMemento' attribute.
See Also:
BoxPrinter.save(IMemento)

createPreview

public void createPreview(java.awt.Graphics2D graphics,
                          IProgressMonitor monitor)
By default this method calls draw and sets dirty to be false.

Specified by:
createPreview in interface BoxPrinter
Parameters:
graphics - A Graphics2D object to perform the drawing on.

isNewPreviewNeeded

public boolean isNewPreviewNeeded()
By default this will return false when ever the size of location of the box has been changed.

Specified by:
isNewPreviewNeeded in interface BoxPrinter
Returns:
Returns true if a the preview has changed since last call of BoxPrinter.createPreview(Graphics2D, IProgressMonitor)

getBox

public Box getBox()
Description copied from interface: BoxPrinter
Returns the box the box set when the setBox method is called.

Specified by:
getBox in interface BoxPrinter
Returns:
the box the box set when the setBox method is called.

setBox

public void setBox(Box box2)
Description copied from interface: BoxPrinter
Sets the owning box. getBox() should return the same box.

Specified by:
setBox in interface BoxPrinter
Parameters:
box2 - The box that owns this BoxPrinter.