forked from External/mage
GUI: added HD screen support (resizing) for player panels (preferences settings under development, part of #12455, #12451, #7563);
This commit is contained in:
parent
7d675de876
commit
72586616ae
10 changed files with 340 additions and 242 deletions
|
|
@ -8,15 +8,16 @@ import mage.client.components.MageRoundPane;
|
|||
import mage.client.components.ext.dlg.DialogManager;
|
||||
import mage.client.dialog.PreferencesDialog;
|
||||
import mage.client.util.CardsViewUtil;
|
||||
import mage.client.util.GUISizeHelper;
|
||||
import mage.client.util.ImageHelper;
|
||||
import mage.client.util.gui.BufferedImageBuilder;
|
||||
import mage.client.util.gui.countryBox.CountryUtil;
|
||||
import mage.components.ImagePanel;
|
||||
import mage.components.ImagePanelStyle;
|
||||
import mage.constants.CardType;
|
||||
import static mage.constants.Constants.*;
|
||||
import mage.constants.ManaType;
|
||||
import mage.designations.DesignationType;
|
||||
import mage.util.DebugUtil;
|
||||
import mage.utils.timer.PriorityTimer;
|
||||
import mage.view.*;
|
||||
import org.mage.card.arcane.ManaSymbols;
|
||||
|
|
@ -30,14 +31,25 @@ import java.awt.*;
|
|||
import java.awt.image.BufferedImage;
|
||||
import java.util.*;
|
||||
|
||||
import static mage.constants.Constants.*;
|
||||
|
||||
/**
|
||||
* Game GUI: player panel with avatar and icons
|
||||
* <p>
|
||||
* Lifecycle:
|
||||
* - create and put to parent panel
|
||||
* - init by static data like player info
|
||||
* - update by dynamic data like timer and game view data
|
||||
* <p>
|
||||
* Warning, it un-support GUI or fonts settings in real time, so must re-create it
|
||||
*
|
||||
* @author nantuko, JayDi85, Susucr
|
||||
*/
|
||||
public class PlayerPanelExt extends javax.swing.JPanel {
|
||||
|
||||
// TODO: *.form file was lost, panel must be reworks in designer
|
||||
// TODO: *.form file was lost, panel must be reworks in designer:
|
||||
// - new form file useless cause player panel must support gui scale (see sizeMod) - it can be done by dynamic components creating only
|
||||
// - so it must migrate to new flow/box layout and runtime creating (current code uses "magic" GroupLayout from NetBeans GUI designer)
|
||||
private UUID playerId;
|
||||
private UUID gameId;
|
||||
private PlayerView player;
|
||||
|
|
@ -48,19 +60,20 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
private static final String DEFAULT_AVATAR_PATH = "/avatars/" + DEFAULT_AVATAR_ID + ".jpg";
|
||||
|
||||
private static final int PANEL_WIDTH = 94;
|
||||
private static final int PANEL_HEIGHT = 290;
|
||||
private static final int PANEL_HEIGHT_SMALL = 238;
|
||||
private static final int PANEL_HEIGHT_EXTRA_FOR_ME = 25;
|
||||
private static final int MANA_LABEL_SIZE_HORIZONTAL = 20;
|
||||
private static final int PANEL_HEIGHT = 270; // full mode (with avatar image)
|
||||
private static final int PANEL_HEIGHT_SMALL = 238; // small mode (with avatar button) // TODO: no need in small mode after GUI scale added
|
||||
private static final int PANEL_HEIGHT_EXTRA_FOR_ME = 25; // hints button
|
||||
|
||||
private static final Border GREEN_BORDER = new LineBorder(Color.green, 3);
|
||||
private static final Border RED_BORDER = new LineBorder(Color.red, 2);
|
||||
private static final Border YELLOW_BORDER = new LineBorder(Color.yellow, 3);
|
||||
private static final Border EMPTY_BORDER = BorderFactory.createEmptyBorder(0, 0, 0, 0);
|
||||
private final Border GREEN_BORDER;
|
||||
private final Border RED_BORDER;
|
||||
private final Border YELLOW_BORDER;
|
||||
private final Border EMPTY_BORDER;
|
||||
|
||||
float guiScaleMod = 1.0f;
|
||||
|
||||
private final Color activeValueColor = new Color(244, 9, 47);
|
||||
private final Font fontValuesZero = this.getFont().deriveFont(Font.PLAIN);
|
||||
private final Font fontValuesNonZero = this.getFont().deriveFont(Font.BOLD);
|
||||
private final Font fontValuesZero;
|
||||
private final Font fontValuesNonZero;
|
||||
|
||||
private int avatarId = -1;
|
||||
private String flagName;
|
||||
|
|
@ -73,11 +86,33 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
* Creates new form PlayerPanel
|
||||
*/
|
||||
public PlayerPanelExt() {
|
||||
setPreferredSize(new Dimension(PANEL_WIDTH, PANEL_HEIGHT));
|
||||
this(1.0f);
|
||||
}
|
||||
|
||||
public PlayerPanelExt(float guiScaleMod) {
|
||||
// gui scale
|
||||
this.guiScaleMod = guiScaleMod;
|
||||
this.setFont(this.getFont().deriveFont(sizeMod(this.getFont().getSize2D())));
|
||||
this.fontValuesZero = this.getFont().deriveFont(Font.PLAIN);
|
||||
this.fontValuesNonZero = this.getFont().deriveFont(Font.BOLD);
|
||||
this.GREEN_BORDER = new LineBorder(Color.green, sizeMod(3));
|
||||
this.RED_BORDER = new LineBorder(Color.red, sizeMod(2));
|
||||
this.YELLOW_BORDER = new LineBorder(Color.yellow, sizeMod(3));
|
||||
this.EMPTY_BORDER = BorderFactory.createEmptyBorder(0, 0, 0, 0);
|
||||
|
||||
setPreferredSize(new Dimension(sizeMod(PANEL_WIDTH), sizeMod(PANEL_HEIGHT)));
|
||||
initComponents();
|
||||
setGUISize();
|
||||
}
|
||||
|
||||
private int sizeMod(int value) {
|
||||
return GUISizeHelper.guiSizeScale(value, this.guiScaleMod);
|
||||
}
|
||||
|
||||
private float sizeMod(float value) {
|
||||
return GUISizeHelper.guiSizeScale(value, this.guiScaleMod);
|
||||
}
|
||||
|
||||
public void init(UUID gameId, UUID playerId, boolean controlled, BigCard bigCard, int priorityTime) {
|
||||
this.gameId = gameId;
|
||||
this.playerId = playerId;
|
||||
|
|
@ -226,12 +261,12 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
|
||||
if (playerLife > 99) {
|
||||
Font font = lifeLabel.getFont();
|
||||
font = font.deriveFont(9f);
|
||||
font = font.deriveFont(sizeMod(9f));
|
||||
lifeLabel.setFont(font);
|
||||
changedFontLife = true;
|
||||
} else if (changedFontLife) {
|
||||
Font font = lifeLabel.getFont();
|
||||
font = font.deriveFont(12f);
|
||||
font = font.deriveFont(sizeMod(12f));
|
||||
lifeLabel.setFont(font);
|
||||
changedFontLife = false;
|
||||
}
|
||||
|
|
@ -244,12 +279,12 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
int libraryCards = player.getLibraryCount();
|
||||
if (libraryCards > 99) {
|
||||
Font font = libraryLabel.getFont();
|
||||
font = font.deriveFont(9f);
|
||||
font = font.deriveFont(sizeMod(9f));
|
||||
libraryLabel.setFont(font);
|
||||
changedFontLibrary = true;
|
||||
} else if (changedFontLibrary) {
|
||||
Font font = libraryLabel.getFont();
|
||||
font = font.deriveFont(12f);
|
||||
font = font.deriveFont(sizeMod(12f));
|
||||
libraryLabel.setFont(font);
|
||||
changedFontLibrary = false;
|
||||
}
|
||||
|
|
@ -259,13 +294,13 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
if (graveCards > 99) {
|
||||
if (!changedFontGrave) {
|
||||
Font font = graveLabel.getFont();
|
||||
font = font.deriveFont(9f);
|
||||
font = font.deriveFont(sizeMod(9f));
|
||||
graveLabel.setFont(font);
|
||||
changedFontGrave = true;
|
||||
}
|
||||
} else if (changedFontGrave) {
|
||||
Font font = lifeLabel.getFont();
|
||||
font = font.deriveFont(12f);
|
||||
font = font.deriveFont(sizeMod(12f));
|
||||
graveLabel.setFont(font);
|
||||
changedFontGrave = false;
|
||||
}
|
||||
|
|
@ -292,13 +327,13 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
if (exileCards > 99) {
|
||||
if (!changedFontExile) {
|
||||
Font font = exileLabel.getFont();
|
||||
font = font.deriveFont(9f);
|
||||
font = font.deriveFont(sizeMod(9f));
|
||||
exileLabel.setFont(font);
|
||||
changedFontExile = true;
|
||||
}
|
||||
} else if (changedFontExile) {
|
||||
Font font = lifeLabel.getFont();
|
||||
font = font.deriveFont(12f);
|
||||
font = font.deriveFont(sizeMod(12f));
|
||||
exileLabel.setFont(font);
|
||||
changedFontExile = false;
|
||||
}
|
||||
|
|
@ -319,7 +354,7 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
path = "/avatars/special/" + avatarId + ".gif";
|
||||
}
|
||||
Image image = ImageHelper.getImageFromResources(path);
|
||||
Rectangle r = new Rectangle(80, 80);
|
||||
Rectangle r = new Rectangle(sizeMod(80), sizeMod(80));
|
||||
BufferedImage resized = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(image, BufferedImage.TYPE_INT_ARGB), r);
|
||||
this.avatar.update(this.player.getName(), resized, resized, resized, resized, r);
|
||||
}
|
||||
|
|
@ -398,7 +433,8 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
if (flagName == null) { // do only once
|
||||
avatar.setText(this.player.getName());
|
||||
flagName = player.getUserData().getFlagName();
|
||||
this.avatar.setTopTextImage(CountryUtil.getCountryFlagIconSize(flagName, 11).getImage());
|
||||
String flagPath = "/flags/" + flagName + (flagName.endsWith(".png") ? "" : ".png");
|
||||
this.avatar.setTopTextImage(ImageHelper.getImageFromResourcesScaledToHeight(flagPath, sizeMod(11)));
|
||||
String countryName = CountryUtil.getCountryName(flagName);
|
||||
basicTooltipText = "<HTML>Name: " + player.getName()
|
||||
+ "<br/>Flag: " + (countryName == null ? "Unknown" : countryName)
|
||||
|
|
@ -414,16 +450,16 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
for (String name : player.getDesignationNames()) {
|
||||
tooltipText.append("<br/>").append(name);
|
||||
if (DesignationType.CITYS_BLESSING.toString().equals(name)) {
|
||||
this.avatar.addTopTextImageRight(ImageHelper.getImageFromResources("/info/city_blessing.png"));
|
||||
this.avatar.addTopTextImageRight(ImageHelper.getImageFromResourcesScaledToHeight("/info/city_blessing.png", sizeMod(11)));
|
||||
}
|
||||
}
|
||||
if (player.isMonarch()) {
|
||||
tooltipText.append("<br/>").append("The Monarch");
|
||||
this.avatar.addTopTextImageRight(ImageHelper.getImageFromResources("/info/crown.png"));
|
||||
this.avatar.addTopTextImageRight(ImageHelper.getImageFromResourcesScaledToHeight("/info/crown.png", sizeMod(11)));
|
||||
}
|
||||
if (player.isInitiative()) {
|
||||
tooltipText.append("<br/>").append("Have the Initiative");
|
||||
this.avatar.addTopTextImageRight(ImageHelper.getImageFromResources("/info/initiative.png"));
|
||||
this.avatar.addTopTextImageRight(ImageHelper.getImageFromResourcesScaledToHeight("/info/initiative.png", sizeMod(11)));
|
||||
}
|
||||
|
||||
// counters
|
||||
|
|
@ -491,8 +527,8 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
private void initComponents() {
|
||||
|
||||
panelBackground = new MageRoundPane();
|
||||
panelBackground.setPreferredSize(new Dimension(PANEL_WIDTH - 2, PANEL_HEIGHT));
|
||||
Rectangle r = new Rectangle(80, 80);
|
||||
panelBackground.setPreferredSize(new Dimension(sizeMod(PANEL_WIDTH - 2), sizeMod(PANEL_HEIGHT)));
|
||||
Rectangle r = new Rectangle(sizeMod(80), sizeMod(80));
|
||||
// avatarFlag = new JLabel();
|
||||
// monarchIcon = new JLabel();
|
||||
timerLabel = new JLabel();
|
||||
|
|
@ -507,30 +543,35 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
libraryLabel = new JLabel();
|
||||
setOpaque(false);
|
||||
|
||||
panelBackground.setXOffset(3);
|
||||
panelBackground.setYOffset(3);
|
||||
panelBackground.setXOffset(sizeMod(3));
|
||||
panelBackground.setYOffset(sizeMod(3));
|
||||
panelBackground.setVisible(true);
|
||||
|
||||
if (DebugUtil.GUI_GAME_DRAW_PLAYER_PANEL_BORDER) {
|
||||
setBorder(BorderFactory.createLineBorder(Color.green));
|
||||
panelBackground.setBorder(BorderFactory.createLineBorder(Color.yellow));
|
||||
}
|
||||
|
||||
// Avatar
|
||||
Image image = ImageHelper.getImageFromResources(DEFAULT_AVATAR_PATH);
|
||||
|
||||
BufferedImage resized = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(image, BufferedImage.TYPE_INT_ARGB), r);
|
||||
avatar = new HoverButton("", resized, resized, resized, r);
|
||||
avatar = new HoverButton("", resized, resized, resized, r, this.guiScaleMod);
|
||||
|
||||
String showPlayerNamePermanently = MageFrame.getPreferences().get(PreferencesDialog.KEY_SHOW_PLAYER_NAMES_PERMANENTLY, "true");
|
||||
if (showPlayerNamePermanently.equals("true")) {
|
||||
avatar.setTextAlwaysVisible(true);
|
||||
}
|
||||
avatar.setTextOffsetButtonY(10);
|
||||
avatar.setTextOffsetButtonY(sizeMod(10));
|
||||
avatar.setObserver(() -> SessionHandler.sendPlayerUUID(gameId, playerId));
|
||||
|
||||
// timer area /small layout)
|
||||
timerLabel.setToolTipText("Time left");
|
||||
timerLabel.setSize(80, 12);
|
||||
timerLabel.setSize(sizeMod(80), sizeMod(12));
|
||||
timerLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
|
||||
// life area
|
||||
r = new Rectangle(18, 18);
|
||||
r = new Rectangle(sizeMod(18), sizeMod(18));
|
||||
lifeLabel.setToolTipText("Life");
|
||||
lifeLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
Image imageLife = ImageHelper.getImageFromResources("/info/life.png");
|
||||
|
|
@ -540,7 +581,7 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
life.setOpaque(false);
|
||||
|
||||
// hand area
|
||||
r = new Rectangle(18, 18);
|
||||
r = new Rectangle(sizeMod(18), sizeMod(18));
|
||||
handLabel.setToolTipText("Hand");
|
||||
handLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
Image imageHand = ImageHelper.getImageFromResources("/info/hand.png");
|
||||
|
|
@ -550,7 +591,7 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
hand.setOpaque(false);
|
||||
|
||||
// Poison count
|
||||
r = new Rectangle(18, 18);
|
||||
r = new Rectangle(sizeMod(18), sizeMod(18));
|
||||
Image imagePoison = ImageHelper.getImageFromResources("/info/poison.png");
|
||||
BufferedImage resizedPoison = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(imagePoison, BufferedImage.TYPE_INT_ARGB), r);
|
||||
poison = new ImagePanel(resizedPoison, ImagePanelStyle.ACTUAL);
|
||||
|
|
@ -559,25 +600,25 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
poisonLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
|
||||
// Library
|
||||
r = new Rectangle(19, 19);
|
||||
r = new Rectangle(sizeMod(19), sizeMod(19));
|
||||
libraryLabel.setToolTipText("Library");
|
||||
libraryLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
Image imageLibrary = ImageHelper.getImageFromResources("/info/library.png");
|
||||
BufferedImage resizedLibrary = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(imageLibrary, BufferedImage.TYPE_INT_ARGB), r);
|
||||
|
||||
library = new HoverButton(null, resizedLibrary, resizedLibrary, resizedLibrary, r);
|
||||
library = new HoverButton(null, resizedLibrary, resizedLibrary, resizedLibrary, r, this.guiScaleMod);
|
||||
library.setToolTipText("Library");
|
||||
library.setOpaque(false);
|
||||
library.setObserver(() -> btnLibraryActionPerformed(null));
|
||||
|
||||
// Grave count and open graveyard button
|
||||
r = new Rectangle(21, 21);
|
||||
r = new Rectangle(sizeMod(21), sizeMod(21));
|
||||
graveLabel.setToolTipText("Card Types: 0");
|
||||
graveLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
Image imageGrave = ImageHelper.getImageFromResources("/info/grave.png");
|
||||
BufferedImage resizedGrave = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(imageGrave, BufferedImage.TYPE_INT_ARGB), r);
|
||||
|
||||
grave = new HoverButton(null, resizedGrave, resizedGrave, resizedGrave, r);
|
||||
grave = new HoverButton(null, resizedGrave, resizedGrave, resizedGrave, r, this.guiScaleMod);
|
||||
grave.setToolTipText("Graveyard");
|
||||
grave.setOpaque(false);
|
||||
grave.setObserver(() -> btnGraveActionPerformed(null));
|
||||
|
|
@ -586,16 +627,16 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
exileLabel.setToolTipText("Exile");
|
||||
exileLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
image = ImageHelper.getImageFromResources("/info/exile.png");
|
||||
r = new Rectangle(21, 21);
|
||||
r = new Rectangle(sizeMod(21), sizeMod(21));
|
||||
resized = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(image, BufferedImage.TYPE_INT_ARGB), r);
|
||||
exileZone = new HoverButton(null, resized, resized, resized, r);
|
||||
exileZone = new HoverButton(null, resized, resized, resized, r, this.guiScaleMod);
|
||||
exileZone.setToolTipText("Exile");
|
||||
exileZone.setOpaque(false);
|
||||
exileZone.setObserver(() -> btnExileZoneActionPerformed(null));
|
||||
exileZone.setBounds(25, 0, 21, 21);
|
||||
exileZone.setBounds(sizeMod(25), 0, sizeMod(21), sizeMod(21));
|
||||
|
||||
// Cheat button
|
||||
r = new Rectangle(25, 21);
|
||||
r = new Rectangle(sizeMod(25), sizeMod(21));
|
||||
image = ImageHelper.getImageFromResources("/info/cheat.png");
|
||||
resized = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(image, BufferedImage.TYPE_INT_ARGB), r);
|
||||
cheat = new JButton();
|
||||
|
|
@ -605,38 +646,39 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
|
||||
// tools button like hints
|
||||
toolHintsHelper = new JButton();
|
||||
toolHintsHelper.setFont(this.getFont());
|
||||
toolHintsHelper.setText("hints");
|
||||
toolHintsHelper.setToolTipText("Open new card hints helper window");
|
||||
toolHintsHelper.addActionListener(e -> btnToolHintsHelperActionPerformed(e));
|
||||
|
||||
zonesPanel = new JPanel();
|
||||
zonesPanel.setPreferredSize(new Dimension(100, 60));
|
||||
zonesPanel.setSize(100, 60);
|
||||
zonesPanel.setPreferredSize(new Dimension(sizeMod(100), sizeMod(60)));
|
||||
zonesPanel.setSize(sizeMod(100), sizeMod(60));
|
||||
zonesPanel.setLayout(null);
|
||||
zonesPanel.setOpaque(false);
|
||||
|
||||
image = ImageHelper.getImageFromResources("/info/command_zone.png");
|
||||
r = new Rectangle(21, 21);
|
||||
r = new Rectangle(sizeMod(21), sizeMod(21));
|
||||
resized = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(image, BufferedImage.TYPE_INT_ARGB), r);
|
||||
commandZone = new HoverButton(null, resized, resized, resized, r);
|
||||
commandZone = new HoverButton(null, resized, resized, resized, r, this.guiScaleMod);
|
||||
commandZone.setToolTipText("Command Zone (Commanders, Emblems and Planes)");
|
||||
commandZone.setOpaque(false);
|
||||
commandZone.setObserver(() -> btnCommandZoneActionPerformed(null));
|
||||
commandZone.setBounds(3, 0, 21, 21);
|
||||
commandZone.setBounds(sizeMod(3), 0, sizeMod(21), sizeMod(21));
|
||||
zonesPanel.add(commandZone);
|
||||
|
||||
commandLabel.setToolTipText("Command zone");
|
||||
commandLabel.setBounds(25, 0, 21, 21);
|
||||
commandLabel.setBounds(sizeMod(25), 0, sizeMod(21), sizeMod(21));
|
||||
zonesPanel.add(commandLabel);
|
||||
|
||||
cheat.setBounds(40, 2, 25, 21);
|
||||
cheat.setBounds(sizeMod(40), sizeMod(2), sizeMod(25), sizeMod(21));
|
||||
zonesPanel.add(cheat);
|
||||
|
||||
toolHintsHelper.setBounds(3, 2 + 21 + 2, 73, 21);
|
||||
toolHintsHelper.setBounds(sizeMod(3), sizeMod(2 + 21 + 2), sizeMod(73), sizeMod(21));
|
||||
zonesPanel.add(toolHintsHelper);
|
||||
|
||||
// Energy count
|
||||
r = new Rectangle(18, 18);
|
||||
r = new Rectangle(sizeMod(18), sizeMod(18));
|
||||
Image imageEnergy = ImageHelper.getImageFromResources("/info/energy.png");
|
||||
BufferedImage resizedEnergy = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(imageEnergy, BufferedImage.TYPE_INT_ARGB), r);
|
||||
energy = new ImagePanel(resizedEnergy, ImagePanelStyle.ACTUAL);
|
||||
|
|
@ -646,7 +688,7 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
energyLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
|
||||
// Experience count
|
||||
r = new Rectangle(18, 18);
|
||||
r = new Rectangle(sizeMod(18), sizeMod(18));
|
||||
Image imageExperience = ImageHelper.getImageFromResources("/info/experience.png");
|
||||
BufferedImage resizedExperience = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(imageExperience, BufferedImage.TYPE_INT_ARGB), r);
|
||||
experience = new ImagePanel(resizedExperience, ImagePanelStyle.ACTUAL);
|
||||
|
|
@ -656,7 +698,7 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
experienceLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
|
||||
// Rad count
|
||||
r = new Rectangle(16, 16);
|
||||
r = new Rectangle(sizeMod(16), sizeMod(16));
|
||||
Image imageRad = ImageHelper.getImageFromResources("/info/rad.png");
|
||||
BufferedImage resizedRad = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(imageRad, BufferedImage.TYPE_INT_ARGB), r);
|
||||
rad = new ImagePanel(resizedRad, ImagePanelStyle.ACTUAL);
|
||||
|
|
@ -666,10 +708,11 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
radLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
|
||||
btnPlayer = new JButton();
|
||||
btnPlayer.setFont(this.getFont());
|
||||
btnPlayer.setText("Player");
|
||||
btnPlayer.setVisible(false);
|
||||
btnPlayer.setToolTipText("Player");
|
||||
btnPlayer.setPreferredSize(new Dimension(20, 40));
|
||||
btnPlayer.setPreferredSize(new Dimension(sizeMod(20), sizeMod(40)));
|
||||
btnPlayer.addActionListener(e -> SessionHandler.sendPlayerUUID(gameId, playerId));
|
||||
|
||||
// Add mana symbols
|
||||
|
|
@ -688,7 +731,7 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
JLabel manaCountLabelW = new JLabel();
|
||||
manaCountLabelW.setToolTipText("White mana");
|
||||
setTextForLabel(manaCountLabelW, 0, false);
|
||||
manaCountLabelW.setIcon(new ImageIcon(ManaSymbols.getSizedManaSymbol("W", 15)));
|
||||
manaCountLabelW.setIcon(new ImageIcon(ManaSymbols.getSizedManaSymbol("W", sizeMod(15))));
|
||||
manaCountLabelW.addMouseListener(manaMouseAdapter);
|
||||
manaLabels.put(manaCountLabelW, ManaType.WHITE);l
|
||||
//*/
|
||||
|
|
@ -696,9 +739,9 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
JLabel manaCountLabelW = new JLabel();
|
||||
manaCountLabelW.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
manaLabels.put(manaCountLabelW, ManaType.WHITE);
|
||||
r = new Rectangle(15, 15);
|
||||
BufferedImage imageManaW = ManaSymbols.getSizedManaSymbol("W", 15);
|
||||
HoverButton btnWhiteMana = new HoverButton(null, imageManaW, imageManaW, imageManaW, r);
|
||||
r = new Rectangle(sizeMod(15), sizeMod(15));
|
||||
BufferedImage imageManaW = ManaSymbols.getSizedManaSymbol("W", sizeMod(15));
|
||||
HoverButton btnWhiteMana = new HoverButton(null, imageManaW, imageManaW, imageManaW, r, this.guiScaleMod);
|
||||
btnWhiteMana.setOpaque(false);
|
||||
btnWhiteMana.setObserver(() -> btnManaActionPerformed(ManaType.WHITE));
|
||||
manaButtons.put(manaCountLabelW, btnWhiteMana);
|
||||
|
|
@ -708,9 +751,9 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
JLabel manaCountLabelU = new JLabel();
|
||||
manaLabels.put(manaCountLabelU, ManaType.BLUE);
|
||||
manaCountLabelU.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
r = new Rectangle(15, 15);
|
||||
BufferedImage imageManaU = ManaSymbols.getSizedManaSymbol("U", 15);
|
||||
HoverButton btnBlueMana = new HoverButton(null, imageManaU, imageManaU, imageManaU, r);
|
||||
r = new Rectangle(sizeMod(15), sizeMod(15));
|
||||
BufferedImage imageManaU = ManaSymbols.getSizedManaSymbol("U", sizeMod(15));
|
||||
HoverButton btnBlueMana = new HoverButton(null, imageManaU, imageManaU, imageManaU, r, this.guiScaleMod);
|
||||
btnBlueMana.setOpaque(false);
|
||||
btnBlueMana.setObserver(() -> btnManaActionPerformed(ManaType.BLUE));
|
||||
manaButtons.put(manaCountLabelU, btnBlueMana);
|
||||
|
|
@ -719,9 +762,9 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
JLabel manaCountLabelB = new JLabel();
|
||||
manaLabels.put(manaCountLabelB, ManaType.BLACK);
|
||||
manaCountLabelB.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
r = new Rectangle(15, 15);
|
||||
BufferedImage imageManaB = ManaSymbols.getSizedManaSymbol("B", 15);
|
||||
HoverButton btnBlackMana = new HoverButton(null, imageManaB, imageManaB, imageManaB, r);
|
||||
r = new Rectangle(sizeMod(15), sizeMod(15));
|
||||
BufferedImage imageManaB = ManaSymbols.getSizedManaSymbol("B", sizeMod(15));
|
||||
HoverButton btnBlackMana = new HoverButton(null, imageManaB, imageManaB, imageManaB, r, this.guiScaleMod);
|
||||
btnBlackMana.setOpaque(false);
|
||||
btnBlackMana.setObserver(() -> btnManaActionPerformed(ManaType.BLACK));
|
||||
manaButtons.put(manaCountLabelB, btnBlackMana);
|
||||
|
|
@ -730,9 +773,9 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
JLabel manaCountLabelR = new JLabel();
|
||||
manaLabels.put(manaCountLabelR, ManaType.RED);
|
||||
manaCountLabelR.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
r = new Rectangle(15, 15);
|
||||
BufferedImage imageManaR = ManaSymbols.getSizedManaSymbol("R", 15);
|
||||
HoverButton btnRedMana = new HoverButton(null, imageManaR, imageManaR, imageManaR, r);
|
||||
r = new Rectangle(sizeMod(15), sizeMod(15));
|
||||
BufferedImage imageManaR = ManaSymbols.getSizedManaSymbol("R", sizeMod(15));
|
||||
HoverButton btnRedMana = new HoverButton(null, imageManaR, imageManaR, imageManaR, r, this.guiScaleMod);
|
||||
btnRedMana.setOpaque(false);
|
||||
btnRedMana.setObserver(() -> btnManaActionPerformed(ManaType.RED));
|
||||
manaButtons.put(manaCountLabelR, btnRedMana);
|
||||
|
|
@ -741,9 +784,9 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
JLabel manaCountLabelG = new JLabel();
|
||||
manaLabels.put(manaCountLabelG, ManaType.GREEN);
|
||||
manaCountLabelG.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
r = new Rectangle(15, 15);
|
||||
BufferedImage imageManaG = ManaSymbols.getSizedManaSymbol("G", 15);
|
||||
HoverButton btnGreenMana = new HoverButton(null, imageManaG, imageManaG, imageManaG, r);
|
||||
r = new Rectangle(sizeMod(15), sizeMod(15));
|
||||
BufferedImage imageManaG = ManaSymbols.getSizedManaSymbol("G", sizeMod(15));
|
||||
HoverButton btnGreenMana = new HoverButton(null, imageManaG, imageManaG, imageManaG, r, this.guiScaleMod);
|
||||
btnGreenMana.setOpaque(false);
|
||||
btnGreenMana.setObserver(() -> btnManaActionPerformed(ManaType.GREEN));
|
||||
manaButtons.put(manaCountLabelG, btnGreenMana);
|
||||
|
|
@ -752,9 +795,9 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
JLabel manaCountLabelX = new JLabel();
|
||||
manaLabels.put(manaCountLabelX, ManaType.COLORLESS);
|
||||
manaCountLabelX.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
r = new Rectangle(15, 15);
|
||||
BufferedImage imageManaX = ManaSymbols.getSizedManaSymbol("C", 15);
|
||||
HoverButton btnColorlessMana = new HoverButton(null, imageManaX, imageManaX, imageManaX, r);
|
||||
r = new Rectangle(sizeMod(15), sizeMod(15));
|
||||
BufferedImage imageManaX = ManaSymbols.getSizedManaSymbol("C", sizeMod(15));
|
||||
HoverButton btnColorlessMana = new HoverButton(null, imageManaX, imageManaX, imageManaX, r, this.guiScaleMod);
|
||||
btnColorlessMana.setOpaque(false);
|
||||
btnColorlessMana.setObserver(() -> btnManaActionPerformed(ManaType.COLORLESS));
|
||||
manaButtons.put(manaCountLabelX, btnColorlessMana);
|
||||
|
|
@ -764,158 +807,158 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
gl_panelBackground.setHorizontalGroup(
|
||||
gl_panelBackground.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addGap(7)
|
||||
.addGap(sizeMod(7))
|
||||
.addGroup(gl_panelBackground.createParallelGroup(Alignment.LEADING)
|
||||
.addComponent(btnPlayer, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(timerLabel, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(avatar, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE))
|
||||
.addGap(6))
|
||||
.addComponent(avatar, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, sizeMod(80), Short.MAX_VALUE))
|
||||
.addGap(sizeMod(6)))
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addGap(9)
|
||||
.addGap(sizeMod(9))
|
||||
// The left column of icon+label
|
||||
.addGroup(gl_panelBackground.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addComponent(life, GroupLayout.PREFERRED_SIZE, 18, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(lifeLabel, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(life, GroupLayout.PREFERRED_SIZE, sizeMod(18), GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(lifeLabel, GroupLayout.PREFERRED_SIZE, sizeMod(20), GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addComponent(poison, GroupLayout.PREFERRED_SIZE, 18, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(poisonLabel, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(poison, GroupLayout.PREFERRED_SIZE, sizeMod(18), GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(poisonLabel, GroupLayout.PREFERRED_SIZE, sizeMod(20), GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addComponent(energy, GroupLayout.PREFERRED_SIZE, 18, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(energyLabel, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(energy, GroupLayout.PREFERRED_SIZE, sizeMod(18), GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(energyLabel, GroupLayout.PREFERRED_SIZE, sizeMod(20), GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addComponent(rad, GroupLayout.PREFERRED_SIZE, 18, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(radLabel, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(rad, GroupLayout.PREFERRED_SIZE, sizeMod(18), GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(radLabel, GroupLayout.PREFERRED_SIZE, sizeMod(20), GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addGap(2)
|
||||
.addComponent(btnWhiteMana, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(manaCountLabelW, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(sizeMod(2))
|
||||
.addComponent(btnWhiteMana, GroupLayout.PREFERRED_SIZE, sizeMod(15), GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(manaCountLabelW, GroupLayout.PREFERRED_SIZE, sizeMod(20), GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addGap(2)
|
||||
.addComponent(btnBlueMana, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(manaCountLabelU, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(sizeMod(2))
|
||||
.addComponent(btnBlueMana, GroupLayout.PREFERRED_SIZE, sizeMod(15), GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(manaCountLabelU, GroupLayout.PREFERRED_SIZE, sizeMod(20), GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addGap(2)
|
||||
.addComponent(btnBlackMana, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(manaCountLabelB, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(sizeMod(2))
|
||||
.addComponent(btnBlackMana, GroupLayout.PREFERRED_SIZE, sizeMod(15), GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(manaCountLabelB, GroupLayout.PREFERRED_SIZE, sizeMod(20), GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addComponent(grave, GroupLayout.PREFERRED_SIZE, 18, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(graveLabel, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)))
|
||||
.addComponent(grave, GroupLayout.PREFERRED_SIZE, sizeMod(18), GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(graveLabel, GroupLayout.PREFERRED_SIZE, sizeMod(20), GroupLayout.PREFERRED_SIZE)))
|
||||
// The right column of icon+label
|
||||
.addGroup(gl_panelBackground.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addComponent(hand, GroupLayout.PREFERRED_SIZE, 18, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(handLabel, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(hand, GroupLayout.PREFERRED_SIZE, sizeMod(18), GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(handLabel, GroupLayout.PREFERRED_SIZE, sizeMod(20), GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addComponent(library, GroupLayout.PREFERRED_SIZE, 18, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(libraryLabel, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(library, GroupLayout.PREFERRED_SIZE, sizeMod(18), GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(libraryLabel, GroupLayout.PREFERRED_SIZE, sizeMod(20), GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addComponent(experience, GroupLayout.PREFERRED_SIZE, 18, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(experienceLabel, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(experience, GroupLayout.PREFERRED_SIZE, sizeMod(18), GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(experienceLabel, GroupLayout.PREFERRED_SIZE, sizeMod(20), GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addGap(2)
|
||||
.addComponent(btnRedMana, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(manaCountLabelR, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(sizeMod(2))
|
||||
.addComponent(btnRedMana, GroupLayout.PREFERRED_SIZE, sizeMod(15), GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(manaCountLabelR, GroupLayout.PREFERRED_SIZE, sizeMod(20), GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addGap(2)
|
||||
.addComponent(btnGreenMana, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(manaCountLabelG, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(sizeMod(2))
|
||||
.addComponent(btnGreenMana, GroupLayout.PREFERRED_SIZE, sizeMod(15), GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(manaCountLabelG, GroupLayout.PREFERRED_SIZE, sizeMod(20), GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addGap(2)
|
||||
.addComponent(btnColorlessMana, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(manaCountLabelX, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(sizeMod(2))
|
||||
.addComponent(btnColorlessMana, GroupLayout.PREFERRED_SIZE, sizeMod(15), GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(manaCountLabelX, GroupLayout.PREFERRED_SIZE, sizeMod(20), GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addComponent(exileZone, GroupLayout.PREFERRED_SIZE, 18, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(exileLabel, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)))
|
||||
.addGap(4))
|
||||
.addComponent(exileZone, GroupLayout.PREFERRED_SIZE, sizeMod(18), GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(exileLabel, GroupLayout.PREFERRED_SIZE, sizeMod(20), GroupLayout.PREFERRED_SIZE)))
|
||||
.addGap(sizeMod(4)))
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addGap(6)
|
||||
.addGap(sizeMod(6))
|
||||
.addComponent(zonesPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(6)));
|
||||
.addGap(sizeMod(6))));
|
||||
gl_panelBackground.setVerticalGroup(
|
||||
gl_panelBackground.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addGap(6)
|
||||
.addComponent(avatar, GroupLayout.PREFERRED_SIZE, 80, GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(sizeMod(6))
|
||||
.addComponent(avatar, GroupLayout.PREFERRED_SIZE, sizeMod(80), GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(ComponentPlacement.RELATED)
|
||||
.addComponent(btnPlayer, GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(btnPlayer, GroupLayout.PREFERRED_SIZE, sizeMod(30), GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(timerLabel)
|
||||
.addGap(2)
|
||||
.addGap(sizeMod(2))
|
||||
// Life & Hand
|
||||
.addGroup(gl_panelBackground.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addGap(1)
|
||||
.addComponent(life, GroupLayout.PREFERRED_SIZE, 18, GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(lifeLabel, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(sizeMod(1))
|
||||
.addComponent(life, GroupLayout.PREFERRED_SIZE, sizeMod(18), GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(lifeLabel, GroupLayout.PREFERRED_SIZE, sizeMod(20), GroupLayout.PREFERRED_SIZE)
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addGap(1)
|
||||
.addComponent(hand, GroupLayout.PREFERRED_SIZE, 18, GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(handLabel, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(sizeMod(1))
|
||||
.addComponent(hand, GroupLayout.PREFERRED_SIZE, sizeMod(18), GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(handLabel, GroupLayout.PREFERRED_SIZE, sizeMod(20), GroupLayout.PREFERRED_SIZE))
|
||||
// Poison & Library
|
||||
.addGroup(gl_panelBackground.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addGap(1)
|
||||
.addComponent(poison, GroupLayout.PREFERRED_SIZE, 18, GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(poisonLabel, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(sizeMod(1))
|
||||
.addComponent(poison, GroupLayout.PREFERRED_SIZE, sizeMod(18), GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(poisonLabel, GroupLayout.PREFERRED_SIZE, sizeMod(20), GroupLayout.PREFERRED_SIZE)
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addGap(1)
|
||||
.addComponent(library, GroupLayout.PREFERRED_SIZE, 18, GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(libraryLabel, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(sizeMod(1))
|
||||
.addComponent(library, GroupLayout.PREFERRED_SIZE, sizeMod(18), GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(libraryLabel, GroupLayout.PREFERRED_SIZE, sizeMod(20), GroupLayout.PREFERRED_SIZE))
|
||||
// Energy & Experience
|
||||
.addGroup(gl_panelBackground.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addGap(1)
|
||||
.addComponent(energy, GroupLayout.PREFERRED_SIZE, 18, GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(energyLabel, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(sizeMod(1))
|
||||
.addComponent(energy, GroupLayout.PREFERRED_SIZE, sizeMod(18), GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(energyLabel, GroupLayout.PREFERRED_SIZE, sizeMod(20), GroupLayout.PREFERRED_SIZE)
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addGap(1)
|
||||
.addComponent(experience, GroupLayout.PREFERRED_SIZE, 18, GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(experienceLabel, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(sizeMod(1))
|
||||
.addComponent(experience, GroupLayout.PREFERRED_SIZE, sizeMod(18), GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(experienceLabel, GroupLayout.PREFERRED_SIZE, sizeMod(20), GroupLayout.PREFERRED_SIZE))
|
||||
// Rad & <empty>
|
||||
.addGroup(gl_panelBackground.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addGap(1)
|
||||
.addComponent(rad, GroupLayout.PREFERRED_SIZE, 18, GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(radLabel, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(sizeMod(1))
|
||||
.addComponent(rad, GroupLayout.PREFERRED_SIZE, sizeMod(18), GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(radLabel, GroupLayout.PREFERRED_SIZE, sizeMod(20), GroupLayout.PREFERRED_SIZE))
|
||||
// W & R
|
||||
.addGroup(gl_panelBackground.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addGap(1)
|
||||
.addComponent(btnWhiteMana, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(manaCountLabelW, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(sizeMod(1))
|
||||
.addComponent(btnWhiteMana, GroupLayout.PREFERRED_SIZE, sizeMod(15), GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(manaCountLabelW, GroupLayout.PREFERRED_SIZE, sizeMod(17), GroupLayout.PREFERRED_SIZE)
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addGap(1)
|
||||
.addComponent(btnRedMana, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(manaCountLabelR, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(sizeMod(1))
|
||||
.addComponent(btnRedMana, GroupLayout.PREFERRED_SIZE, sizeMod(15), GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(manaCountLabelR, GroupLayout.PREFERRED_SIZE, sizeMod(17), GroupLayout.PREFERRED_SIZE))
|
||||
// U & G
|
||||
.addGroup(gl_panelBackground.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addGap(1)
|
||||
.addComponent(btnBlueMana, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(manaCountLabelU, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(sizeMod(1))
|
||||
.addComponent(btnBlueMana, GroupLayout.PREFERRED_SIZE, sizeMod(15), GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(manaCountLabelU, GroupLayout.PREFERRED_SIZE, sizeMod(17), GroupLayout.PREFERRED_SIZE)
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addGap(1)
|
||||
.addComponent(btnGreenMana, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(manaCountLabelG, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(sizeMod(1))
|
||||
.addComponent(btnGreenMana, GroupLayout.PREFERRED_SIZE, sizeMod(15), GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(manaCountLabelG, GroupLayout.PREFERRED_SIZE, sizeMod(17), GroupLayout.PREFERRED_SIZE))
|
||||
// B & X
|
||||
.addGroup(gl_panelBackground.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addGap(1)
|
||||
.addComponent(btnBlackMana, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(manaCountLabelB, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(sizeMod(1))
|
||||
.addComponent(btnBlackMana, GroupLayout.PREFERRED_SIZE, sizeMod(15), GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(manaCountLabelB, GroupLayout.PREFERRED_SIZE, sizeMod(17), GroupLayout.PREFERRED_SIZE)
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addGap(1)
|
||||
.addComponent(btnColorlessMana, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(manaCountLabelX, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(sizeMod(1))
|
||||
.addComponent(btnColorlessMana, GroupLayout.PREFERRED_SIZE, sizeMod(15), GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(manaCountLabelX, GroupLayout.PREFERRED_SIZE, sizeMod(17), GroupLayout.PREFERRED_SIZE))
|
||||
// grave & exile
|
||||
.addGroup(gl_panelBackground.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addComponent(grave, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(graveLabel, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(grave, GroupLayout.PREFERRED_SIZE, sizeMod(20), GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(graveLabel, GroupLayout.PREFERRED_SIZE, sizeMod(20), GroupLayout.PREFERRED_SIZE)
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addComponent(exileZone, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(exileLabel, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(2)
|
||||
.addComponent(exileZone, GroupLayout.PREFERRED_SIZE, sizeMod(20), GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(exileLabel, GroupLayout.PREFERRED_SIZE, sizeMod(20), GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(sizeMod(2))
|
||||
.addComponent(zonesPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)));
|
||||
panelBackground.setLayout(gl_panelBackground);
|
||||
GroupLayout groupLayout = new GroupLayout(this);
|
||||
|
|
@ -939,14 +982,14 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
avatar.setVisible(false);
|
||||
btnPlayer.setVisible(true);
|
||||
timerLabel.setVisible(true);
|
||||
panelBackground.setPreferredSize(new Dimension(PANEL_WIDTH - 2, PANEL_HEIGHT_SMALL + extraForMe));
|
||||
panelBackground.setBounds(0, 0, PANEL_WIDTH - 2, PANEL_HEIGHT_SMALL + extraForMe);
|
||||
panelBackground.setPreferredSize(new Dimension(sizeMod(PANEL_WIDTH - 2), sizeMod(PANEL_HEIGHT_SMALL + extraForMe)));
|
||||
panelBackground.setBounds(0, 0, sizeMod(PANEL_WIDTH - 2), sizeMod(PANEL_HEIGHT_SMALL + extraForMe));
|
||||
} else {
|
||||
avatar.setVisible(true);
|
||||
btnPlayer.setVisible(false);
|
||||
timerLabel.setVisible(false);
|
||||
panelBackground.setPreferredSize(new Dimension(PANEL_WIDTH - 2, PANEL_HEIGHT + extraForMe));
|
||||
panelBackground.setBounds(0, 0, PANEL_WIDTH - 2, PANEL_HEIGHT + extraForMe);
|
||||
panelBackground.setPreferredSize(new Dimension(sizeMod(PANEL_WIDTH - 2), sizeMod(PANEL_HEIGHT + extraForMe)));
|
||||
panelBackground.setBounds(0, 0, sizeMod(PANEL_WIDTH - 2), sizeMod(PANEL_HEIGHT + extraForMe));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue