org.jdesktop.animation.transitions
Class ComponentState

java.lang.Object
  extended by org.jdesktop.animation.transitions.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
 boolean equals(java.lang.Object obj)
           
 javax.swing.JComponent getComponent()
           
 int getHeight()
           
 java.awt.Image getSnapshot()
           
 int getWidth()
           
 int getX()
           
 int getY()
           
 int hashCode()
           
static void paintHierarchySingleBuffered(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 paintSingleBuffered(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.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, 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()

paintSingleBuffered

public static void paintSingleBuffered(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

paintHierarchySingleBuffered

public static void paintHierarchySingleBuffered(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.


equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object