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) {
ActionCallback callback = Plugins.getInstance().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) {
ActionCallback callback = Plugins.getInstance().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) {
imagePanelState = !imagePanelState;
if (!imagePanelState) {
jSplitPane0.resetToPreferredSizes();
jSplitPane0.setDividerLocation(jSplitPane0.getSize().width - jSplitPane0.getInsets().right - jSplitPane0.getDividerSize() - 260);
} else {
jSplitPane0.setDividerLocation(1.0);
}
}
});
final BasicSplitPaneUI myUi = (BasicSplitPaneUI) jSplitPane0.getUI();
final BasicSplitPaneDivider divider = myUi.getDivider();
final JButton upArrowButton = (JButton) divider.getComponent(0);
upArrowButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
PreferencesDialog.saveValue(PreferencesDialog.KEY_BIG_CARD_TOGGLED, "up");
}
});
final JButton downArrowButton = (JButton) divider.getComponent(1);
downArrowButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent 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) {
ActionCallback callback = Plugins.getInstance().getActionCallback();
((MageActionCallback)callback).hideEnlargedCard();
}
});
btnSwitchHands.setContentAreaFilled(false);