com.tensegrity.composite.util
Class RepaintManager

java.lang.Object
  extended bycom.tensegrity.composite.util.RepaintManager

public class RepaintManager
extends java.lang.Object

This class acts as a status holder for the current buffering state of the rendering engine. It works on top of the active rendering code, which doesn't have to be aware of the existence of the RepaintManager.

The RepaintManager internally stores a background and a foreground bitmap. Additionally a flag is stored internally that keeps track of whether the current state of the RepaintManager is considered to be valid or not. The clients of this class are responsible for both validating and invalidating the state of the RepaintManager based on their needs.

If RepaintManager is in a valid state, then the methods getBackground() and getForeground() both return valid non-null images.

If RepaintManager is not in a valid state, then the methods getBackground() and getForeground() both return valid null.

Version:
$Id: RepaintManager.java,v 1.3 2004/02/12 10:10:26 AndreasEbbert Exp $
Author:
StepanRutz

Field Summary
static int REASON_CLIENTSIZE_CHANGE
          Defines that indicate what the reason for an invalidation of the of a buffer was.
static int REASON_COMPOSITEMOVER_VIEWPORT_CHANGE
          Defines that indicate what the reason for an invalidation of the of a buffer was.
static int REASON_CONTENT_CHANGE
          Defines that indicate what the reason for an invalidation of the of a buffer was.
static int REASON_FOLDSTATE_CHANGE
          Defines that indicate what the reason for an invalidation of the of a buffer was.
static int REASON_GRAPHPANEL_VIEWPORT_CHANGE
          Defines that indicate what the reason for an invalidation of the of a buffer was.
static int REASON_NAVIGATOR_VIEWPORT_CHANGE
          Defines that indicate what the reason for an invalidation of the of a buffer was.
static int REASON_NOT_DISCLOSED
          Defines that indicate what the reason for an invalidation of the of a buffer was.
static int REASON_SCROLLBAR_VIEWPORT_CHANGE
          Defines that indicate what the reason for an invalidation of the of a buffer was.
static int REASON_SELECTION_CHANGE
          Defines that indicate what the reason for an invalidation of the of a buffer was.
 
Constructor Summary
RepaintManager(CompositeView compositeview)
          Constructs a new RepaintManager.
 
Method Summary
 RepaintBuffer getBackground()
          Returns the background RepaintBuffer of this instance, null is returned if no background buffer is set.
 RepaintBuffer getForeground()
          Returns the foreground RepaintBuffer of this instance, null is returned if no foreground buffer is set.
 void invalidate(int reason)
          Invalidates this instance.
 boolean isValid()
          Returns if this instance is valid, otherwise false is returned.
static java.lang.String reason2String(int reason)
          Converts a given reason identifier into a descriptive string.
 void validate(RepaintBuffer background, RepaintBuffer foreground)
          Validates this RepaintManager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REASON_NOT_DISCLOSED

public static final int REASON_NOT_DISCLOSED
Defines that indicate what the reason for an invalidation of the of a buffer was.

See Also:
Constant Field Values

REASON_SELECTION_CHANGE

public static final int REASON_SELECTION_CHANGE
Defines that indicate what the reason for an invalidation of the of a buffer was.

See Also:
Constant Field Values

REASON_CONTENT_CHANGE

public static final int REASON_CONTENT_CHANGE
Defines that indicate what the reason for an invalidation of the of a buffer was.

See Also:
Constant Field Values

REASON_COMPOSITEMOVER_VIEWPORT_CHANGE

public static final int REASON_COMPOSITEMOVER_VIEWPORT_CHANGE
Defines that indicate what the reason for an invalidation of the of a buffer was.

See Also:
Constant Field Values

REASON_NAVIGATOR_VIEWPORT_CHANGE

public static final int REASON_NAVIGATOR_VIEWPORT_CHANGE
Defines that indicate what the reason for an invalidation of the of a buffer was.

See Also:
Constant Field Values

REASON_SCROLLBAR_VIEWPORT_CHANGE

public static final int REASON_SCROLLBAR_VIEWPORT_CHANGE
Defines that indicate what the reason for an invalidation of the of a buffer was.

See Also:
Constant Field Values

REASON_GRAPHPANEL_VIEWPORT_CHANGE

public static final int REASON_GRAPHPANEL_VIEWPORT_CHANGE
Defines that indicate what the reason for an invalidation of the of a buffer was.

See Also:
Constant Field Values

REASON_CLIENTSIZE_CHANGE

public static final int REASON_CLIENTSIZE_CHANGE
Defines that indicate what the reason for an invalidation of the of a buffer was.

See Also:
Constant Field Values

REASON_FOLDSTATE_CHANGE

public static final int REASON_FOLDSTATE_CHANGE
Defines that indicate what the reason for an invalidation of the of a buffer was.

See Also:
Constant Field Values
Constructor Detail

RepaintManager

public RepaintManager(CompositeView compositeview)
Constructs a new RepaintManager. Initially the state of the RepaintManager is invalid.

Parameters:
compositeview - the CompositeView this instance is used with.
Method Detail

reason2String

public static final java.lang.String reason2String(int reason)
Converts a given reason identifier into a descriptive string.

Parameters:
reason - the reason identifier.
Returns:
a descriptive string for the given reason identifier.

getBackground

public RepaintBuffer getBackground()
Returns the background RepaintBuffer of this instance, null is returned if no background buffer is set.

Returns:
the background RepaintBuffer of this instance,

getForeground

public RepaintBuffer getForeground()
Returns the foreground RepaintBuffer of this instance, null is returned if no foreground buffer is set.

Returns:
the foreground RepaintBuffer of this instance,

isValid

public boolean isValid()
Returns if this instance is valid, otherwise false is returned.

Returns:
if this instance is valid, otherwise false.

validate

public void validate(RepaintBuffer background,
                     RepaintBuffer foreground)
Validates this RepaintManager.

Parameters:
background - the background RepaintBuffer that is declared to be valid.
foreground - the foreground RepaintBuffer that is declared to be valid.

invalidate

public void invalidate(int reason)
Invalidates this instance.

Parameters:
reason - a reason identifier that gives additional information why the call to this method was made.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.