org.pbjar.jxlayer.plaf.ext.transform
Class TransformRPMImpl

java.lang.Object
  extended by org.pbjar.jxlayer.plaf.ext.transform.TransformRPMImpl

public class TransformRPMImpl
extends Object

To avoid duplicate code, this class implements the actual logic for TransformRPMSwingX and TransformRPMFallBack.

Author:
Piet Blok

Field Summary
static boolean hack
          A flag, indicating whether or not a very dirty initialization on created RepaintManagers must be performed.
 
Method Summary
static boolean addDirtyRegion(JComponent aComponent, int x, int y, int w, int h, RepaintManager manager)
          Searches upwards in the component hierarchy for a JXLayer ancestor with an enabled TransformUI.
static void hackInitialization(RepaintManager sourceManager, RepaintManager destinationManager)
          If hack is true, the private fields paintManager and bufferStrategyType are copied via reflection from the source manager into the destination manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hack

public static boolean hack
A flag, indicating whether or not a very dirty initialization on created RepaintManagers must be performed.

See Also:
hackInitialization(RepaintManager, RepaintManager)
Method Detail

addDirtyRegion

public static boolean addDirtyRegion(JComponent aComponent,
                                     int x,
                                     int y,
                                     int w,
                                     int h,
                                     RepaintManager manager)
Searches upwards in the component hierarchy for a JXLayer ancestor with an enabled TransformUI.

If found, the dirty rectangle is transformed to a rectangle targeted at that JXLayer and the argument manager's RepaintManager.addDirtyRegion(JComponent, int, int, int, int) is invoked. true is returned.

Else, (@code false} is returned.

Parameters:
aComponent - a component
x - the X of the dirty region
y - the Y of the dirty region
w - the width of the dirty region
h - the height of the dirty region
manager - the current RepaintManager
Returns:
true if the call is delegated to the manager with a transformed rectangle, false otherwise

hackInitialization

public static void hackInitialization(RepaintManager sourceManager,
                                      RepaintManager destinationManager)
If hack is true, the private fields paintManager and bufferStrategyType are copied via reflection from the source manager into the destination manager.

Parameters:
sourceManager -
destinationManager -