presetComboBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
PreviewUIController pc = Lookup.getDefault().lookup(PreviewUIController.class);
PreviewUIModel previewModel = pc.getModel();
if (previewModel != null && presetComboBox.getSelectedItem() instanceof PreviewPreset) {
if (previewModel.getCurrentPreset() != presetComboBox.getSelectedItem()) {
pc.setCurrentPreset((PreviewPreset) presetComboBox.getSelectedItem());
propertySheet.setNodes(new Node[]{new PreviewNode(propertySheet)});
}
}
}
});
//Export
svgExportButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
VectorialFileExporterUI ui = Lookup.getDefault().lookup(VectorialFileExporterUI.class);
ui.action();
}
});
setup(null);
PreviewUIController controller = Lookup.getDefault().lookup(PreviewUIController.class);
controller.addPropertyChangeListener(this);
PreviewUIModel m = controller.getModel();
if (m != null) {
setup(m);
enableRefreshButton();
}
}