JIDE 3.5.15

com.jidesoft.swing
Class OverlayableUtils

java.lang.Object
  extended by com.jidesoft.swing.OverlayableUtils

public class OverlayableUtils
extends Object

This util class has several methods related to Overlayable.


Constructor Summary
OverlayableUtils()
           
 
Method Summary
static Overlayable[] getAllOverlayables(JComponent component)
          Gets all overlayables associated with this component and its parents.
static Overlayable getOverlayable(JComponent component)
          Gets the overlayable associated with this component and its parents.
static Icon getPredefinedOverlayIcon(String name)
          Gets the predefined icon that can be used as the overlay icon for the Swing component.
static void repaintAllOverlayables(JComponent component)
          Repaints all the overlayables associated with the component or its parents.
static void repaintOverlayable(JComponent component)
          Repaints the overlayable component associated with component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OverlayableUtils

public OverlayableUtils()
Method Detail

getOverlayable

public static Overlayable getOverlayable(JComponent component)
Gets the overlayable associated with this component and its parents. This method will find the first overlayable that contains the component or its parents.

Parameters:
component - the component.
Returns:
the overlayable.

getAllOverlayables

public static Overlayable[] getAllOverlayables(JComponent component)
Gets all overlayables associated with this component and its parents. Different from getOverlayable(javax.swing.JComponent), this method will find the all overlayables that contain the component or its parents.

Parameters:
component - the component
Returns:
all the overlayables.

repaintOverlayable

public static void repaintOverlayable(JComponent component)
Repaints the overlayable component associated with component. Because the overlay component is shown above the component and its child components, if any of the components repaint, the overlay component will be covered if the overlay component doesn't know to repaint immediately. Due to way Swing repaintManager works, there isn't any other better way to solve the issue other than the component has code to trigger the repaint of the overlay component. That's one reason we provide this way to repaint the overlay component easily.

See below for an example of how to prepare the component to be ready for the overlayable.


 public OverlayTextField() {
 ...
 public void repaint(long tm, int x, int y, int width, int height) {
     super.repaint(tm, x, y, width, height);
     OverlayableUtils.repaintOverlayable(this);
 }
 

Parameters:
component - the component that has an overlayable.

repaintAllOverlayables

public static void repaintAllOverlayables(JComponent component)
Repaints all the overlayables associated with the component or its parents.

Parameters:
component - the component.

getPredefinedOverlayIcon

public static Icon getPredefinedOverlayIcon(String name)
Gets the predefined icon that can be used as the overlay icon for the Swing component. Available icon names are

Parameters:
name - name defined in OverlayableIconsFactory.
Returns:
the icon

JIDE 3.5.15