make a wrapper

This commit is contained in:
Konstantin Bulenkov
2010-12-23 16:28:27 +03:00
parent 9193df7c1d
commit 4cd5542160
@@ -17,23 +17,42 @@ package com.intellij.ui;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
import java.awt.*;
/**
* Used for deferred re-painting (i.e. for deferred icons). As a paint() method is invoked through the normal AWT painting cycle, deferred painting
* of children may be queued. It means that actual data used for painting is pushed for calculation and, as it gets ready, there is need for repaint.
* The target component for further repaint() is either the component that was originally exposed to painting or, if it's no longer showing (in case of a flyweight
* Used for deferred re-painting (i.e. for deferred icons). As a paint() method
* is invoked through the normal AWT painting cycle, deferred painting of
* children may be queued. It means that actual data used for painting is pushed
* for calculation and, as it gets ready, there is need for repaint.
*
* The target component for further repaint() is either the component that was
* originally exposed to painting or, if it's no longer showing (in case of a flyweight
* renderer) -- the first component up in the hierarchy that implements PaintingParent.
*
* @author Kirill Kalishev
* @author Konstantin Bulenkov
*/
public interface PaintingParent {
/**
* Returns rectangle of a child component for further repainting
* @param c
* @return a rectange, if null -- the whole component will be repainted
* @param c a component
* @return a rectangle, if null -- the whole component will be repainted
*/
@Nullable
Rectangle getChildRec(Component c);
class Wrapper extends JPanel implements PaintingParent {
public Wrapper(Component component) {
super(new BorderLayout(0,0));
add(component);
}
@Override
public Rectangle getChildRec(Component c) {
return null;
}
}
}