prefuse.util.display
Class BackgroundPainter

java.lang.Object
  extended by prefuse.util.display.BackgroundPainter
All Implemented Interfaces:
java.util.EventListener, PaintListener

public class BackgroundPainter
extends java.lang.Object
implements PaintListener

Paints a background image in a display. The image can either pan and zoom along with the display or stay stationary. Additionally, the image can be optionally tiled across the Display space. This class is used by the Display class in response to the Display.setBackgroundImage(Image, boolean, boolean) and Display.setBackgroundImage(String, boolean, boolean) methods.

Author:
jeffrey heer

Constructor Summary
BackgroundPainter(java.awt.Image image, boolean fixed, boolean tile)
          Create a new BackgroundPainter.
BackgroundPainter(java.lang.String imageLocation, boolean fixed, boolean tile)
          Create a new BackgroundPainter.
 
Method Summary
 void postPaint(Display d, java.awt.Graphics2D g)
          Does nothing.
 void prePaint(Display d, java.awt.Graphics2D g)
          Paint the background.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BackgroundPainter

public BackgroundPainter(java.lang.String imageLocation,
                         boolean fixed,
                         boolean tile)
Create a new BackgroundPainter.

Parameters:
imageLocation - a location String of where to retrieve the image file from. Uses IOLib.urlFromString(String) to resolve the String.
fixed - true if the background image should stay in a fixed position, invariant to panning, zooming, or rotation; false if the image should be subject to view transforms
tile - true to tile the image across the visible background, false to only include the image once

BackgroundPainter

public BackgroundPainter(java.awt.Image image,
                         boolean fixed,
                         boolean tile)
Create a new BackgroundPainter.

Parameters:
image - the background Image
fixed - true if the background image should stay in a fixed position, invariant to panning, zooming, or rotation; false if the image should be subject to view transforms
tile - true to tile the image across the visible background, false to only include the image once
Method Detail

prePaint

public void prePaint(Display d,
                     java.awt.Graphics2D g)
Paint the background.

Specified by:
prePaint in interface PaintListener
Parameters:
d - the Display about to paint itself
g - the Graphics context for the Display
See Also:
PaintListener.prePaint(prefuse.Display, java.awt.Graphics2D)

postPaint

public void postPaint(Display d,
                      java.awt.Graphics2D g)
Does nothing.

Specified by:
postPaint in interface PaintListener
Parameters:
d - the Display about to paint itself
g - the Graphics context for the Display
See Also:
PaintListener.postPaint(prefuse.Display, java.awt.Graphics2D)


Copyright © 2007 Regents of the University of California