org.jdesktop.swingx.plaf
Class SafeBorder

java.lang.Object
  extended by javax.swing.border.AbstractBorder
      extended by org.jdesktop.swingx.plaf.SafeBorder
All Implemented Interfaces:
Serializable, Border, UIResource

public class SafeBorder
extends AbstractBorder
implements UIResource

Wrapper around a delegate with the same behaviour as the delegate except that it catches null insets (hack around Issue 1297-swingx which is core bug 6739738)

See Also:
Serialized Form

Constructor Summary
SafeBorder(AbstractBorder delegate)
           
 
Method Summary
 int getBaseline(Component c, int width, int height)
          
 Component.BaselineResizeBehavior getBaselineResizeBehavior(Component c)
          
 Insets getBorderInsets(Component c)
          
 Insets getBorderInsets(Component c, Insets insets)
          
 Rectangle getInteriorRectangle(Component c, int x, int y, int width, int height)
          
 boolean isBorderOpaque()
          
 void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
          
 
Methods inherited from class javax.swing.border.AbstractBorder
getInteriorRectangle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SafeBorder

public SafeBorder(AbstractBorder delegate)
Method Detail

getBaseline

public int getBaseline(Component c,
                       int width,
                       int height)

Overrides:
getBaseline in class AbstractBorder

getBaselineResizeBehavior

public Component.BaselineResizeBehavior getBaselineResizeBehavior(Component c)

Overrides:
getBaselineResizeBehavior in class AbstractBorder

getBorderInsets

public Insets getBorderInsets(Component c,
                              Insets insets)

Overrides:
getBorderInsets in class AbstractBorder

getBorderInsets

public Insets getBorderInsets(Component c)

Specified by:
getBorderInsets in interface Border
Overrides:
getBorderInsets in class AbstractBorder

getInteriorRectangle

public Rectangle getInteriorRectangle(Component c,
                                      int x,
                                      int y,
                                      int width,
                                      int height)

Overrides:
getInteriorRectangle in class AbstractBorder

isBorderOpaque

public boolean isBorderOpaque()

Specified by:
isBorderOpaque in interface Border
Overrides:
isBorderOpaque in class AbstractBorder

paintBorder

public void paintBorder(Component c,
                        Graphics g,
                        int x,
                        int y,
                        int width,
                        int height)

Specified by:
paintBorder in interface Border
Overrides:
paintBorder in class AbstractBorder


Copyright © 2012. All Rights Reserved.