From 106bcc3c6607d0e1fe044ad3be94ce1d3d95622a Mon Sep 17 00:00:00 2001 From: fros4943 Date: Wed, 19 May 2010 17:52:23 +0000 Subject: [PATCH] disable tree icons icon at errors --- .../cooja/dialogs/ProjectDirectoriesDialog.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tools/cooja/java/se/sics/cooja/dialogs/ProjectDirectoriesDialog.java b/tools/cooja/java/se/sics/cooja/dialogs/ProjectDirectoriesDialog.java index 42bbbc142..e5025242d 100644 --- a/tools/cooja/java/se/sics/cooja/dialogs/ProjectDirectoriesDialog.java +++ b/tools/cooja/java/se/sics/cooja/dialogs/ProjectDirectoriesDialog.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ProjectDirectoriesDialog.java,v 1.14 2010/05/19 17:38:46 fros4943 Exp $ + * $Id: ProjectDirectoriesDialog.java,v 1.15 2010/05/19 17:52:23 fros4943 Exp $ */ package se.sics.cooja.dialogs; @@ -465,12 +465,17 @@ class DirectoryTreePanel extends JPanel { } public void paintIcon(Component c, Graphics g, int x, int y) { if (icon != null) { - icon.paintIcon(c, g, x, y); - } else { + try { + icon.paintIcon(c, g, x, y); + } catch (Exception e) { + icon = null; + } + } + if (icon == null) { g.setColor(Color.WHITE); - g.fillRect(x, y, 18, 18); + g.fillRect(x+1, y+1, 16, 16); g.setColor(Color.BLACK); - g.drawRect(x, y, 18, 18); + g.drawRect(x+1, y+1, 16, 16); } if (color != null) { g.setColor(color);