org.dillenburg.pictureframe
Class PictureLayout

java.lang.Object
  extended by org.dillenburg.pictureframe.PictureLayout
Direct Known Subclasses:
CenteredPictureLayout, LeftRightPictureLayout, TopBottomPictureLayout

public abstract class PictureLayout
extends java.lang.Object

Base class for all picture layout sub-classes. Renders one or more picture files using the paint(Graphics2D, Dimension) method.


Constructor Summary
PictureLayout()
           
 
Method Summary
abstract  java.util.List<java.io.File> getFiles()
          Get all files to be drawn by this layout.
abstract  void paint(java.awt.Graphics2D g, java.awt.Dimension screenSize)
          Paint the image files onto the given graphics canvas with the overall size given.
protected  void scaleAndCenterWithin(java.awt.Graphics2D g, java.awt.Rectangle r, java.awt.image.BufferedImage image)
          Scale and center an image within a rectangle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PictureLayout

public PictureLayout()
Method Detail

paint

public abstract void paint(java.awt.Graphics2D g,
                           java.awt.Dimension screenSize)
                    throws java.io.IOException
Paint the image files onto the given graphics canvas with the overall size given.

Parameters:
g - graphics canvas
screenSize - size of drawing area
Throws:
java.io.IOException - on error loading image files

scaleAndCenterWithin

protected void scaleAndCenterWithin(java.awt.Graphics2D g,
                                    java.awt.Rectangle r,
                                    java.awt.image.BufferedImage image)
Scale and center an image within a rectangle.

Parameters:
g - graphics canvas
r - rectangel to center within
image - image to draw

getFiles

public abstract java.util.List<java.io.File> getFiles()
Get all files to be drawn by this layout.

Returns:
list of files to be drawn using the given layout


JPictureFrame hosted by SourceForge.net - John Dillenburg - john_sourceforge@dillenburg.org