From: Frederick W. <fre...@us...> - 2012-02-07 16:37:37
|
rails/ui/swing/GridPanel.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) New commits: commit 59e98fa0bda31a4f2944fee0dac6bd123b322bb0 Author: Frederick Weld <fre...@gm...> Date: Tue Feb 7 17:36:03 2012 +0100 Increased robustness of grid panel highlighting getBorderInsets was reported to return null under some conditions. Now, GridPanel is able to handle that. diff --git a/rails/ui/swing/GridPanel.java b/rails/ui/swing/GridPanel.java index 9f11f42..d2ea42b 100644 --- a/rails/ui/swing/GridPanel.java +++ b/rails/ui/swing/GridPanel.java @@ -252,12 +252,16 @@ implements ActionListener, KeyListener { this.nativeInnerBorder = innerBorder; this.outlineBorder = outlineBorder; this.outerBorder = outerBorder; + Insets nativeInnerBorderInsets = nativeInnerBorder.getBorderInsets(null); + if (nativeInnerBorderInsets == null) { + nativeInnerBorderInsets = new Insets(0,0,0,0); + } this.highlightedInnerBorder = new DynamicBorder( highlightedBorderColor, - nativeInnerBorder.getBorderInsets(null).top, - nativeInnerBorder.getBorderInsets(null).left, - nativeInnerBorder.getBorderInsets(null).bottom, - nativeInnerBorder.getBorderInsets(null).right); + nativeInnerBorderInsets.top, + nativeInnerBorderInsets.left, + nativeInnerBorderInsets.bottom, + nativeInnerBorderInsets.right); } public void setHighlight(boolean isToBeHighlighted) { outlineBorder.setHighlight(isToBeHighlighted); |