gishur.gui2
Class BackgroundLayer

java.lang.Object
  |
  +--gishur.gui2.DrawAtom
        |
        +--gishur.gui2.BackgroundLayer

public class BackgroundLayer
extends DrawAtom

The basic BackgroundLayer for drawing backgrounds. This class should be parent class for all other backgrounds. In this implementation the background will simply cleared with the color specified in the properties list under the key "background_color". To change the background color, simply change / set the property in the BackgroundLayer or one of its parents properties list and mark the BackgroundLayer as dirty (via makeDirty()).

Properties Summary
Key Value Type Default value Meaning
background_color java.awt.Color Color.lightGray The background color.

Version:
1.0
Author:
Thomas Wolf
See Also:
LayerManager

Fields inherited from class gishur.gui2.DrawAtom
BLOCK_REPAINT, MARK_RECALC, MARK_REPAINT, MARK_SIZE, REPAINT, UNBLOCK_REPAINT, USER_STATES_FIRST, USER_STATES_MASK
 
Constructor Summary
BackgroundLayer()
          The default constructor for BackgroundLayers.
 
Method Summary
 boolean dirty()
          Returns true, if the object is currently marked as dirty.
protected  void draw(java.awt.Graphics g, RenderContext context)
          Draws this DrawAtom to the given Graphics g.
 void makeDirty()
          Makes this object dirty and marks it for repainting.
protected  void recalculate(RenderContext context)
          Forces the DrawAtom to recalculate its representation.
 
Methods inherited from class gishur.gui2.DrawAtom
addProperties, collectHits, dispatchEvent, displayManager, drawComponent, getBounds, getLocalProperty, getProperty, getProperty, getRequiredProperty, locate, prepeareRenderContext, preprocessEvent, processMessage, properties, removeProperty, sendEvent, sendMessage, setBounds, setPropertiesTo, setProperty, setProperty, setProperty, setProperty, toString, toString, toStringDetail, toTreeString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BackgroundLayer

public BackgroundLayer()
The default constructor for BackgroundLayers.
Method Detail

recalculate

protected void recalculate(RenderContext context)
Forces the DrawAtom to recalculate its representation. This method will only be called, if it became dirty via a call to the makeDirty() method or something has happened, that causes all DrawAtoms to recalculate their representation. This method should only be called by the render system.
Overrides:
recalculate in class DrawAtom
Parameters:
context - the RenderContext to use

draw

protected void draw(java.awt.Graphics g,
                    RenderContext context)
Draws this DrawAtom to the given Graphics g. This method should only be called by the render system.
Overrides:
draw in class DrawAtom
Parameters:
g - Graphics for drawing
context - the RenderContext to use
Throws:
DrawException - if invalid call to this method

dirty

public boolean dirty()
Returns true, if the object is currently marked as dirty.
Returns:
true, if object dirty

makeDirty

public void makeDirty()
Makes this object dirty and marks it for repainting.