Search in sources :

Example 1 with SetupFrame

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);
}
Also used : ExtendedStats(games.strategy.triplea.ui.ExtendedStats) Arrays(java.util.Arrays) Enumeration(java.util.Enumeration) GameDataUtils(games.strategy.engine.framework.GameDataUtils) HistoryNode(games.strategy.engine.history.HistoryNode) UnitAttachment(games.strategy.triplea.attachments.UnitAttachment) TripleAFrame(games.strategy.triplea.ui.TripleAFrame) GameDataExporter(games.strategy.engine.data.export.GameDataExporter) JFileChooser(javax.swing.JFileChooser) JFrame(javax.swing.JFrame) Round(games.strategy.engine.history.Round) ClientContext(games.strategy.engine.ClientContext) Collection(java.util.Collection) Set(java.util.Set) JMenu(javax.swing.JMenu) PlayerOrderComparator(games.strategy.triplea.util.PlayerOrderComparator) KeyEvent(java.awt.event.KeyEvent) StandardCharsets(java.nio.charset.StandardCharsets) DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) HistoryPanel(games.strategy.triplea.ui.history.HistoryPanel) GameData(games.strategy.engine.data.GameData) List(java.util.List) PlayerID(games.strategy.engine.data.PlayerID) Writer(java.io.Writer) LocalizeHtml(games.strategy.util.LocalizeHtml) WindowConstants(javax.swing.WindowConstants) SwingAction(games.strategy.ui.SwingAction) SystemProperties(games.strategy.engine.framework.system.SystemProperties) SetupFrame(games.strategy.triplea.printgenerator.SetupFrame) TreeNode(javax.swing.tree.TreeNode) LocalDateTime(java.time.LocalDateTime) Action(javax.swing.Action) Resource(games.strategy.engine.data.Resource) ArrayList(java.util.ArrayList) JMenuItem(javax.swing.JMenuItem) UiContext(games.strategy.triplea.ui.UiContext) UnitType(games.strategy.engine.data.UnitType) LinkedHashSet(java.util.LinkedHashSet) JComponent(javax.swing.JComponent) Files(java.nio.file.Files) IOException(java.io.IOException) IStat(games.strategy.engine.stats.IStat) JOptionPane(javax.swing.JOptionPane) ScreenshotExporter(games.strategy.triplea.ui.export.ScreenshotExporter) File(java.io.File) ClientLogger(games.strategy.debug.ClientLogger) FileNameUtils(games.strategy.util.FileNameUtils) Step(games.strategy.engine.history.Step) DateTimeFormatter(java.time.format.DateTimeFormatter) EndRoundDelegate(games.strategy.triplea.delegate.EndRoundDelegate) ProductionRule(games.strategy.engine.data.ProductionRule) GameData(games.strategy.engine.data.GameData) JFrame(javax.swing.JFrame) JComponent(javax.swing.JComponent) JMenuItem(javax.swing.JMenuItem) SetupFrame(games.strategy.triplea.printgenerator.SetupFrame)

Aggregations

ClientLogger (games.strategy.debug.ClientLogger)1 ClientContext (games.strategy.engine.ClientContext)1 GameData (games.strategy.engine.data.GameData)1 PlayerID (games.strategy.engine.data.PlayerID)1 ProductionRule (games.strategy.engine.data.ProductionRule)1 Resource (games.strategy.engine.data.Resource)1 UnitType (games.strategy.engine.data.UnitType)1 GameDataExporter (games.strategy.engine.data.export.GameDataExporter)1 GameDataUtils (games.strategy.engine.framework.GameDataUtils)1 SystemProperties (games.strategy.engine.framework.system.SystemProperties)1 HistoryNode (games.strategy.engine.history.HistoryNode)1 Round (games.strategy.engine.history.Round)1 Step (games.strategy.engine.history.Step)1 IStat (games.strategy.engine.stats.IStat)1 UnitAttachment (games.strategy.triplea.attachments.UnitAttachment)1 EndRoundDelegate (games.strategy.triplea.delegate.EndRoundDelegate)1 SetupFrame (games.strategy.triplea.printgenerator.SetupFrame)1 ExtendedStats (games.strategy.triplea.ui.ExtendedStats)1 TripleAFrame (games.strategy.triplea.ui.TripleAFrame)1 UiContext (games.strategy.triplea.ui.UiContext)1