use of games.strategy.triplea.printgenerator.SetupFrame in project triplea by triplea-game.
the class ExportMenu method addExportSetupCharts.
private void addExportSetupCharts() {
final JMenuItem menuFileExport = new JMenuItem(SwingAction.of("Export Setup Charts", e -> {
final JFrame frame = new JFrame("Export Setup Charts");
frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
GameData clonedGameData;
gameData.acquireReadLock();
try {
clonedGameData = GameDataUtils.cloneGameData(gameData);
} finally {
gameData.releaseReadLock();
}
final JComponent newContentPane = new SetupFrame(clonedGameData);
// content panes must be opaque
newContentPane.setOpaque(true);
frame.setContentPane(newContentPane);
// Display the window.
frame.pack();
frame.setLocationRelativeTo(frame);
frame.setVisible(true);
uiContext.addShutdownWindow(frame);
}));
menuFileExport.setMnemonic(KeyEvent.VK_C);
add(menuFileExport);
}
Aggregations