pack();
setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
}
protected void createContent(){
Container content = getContentPane();
content.setLayout(new BorderLayout());
// HeaderPanel
headerPanel = new HeaderPanel(true);
headerPanel.setTitle(resources.getString("pageSetup"));
headerPanel.displayInfo(resources.getString("pageSetupTip"));
content.add(headerPanel, BorderLayout.NORTH);
// Inner panel
GridBagPanel pageSetupPanel = new GridBagPanel();
GridBagPanel pageModePanel = new GridBagPanel();
GridBagPanel pageFormatPanel = new GridBagPanel( resources.getStringValue("pageFormat"));
// Mode
normalView = resources.getRadioButton("layoutMode", this);
printView = resources.getRadioButton("pageMode", this);
normalView.setSelected(false);
printView.setSelected(false);
ButtonGroup modeGroup = new ButtonGroup();
modeGroup.add(normalView);
modeGroup.add(printView);
pageModePanel.addOnCurrentRow(normalView);
pageModePanel.carriageReturn();
pageModePanel.addOnCurrentRow(printView);
pageModePanel.carriageReturn();
// Format
paperFormatList = new JComboBox( pageFormats );
paperFormatList.addActionListener(this);
SpinnerNumberModel heightSpi = new SpinnerNumberModel();
heightSpi.setStepSize(new Integer(1));
heightSpi.setMinimum(new Integer(50));
heightSpi.setMaximum(new Integer(10000));
heightSpi.setValue(new Integer(1));
height = new JSpinner(heightSpi);
SpinnerNumberModel widthSpi = new SpinnerNumberModel();
widthSpi.setStepSize(new Integer(1));
widthSpi.setMinimum(new Integer(50));
widthSpi.setMaximum(new Integer(10000));
widthSpi.setValue(new Integer(1));
width = new JSpinner(widthSpi);
lformat = resources.getLabel("format");
pageFormatPanel.addOnCurrentRow(lformat);
pageFormatPanel.addOnCurrentRow(paperFormatList);
portrait = resources.getRadioButton("portrait", this);
landscape = resources.getRadioButton("landscape", this);
portrait.setSelected(false);
landscape.setSelected(false);
/* orientationGroup = new ButtonGroup();
orientationGroup.add(portrait);
orientationGroup.add(landscape);*/
pageFormatPanel.addOnCurrentRow(portrait);
pageFormatPanel.addOnCurrentRow(landscape);
pageFormatPanel.carriageReturn();
lwidth = resources.getLabel("width");
pageFormatPanel.addOnCurrentRow(lwidth);
pageFormatPanel.addOnCurrentRow(width);
pageFormatPanel.carriageReturn();
lheight = resources.getLabel("height");
pageFormatPanel.addOnCurrentRow(lheight);
pageFormatPanel.addOnCurrentRow(height);
pageFormatPanel.carriageReturn();
// Add all panels
pageSetupPanel.addOnCurrentRow(pageModePanel, 3, true, true, true);
pageSetupPanel.addOnCurrentRow(pageFormatPanel, 3, true, true, false);
content.add(pageSetupPanel, BorderLayout.CENTER);
// Buttons
JPanel navigationBarPanel = new JPanel(new BorderLayout());
JPanel navigationBar = new JPanel();
closeButton = resources.getButton("closeButton", this);
okButton = resources.getButton("okButton", this);
navigationBar.add(okButton);
navigationBar.add(closeButton);
navigationBarPanel.add(navigationBar, BorderLayout.EAST);
content.add(navigationBarPanel,BorderLayout.SOUTH);
}