use of mage.client.cards.BigCard in project mage by magefree.
the class MagePaneMenuItem method addTooltipContainer.
private void addTooltipContainer() {
JEditorPane cardInfoPane = (JEditorPane) Plugins.instance.getCardInfoPane();
if (cardInfoPane == null) {
LOGGER.fatal("Can't find card tooltip plugin");
return;
}
cardInfoPane.setLocation(40, 40);
cardInfoPane.setBackground(new Color(0, 0, 0, 0));
UI.addComponent(MageComponents.CARD_INFO_PANE, cardInfoPane);
MageRoundPane popupContainer = new MageRoundPane();
popupContainer.setLayout(null);
popupContainer.add(cardInfoPane);
popupContainer.setVisible(false);
desktopPane.add(popupContainer, JLayeredPane.POPUP_LAYER);
UI.addComponent(MageComponents.POPUP_CONTAINER, popupContainer);
JPanel cardPreviewContainer = new JPanel();
cardPreviewContainer.setOpaque(false);
cardPreviewContainer.setLayout(null);
cardPreviewContainer.setVisible(false);
desktopPane.add(cardPreviewContainer, JLayeredPane.POPUP_LAYER);
UI.addComponent(MageComponents.CARD_PREVIEW_CONTAINER, cardPreviewContainer);
BigCard bigCard = new BigCard();
bigCard.setLocation(40, 40);
bigCard.setBackground(new Color(0, 0, 0, 0));
cardPreviewContainer.add(bigCard);
UI.addComponent(MageComponents.CARD_PREVIEW_PANE, bigCard);
JPanel cardPreviewContainerRotated = new JPanel();
cardPreviewContainerRotated.setOpaque(false);
cardPreviewContainerRotated.setLayout(null);
cardPreviewContainerRotated.setVisible(false);
desktopPane.add(cardPreviewContainerRotated, JLayeredPane.POPUP_LAYER);
UI.addComponent(MageComponents.CARD_PREVIEW_CONTAINER_ROTATED, cardPreviewContainerRotated);
BigCard bigCardRotated = new BigCard(true);
bigCardRotated.setLocation(40, 40);
bigCardRotated.setBackground(new Color(0, 0, 0, 0));
cardPreviewContainerRotated.add(bigCardRotated);
UI.addComponent(MageComponents.CARD_PREVIEW_PANE_ROTATED, bigCardRotated);
updateTooltipContainerSizes();
}
use of mage.client.cards.BigCard in project mage by magefree.
the class ReplayTask method initComponents.
@SuppressWarnings("unchecked")
private void initComponents() {
abilityPicker = new mage.client.components.ability.AbilityPicker();
jSplitPane1 = new javax.swing.JSplitPane();
jSplitPane0 = new javax.swing.JSplitPane();
jPanel2 = new javax.swing.JPanel();
pnlHelperHandButtonsStackArea = new javax.swing.JPanel();
pnlShortCuts = new javax.swing.JPanel();
lblPhase = new javax.swing.JLabel();
txtPhase = new javax.swing.JLabel();
lblStep = new javax.swing.JLabel();
txtStep = new javax.swing.JLabel();
lblTurn = new javax.swing.JLabel();
txtTurn = new javax.swing.JLabel();
txtActivePlayer = new javax.swing.JLabel();
lblActivePlayer = new javax.swing.JLabel();
txtPriority = new javax.swing.JLabel();
lblPriority = new javax.swing.JLabel();
feedbackPanel = new mage.client.game.FeedbackPanel();
txtSpellsCast = new javax.swing.JLabel();
Border paddingBorder = BorderFactory.createEmptyBorder(4, 4, 4, 4);
Border border = BorderFactory.createLineBorder(Color.DARK_GRAY, 2);
txtSpellsCast.setBorder(BorderFactory.createCompoundBorder(border, paddingBorder));
txtSpellsCast.setBackground(Color.LIGHT_GRAY);
txtSpellsCast.setOpaque(true);
txtSpellsCast.setToolTipText("spells cast during the current turn");
txtHoldPriority = new javax.swing.JLabel();
txtHoldPriority.setText("Hold");
txtHoldPriority.setBorder(BorderFactory.createCompoundBorder(border, paddingBorder));
txtHoldPriority.setBackground(Color.LIGHT_GRAY);
txtHoldPriority.setOpaque(true);
txtHoldPriority.setToolTipText("Holding priority after the next spell cast or ability activation");
txtHoldPriority.setVisible(false);
boolean displayButtonText = PreferencesDialog.getCurrentTheme().isShortcutsVisibleForSkipButtons();
btnToggleMacro = new KeyboundButton(KEY_CONTROL_TOGGLE_MACRO, displayButtonText);
// F3
btnCancelSkip = new KeyboundButton(KEY_CONTROL_CANCEL_SKIP, displayButtonText);
// F4
btnSkipToNextTurn = new KeyboundButton(KEY_CONTROL_NEXT_TURN, displayButtonText);
// F5
btnSkipToEndTurn = new KeyboundButton(KEY_CONTROL_END_STEP, displayButtonText);
// F7
btnSkipToNextMain = new KeyboundButton(KEY_CONTROL_MAIN_STEP, displayButtonText);
// F10
btnSkipStack = new KeyboundButton(KEY_CONTROL_SKIP_STACK, displayButtonText);
// F9
btnSkipToYourTurn = new KeyboundButton(KEY_CONTROL_YOUR_TURN, displayButtonText);
// F11
btnSkipToEndStepBeforeYourTurn = new KeyboundButton(KEY_CONTROL_PRIOR_END, displayButtonText);
btnConcede = new javax.swing.JButton();
btnSwitchHands = new javax.swing.JButton();
btnStopWatching = new javax.swing.JButton();
bigCard = new mage.client.cards.BigCard();
pnlReplay = new javax.swing.JPanel();
btnStopReplay = new javax.swing.JButton();
btnNextPlay = new javax.swing.JButton();
btnPlay = new javax.swing.JButton();
btnSkipForward = new javax.swing.JButton();
btnPreviousPlay = new javax.swing.JButton();
pnlBattlefield = new javax.swing.JPanel();
gameChatPanel = new mage.client.chat.ChatPanelBasic();
gameChatPanel.useExtendedView(ChatPanelBasic.VIEW_MODE.GAME);
userChatPanel = new mage.client.chat.ChatPanelBasic();
userChatPanel.setParentChat(gameChatPanel);
userChatPanel.useExtendedView(ChatPanelBasic.VIEW_MODE.CHAT);
userChatPanel.setChatType(ChatPanelBasic.ChatType.GAME);
gameChatPanel.setConnectedChat(userChatPanel);
gameChatPanel.disableInput();
gameChatPanel.setMinimumSize(new java.awt.Dimension(100, 48));
gameChatPanel.enableHyperlinks();
jSplitPane2 = new javax.swing.JSplitPane();
handContainer = new HandPanel();
handCards = new HashMap<>();
pnlShortCuts.setOpaque(false);
pnlShortCuts.setPreferredSize(new Dimension(410, 72));
stackObjects = new mage.client.cards.Cards();
jSplitPane1.setBorder(null);
jSplitPane1.setDividerSize(7);
jSplitPane1.setResizeWeight(1.0);
jSplitPane1.setOneTouchExpandable(true);
jSplitPane1.setMinimumSize(new java.awt.Dimension(26, 48));
jSplitPane0.setBorder(null);
jSplitPane0.setDividerSize(7);
jSplitPane0.setResizeWeight(1.0);
jSplitPane0.setOneTouchExpandable(true);
restoreDividerLocations();
lblPhase.setLabelFor(txtPhase);
lblPhase.setText("Phase:");
txtPhase.setText("Phase");
txtPhase.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(153, 153, 153), 1, true));
txtPhase.setMinimumSize(new java.awt.Dimension(0, 16));
lblStep.setLabelFor(txtStep);
lblStep.setText("Step:");
txtStep.setText("Step");
txtStep.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(153, 153, 153), 1, true));
txtStep.setMinimumSize(new java.awt.Dimension(0, 16));
lblTurn.setLabelFor(txtTurn);
lblTurn.setText("Turn:");
txtTurn.setText("Turn");
txtTurn.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(153, 153, 153), 1, true));
txtTurn.setMinimumSize(new java.awt.Dimension(0, 16));
txtActivePlayer.setText("Active Player");
txtActivePlayer.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(153, 153, 153), 1, true));
txtActivePlayer.setMinimumSize(new java.awt.Dimension(0, 16));
lblActivePlayer.setLabelFor(txtActivePlayer);
lblActivePlayer.setText("Active Player:");
txtPriority.setText("Priority Player");
txtPriority.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(153, 153, 153), 1, true));
txtPriority.setMinimumSize(new java.awt.Dimension(0, 16));
lblPriority.setLabelFor(txtPriority);
lblPriority.setText("Priority Player:");
bigCard.setBorder(new LineBorder(Color.black, 1, true));
// CHATS and HINTS support
// HOTKEYS
int c = JComponent.WHEN_IN_FOCUSED_WINDOW;
// special hotkeys for custom rendered dialogs without focus
// call it before any user defined hotkeys
this.abilityPicker.injectHotkeys(this, "ABILITY_PICKER");
btnToggleMacro.setContentAreaFilled(false);
btnToggleMacro.setBorder(new EmptyBorder(BORDER_SIZE, BORDER_SIZE, BORDER_SIZE, BORDER_SIZE));
btnToggleMacro.setIcon(new ImageIcon(ImageManagerImpl.instance.getToggleRecordMacroButtonImage()));
btnToggleMacro.setToolTipText("Toggle Record Macro (" + getCachedKeyText(KEY_CONTROL_TOGGLE_MACRO) + ").");
btnToggleMacro.setFocusable(false);
btnToggleMacro.addMouseListener(new FirstButtonMousePressedAction(e -> btnToggleMacroActionPerformed(null)));
KeyStroke kst = getCachedKeystroke(KEY_CONTROL_TOGGLE_MACRO);
this.getInputMap(c).put(kst, "F8_PRESS");
this.getActionMap().put("F8_PRESS", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
if (isUserImputActive())
return;
btnToggleMacroActionPerformed(actionEvent);
}
});
KeyStroke ks3 = getCachedKeystroke(KEY_CONTROL_CANCEL_SKIP);
this.getInputMap(c).put(ks3, "F3_PRESS");
this.getActionMap().put("F3_PRESS", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
if (isUserImputActive())
return;
restorePriorityActionPerformed(actionEvent);
}
});
// SKIP BUTTONS (button's hint/state is dynamic)
btnCancelSkip.setContentAreaFilled(false);
btnCancelSkip.setBorder(new EmptyBorder(BORDER_SIZE, BORDER_SIZE, BORDER_SIZE, BORDER_SIZE));
btnCancelSkip.setIcon(new ImageIcon(ImageManagerImpl.instance.getCancelSkipButtonImage()));
btnCancelSkip.setToolTipText("CANCEL all skips");
btnCancelSkip.setFocusable(false);
btnCancelSkip.addMouseListener(new FirstButtonMousePressedAction(e -> restorePriorityActionPerformed(null)));
btnSkipToNextTurn.setContentAreaFilled(false);
btnSkipToNextTurn.setBorder(new EmptyBorder(BORDER_SIZE, BORDER_SIZE, BORDER_SIZE, BORDER_SIZE));
btnSkipToNextTurn.setIcon(new ImageIcon(ImageManagerImpl.instance.getSkipNextTurnButtonImage()));
btnSkipToNextTurn.setToolTipText("dynamic");
btnSkipToNextTurn.setFocusable(false);
btnSkipToNextTurn.addMouseListener(new FirstButtonMousePressedAction(e -> btnEndTurnActionPerformed(null)));
KeyStroke ks = getCachedKeystroke(KEY_CONTROL_NEXT_TURN);
this.getInputMap(c).put(ks, "F4_PRESS");
this.getActionMap().put("F4_PRESS", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
if (isUserImputActive())
return;
btnEndTurnActionPerformed(actionEvent);
}
});
btnSkipToEndTurn.setContentAreaFilled(false);
btnSkipToEndTurn.setBorder(new EmptyBorder(BORDER_SIZE, BORDER_SIZE, BORDER_SIZE, BORDER_SIZE));
btnSkipToEndTurn.setIcon(new ImageIcon(ImageManagerImpl.instance.getSkipEndTurnButtonImage()));
btnSkipToEndTurn.setToolTipText("dynamic");
btnSkipToEndTurn.setFocusable(false);
btnSkipToEndTurn.addMouseListener(new FirstButtonMousePressedAction(e -> btnUntilEndOfTurnActionPerformed(null)));
ks = getCachedKeystroke(KEY_CONTROL_END_STEP);
this.getInputMap(c).put(ks, "F5_PRESS");
this.getActionMap().put("F5_PRESS", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
if (isUserImputActive())
return;
btnUntilEndOfTurnActionPerformed(actionEvent);
}
});
ks = getCachedKeystroke(KEY_CONTROL_SKIP_STEP);
this.getInputMap(c).put(ks, "F6_PRESS");
this.getActionMap().put("F6_PRESS", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
if (isUserImputActive())
return;
btnEndTurnSkipStackActionPerformed(actionEvent);
}
});
btnSkipToNextMain.setContentAreaFilled(false);
btnSkipToNextMain.setBorder(new EmptyBorder(BORDER_SIZE, BORDER_SIZE, BORDER_SIZE, BORDER_SIZE));
btnSkipToNextMain.setIcon(new ImageIcon(ImageManagerImpl.instance.getSkipMainButtonImage()));
btnSkipToNextMain.setToolTipText("dynamic");
btnSkipToNextMain.setFocusable(false);
btnSkipToNextMain.addMouseListener(new FirstButtonMousePressedAction(e -> btnUntilNextMainPhaseActionPerformed(null)));
ks = getCachedKeystroke(KEY_CONTROL_MAIN_STEP);
this.getInputMap(c).put(ks, "F7_PRESS");
this.getActionMap().put("F7_PRESS", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
if (isUserImputActive())
return;
btnUntilNextMainPhaseActionPerformed(actionEvent);
}
});
btnSkipToYourTurn.setContentAreaFilled(false);
btnSkipToYourTurn.setBorder(new EmptyBorder(BORDER_SIZE, BORDER_SIZE, BORDER_SIZE, BORDER_SIZE));
btnSkipToYourTurn.setIcon(new ImageIcon(ImageManagerImpl.instance.getSkipYourNextTurnButtonImage()));
btnSkipToYourTurn.setToolTipText("dynamic");
btnSkipToYourTurn.setFocusable(false);
btnSkipToYourTurn.addMouseListener(new FirstButtonMousePressedAction(e -> btnPassPriorityUntilNextYourTurnActionPerformed(null)));
KeyStroke ks9 = getCachedKeystroke(KEY_CONTROL_YOUR_TURN);
this.getInputMap(c).put(ks9, "F9_PRESS");
this.getActionMap().put("F9_PRESS", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
if (isUserImputActive())
return;
btnPassPriorityUntilNextYourTurnActionPerformed(actionEvent);
}
});
btnSkipToEndStepBeforeYourTurn.setContentAreaFilled(false);
btnSkipToEndStepBeforeYourTurn.setBorder(new EmptyBorder(BORDER_SIZE, BORDER_SIZE, BORDER_SIZE, BORDER_SIZE));
btnSkipToEndStepBeforeYourTurn.setIcon(new ImageIcon(ImageManagerImpl.instance.getSkipEndStepBeforeYourTurnButtonImage()));
btnSkipToEndStepBeforeYourTurn.setToolTipText("dynamic");
btnSkipToEndStepBeforeYourTurn.setFocusable(false);
btnSkipToEndStepBeforeYourTurn.addMouseListener(new FirstButtonMousePressedAction(e -> btnSkipToEndStepBeforeYourTurnActionPerformed(null)));
KeyStroke ks11 = getCachedKeystroke(KEY_CONTROL_PRIOR_END);
this.getInputMap(c).put(ks11, "F11_PRESS");
this.getActionMap().put("F11_PRESS", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
if (isUserImputActive())
return;
btnSkipToEndStepBeforeYourTurnActionPerformed(actionEvent);
}
});
btnSkipStack.setContentAreaFilled(false);
btnSkipStack.setBorder(new EmptyBorder(BORDER_SIZE, BORDER_SIZE, BORDER_SIZE, BORDER_SIZE));
btnSkipStack.setIcon(new ImageIcon(ImageManagerImpl.instance.getSkipStackButtonImage()));
btnSkipStack.setToolTipText("dynamic");
btnSkipStack.setFocusable(false);
btnSkipStack.addMouseListener(new FirstButtonMousePressedAction(e -> btnPassPriorityUntilStackResolvedActionPerformed(null)));
ks = getCachedKeystroke(KEY_CONTROL_SKIP_STACK);
this.getInputMap(c).put(ks, "F10_PRESS");
this.getActionMap().put("F10_PRESS", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
if (isUserImputActive())
return;
btnPassPriorityUntilStackResolvedActionPerformed(actionEvent);
}
});
btnConcede.setContentAreaFilled(false);
btnConcede.setBorder(new EmptyBorder(BORDER_SIZE, BORDER_SIZE, BORDER_SIZE, BORDER_SIZE));
btnConcede.setIcon(new ImageIcon(ImageManagerImpl.instance.getConcedeButtonImage()));
btnConcede.setToolTipText("CONCEDE current game");
btnConcede.setFocusable(false);
btnConcede.addMouseListener(new FirstButtonMousePressedAction(e -> btnConcedeActionPerformed(null)));
// update button hint/states to default values
updateSkipButtons();
// HOTKEYS
KeyStroke ks2 = getCachedKeystroke(KEY_CONTROL_CONFIRM);
this.getInputMap(c).put(ks2, "F2_PRESS");
this.getActionMap().put("F2_PRESS", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
if (isUserImputActive())
return;
if (feedbackPanel != null) {
feedbackPanel.pressOKYesOrDone();
}
}
});
KeyStroke ks12 = getCachedKeystroke(KEY_CONTROL_SWITCH_CHAT);
this.getInputMap(c).put(ks12, "F12_PRESS");
this.getActionMap().put("F12_PRESS", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
// if (isUserImputActive()) return;
if (isChatInputActive()) {
KeyboardFocusManager.getCurrentKeyboardFocusManager().clearFocusOwner();
} else if (!isUserImputActive()) {
userChatPanel.getTxtMessageInputComponent().requestFocusInWindow();
}
}
});
KeyStroke ksAltE = KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.ALT_MASK);
this.getInputMap(c).put(ksAltE, "ENLARGE");
this.getActionMap().put("ENLARGE", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
if (isUserImputActive())
return;
ActionCallback callback = Plugins.instance.getActionCallback();
((MageActionCallback) callback).enlargeCard(EnlargeMode.NORMAL);
}
});
KeyStroke ksAltS = KeyStroke.getKeyStroke(KeyEvent.VK_S, InputEvent.ALT_MASK);
this.getInputMap(c).put(ksAltS, "ENLARGE_SOURCE");
this.getActionMap().put("ENLARGE_SOURCE", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
if (isUserImputActive())
return;
ActionCallback callback = Plugins.instance.getActionCallback();
((MageActionCallback) callback).enlargeCard(EnlargeMode.ALTERNATE);
}
});
KeyStroke ksAltD = KeyStroke.getKeyStroke(KeyEvent.VK_D, InputEvent.ALT_MASK);
this.getInputMap(c).put(ksAltD, "BIG_IMAGE");
this.getActionMap().put("BIG_IMAGE", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
if (isUserImputActive())
return;
imagePanelState = !imagePanelState;
if (!imagePanelState) {
jSplitPane0.resetToPreferredSizes();
jSplitPane0.setDividerLocation(jSplitPane0.getSize().width - jSplitPane0.getInsets().right - jSplitPane0.getDividerSize() - 260);
} else {
jSplitPane0.setDividerLocation(1.0);
}
}
});
KeyStroke ksAlt1 = KeyStroke.getKeyStroke(KeyEvent.VK_1, InputEvent.ALT_MASK);
this.getInputMap(c).put(ksAlt1, "USEFIRSTMANAABILITY");
this.getActionMap().put("USEFIRSTMANAABILITY", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
if (isUserImputActive())
return;
SessionHandler.sendPlayerAction(PlayerAction.USE_FIRST_MANA_ABILITY_ON, gameId, null);
setMenuStates(PreferencesDialog.getCachedValue(KEY_GAME_MANA_AUTOPAYMENT, "true").equals("true"), PreferencesDialog.getCachedValue(KEY_GAME_MANA_AUTOPAYMENT_ONLY_ONE, "true").equals("true"), PreferencesDialog.getCachedValue(KEY_USE_FIRST_MANA_ABILITY, "false").equals("true"), holdingPriority);
}
});
final BasicSplitPaneUI myUi = (BasicSplitPaneUI) jSplitPane0.getUI();
final BasicSplitPaneDivider divider = myUi.getDivider();
final JButton upArrowButton = (JButton) divider.getComponent(0);
upArrowButton.addActionListener(actionEvent -> PreferencesDialog.saveValue(PreferencesDialog.KEY_BIG_CARD_TOGGLED, "up"));
final JButton downArrowButton = (JButton) divider.getComponent(1);
downArrowButton.addActionListener(actionEvent -> PreferencesDialog.saveValue(PreferencesDialog.KEY_BIG_CARD_TOGGLED, "down"));
KeyStroke ksAltEReleased = KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.ALT_MASK, true);
this.getInputMap(c).put(ksAltEReleased, "ENLARGE_RELEASE");
KeyStroke ksAltSReleased = KeyStroke.getKeyStroke(KeyEvent.VK_S, InputEvent.ALT_MASK, true);
this.getInputMap(c).put(ksAltSReleased, "ENLARGE_RELEASE");
this.getActionMap().put("ENLARGE_RELEASE", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
if (isUserImputActive())
return;
ActionCallback callback = Plugins.instance.getActionCallback();
((MageActionCallback) callback).hideEnlargedCard();
}
});
KeyStroke ksAlt1Released = KeyStroke.getKeyStroke(KeyEvent.VK_1, InputEvent.ALT_MASK, true);
this.getInputMap(c).put(ksAlt1Released, "USEFIRSTMANAABILITY_RELEASE");
this.getActionMap().put("USEFIRSTMANAABILITY_RELEASE", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
if (isUserImputActive())
return;
SessionHandler.sendPlayerAction(PlayerAction.USE_FIRST_MANA_ABILITY_OFF, gameId, null);
setMenuStates(PreferencesDialog.getCachedValue(KEY_GAME_MANA_AUTOPAYMENT, "true").equals("true"), PreferencesDialog.getCachedValue(KEY_GAME_MANA_AUTOPAYMENT_ONLY_ONE, "true").equals("true"), PreferencesDialog.getCachedValue(KEY_USE_FIRST_MANA_ABILITY, "false").equals("true"), holdingPriority);
}
});
btnSwitchHands.setContentAreaFilled(false);
btnSwitchHands.setBorder(new EmptyBorder(0, 0, 0, 0));
btnSwitchHands.setIcon(new ImageIcon(ImageManagerImpl.instance.getSwitchHandsButtonImage()));
btnSwitchHands.setFocusable(false);
btnSwitchHands.setToolTipText("Switch between your hand cards and hand cards of controlled players.");
btnSwitchHands.addMouseListener(new FirstButtonMousePressedAction(e -> btnSwitchHandActionPerformed(null)));
btnStopWatching.setContentAreaFilled(false);
btnStopWatching.setBorder(new EmptyBorder(0, 0, 0, 0));
btnStopWatching.setIcon(new ImageIcon(ImageManagerImpl.instance.getStopWatchButtonImage()));
btnStopWatching.setFocusable(false);
btnStopWatching.setToolTipText("Stop watching this game.");
btnStopWatching.addMouseListener(new FirstButtonMousePressedAction(e -> btnStopWatchingActionPerformed(null)));
stackObjects.setBackgroundColor(new Color(0, 0, 0, 40));
btnStopReplay.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/control_stop.png")));
btnStopReplay.addActionListener(evt -> btnStopReplayActionPerformed(evt));
btnNextPlay.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/control_stop_right.png")));
btnNextPlay.addActionListener(evt -> btnNextPlayActionPerformed(evt));
btnPlay.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/control_right.png")));
btnPlay.addActionListener(evt -> btnPlayActionPerformed(evt));
btnSkipForward.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/control_double_stop_right.png")));
btnSkipForward.addActionListener(evt -> btnSkipForwardActionPerformed(evt));
btnPreviousPlay.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/control_stop_left.png")));
btnPreviousPlay.addActionListener(evt -> btnPreviousPlayActionPerformed(evt));
initPopupMenuTriggerOrder();
setGUISize();
// Replay panel to control replay of games
javax.swing.GroupLayout gl_pnlReplay = new javax.swing.GroupLayout(pnlReplay);
pnlReplay.setLayout(gl_pnlReplay);
gl_pnlReplay.setHorizontalGroup(gl_pnlReplay.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(gl_pnlReplay.createSequentialGroup().addComponent(btnPreviousPlay, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(btnPlay, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addComponent(btnStopReplay, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(btnNextPlay, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(btnSkipForward, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)));
gl_pnlReplay.setVerticalGroup(gl_pnlReplay.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(btnSkipForward, 0, 0, Short.MAX_VALUE).addComponent(btnNextPlay, 0, 0, Short.MAX_VALUE).addComponent(btnStopReplay, 0, 0, Short.MAX_VALUE).addComponent(btnPlay, 0, 0, Short.MAX_VALUE).addComponent(btnPreviousPlay, javax.swing.GroupLayout.PREFERRED_SIZE, 31, Short.MAX_VALUE));
// Game info panel (buttons on the right panel)
javax.swing.GroupLayout gl_pnlShortCuts = new javax.swing.GroupLayout(pnlShortCuts);
pnlShortCuts.setLayout(gl_pnlShortCuts);
gl_pnlShortCuts.setHorizontalGroup(gl_pnlShortCuts.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING).addGroup(gl_pnlShortCuts.createSequentialGroup().addComponent(btnSkipToNextTurn).addComponent(btnSkipToEndTurn).addComponent(btnSkipToNextMain).addComponent(btnSkipToYourTurn).addComponent(btnSkipStack).addComponent(btnSkipToEndStepBeforeYourTurn)).addGroup(gl_pnlShortCuts.createSequentialGroup().addComponent(txtHoldPriority).addComponent(txtSpellsCast).addComponent(btnSwitchHands).addComponent(btnCancelSkip).addComponent(btnConcede).addComponent(btnStopWatching)).addGroup(gl_pnlShortCuts.createSequentialGroup().addContainerGap().addComponent(pnlReplay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addContainerGap(51, Short.MAX_VALUE)));
gl_pnlShortCuts.setVerticalGroup(gl_pnlShortCuts.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(gl_pnlShortCuts.createSequentialGroup().addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 164, Short.MAX_VALUE).addComponent(pnlReplay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup(gl_pnlShortCuts.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING).addComponent(btnSkipToNextTurn).addComponent(btnSkipToEndTurn).addComponent(btnSkipToNextMain).addComponent(btnSkipToYourTurn).addComponent(btnSkipStack).addComponent(btnSkipToEndStepBeforeYourTurn)).addGroup(gl_pnlShortCuts.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING).addComponent(txtHoldPriority).addComponent(txtSpellsCast).addComponent(btnSwitchHands).addComponent(btnCancelSkip).addComponent(btnConcede).addComponent(btnStopWatching))));
pnlBattlefield.setLayout(new java.awt.GridBagLayout());
jPhases = new JPanel();
jPhases.setBackground(new Color(0, 0, 0, 0));
jPhases.setLayout(null);
jPhases.setPreferredSize(new Dimension(X_PHASE_WIDTH, 435));
MouseAdapter phasesMouseAdapter = new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent evt) {
mouseClickPhaseBar(evt);
}
};
String[] phases = { "Untap", "Upkeep", "Draw", "Main1", "Combat_Start", "Combat_Attack", "Combat_Block", "Combat_Damage", "Combat_End", "Main2", "Cleanup", "Next_Turn" };
for (String name : phases) {
createPhaseButton(name, phasesMouseAdapter);
}
int i = 0;
for (String name : hoverButtons.keySet()) {
HoverButton hoverButton = hoverButtons.get(name);
hoverButton.setAlignmentX(LEFT_ALIGNMENT);
hoverButton.setBounds(X_PHASE_WIDTH - 36, i * 36, 36, 36);
jPhases.add(hoverButton);
i++;
}
jPhases.addMouseListener(phasesMouseAdapter);
pnlReplay.setOpaque(false);
helper = new HelperPanel();
feedbackPanel.setHelperPanel(helper);
jSplitPane2.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
jSplitPane2.setResizeWeight(0.5);
jSplitPane2.setLeftComponent(userChatPanel);
jSplitPane2.setBottomComponent(gameChatPanel);
phasesContainer = new JPanel();
phasesContainer.setLayout(new RelativeLayout(RelativeLayout.Y_AXIS));
phasesContainer.setBackground(new Color(0, 0, 0, 0));
Float ratio = (float) 1;
JPanel empty1 = new JPanel();
empty1.setBackground(new Color(0, 0, 0, 0));
phasesContainer.add(empty1, ratio);
phasesContainer.add(jPhases);
javax.swing.GroupLayout gl_helperHandButtonsStackArea = new javax.swing.GroupLayout(pnlHelperHandButtonsStackArea);
gl_helperHandButtonsStackArea.setHorizontalGroup(gl_helperHandButtonsStackArea.createParallelGroup(Alignment.LEADING).addGroup(gl_helperHandButtonsStackArea.createSequentialGroup().addGroup(gl_helperHandButtonsStackArea.createParallelGroup(Alignment.LEADING).addGroup(gl_helperHandButtonsStackArea.createSequentialGroup().addGroup(gl_helperHandButtonsStackArea.createParallelGroup(Alignment.LEADING).addComponent(helper, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addComponent(handContainer, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)).addGroup(gl_helperHandButtonsStackArea.createParallelGroup(Alignment.LEADING).addComponent(pnlShortCuts, 410, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE).addComponent(stackObjects, 410, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE))).addGap(0).addGroup(gl_helperHandButtonsStackArea.createSequentialGroup().addComponent(pnlBattlefield, GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE).addComponent(phasesContainer, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))));
gl_helperHandButtonsStackArea.setVerticalGroup(gl_helperHandButtonsStackArea.createParallelGroup(Alignment.TRAILING).addGroup(gl_helperHandButtonsStackArea.createSequentialGroup().addGroup(gl_helperHandButtonsStackArea.createParallelGroup(Alignment.LEADING).addComponent(pnlBattlefield, GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE).addComponent(phasesContainer, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)).addGroup(gl_helperHandButtonsStackArea.createParallelGroup(Alignment.LEADING).addGroup(gl_helperHandButtonsStackArea.createSequentialGroup().addGap(2).addComponent(pnlShortCuts, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addComponent(stackObjects, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)).addGroup(gl_helperHandButtonsStackArea.createSequentialGroup().addComponent(helper, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addComponent(handContainer, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))));
pnlHelperHandButtonsStackArea.setLayout(gl_helperHandButtonsStackArea);
jSplitPane1.setLeftComponent(pnlHelperHandButtonsStackArea);
jSplitPane1.setRightComponent(jSplitPane2);
// Set individual area sizes of big card pane
GridBagLayout gbl = new GridBagLayout();
jPanel2.setLayout(gbl);
GridBagConstraints gbc = new GridBagConstraints();
gbc.fill = GridBagConstraints.BOTH;
gbc.gridx = 0;
gbc.gridy = 0;
gbc.gridwidth = 1;
// size 4/5
gbc.gridheight = 4;
gbc.weightx = 1.0;
gbc.weighty = 1.0;
gbl.setConstraints(bigCard, gbc);
jPanel2.add(bigCard);
jPanel2.setOpaque(false);
// game pane and chat/log pane
jSplitPane0.setLeftComponent(jSplitPane1);
// big card and buttons
jSplitPane0.setRightComponent(jPanel2);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jSplitPane0, javax.swing.GroupLayout.DEFAULT_SIZE, 1078, Short.MAX_VALUE));
layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jSplitPane0, javax.swing.GroupLayout.DEFAULT_SIZE, 798, Short.MAX_VALUE));
}
use of mage.client.cards.BigCard in project mage by magefree.
the class MagePaneMenuItem method setGUISizeTooltipContainer.
private void setGUISizeTooltipContainer() {
try {
int height = GUISizeHelper.enlargedImageHeight;
int width = (int) ((float) height * (float) 0.64);
JPanel cardPreviewContainer = (JPanel) UI.getComponent(MageComponents.CARD_PREVIEW_CONTAINER);
cardPreviewContainer.setBounds(0, 0, width + 80, height + 30);
BigCard bigCard = (BigCard) UI.getComponent(MageComponents.CARD_PREVIEW_PANE);
bigCard.setSize(width, height);
JPanel cardPreviewContainerRotated = (JPanel) UI.getComponent(MageComponents.CARD_PREVIEW_CONTAINER_ROTATED);
cardPreviewContainerRotated.setBounds(0, 0, height + 80, width + 100 + 30);
BigCard bigCardRotated = (BigCard) UI.getComponent(MageComponents.CARD_PREVIEW_PANE_ROTATED);
bigCardRotated.setSize(height, width + 30);
} catch (Exception e) {
LOGGER.warn("Error while changing tooltip container size.", e);
}
}
use of mage.client.cards.BigCard in project mage by magefree.
the class MagePaneMenuItem method updateTooltipContainerSizes.
private void updateTooltipContainerSizes() {
JPanel cardPreviewContainer;
BigCard bigCard;
JPanel cardPreviewContainerRotated;
BigCard bigCardRotated;
try {
cardPreviewContainer = (JPanel) UI.getComponent(MageComponents.CARD_PREVIEW_CONTAINER);
bigCard = (BigCard) UI.getComponent(MageComponents.CARD_PREVIEW_PANE);
cardPreviewContainerRotated = (JPanel) UI.getComponent(MageComponents.CARD_PREVIEW_CONTAINER_ROTATED);
bigCardRotated = (BigCard) UI.getComponent(MageComponents.CARD_PREVIEW_PANE_ROTATED);
} catch (InterruptedException e) {
LOGGER.fatal("Can't update tooltip panel sizes");
Thread.currentThread().interrupt();
return;
}
int height = GUISizeHelper.enlargedImageHeight;
int width = (int) ((float) height * (float) 0.64);
bigCard.setSize(width, height);
cardPreviewContainer.setBounds(0, 0, width + 80, height + 30);
bigCardRotated.setSize(height, width + 30);
cardPreviewContainerRotated.setBounds(0, 0, height + 80, width + 100 + 30);
}
use of mage.client.cards.BigCard in project mage by magefree.
the class UpdateDeckTask method initComponents.
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
void initComponents() {
panelRight = new javax.swing.JSplitPane();
cardSelector = new mage.client.deckeditor.CardSelector();
deckArea = new mage.client.deckeditor.DeckArea();
panelLeft = new javax.swing.JPanel();
cardInfoPane = Plugins.instance.getCardInfoPane();
if (cardInfoPane != null && System.getProperty("testCardInfo") != null) {
cardInfoPane.setPreferredSize(new Dimension(170, 150));
cardInfoPane.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(200, 0, 0)));
} else {
cardInfoPane = new JLabel();
cardInfoPane.setVisible(false);
}
panelDeck = new javax.swing.JPanel();
panelDeckName = new javax.swing.JPanel();
lblDeckName = new javax.swing.JLabel();
txtDeckName = new javax.swing.JTextField();
panelDeckCreate = new javax.swing.JPanel();
btnNew = new javax.swing.JButton();
btnGenDeck = new javax.swing.JButton();
panelDeckLoad = new javax.swing.JPanel();
btnLoad = new javax.swing.JButton();
btnImport = new javax.swing.JButton();
panelDeckSave = new javax.swing.JPanel();
btnSave = new javax.swing.JButton();
btnExport = new javax.swing.JButton();
panelDeckDraft = new javax.swing.JPanel();
btnSubmit = new javax.swing.JButton();
btnSubmitTimer = new javax.swing.JButton();
panelDeckLands = new javax.swing.JPanel();
btnAddLand = new javax.swing.JButton();
btnLegality = new javax.swing.JButton();
panelDeckExit = new javax.swing.JPanel();
btnExit = new javax.swing.JButton();
txtTimeRemaining = new javax.swing.JTextField();
scrollPaneInfo = new javax.swing.JScrollPane();
panelInfo = new javax.swing.JPanel();
deckLegalityDisplay = new mage.client.deckeditor.DeckLegalityPanel();
bigCard = new mage.client.cards.BigCard();
panelRight.setDividerSize(10);
panelRight.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
panelRight.setResizeWeight(0.5);
panelRight.setTopComponent(cardSelector);
deckArea.setMinimumSize(new java.awt.Dimension(200, 56));
panelRight.setBottomComponent(deckArea);
panelDeck.setOpaque(false);
panelDeck.setLayout(new javax.swing.BoxLayout(panelDeck, javax.swing.BoxLayout.Y_AXIS));
panelDeckName.setOpaque(false);
lblDeckName.setForeground(new java.awt.Color(255, 255, 255));
lblDeckName.setLabelFor(txtDeckName);
lblDeckName.setText("Deck Name:");
javax.swing.GroupLayout panelDeckNameLayout = new javax.swing.GroupLayout(panelDeckName);
panelDeckName.setLayout(panelDeckNameLayout);
panelDeckNameLayout.setHorizontalGroup(panelDeckNameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(panelDeckNameLayout.createSequentialGroup().addContainerGap().addComponent(lblDeckName).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(txtDeckName, javax.swing.GroupLayout.DEFAULT_SIZE, 205, Short.MAX_VALUE).addContainerGap()));
panelDeckNameLayout.setVerticalGroup(panelDeckNameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(panelDeckNameLayout.createSequentialGroup().addGroup(panelDeckNameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(txtDeckName, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE).addComponent(lblDeckName)).addGap(0, 0, 0)));
panelDeck.add(panelDeckName);
panelDeckCreate.setOpaque(false);
// NOI18N
btnNew.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/state_active.png")));
btnNew.setText("NEW");
btnNew.setIconTextGap(2);
btnNew.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnNewActionPerformed(evt);
}
});
// NOI18N
btnGenDeck.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/card_panel.png")));
btnGenDeck.setText("Random");
btnGenDeck.setIconTextGap(1);
// NOI18N
btnGenDeck.setName("btnGenDeck");
btnGenDeck.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnGenDeckActionPerformed(evt);
}
});
javax.swing.GroupLayout panelDeckCreateLayout = new javax.swing.GroupLayout(panelDeckCreate);
panelDeckCreate.setLayout(panelDeckCreateLayout);
panelDeckCreateLayout.setHorizontalGroup(panelDeckCreateLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(panelDeckCreateLayout.createSequentialGroup().addContainerGap().addComponent(btnNew, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(btnGenDeck, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE).addContainerGap(70, Short.MAX_VALUE)));
panelDeckCreateLayout.setVerticalGroup(panelDeckCreateLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(panelDeckCreateLayout.createSequentialGroup().addGap(5, 5, 5).addGroup(panelDeckCreateLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(btnGenDeck, javax.swing.GroupLayout.DEFAULT_SIZE, 30, Short.MAX_VALUE).addComponent(btnNew, javax.swing.GroupLayout.DEFAULT_SIZE, 30, Short.MAX_VALUE))));
panelDeck.add(panelDeckCreate);
panelDeckLoad.setOpaque(false);
// NOI18N
btnLoad.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/search_24.png")));
btnLoad.setText("LOAD");
btnLoad.setIconTextGap(2);
btnLoad.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnLoadActionPerformed(evt);
}
});
// NOI18N
btnImport.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/deck_in.png")));
btnImport.setText("Import");
btnImport.setIconTextGap(2);
// NOI18N
btnImport.setName("btnImport");
btnImport.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnImportActionPerformed(evt);
}
});
javax.swing.GroupLayout panelDeckLoadLayout = new javax.swing.GroupLayout(panelDeckLoad);
panelDeckLoad.setLayout(panelDeckLoadLayout);
panelDeckLoadLayout.setHorizontalGroup(panelDeckLoadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(panelDeckLoadLayout.createSequentialGroup().addContainerGap().addComponent(btnLoad, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(btnImport, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE).addContainerGap(70, Short.MAX_VALUE)));
panelDeckLoadLayout.setVerticalGroup(panelDeckLoadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(panelDeckLoadLayout.createSequentialGroup().addContainerGap().addGroup(panelDeckLoadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(btnLoad, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE).addComponent(btnImport, javax.swing.GroupLayout.DEFAULT_SIZE, 30, Short.MAX_VALUE))));
panelDeck.add(panelDeckLoad);
panelDeckSave.setOpaque(false);
// NOI18N
btnSave.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/sideboard_out.png")));
btnSave.setText("SAVE");
btnSave.setIconTextGap(2);
btnSave.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnSaveActionPerformed(evt);
}
});
// NOI18N
btnExport.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/deck_out.png")));
btnExport.setText("Export");
btnExport.setIconTextGap(2);
// NOI18N
btnExport.setName("btnImport");
btnExport.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnExportActionPerformed(evt);
}
});
javax.swing.GroupLayout panelDeckSaveLayout = new javax.swing.GroupLayout(panelDeckSave);
panelDeckSave.setLayout(panelDeckSaveLayout);
panelDeckSaveLayout.setHorizontalGroup(panelDeckSaveLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(panelDeckSaveLayout.createSequentialGroup().addContainerGap().addComponent(btnSave, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(btnExport, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE).addContainerGap(70, Short.MAX_VALUE)));
panelDeckSaveLayout.setVerticalGroup(panelDeckSaveLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(panelDeckSaveLayout.createSequentialGroup().addContainerGap().addGroup(panelDeckSaveLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(btnSave, javax.swing.GroupLayout.DEFAULT_SIZE, 30, Short.MAX_VALUE).addComponent(btnExport, javax.swing.GroupLayout.DEFAULT_SIZE, 30, Short.MAX_VALUE))));
panelDeck.add(panelDeckSave);
panelDeckDraft.setOpaque(false);
// NOI18N
btnSubmit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/state_finished.png")));
btnSubmit.setText("SUBMIT");
btnSubmit.setIconTextGap(2);
// NOI18N
btnSubmit.setName("btnSubmit");
btnSubmit.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnSubmitActionPerformed(evt);
}
});
// NOI18N
btnSubmitTimer.setFont(new java.awt.Font("Tahoma", 0, 9));
// NOI18N
btnSubmitTimer.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/state_finished.png")));
btnSubmitTimer.setText("<html>Submit<br>in 1 min");
btnSubmitTimer.setIconTextGap(2);
// NOI18N
btnSubmitTimer.setName("btnSubmitTimer");
btnSubmitTimer.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnSubmitTimerActionPerformed(evt);
}
});
javax.swing.GroupLayout panelDeckDraftLayout = new javax.swing.GroupLayout(panelDeckDraft);
panelDeckDraft.setLayout(panelDeckDraftLayout);
panelDeckDraftLayout.setHorizontalGroup(panelDeckDraftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(panelDeckDraftLayout.createSequentialGroup().addContainerGap().addComponent(btnSubmit, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(btnSubmitTimer, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE).addContainerGap(70, Short.MAX_VALUE)));
panelDeckDraftLayout.setVerticalGroup(panelDeckDraftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(panelDeckDraftLayout.createSequentialGroup().addContainerGap().addGroup(panelDeckDraftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(panelDeckDraftLayout.createSequentialGroup().addComponent(btnSubmit, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE).addGap(0, 0, Short.MAX_VALUE)).addComponent(btnSubmitTimer, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)).addGap(0, 0, 0)));
panelDeck.add(panelDeckDraft);
panelDeckLands.setOpaque(false);
// NOI18N
btnAddLand.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/type_land.png")));
btnAddLand.setText("Lands");
btnAddLand.setIconTextGap(2);
// NOI18N
btnAddLand.setName("btnAddLand");
btnAddLand.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnAddLandActionPerformed(evt);
}
});
btnLegality.setText("Validate");
btnLegality.setIconTextGap(2);
// NOI18N
btnLegality.setName("btnLegality");
btnLegality.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnLegalityActionPerformed(evt);
}
});
javax.swing.GroupLayout panelDeckLandsLayout = new javax.swing.GroupLayout(panelDeckLands);
panelDeckLands.setLayout(panelDeckLandsLayout);
panelDeckLandsLayout.setHorizontalGroup(panelDeckLandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(panelDeckLandsLayout.createSequentialGroup().addContainerGap().addComponent(btnAddLand, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(btnLegality, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE).addContainerGap(70, Short.MAX_VALUE)));
panelDeckLandsLayout.setVerticalGroup(panelDeckLandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelDeckLandsLayout.createSequentialGroup().addContainerGap().addGroup(panelDeckLandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(btnAddLand, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addComponent(btnLegality, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)).addGap(0, 0, 0)));
panelDeck.add(panelDeckLands);
panelDeckExit.setOpaque(false);
btnExit.setText("Exit");
btnExit.setIconTextGap(2);
btnExit.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnExitActionPerformed(evt);
}
});
txtTimeRemaining.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtTimeRemainingActionPerformed(evt);
}
});
javax.swing.GroupLayout panelDeckExitLayout = new javax.swing.GroupLayout(panelDeckExit);
panelDeckExit.setLayout(panelDeckExitLayout);
panelDeckExitLayout.setHorizontalGroup(panelDeckExitLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(panelDeckExitLayout.createSequentialGroup().addContainerGap().addComponent(btnExit, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(txtTimeRemaining, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE).addContainerGap(70, Short.MAX_VALUE)));
panelDeckExitLayout.setVerticalGroup(panelDeckExitLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelDeckExitLayout.createSequentialGroup().addGap(0, 11, Short.MAX_VALUE).addGroup(panelDeckExitLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(btnExit, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE).addComponent(txtTimeRemaining, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))));
panelDeck.add(panelDeckExit);
scrollPaneInfo.setBorder(null);
scrollPaneInfo.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
scrollPaneInfo.setOpaque(false);
panelInfo.setOpaque(false);
deckLegalityDisplay.setMaximumSize(new java.awt.Dimension(245, 155));
deckLegalityDisplay.setMinimumSize(new java.awt.Dimension(85, 155));
deckLegalityDisplay.setOpaque(false);
deckLegalityDisplay.setVisible(false);
javax.swing.GroupLayout panelInfoLayout = new javax.swing.GroupLayout(panelInfo);
panelInfo.setLayout(panelInfoLayout);
panelInfoLayout.setHorizontalGroup(panelInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(panelInfoLayout.createSequentialGroup().addGap(15, 15, 15).addGroup(panelInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(bigCard, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelInfoLayout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE).addComponent(deckLegalityDisplay, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE).addGap(0, 0, Short.MAX_VALUE))).addGap(15, 15, 15)));
panelInfoLayout.setVerticalGroup(panelInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(panelInfoLayout.createSequentialGroup().addContainerGap().addComponent(deckLegalityDisplay, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addComponent(bigCard, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addContainerGap()));
scrollPaneInfo.setViewportView(panelInfo);
javax.swing.GroupLayout panelLeftLayout = new javax.swing.GroupLayout(panelLeft);
panelLeft.setLayout(panelLeftLayout);
panelLeftLayout.setHorizontalGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(panelDeck, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addComponent(scrollPaneInfo));
panelLeftLayout.setVerticalGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(panelLeftLayout.createSequentialGroup().addComponent(panelDeck, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(scrollPaneInfo).addContainerGap()));
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addComponent(panelLeft, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(panelRight, javax.swing.GroupLayout.DEFAULT_SIZE, 883, Short.MAX_VALUE)));
layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(panelLeft, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addComponent(panelRight, javax.swing.GroupLayout.Alignment.TRAILING));
}
Aggregations