disable tree icons icon at errors
This commit is contained in:
parent
83a1819992
commit
106bcc3c66
1 changed files with 10 additions and 5 deletions
|
@ -26,7 +26,7 @@
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* 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;
|
package se.sics.cooja.dialogs;
|
||||||
|
@ -465,12 +465,17 @@ class DirectoryTreePanel extends JPanel {
|
||||||
}
|
}
|
||||||
public void paintIcon(Component c, Graphics g, int x, int y) {
|
public void paintIcon(Component c, Graphics g, int x, int y) {
|
||||||
if (icon != null) {
|
if (icon != null) {
|
||||||
icon.paintIcon(c, g, x, y);
|
try {
|
||||||
} else {
|
icon.paintIcon(c, g, x, y);
|
||||||
|
} catch (Exception e) {
|
||||||
|
icon = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (icon == null) {
|
||||||
g.setColor(Color.WHITE);
|
g.setColor(Color.WHITE);
|
||||||
g.fillRect(x, y, 18, 18);
|
g.fillRect(x+1, y+1, 16, 16);
|
||||||
g.setColor(Color.BLACK);
|
g.setColor(Color.BLACK);
|
||||||
g.drawRect(x, y, 18, 18);
|
g.drawRect(x+1, y+1, 16, 16);
|
||||||
}
|
}
|
||||||
if (color != null) {
|
if (color != null) {
|
||||||
g.setColor(color);
|
g.setColor(color);
|
||||||
|
|
Loading…
Add table
Reference in a new issue