org.zilonis.tool.ext.aerith.effects
Class ComponentState

java.lang.Object
  extended by org.zilonis.tool.ext.aerith.effects.ComponentState

public class ComponentState
extends java.lang.Object

The structure stores the state of a given transition component that will be used during the transition, which includes the position, the size, and the image snapshot of the component.


Constructor Summary
ComponentState(javax.swing.JComponent component)
          Constructor, which takes the given component and derives the state information needed (location, size, and image snapshot)
 
Method Summary
 javax.swing.JComponent getComponent()
           
 int getHeight()
           
 java.awt.Image getSnapshot()
           
 int getWidth()
           
 int getX()
           
 int getY()
           
static void paintComponentHierarchySingleBuffered(javax.swing.JComponent component, java.awt.Graphics g)
          This variation paints the component including whatever is behind it; this handles the case where the component is not opaque.
static void paintComponentSingleBuffered(javax.swing.JComponent component, java.awt.Graphics g)
          Paints the given JComponent in single-buffered mode, which is needed to avoid rendering artifacts when capturing a non-opaque Swing component hierarchy into an offscreen image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentState

public ComponentState(javax.swing.JComponent component)
Constructor, which takes the given component and derives the state information needed (location, size, and image snapshot)

Method Detail

getX

public int getX()

getY

public int getY()

getWidth

public int getWidth()

getHeight

public int getHeight()

getComponent

public javax.swing.JComponent getComponent()

getSnapshot

public java.awt.Image getSnapshot()

paintComponentSingleBuffered

public static void paintComponentSingleBuffered(javax.swing.JComponent component,
                                                java.awt.Graphics g)
Paints the given JComponent in single-buffered mode, which is needed to avoid rendering artifacts when capturing a non-opaque Swing component hierarchy into an offscreen image.

Parameters:
component - the JComponent (and its children) to be painted
g - the Graphics into which component will be painted

paintComponentHierarchySingleBuffered

public static void paintComponentHierarchySingleBuffered(javax.swing.JComponent component,
                                                         java.awt.Graphics g)
This variation paints the component including whatever is behind it; this handles the case where the component is not opaque. This is useful/required for taking a snapshot of the transition container background, for example.