private void createUserInterface()
{
setVisible(false);
setDefaultCloseOperation(MainFrame.DO_NOTHING_ON_CLOSE);
final SquirrelResources rsrc = _app.getResources();
getDesktopContainer().setDesktopManager(new SquirrelDesktopManager(_app));
final Container content = getContentPane();
content.setLayout(new BorderLayout());
final JScrollPane sp = new JScrollPane(getDesktopContainer().getComponent());
sp.setBorder(BorderFactory.createEmptyBorder());
_msgPnl = new MessagePanel()
{
public void setSize(int width, int height)
{
super.setSize(width, height);
if(0 < width && 0 < height)
{
// The call here is the result of a desperate fight
// to find a place where the components in the split
// had not height = 0. If someone knows a better way
// please tell me I'll apreciate any advice.
// gerdwagner@users.sourceforge.net
resizeSplitOnStartup();
}
}
};
_msgPnl.setName(MessagePanel.class.toString());
_msgPnl.setEditable(false);
_splitPn = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
_splitPn.add(sp);
_splitPn.add(new JScrollPane(_msgPnl));
_splitPn.setResizeWeight(1);
//i18n[MainFrame.saveSize=Save size]
String key = s_stringMgr.getString("MainFrame.saveSize");
Action splitDividerLocAction = new AbstractAction(key)
{
public void actionPerformed(ActionEvent e)
{
int msgPanelHeight = _splitPn.getBottomComponent().getSize().height;
Preferences.userRoot().putInt(PREFS_KEY_MESSAGEPANEL_HEIGHT, msgPanelHeight);
}
};
_msgPnl.addToMessagePanelPopup(splitDividerLocAction);
//i18n[MainFrame.restoreSize=Restore saved size]
key = s_stringMgr.getString("MainFrame.restoreSize");
Action setSplitDividerLocAction = new AbstractAction(key)
{
public void actionPerformed(ActionEvent e)
{
int prefMsgPanelHeight = Preferences.userRoot().getInt(PREFS_KEY_MESSAGEPANEL_HEIGHT, -1);
if(-1 != prefMsgPanelHeight)
{
int divLoc = getDividerLocation(prefMsgPanelHeight, _splitPn);
_splitPn.setDividerLocation(divLoc);
}
}
};
_msgPnl.addToMessagePanelPopup(setSplitDividerLocAction);
content.add(_splitPn, BorderLayout.CENTER);
_statusBar = new MainFrameStatusBar(_app);
final Font fn = _app.getFontInfoStore().getStatusBarFontInfo().createFont();
_statusBar.setFont(fn);
setJMenuBar(new MainFrameMenuBar(_app, getDesktopContainer(), _app.getActionCollection()));
setupFromPreferences();
final ImageIcon icon = rsrc.getIcon(SquirrelResources.IImageNames.APPLICATION_ICON);
if (icon != null)
{
setIconImage(icon.getImage());
}
else