content.setVisible(true);
SpringLayout sl = new SpringLayout();
content.setLayout(sl);
// defining the basic springs
Spring top = sl.getConstraint(SpringLayout.NORTH, content);
Spring left = sl.getConstraint(SpringLayout.WEST, content);
Spring bottom = sl.getConstraint(SpringLayout.SOUTH, content);
Spring right = sl.getConstraint(SpringLayout.EAST, content);
// add the main menu
log.debug("Adding main menu...");
mainMenu.setVisible(true);
// springs for the menu
Spring menuWidth = Spring.sum(right, Spring.minus(left));
Spring menuHeight = Spring.constant(20);
content.add(mainMenu, new SpringLayout.Constraints(top,left,menuWidth,menuHeight));
// add the status panel
Spring statusWidth = Spring.constant(146);
Spring statusHeight = Spring.sum(Spring.sum(bottom, Spring.minus(top)), Spring.minus(menuHeight));
Spring statusTop = Spring.sum(bottom, Spring.minus(statusHeight));
Spring statusLeft = Spring.sum(right, Spring.minus(statusWidth));
log.debug("Adding status panel...");
sp.setVisible(true);
content.add(sp, new SpringLayout.Constraints(statusLeft,statusTop,statusWidth,statusHeight));
// put the status panel in the repository
PanelRepository.add(PanelRepository.STATUS_PANEL, sp);
sp.repaint();
// // add the message panel
// log.debug("Adding message panel...");
Spring messHeight = Spring.constant(80);
Spring messTop = Spring.sum(bottom, Spring.minus(messHeight));
Spring messLeft = Spring.sum(left, statusWidth);
Spring messWidth = Spring.sum(right, Spring.minus(messLeft));
// messP.setVisible(true);
// content.add(messP, new SpringLayout.Constraints(messLeft,messTop,messWidth,messHeight));
// PanelRepository.add(PanelRepository.MESSAGE_PANEL, messP);
// finally, add the map panel
log.debug("Adding map panel...");
// map height with message panel:
// Spring mapHeight = Spring.sum(messTop, Spring.minus(Spring.sum(top, menuHeight)));
// map height without message panel:
Spring mapHeight = Spring.sum(bottom, Spring.minus(Spring.sum(top, menuHeight)));
Spring mapTop = Spring.sum(top, menuHeight);
Spring mapLeft = left;
Spring mapWidth = Spring.sum(right, Spring.minus(statusWidth));
mp.setVisible(true);
// mp.addMouseListener(new GUIEventListener());
content.add(mp, new SpringLayout.Constraints(mapLeft,mapTop,mapWidth,mapHeight));