public ContentDialog(Content content) { frame = new JFrame("Content"); int margin = 15; JPanel main = new JPanel(); frame.setContentPane(main); main.setLayout(new BorderLayout()); ContentConfig config = new ContentConfig(); ContentPanel contentPanel = new ContentPanel(content, config, margin); Settings settings = new Settings(contentPanel); ScrollableView<ContentPanel> scrollableView = new ScrollableView<>(contentPanel); main.add(settings, BorderLayout.NORTH); main.add(scrollableView, BorderLayout.CENTER); /* * Menu */ Rectangle scene = content.getScene(); ContentPainter painter = new ContentPainter(scene, content, config, null); JMenuBar menu = new JMenuBar(); JMenu menuFile = new JMenu("File"); menu.add(menuFile); ExportUtil.addExportItems(menuFile, frame, painter, contentPanel); frame.setJMenuBar(menu); /* * Show dialog */ frame.setLocationByPlatform(true); frame.setSize(800, 500); frame.setVisible(true); }
public ContentPanel(Content content, ContentConfig config, int margin) { super(content.getScene()); this.config = config; visualizationPainter = new ContentPainter(scene, content, config, painter); }