com.imagero.gui.swing
Class BackgroundPainter

java.lang.Object
  extended bycom.imagero.gui.swing.BackgroundPainter

public class BackgroundPainter
extends java.lang.Object

BackgroundPainter.
Basic support for drawing on Component's background.

 Use with awt:
 override update(Graphics g);
 BackgroundPainter bp;
 public void update(Graphics g) {
  bp.paint(this, g);
  paint(g);
 }
 use with swing:
 setOpaque(false);
 protected void paintComponent(Graphics g) {
  backgroundPainter.paint(this, g);
  super.paintComponent(g);
 }
 


Field Summary
static int BOTTOM
           
static int BOTTOM_LEFT
           
static int BOTTOM_RIGHT
           
static int CENTER
           
static int CUSTOM
           
static int LEFT
           
static int RIGHT
           
static int TILED
           
static int TOP
           
static int TOP_LEFT
           
static int TOP_RIGHT
           
 
Constructor Summary
BackgroundPainter()
           
BackgroundPainter(java.awt.Image img)
           
BackgroundPainter(java.awt.Paint gp)
           
BackgroundPainter(java.awt.Paint gp, java.awt.Image img)
           
 
Method Summary
 java.awt.Image getBgImage()
           
 java.awt.Paint getPaint()
           
 boolean isEmpty()
           
 void paint(java.awt.Component c, java.awt.Graphics g)
           
 void setBgImage(java.awt.Image bgImage)
           
 void setImageJustification(int justify)
           
 void setImageJustificationParams(float imgX, float imgY, float imgScaleX, float imgScaleY)
           
 void setPaint(java.awt.Paint gp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BOTTOM

public static final int BOTTOM
See Also:
Constant Field Values

BOTTOM_LEFT

public static final int BOTTOM_LEFT
See Also:
Constant Field Values

BOTTOM_RIGHT

public static final int BOTTOM_RIGHT
See Also:
Constant Field Values

CENTER

public static final int CENTER
See Also:
Constant Field Values

CUSTOM

public static final int CUSTOM
See Also:
Constant Field Values

LEFT

public static final int LEFT
See Also:
Constant Field Values

RIGHT

public static final int RIGHT
See Also:
Constant Field Values

TILED

public static final int TILED
See Also:
Constant Field Values

TOP

public static final int TOP
See Also:
Constant Field Values

TOP_LEFT

public static final int TOP_LEFT
See Also:
Constant Field Values

TOP_RIGHT

public static final int TOP_RIGHT
See Also:
Constant Field Values
Constructor Detail

BackgroundPainter

public BackgroundPainter()

BackgroundPainter

public BackgroundPainter(java.awt.Image img)

BackgroundPainter

public BackgroundPainter(java.awt.Paint gp)

BackgroundPainter

public BackgroundPainter(java.awt.Paint gp,
                         java.awt.Image img)
Method Detail

getBgImage

public java.awt.Image getBgImage()

getPaint

public java.awt.Paint getPaint()

isEmpty

public boolean isEmpty()

paint

public void paint(java.awt.Component c,
                  java.awt.Graphics g)

setBgImage

public void setBgImage(java.awt.Image bgImage)

setImageJustification

public void setImageJustification(int justify)

setImageJustificationParams

public void setImageJustificationParams(float imgX,
                                        float imgY,
                                        float imgScaleX,
                                        float imgScaleY)

setPaint

public void setPaint(java.awt.Paint gp)