mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
Refactor
This commit is contained in:
parent
771fac97ef
commit
01adbcf96f
1 changed files with 11 additions and 5 deletions
|
@ -70,6 +70,14 @@ public class CardArea extends JPanel implements MouseListener {
|
|||
this.verticalCardOffset = verticalCardOffset;
|
||||
}
|
||||
|
||||
private void fixDialogSize() {
|
||||
// fix panel size (must include scrolls)
|
||||
Dimension newSize = new Dimension(cardArea.getPreferredSize());
|
||||
newSize.width += 20;
|
||||
newSize.height += 20;
|
||||
this.setPreferredSize(newSize);
|
||||
}
|
||||
|
||||
public void loadCards(CardsView showCards, BigCard bigCard, UUID gameId) {
|
||||
this.reloaded = true;
|
||||
cardArea.removeAll();
|
||||
|
@ -85,11 +93,7 @@ public class CardArea extends JPanel implements MouseListener {
|
|||
this.revalidate();
|
||||
this.repaint();
|
||||
|
||||
// fix panel size (must include scrolls)
|
||||
Dimension newSize = new Dimension(cardArea.getPreferredSize());
|
||||
newSize.width += 20;
|
||||
newSize.height += 20;
|
||||
this.setPreferredSize(newSize);
|
||||
fixDialogSize();
|
||||
}
|
||||
|
||||
public void loadCardsNarrow(CardsView showCards, BigCard bigCard, UUID gameId) {
|
||||
|
@ -103,6 +107,8 @@ public class CardArea extends JPanel implements MouseListener {
|
|||
|
||||
this.revalidate();
|
||||
this.repaint();
|
||||
|
||||
fixDialogSize();
|
||||
}
|
||||
|
||||
private void loadCardsFew(CardsView showCards, BigCard bigCard, UUID gameId) {
|
||||
|
|
Loading…
Reference in a new issue