Search in sources :

Example 21 with Tuple

use of games.strategy.util.Tuple in project triplea by triplea-game.

the class TabbedProductionPanel method initLayout.

@Override
protected void initLayout() {
    this.removeAll();
    this.setLayout(new GridBagLayout());
    add(new JLabel("Attack/Defense/Movement"), new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(8, 8, 8, 0), 0, 0));
    final JTabbedPane tabs = new JTabbedPane();
    add(tabs, new GridBagConstraints(0, 1, 1, 1, 100, 100, GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(8, 8, 8, 8), 0, 0));
    final ProductionTabsProperties properties = ProductionTabsProperties.getInstance(id, rules);
    final List<Tuple<String, List<Rule>>> ruleLists = getRuleLists(properties);
    calculateRowsAndColumns(properties, largestList(ruleLists));
    for (final Tuple<String, List<Rule>> ruleList : ruleLists) {
        if (ruleList.getSecond().size() > 0) {
            tabs.addTab(ruleList.getFirst(), new JScrollPane(getRulesPanel(ruleList.getSecond())));
        }
    }
    final JPanel totals = new JPanel();
    totals.add(left);
    totals.add(remainingResources);
    add(totals, new GridBagConstraints(0, 2, 1, 1, 1, 1, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(8, 8, 0, 12), 0, 0));
    done = new JButton(doneAction);
    add(done, new GridBagConstraints(0, 3, 2, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 8, 0), 0, 0));
    tabs.validate();
    this.validate();
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) JTabbedPane(javax.swing.JTabbedPane) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) ArrayList(java.util.ArrayList) List(java.util.List) ProductionRule(games.strategy.engine.data.ProductionRule) Tuple(games.strategy.util.Tuple)

Example 22 with Tuple

use of games.strategy.util.Tuple in project triplea by triplea-game.

the class TripleAFrame method selectTerritoryForAirToLand.

@Nullable
public Territory selectTerritoryForAirToLand(final Collection<Territory> candidates, final Territory currentTerritory, final String unitMessage) {
    if (candidates == null || candidates.isEmpty()) {
        return null;
    }
    if (candidates.size() == 1 || messageAndDialogThreadPool == null) {
        return candidates.iterator().next();
    }
    messageAndDialogThreadPool.waitForAll();
    final Supplier<Tuple<JPanel, JList<Territory>>> action = () -> {
        mapPanel.centerOn(currentTerritory);
        final JList<Territory> list = new JList<>(SwingComponents.newListModel(candidates));
        list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        list.setSelectedIndex(0);
        final JPanel panel = new JPanel();
        panel.setLayout(new BorderLayout());
        final JScrollPane scroll = new JScrollPane(list);
        final JTextArea text = new JTextArea(unitMessage, 8, 30);
        text.setLineWrap(true);
        text.setEditable(false);
        text.setWrapStyleWord(true);
        panel.add(text, BorderLayout.NORTH);
        panel.add(scroll, BorderLayout.CENTER);
        return Tuple.of(panel, list);
    };
    return Interruptibles.awaitResult(() -> SwingAction.invokeAndWaitResult(action)).result.map(comps -> {
        final JPanel panel = comps.getFirst();
        final JList<?> list = comps.getSecond();
        final String[] options = { "OK" };
        final String title = "Select territory for air units to land, current territory is " + currentTerritory.getName();
        EventThreadJOptionPane.showOptionDialog(this, panel, title, JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null, options, null, getUiContext().getCountDownLatchHandler());
        return (Territory) list.getSelectedValue();
    }).orElse(null);
}
Also used : JScrollPane(javax.swing.JScrollPane) Color(java.awt.Color) ClientGame(games.strategy.engine.framework.ClientGame) BaseEditDelegate(games.strategy.triplea.delegate.BaseEditDelegate) Arrays(java.util.Arrays) Enumeration(java.util.Enumeration) IGamePlayer(games.strategy.engine.gamePlayer.IGamePlayer) GameDataUtils(games.strategy.engine.framework.GameDataUtils) DefaultNamed(games.strategy.engine.data.DefaultNamed) Constants(games.strategy.triplea.Constants) LocalPlayers(games.strategy.engine.framework.LocalPlayers) HistorySynchronizer(games.strategy.engine.framework.HistorySynchronizer) UserActionAttachment(games.strategy.triplea.attachments.UserActionAttachment) TerritoryAttachment(games.strategy.triplea.attachments.TerritoryAttachment) Map(java.util.Map) ButtonModel(javax.swing.ButtonModel) IntegerMap(games.strategy.util.IntegerMap) Renderable(games.strategy.engine.history.Renderable) Frame(java.awt.Frame) FightBattleDetails(games.strategy.triplea.delegate.dataObjects.FightBattleDetails) IPlayerBridge(games.strategy.engine.gamePlayer.IPlayerBridge) Set(java.util.Set) ProAi(games.strategy.triplea.ai.pro.ProAi) HistoryLog(games.strategy.triplea.ui.history.HistoryLog) KeyEvent(java.awt.event.KeyEvent) WindowAdapter(java.awt.event.WindowAdapter) Component(java.awt.Component) DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) HistoryPanel(games.strategy.triplea.ui.history.HistoryPanel) CountDownLatch(java.util.concurrent.CountDownLatch) GameData(games.strategy.engine.data.GameData) MoveDescription(games.strategy.triplea.delegate.dataObjects.MoveDescription) HelpMenu(games.strategy.triplea.ui.menubar.HelpMenu) Tuple(games.strategy.util.Tuple) ResourceCollection(games.strategy.engine.data.ResourceCollection) AbstractConditionsAttachment(games.strategy.triplea.attachments.AbstractConditionsAttachment) AbstractAction(javax.swing.AbstractAction) AbstractTriggerAttachment(games.strategy.triplea.attachments.AbstractTriggerAttachment) Matches(games.strategy.triplea.delegate.Matches) EventThreadJOptionPane(games.strategy.util.EventThreadJOptionPane) EmptyBorder(javax.swing.border.EmptyBorder) LocalizeHtml(games.strategy.util.LocalizeHtml) GridBagLayout(java.awt.GridBagLayout) ServerGame(games.strategy.engine.framework.ServerGame) JPanel(javax.swing.JPanel) WindowConstants(javax.swing.WindowConstants) ListSelectionModel(javax.swing.ListSelectionModel) KeyListener(java.awt.event.KeyListener) TileImageFactory(games.strategy.triplea.image.TileImageFactory) JSplitPane(javax.swing.JSplitPane) GameStepPropertiesHelper(games.strategy.triplea.delegate.GameStepPropertiesHelper) SwingComponents(games.strategy.ui.SwingComponents) TextAttribute(java.awt.font.TextAttribute) IUserActionDelegate(games.strategy.triplea.delegate.remote.IUserActionDelegate) Action(javax.swing.Action) KeyAdapter(java.awt.event.KeyAdapter) Supplier(java.util.function.Supplier) Resource(games.strategy.engine.data.Resource) ArrayList(java.util.ArrayList) BattleType(games.strategy.triplea.delegate.IBattle.BattleType) UnitsDrawer(games.strategy.triplea.ui.screen.UnitsDrawer) JTabbedPane(javax.swing.JTabbedPane) ImageIcon(javax.swing.ImageIcon) JToolTip(javax.swing.JToolTip) GameDataChangeListener(games.strategy.engine.data.events.GameDataChangeListener) Nullable(javax.annotation.Nullable) FlowLayout(java.awt.FlowLayout) JButton(javax.swing.JButton) Unit(games.strategy.engine.data.Unit) TerritoryEffectHelper(games.strategy.triplea.delegate.TerritoryEffectHelper) FileOutputStream(java.io.FileOutputStream) Territory(games.strategy.engine.data.Territory) IOException(java.io.IOException) PoliticalActionAttachment(games.strategy.triplea.attachments.PoliticalActionAttachment) File(java.io.File) JScrollPane(javax.swing.JScrollPane) ClientLogger(games.strategy.debug.ClientLogger) Change(games.strategy.engine.data.Change) BattleDelegate(games.strategy.triplea.delegate.BattleDelegate) ChatPanel(games.strategy.engine.chat.ChatPanel) JTextArea(javax.swing.JTextArea) MouseInfo(java.awt.MouseInfo) EtchedBorder(javax.swing.border.EtchedBorder) JDialog(javax.swing.JDialog) PopupFactory(javax.swing.PopupFactory) JToggleButton(javax.swing.JToggleButton) HistoryNode(games.strategy.engine.history.HistoryNode) UnitAttachment(games.strategy.triplea.attachments.UnitAttachment) Point(java.awt.Point) Properties(games.strategy.triplea.Properties) TripleAMenuBar(games.strategy.triplea.ui.menubar.TripleAMenuBar) PlayerChatRenderer(games.strategy.engine.chat.PlayerChatRenderer) InGameLobbyWatcherWrapper(games.strategy.engine.framework.startup.ui.InGameLobbyWatcherWrapper) WindowListener(java.awt.event.WindowListener) IEditDelegate(games.strategy.triplea.delegate.remote.IEditDelegate) BorderLayout(java.awt.BorderLayout) Round(games.strategy.engine.history.Round) Image(java.awt.Image) Font(java.awt.Font) Collection(java.util.Collection) BorderFactory(javax.swing.BorderFactory) AbstractEndTurnDelegate(games.strategy.triplea.delegate.AbstractEndTurnDelegate) GridBagConstraints(java.awt.GridBagConstraints) GameRunner(games.strategy.engine.framework.GameRunner) Collectors(java.util.stream.Collectors) WindowEvent(java.awt.event.WindowEvent) Dimension(java.awt.Dimension) List(java.util.List) PlayerID(games.strategy.engine.data.PlayerID) MyFormatter(games.strategy.triplea.formatter.MyFormatter) Graphics(java.awt.Graphics) Entry(java.util.Map.Entry) Optional(java.util.Optional) HistoryDetailsPanel(games.strategy.triplea.ui.history.HistoryDetailsPanel) TerritoryEffect(games.strategy.engine.data.TerritoryEffect) Toolkit(java.awt.Toolkit) SwingAction(games.strategy.ui.SwingAction) SystemProperties(games.strategy.engine.framework.system.SystemProperties) Insets(java.awt.Insets) TreeNode(javax.swing.tree.TreeNode) Popup(javax.swing.Popup) HashMap(java.util.HashMap) AtomicReference(java.util.concurrent.atomic.AtomicReference) SwingConstants(javax.swing.SwingConstants) TuvUtils(games.strategy.triplea.util.TuvUtils) HashSet(java.util.HashSet) Route(games.strategy.engine.data.Route) AirThatCantLandUtil(games.strategy.triplea.delegate.AirThatCantLandUtil) FocusAdapter(java.awt.event.FocusAdapter) SwingUtilities(javax.swing.SwingUtilities) ImmutableList(com.google.common.collect.ImmutableList) ImageScrollModel(games.strategy.ui.ImageScrollModel) TechRoll(games.strategy.triplea.delegate.dataObjects.TechRoll) IPoliticsDelegate(games.strategy.triplea.delegate.remote.IPoliticsDelegate) GameDataManager(games.strategy.engine.framework.GameDataManager) TripleAUnit(games.strategy.triplea.TripleAUnit) TechResults(games.strategy.triplea.delegate.dataObjects.TechResults) ClientSetting(games.strategy.triplea.settings.ClientSetting) RepairRule(games.strategy.engine.data.RepairRule) ClipPlayer(games.strategy.sound.ClipPlayer) BoxLayout(javax.swing.BoxLayout) CollectionUtils(games.strategy.util.CollectionUtils) JComponent(javax.swing.JComponent) Interruptibles(games.strategy.util.Interruptibles) JPopupMenu(javax.swing.JPopupMenu) UnitBattleComparator(games.strategy.triplea.delegate.UnitBattleComparator) JList(javax.swing.JList) GameStepListener(games.strategy.engine.data.events.GameStepListener) JOptionPane(javax.swing.JOptionPane) TripleAPlayer(games.strategy.triplea.TripleAPlayer) ScreenshotExporter(games.strategy.triplea.ui.export.ScreenshotExporter) ActionEvent(java.awt.event.ActionEvent) ListCellRenderer(javax.swing.ListCellRenderer) ChangeFactory(games.strategy.engine.data.changefactory.ChangeFactory) ThreadPool(games.strategy.thread.ThreadPool) FocusEvent(java.awt.event.FocusEvent) JLabel(javax.swing.JLabel) Step(games.strategy.engine.history.Step) IGame(games.strategy.engine.framework.IGame) ProductionRule(games.strategy.engine.data.ProductionRule) Collections(java.util.Collections) SoundPath(games.strategy.sound.SoundPath) JPanel(javax.swing.JPanel) Territory(games.strategy.engine.data.Territory) JTextArea(javax.swing.JTextArea) BorderLayout(java.awt.BorderLayout) Tuple(games.strategy.util.Tuple) JList(javax.swing.JList) Nullable(javax.annotation.Nullable)

Example 23 with Tuple

use of games.strategy.util.Tuple in project triplea by triplea-game.

the class TripleAFrame method scrambleUnitsQuery.

public HashMap<Territory, Collection<Unit>> scrambleUnitsQuery(final Territory scrambleTo, final Map<Territory, Tuple<Collection<Unit>, Collection<Unit>>> possibleScramblers) {
    if (messageAndDialogThreadPool == null) {
        return null;
    }
    messageAndDialogThreadPool.waitForAll();
    if (SwingUtilities.isEventDispatchThread()) {
        throw new IllegalStateException("Should not be called from dispatch thread");
    }
    final CountDownLatch continueLatch = new CountDownLatch(1);
    final HashMap<Territory, Collection<Unit>> selection = new HashMap<>();
    final Collection<Tuple<Territory, UnitChooser>> choosers = new ArrayList<>();
    SwingUtilities.invokeLater(() -> {
        mapPanel.centerOn(scrambleTo);
        final JDialog dialog = new JDialog(this, "Select units to scramble to " + scrambleTo.getName());
        final JPanel panel = new JPanel();
        panel.setLayout(new BorderLayout());
        final String optionScramble = "Scramble";
        final String optionNone = "None";
        final JButton scrambleButton = new JButton(optionScramble);
        scrambleButton.addActionListener(e -> getOptionPane((JComponent) e.getSource()).setValue(scrambleButton));
        final JButton noneButton = new JButton(optionNone);
        noneButton.addActionListener(e -> getOptionPane((JComponent) e.getSource()).setValue(noneButton));
        final Object[] options = { scrambleButton, noneButton };
        final JOptionPane optionPane = new JOptionPane(panel, JOptionPane.PLAIN_MESSAGE, JOptionPane.YES_NO_CANCEL_OPTION, null, options, options[1]);
        final JLabel whereTo = new JLabel("Scramble To: " + scrambleTo.getName());
        whereTo.setFont(new Font("Arial", Font.ITALIC, 12));
        panel.add(whereTo, BorderLayout.NORTH);
        final JPanel panel2 = new JPanel();
        panel2.setBorder(BorderFactory.createEmptyBorder());
        panel2.setLayout(new FlowLayout());
        final JPanel fuelCostPanel = new JPanel(new GridBagLayout());
        panel.add(fuelCostPanel, BorderLayout.SOUTH);
        for (final Territory from : possibleScramblers.keySet()) {
            final JPanel panelChooser = new JPanel();
            panelChooser.setLayout(new BoxLayout(panelChooser, BoxLayout.Y_AXIS));
            panelChooser.setBorder(BorderFactory.createLineBorder(getBackground()));
            final JLabel whereFrom = new JLabel("From: " + from.getName());
            whereFrom.setHorizontalAlignment(SwingConstants.LEFT);
            whereFrom.setFont(new Font("Arial", Font.BOLD, 12));
            panelChooser.add(whereFrom);
            panelChooser.add(new JLabel(" "));
            final Collection<Unit> possible = possibleScramblers.get(from).getSecond();
            final int maxAllowed = Math.min(BattleDelegate.getMaxScrambleCount(possibleScramblers.get(from).getFirst()), possible.size());
            final UnitChooser chooser = new UnitChooser(possible, Collections.emptyMap(), false, uiContext);
            chooser.setMaxAndShowMaxButton(maxAllowed);
            chooser.addChangeListener(field -> {
                final Collection<Unit> units = new HashSet<>();
                final Map<PlayerID, ResourceCollection> playerFuelCost = new HashMap<>();
                for (final Tuple<Territory, UnitChooser> tuple : choosers) {
                    units.addAll(tuple.getSecond().getSelected(false));
                    final Map<PlayerID, ResourceCollection> map = Route.getScrambleFuelCostCharge(tuple.getSecond().getSelected(false), tuple.getFirst(), scrambleTo, data);
                    for (final Entry<PlayerID, ResourceCollection> playerAndCost : map.entrySet()) {
                        if (playerFuelCost.containsKey(playerAndCost.getKey())) {
                            playerFuelCost.get(playerAndCost.getKey()).add(playerAndCost.getValue());
                        } else {
                            playerFuelCost.put(playerAndCost.getKey(), playerAndCost.getValue());
                        }
                    }
                }
                fuelCostPanel.removeAll();
                boolean hasEnoughFuel = true;
                int count = 0;
                for (final Entry<PlayerID, ResourceCollection> entry : playerFuelCost.entrySet()) {
                    final JLabel label = new JLabel(entry.getKey().getName() + ": ");
                    fuelCostPanel.add(label, new GridBagConstraints(0, count, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
                    fuelCostPanel.add(uiContext.getResourceImageFactory().getResourcesPanel(entry.getValue(), data), new GridBagConstraints(1, count++, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
                    if (!entry.getKey().getResources().has(entry.getValue().getResourcesCopy())) {
                        hasEnoughFuel = false;
                        label.setForeground(Color.RED);
                    }
                }
                scrambleButton.setEnabled(hasEnoughFuel);
                dialog.pack();
            });
            choosers.add(Tuple.of(from, chooser));
            panelChooser.add(chooser);
            final JScrollPane chooserScrollPane = new JScrollPane(panelChooser);
            panel2.add(chooserScrollPane);
        }
        panel.add(panel2, BorderLayout.CENTER);
        dialog.setContentPane(optionPane);
        dialog.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
        dialog.setLocationRelativeTo(getParent());
        dialog.setAlwaysOnTop(true);
        dialog.pack();
        dialog.setVisible(true);
        dialog.requestFocusInWindow();
        optionPane.addPropertyChangeListener(e -> {
            if (!dialog.isVisible()) {
                return;
            }
            final String option = ((JButton) optionPane.getValue()).getText();
            if (option.equals(optionNone)) {
                choosers.clear();
                selection.clear();
                dialog.setVisible(false);
                dialog.removeAll();
                dialog.dispose();
                continueLatch.countDown();
            } else if (option.equals(optionScramble)) {
                for (final Tuple<Territory, UnitChooser> terrChooser : choosers) {
                    selection.put(terrChooser.getFirst(), terrChooser.getSecond().getSelected());
                }
                dialog.setVisible(false);
                dialog.removeAll();
                dialog.dispose();
                continueLatch.countDown();
            }
        });
    });
    mapPanel.getUiContext().addShutdownLatch(continueLatch);
    Interruptibles.await(continueLatch);
    mapPanel.getUiContext().removeShutdownLatch(continueLatch);
    return selection;
}
Also used : JPanel(javax.swing.JPanel) PlayerID(games.strategy.engine.data.PlayerID) GridBagConstraints(java.awt.GridBagConstraints) FlowLayout(java.awt.FlowLayout) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) HashMap(java.util.HashMap) BoxLayout(javax.swing.BoxLayout) ArrayList(java.util.ArrayList) JButton(javax.swing.JButton) Unit(games.strategy.engine.data.Unit) TripleAUnit(games.strategy.triplea.TripleAUnit) Font(java.awt.Font) BorderLayout(java.awt.BorderLayout) HashSet(java.util.HashSet) JScrollPane(javax.swing.JScrollPane) Territory(games.strategy.engine.data.Territory) JLabel(javax.swing.JLabel) CountDownLatch(java.util.concurrent.CountDownLatch) EventThreadJOptionPane(games.strategy.util.EventThreadJOptionPane) JOptionPane(javax.swing.JOptionPane) Point(java.awt.Point) ResourceCollection(games.strategy.engine.data.ResourceCollection) Collection(java.util.Collection) Tuple(games.strategy.util.Tuple) JDialog(javax.swing.JDialog) ResourceCollection(games.strategy.engine.data.ResourceCollection)

Example 24 with Tuple

use of games.strategy.util.Tuple in project triplea by triplea-game.

the class TripleAFrame method getStrategicBombingRaidTarget.

@Nullable
public Unit getStrategicBombingRaidTarget(final Territory territory, final Collection<Unit> potentialTargets, final Collection<Unit> bombers) {
    if (potentialTargets.size() == 1 || messageAndDialogThreadPool == null) {
        return potentialTargets.iterator().next();
    }
    messageAndDialogThreadPool.waitForAll();
    final AtomicReference<Unit> selected = new AtomicReference<>();
    final String message = "Select bombing target in " + territory.getName();
    final Supplier<Tuple<JPanel, JList<Unit>>> action = () -> {
        final JList<Unit> list = new JList<>(SwingComponents.newListModel(potentialTargets));
        list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        list.setSelectedIndex(0);
        list.setCellRenderer(new UnitRenderer());
        final JPanel panel = new JPanel();
        panel.setLayout(new BorderLayout());
        if (bombers != null) {
            panel.add(new JLabel("For Units: " + MyFormatter.unitsToTextNoOwner(bombers)), BorderLayout.NORTH);
        }
        final JScrollPane scroll = new JScrollPane(list);
        panel.add(scroll, BorderLayout.CENTER);
        return Tuple.of(panel, list);
    };
    return Interruptibles.awaitResult(() -> SwingAction.invokeAndWaitResult(action)).result.map(comps -> {
        final JPanel panel = comps.getFirst();
        final JList<?> list = comps.getSecond();
        final String[] options = { "OK" };
        final int selection = EventThreadJOptionPane.showOptionDialog(this, panel, message, JOptionPane.OK_OPTION, JOptionPane.PLAIN_MESSAGE, null, options, null, getUiContext().getCountDownLatchHandler());
        if (selection == 0) {
            selected.set((Unit) list.getSelectedValue());
        }
        return selected.get();
    }).orElse(null);
}
Also used : JScrollPane(javax.swing.JScrollPane) Color(java.awt.Color) ClientGame(games.strategy.engine.framework.ClientGame) BaseEditDelegate(games.strategy.triplea.delegate.BaseEditDelegate) Arrays(java.util.Arrays) Enumeration(java.util.Enumeration) IGamePlayer(games.strategy.engine.gamePlayer.IGamePlayer) GameDataUtils(games.strategy.engine.framework.GameDataUtils) DefaultNamed(games.strategy.engine.data.DefaultNamed) Constants(games.strategy.triplea.Constants) LocalPlayers(games.strategy.engine.framework.LocalPlayers) HistorySynchronizer(games.strategy.engine.framework.HistorySynchronizer) UserActionAttachment(games.strategy.triplea.attachments.UserActionAttachment) TerritoryAttachment(games.strategy.triplea.attachments.TerritoryAttachment) Map(java.util.Map) ButtonModel(javax.swing.ButtonModel) IntegerMap(games.strategy.util.IntegerMap) Renderable(games.strategy.engine.history.Renderable) Frame(java.awt.Frame) FightBattleDetails(games.strategy.triplea.delegate.dataObjects.FightBattleDetails) IPlayerBridge(games.strategy.engine.gamePlayer.IPlayerBridge) Set(java.util.Set) ProAi(games.strategy.triplea.ai.pro.ProAi) HistoryLog(games.strategy.triplea.ui.history.HistoryLog) KeyEvent(java.awt.event.KeyEvent) WindowAdapter(java.awt.event.WindowAdapter) Component(java.awt.Component) DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) HistoryPanel(games.strategy.triplea.ui.history.HistoryPanel) CountDownLatch(java.util.concurrent.CountDownLatch) GameData(games.strategy.engine.data.GameData) MoveDescription(games.strategy.triplea.delegate.dataObjects.MoveDescription) HelpMenu(games.strategy.triplea.ui.menubar.HelpMenu) Tuple(games.strategy.util.Tuple) ResourceCollection(games.strategy.engine.data.ResourceCollection) AbstractConditionsAttachment(games.strategy.triplea.attachments.AbstractConditionsAttachment) AbstractAction(javax.swing.AbstractAction) AbstractTriggerAttachment(games.strategy.triplea.attachments.AbstractTriggerAttachment) Matches(games.strategy.triplea.delegate.Matches) EventThreadJOptionPane(games.strategy.util.EventThreadJOptionPane) EmptyBorder(javax.swing.border.EmptyBorder) LocalizeHtml(games.strategy.util.LocalizeHtml) GridBagLayout(java.awt.GridBagLayout) ServerGame(games.strategy.engine.framework.ServerGame) JPanel(javax.swing.JPanel) WindowConstants(javax.swing.WindowConstants) ListSelectionModel(javax.swing.ListSelectionModel) KeyListener(java.awt.event.KeyListener) TileImageFactory(games.strategy.triplea.image.TileImageFactory) JSplitPane(javax.swing.JSplitPane) GameStepPropertiesHelper(games.strategy.triplea.delegate.GameStepPropertiesHelper) SwingComponents(games.strategy.ui.SwingComponents) TextAttribute(java.awt.font.TextAttribute) IUserActionDelegate(games.strategy.triplea.delegate.remote.IUserActionDelegate) Action(javax.swing.Action) KeyAdapter(java.awt.event.KeyAdapter) Supplier(java.util.function.Supplier) Resource(games.strategy.engine.data.Resource) ArrayList(java.util.ArrayList) BattleType(games.strategy.triplea.delegate.IBattle.BattleType) UnitsDrawer(games.strategy.triplea.ui.screen.UnitsDrawer) JTabbedPane(javax.swing.JTabbedPane) ImageIcon(javax.swing.ImageIcon) JToolTip(javax.swing.JToolTip) GameDataChangeListener(games.strategy.engine.data.events.GameDataChangeListener) Nullable(javax.annotation.Nullable) FlowLayout(java.awt.FlowLayout) JButton(javax.swing.JButton) Unit(games.strategy.engine.data.Unit) TerritoryEffectHelper(games.strategy.triplea.delegate.TerritoryEffectHelper) FileOutputStream(java.io.FileOutputStream) Territory(games.strategy.engine.data.Territory) IOException(java.io.IOException) PoliticalActionAttachment(games.strategy.triplea.attachments.PoliticalActionAttachment) File(java.io.File) JScrollPane(javax.swing.JScrollPane) ClientLogger(games.strategy.debug.ClientLogger) Change(games.strategy.engine.data.Change) BattleDelegate(games.strategy.triplea.delegate.BattleDelegate) ChatPanel(games.strategy.engine.chat.ChatPanel) JTextArea(javax.swing.JTextArea) MouseInfo(java.awt.MouseInfo) EtchedBorder(javax.swing.border.EtchedBorder) JDialog(javax.swing.JDialog) PopupFactory(javax.swing.PopupFactory) JToggleButton(javax.swing.JToggleButton) HistoryNode(games.strategy.engine.history.HistoryNode) UnitAttachment(games.strategy.triplea.attachments.UnitAttachment) Point(java.awt.Point) Properties(games.strategy.triplea.Properties) TripleAMenuBar(games.strategy.triplea.ui.menubar.TripleAMenuBar) PlayerChatRenderer(games.strategy.engine.chat.PlayerChatRenderer) InGameLobbyWatcherWrapper(games.strategy.engine.framework.startup.ui.InGameLobbyWatcherWrapper) WindowListener(java.awt.event.WindowListener) IEditDelegate(games.strategy.triplea.delegate.remote.IEditDelegate) BorderLayout(java.awt.BorderLayout) Round(games.strategy.engine.history.Round) Image(java.awt.Image) Font(java.awt.Font) Collection(java.util.Collection) BorderFactory(javax.swing.BorderFactory) AbstractEndTurnDelegate(games.strategy.triplea.delegate.AbstractEndTurnDelegate) GridBagConstraints(java.awt.GridBagConstraints) GameRunner(games.strategy.engine.framework.GameRunner) Collectors(java.util.stream.Collectors) WindowEvent(java.awt.event.WindowEvent) Dimension(java.awt.Dimension) List(java.util.List) PlayerID(games.strategy.engine.data.PlayerID) MyFormatter(games.strategy.triplea.formatter.MyFormatter) Graphics(java.awt.Graphics) Entry(java.util.Map.Entry) Optional(java.util.Optional) HistoryDetailsPanel(games.strategy.triplea.ui.history.HistoryDetailsPanel) TerritoryEffect(games.strategy.engine.data.TerritoryEffect) Toolkit(java.awt.Toolkit) SwingAction(games.strategy.ui.SwingAction) SystemProperties(games.strategy.engine.framework.system.SystemProperties) Insets(java.awt.Insets) TreeNode(javax.swing.tree.TreeNode) Popup(javax.swing.Popup) HashMap(java.util.HashMap) AtomicReference(java.util.concurrent.atomic.AtomicReference) SwingConstants(javax.swing.SwingConstants) TuvUtils(games.strategy.triplea.util.TuvUtils) HashSet(java.util.HashSet) Route(games.strategy.engine.data.Route) AirThatCantLandUtil(games.strategy.triplea.delegate.AirThatCantLandUtil) FocusAdapter(java.awt.event.FocusAdapter) SwingUtilities(javax.swing.SwingUtilities) ImmutableList(com.google.common.collect.ImmutableList) ImageScrollModel(games.strategy.ui.ImageScrollModel) TechRoll(games.strategy.triplea.delegate.dataObjects.TechRoll) IPoliticsDelegate(games.strategy.triplea.delegate.remote.IPoliticsDelegate) GameDataManager(games.strategy.engine.framework.GameDataManager) TripleAUnit(games.strategy.triplea.TripleAUnit) TechResults(games.strategy.triplea.delegate.dataObjects.TechResults) ClientSetting(games.strategy.triplea.settings.ClientSetting) RepairRule(games.strategy.engine.data.RepairRule) ClipPlayer(games.strategy.sound.ClipPlayer) BoxLayout(javax.swing.BoxLayout) CollectionUtils(games.strategy.util.CollectionUtils) JComponent(javax.swing.JComponent) Interruptibles(games.strategy.util.Interruptibles) JPopupMenu(javax.swing.JPopupMenu) UnitBattleComparator(games.strategy.triplea.delegate.UnitBattleComparator) JList(javax.swing.JList) GameStepListener(games.strategy.engine.data.events.GameStepListener) JOptionPane(javax.swing.JOptionPane) TripleAPlayer(games.strategy.triplea.TripleAPlayer) ScreenshotExporter(games.strategy.triplea.ui.export.ScreenshotExporter) ActionEvent(java.awt.event.ActionEvent) ListCellRenderer(javax.swing.ListCellRenderer) ChangeFactory(games.strategy.engine.data.changefactory.ChangeFactory) ThreadPool(games.strategy.thread.ThreadPool) FocusEvent(java.awt.event.FocusEvent) JLabel(javax.swing.JLabel) Step(games.strategy.engine.history.Step) IGame(games.strategy.engine.framework.IGame) ProductionRule(games.strategy.engine.data.ProductionRule) Collections(java.util.Collections) SoundPath(games.strategy.sound.SoundPath) JPanel(javax.swing.JPanel) JLabel(javax.swing.JLabel) AtomicReference(java.util.concurrent.atomic.AtomicReference) Unit(games.strategy.engine.data.Unit) TripleAUnit(games.strategy.triplea.TripleAUnit) BorderLayout(java.awt.BorderLayout) Tuple(games.strategy.util.Tuple) JList(javax.swing.JList) Nullable(javax.annotation.Nullable)

Aggregations

Tuple (games.strategy.util.Tuple)24 ArrayList (java.util.ArrayList)20 Unit (games.strategy.engine.data.Unit)18 Territory (games.strategy.engine.data.Territory)11 HashSet (java.util.HashSet)11 UnitType (games.strategy.engine.data.UnitType)10 IntegerMap (games.strategy.util.IntegerMap)10 HashMap (java.util.HashMap)9 GameData (games.strategy.engine.data.GameData)8 PlayerID (games.strategy.engine.data.PlayerID)8 TripleAUnit (games.strategy.triplea.TripleAUnit)8 UnitAttachment (games.strategy.triplea.attachments.UnitAttachment)7 Collection (java.util.Collection)7 List (java.util.List)7 Set (java.util.Set)7 CompositeChange (games.strategy.engine.data.CompositeChange)6 Change (games.strategy.engine.data.Change)5 ProductionRule (games.strategy.engine.data.ProductionRule)4 ResourceCollection (games.strategy.engine.data.ResourceCollection)4 GridBagConstraints (java.awt.GridBagConstraints)4