use of net.sf.sdedit.config.PrintConfiguration in project abstools by abstools.
the class PrintDialog method init.
private void init() {
JPanel center = new JPanel();
getContentPane().add(center, BorderLayout.CENTER);
ButtonPanel buttonPanel = new ButtonPanel();
buttonPanel.addAction(cancel);
buttonPanel.addAction(ok, 0, true);
getContentPane().add(buttonPanel, BorderLayout.SOUTH);
printerProperties = ConfigurationManager.getPrintConfigurationBean();
setToCurrentFile();
ConfigurationUI<PrintConfiguration> cui = new ConfigurationUI<PrintConfiguration>(this, printerProperties, null, null, null, null);
cui.hideButtons();
cui.hideCategoryList();
printerProperties.addPropertyChangeListener(this);
center.setLayout(new GridLayout(1, 2));
center.add(cui);
JPanel right = new JPanel();
right.setBorder(new TitledBorder("Preview"));
right.setLayout(new BorderLayout());
preview = new JScrollPane();
right.add(preview);
scaleLabel = new JLabel("Zoom factor: 100 %");
scaleLabel.setHorizontalAlignment(SwingConstants.CENTER);
right.add(scaleLabel, BorderLayout.SOUTH);
center.add(right);
}
use of net.sf.sdedit.config.PrintConfiguration in project abstools by abstools.
the class PrintDialog method propertyChange.
public void propertyChange(PropertyChangeEvent evt) {
String property = evt.getPropertyName();
if (!property.equals("command") && !property.equals("exportFile") && !property.equals("commandFile")) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
reinitialize();
}
});
}
if (property.equals("command")) {
PrintConfiguration prop = printerProperties.getDataObject();
String command = prop.getAction();
if (command.equals(PrintConfiguration.EXPORT_AND_PRINT)) {
prop.setExportFile(new File(System.getProperty("java.io.tmpdir"), "temp.pdf"));
} else if (command.equals(PrintConfiguration.EXPORT)) {
setToCurrentFile();
}
}
}
Aggregations