Search in sources :

Example 1 with ZoomPane

use of net.sf.sdedit.ui.components.ZoomPane in project abstools by abstools.

the class MultipageExporter method init.

public void init() throws SyntaxError, SemanticError {
    paintDevice = new MultipagePaintDevice(properties, size);
    TextHandler th = new TextHandler(source);
    new Diagram(configuration, th, paintDevice).generate();
    int n = paintDevice.getPanels().size();
    setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
    int i = 0;
    for (MultipagePaintDevice.MultipagePanel panel : paintDevice.getPanels()) {
        i++;
        JPanel wrap = new JPanel();
        wrap.setLayout(new BoxLayout(wrap, BoxLayout.Y_AXIS));
        wrap.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10));
        wrap.setAlignmentY(0.5F);
        ZoomPane zoomPane = new ZoomPane(false);
        zoomPane.setViewportView(panel);
        zoomPane.setScale(scale);
        zoomPane.setMinimumSize(previewSize);
        zoomPane.setMaximumSize(previewSize);
        zoomPane.setPreferredSize(previewSize);
        zoomPane.setBorder(BorderFactory.createLineBorder(Color.BLACK, 1));
        wrap.add(zoomPane);
        JLabel label = new JLabel(i + "/" + n);
        label.setAlignmentX(0.5F);
        wrap.add(label);
        add(wrap);
    }
}
Also used : JPanel(javax.swing.JPanel) ZoomPane(net.sf.sdedit.ui.components.ZoomPane) BoxLayout(javax.swing.BoxLayout) TextHandler(net.sf.sdedit.text.TextHandler) JLabel(javax.swing.JLabel) Diagram(net.sf.sdedit.diagram.Diagram)

Aggregations

BoxLayout (javax.swing.BoxLayout)1 JLabel (javax.swing.JLabel)1 JPanel (javax.swing.JPanel)1 Diagram (net.sf.sdedit.diagram.Diagram)1 TextHandler (net.sf.sdedit.text.TextHandler)1 ZoomPane (net.sf.sdedit.ui.components.ZoomPane)1