minor bugfix: use isVisualized() method to determine if Cooja is visualized

This commit is contained in:
fros4943 2008-12-19 12:48:09 +00:00
parent 9d7e9fe297
commit e9fa905ff1
1 changed files with 6 additions and 3 deletions

View File

@ -24,7 +24,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: GUI.java,v 1.99 2008/12/17 13:12:07 fros4943 Exp $
* $Id: GUI.java,v 1.100 2008/12/19 12:48:09 fros4943 Exp $
*/
package se.sics.cooja;
@ -364,12 +364,15 @@ public class GUI extends Observable {
reparseProjectConfig();
} catch (ParseProjectsException e) {
logger.fatal("Error when loading project directories: " + e.getMessage());
e.printStackTrace();
if (myDesktopPane != null) {
if (isVisualized()) {
JOptionPane.showMessageDialog(GUI.getTopParentContainer(),
"Loading project directories failed.\nStack trace printed to console.",
"Error", JOptionPane.ERROR_MESSAGE);
} else {
logger.fatal("Loading project directories failed");
logger.fatal("Stack trace:");
}
e.printStackTrace();
}
}