Search in sources :

Example 1 with PrintConfiguration

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);
}
Also used : PrintConfiguration(net.sf.sdedit.config.PrintConfiguration) JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) GridLayout(java.awt.GridLayout) BorderLayout(java.awt.BorderLayout) ConfigurationUI(net.sf.sdedit.ui.components.configuration.ConfigurationUI) JLabel(javax.swing.JLabel) TitledBorder(javax.swing.border.TitledBorder) ButtonPanel(net.sf.sdedit.ui.components.ButtonPanel)

Example 2 with PrintConfiguration

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();
        }
    }
}
Also used : PrintConfiguration(net.sf.sdedit.config.PrintConfiguration) File(java.io.File)

Aggregations

PrintConfiguration (net.sf.sdedit.config.PrintConfiguration)2 BorderLayout (java.awt.BorderLayout)1 GridLayout (java.awt.GridLayout)1 File (java.io.File)1 JLabel (javax.swing.JLabel)1 JPanel (javax.swing.JPanel)1 JScrollPane (javax.swing.JScrollPane)1 TitledBorder (javax.swing.border.TitledBorder)1 ButtonPanel (net.sf.sdedit.ui.components.ButtonPanel)1 ConfigurationUI (net.sf.sdedit.ui.components.configuration.ConfigurationUI)1