Search in sources :

Example 1 with ImagePanel

use of mage.components.ImagePanel in project mage by magefree.

the class ThemePluginImpl method applyInGame.

@Override
public void applyInGame(Map<String, JComponent> ui) {
    BufferedImage backgroundImage;
    try {
        if (PreferencesDialog.getCachedValue(PreferencesDialog.KEY_BATTLEFIELD_IMAGE_DEFAULT, "true").equals("true")) {
            backgroundImage = loadbuffer_default();
        } else if (PreferencesDialog.getCachedValue(PreferencesDialog.KEY_BATTLEFIELD_IMAGE_RANDOM, "true").equals("true")) {
            backgroundImage = loadbuffer_random();
        } else if (PreferencesDialog.getCachedValue(PreferencesDialog.KEY_BATTLEFIELD_IMAGE, "") != null) {
            backgroundImage = loadbuffer_selected();
        } else {
            backgroundImage = loadbuffer_default();
        }
        if (backgroundImage == null) {
            backgroundImage = loadbuffer_default();
        }
        if (backgroundImage == null) {
            throw new FileNotFoundException("Couldn't find in resources.");
        }
        if (ui.containsKey("gamePanel") && ui.containsKey("jLayeredPane")) {
            ImagePanel bgPanel = new ImagePanel(backgroundImage, ImagePanelStyle.TILED);
            unsetOpaque(ui.get("jSplitPane1"));
            unsetOpaque(ui.get("pnlBattlefield"));
            unsetOpaque(ui.get("pnlHelperHandButtonsStackArea"));
            unsetOpaque(ui.get("hand"));
            unsetOpaque(ui.get("gameChatPanel"));
            unsetOpaque(ui.get("userChatPanel"));
            ui.get("gamePanel").remove(ui.get("jLayeredPane"));
            bgPanel.add(ui.get("jLayeredPane"));
            ui.get("gamePanel").add(bgPanel);
        } else {
            log.error("error: no components");
        }
    } catch (Exception e) {
        log.error(e.getMessage(), e);
    }
}
Also used : BufferedImage(java.awt.image.BufferedImage) ImagePanel(mage.components.ImagePanel)

Example 2 with ImagePanel

use of mage.components.ImagePanel in project mage by magefree.

the class ThemePluginImpl method updateTable.

public JComponent updateTable(Map<String, JComponent> ui) {
    ImagePanel bgPanel = createImagePanelInstance();
    unsetOpaque(ui.get("jScrollPane1"));
    unsetOpaque(ui.get("jPanel1"));
    unsetOpaque(ui.get("tablesPanel"));
    JComponent viewport = ui.get("jScrollPane1ViewPort");
    if (viewport != null) {
        viewport.setBackground(new Color(255, 255, 255, 50));
    }
    return bgPanel;
}
Also used : ImagePanel(mage.components.ImagePanel)

Example 3 with ImagePanel

use of mage.components.ImagePanel in project mage by magefree.

the class MageBook method getImagePanel.

private ImagePanel getImagePanel(String filename, ImagePanelStyle type) {
    try {
        InputStream is = this.getClass().getResourceAsStream(filename);
        if (is == null) {
            throw new FileNotFoundException("Couldn't find " + filename + " in resources.");
        }
        BufferedImage background = ImageIO.read(is);
        if (background == null) {
            throw new FileNotFoundException("Couldn't find " + filename + " in resources.");
        }
        return new ImagePanel(background, type);
    } catch (Exception e) {
        log.error(e.getMessage(), e);
        return null;
    }
}
Also used : InputStream(java.io.InputStream) FileNotFoundException(java.io.FileNotFoundException) BufferedImage(java.awt.image.BufferedImage) FileNotFoundException(java.io.FileNotFoundException) InvocationTargetException(java.lang.reflect.InvocationTargetException) ImagePanel(mage.components.ImagePanel)

Example 4 with ImagePanel

use of mage.components.ImagePanel in project mage by magefree.

the class MagePaneMenuItem method setBackground.

// Sets background for login screen
private void setBackground() {
    if (liteMode || grayMode) {
        return;
    }
    try {
        // If user has custom background, use that, otherwise, use theme background
        if (Plugins.instance.isThemePluginLoaded() && !PreferencesDialog.getCachedValue(PreferencesDialog.KEY_BACKGROUND_IMAGE_DEFAULT, "true").equals("true")) {
            backgroundPane = (ImagePanel) Plugins.instance.updateTablePanel(new HashMap<>());
        } else {
            InputStream is = this.getClass().getResourceAsStream(PreferencesDialog.getCurrentTheme().getLoginBackgroundPath());
            BufferedImage background = ImageIO.read(is);
            backgroundPane = new ImagePanel(background, ImagePanelStyle.SCALED);
        }
        backgroundPane.setSize(1024, 768);
        desktopPane.add(backgroundPane, JLayeredPane.DEFAULT_LAYER);
    } catch (IOException e) {
        LOGGER.fatal("Error while setting background.", e);
    }
}
Also used : InputStream(java.io.InputStream) IOException(java.io.IOException) BufferedImage(java.awt.image.BufferedImage) ImagePanel(mage.components.ImagePanel)

Example 5 with ImagePanel

use of mage.components.ImagePanel in project mage by magefree.

the class PlayerPanelExt 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() {
    panelBackground = new MageRoundPane();
    panelBackground.setPreferredSize(new Dimension(PANEL_WIDTH - 2, PANEL_HEIGHT));
    Rectangle r = new Rectangle(80, 80);
    // avatarFlag = new JLabel();
    // monarchIcon = new JLabel();
    timerLabel = new JLabel();
    lifeLabel = new JLabel();
    handLabel = new JLabel();
    poisonLabel = new JLabel();
    energyLabel = new JLabel();
    experienceLabel = new JLabel();
    graveLabel = new JLabel();
    commandLabel = new JLabel();
    libraryLabel = new JLabel();
    setOpaque(false);
    panelBackground.setXOffset(3);
    panelBackground.setYOffset(3);
    panelBackground.setVisible(true);
    // 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);
    String showPlayerNamePermanently = MageFrame.getPreferences().get(PreferencesDialog.KEY_SHOW_PLAYER_NAMES_PERMANENTLY, "true");
    if (showPlayerNamePermanently.equals("true")) {
        avatar.setTextAlwaysVisible(true);
    }
    avatar.setTextOffsetButtonY(10);
    avatar.setObserver(() -> SessionHandler.sendPlayerUUID(gameId, playerId));
    // timer area /small layout)
    timerLabel.setToolTipText("Time left");
    timerLabel.setSize(80, 12);
    timerLabel.setHorizontalAlignment(SwingConstants.CENTER);
    // life area
    r = new Rectangle(18, 18);
    lifeLabel.setToolTipText("Life");
    Image imageLife = ImageHelper.getImageFromResources("/info/life.png");
    BufferedImage resizedLife = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(imageLife, BufferedImage.TYPE_INT_ARGB), r);
    life = new ImagePanel(resizedLife, ImagePanelStyle.ACTUAL);
    life.setToolTipText("Life");
    life.setOpaque(false);
    // hand area
    r = new Rectangle(18, 18);
    handLabel.setToolTipText("Hand");
    Image imageHand = ImageHelper.getImageFromResources("/info/hand.png");
    BufferedImage resizedHand = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(imageHand, BufferedImage.TYPE_INT_ARGB), r);
    hand = new ImagePanel(resizedHand, ImagePanelStyle.ACTUAL);
    hand.setToolTipText("Hand");
    hand.setOpaque(false);
    // Poison count
    r = new Rectangle(18, 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);
    poison.setOpaque(false);
    setTextForLabel("poison", poisonLabel, poison, 0, false);
    // Library
    r = new Rectangle(19, 19);
    libraryLabel.setToolTipText("Library");
    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.setToolTipText("Library");
    library.setOpaque(false);
    library.setObserver(() -> btnLibraryActionPerformed(null));
    // Grave count and open graveyard button
    r = new Rectangle(21, 21);
    graveLabel.setToolTipText("Card Types: 0");
    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.setToolTipText("Graveyard");
    grave.setOpaque(false);
    grave.setObserver(() -> btnGraveActionPerformed(null));
    exileLabel = new JLabel();
    exileLabel.setToolTipText("Exile");
    image = ImageHelper.getImageFromResources("/info/exile.png");
    r = new Rectangle(21, 21);
    resized = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(image, BufferedImage.TYPE_INT_ARGB), r);
    exileZone = new HoverButton(null, resized, resized, resized, r);
    exileZone.setToolTipText("Exile");
    exileZone.setOpaque(false);
    exileZone.setObserver(() -> btnExileZoneActionPerformed(null));
    exileZone.setBounds(25, 0, 21, 21);
    // Cheat button
    r = new Rectangle(25, 21);
    image = ImageHelper.getImageFromResources("/info/cheat.png");
    resized = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(image, BufferedImage.TYPE_INT_ARGB), r);
    cheat = new JButton();
    cheat.setIcon(new ImageIcon(resized));
    cheat.setToolTipText("Cheat button");
    cheat.addActionListener(e -> btnCheatActionPerformed(e));
    zonesPanel = new JPanel();
    zonesPanel.setPreferredSize(new Dimension(100, 60));
    zonesPanel.setSize(100, 60);
    zonesPanel.setLayout(null);
    zonesPanel.setOpaque(false);
    image = ImageHelper.getImageFromResources("/info/command_zone.png");
    r = new Rectangle(21, 21);
    resized = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(image, BufferedImage.TYPE_INT_ARGB), r);
    commandZone = new HoverButton(null, resized, resized, resized, r);
    commandZone.setToolTipText("Command Zone (Commanders, Emblems and Planes)");
    commandZone.setOpaque(false);
    commandZone.setObserver(() -> btnCommandZoneActionPerformed(null));
    commandZone.setBounds(3, 0, 21, 21);
    zonesPanel.add(commandZone);
    commandLabel.setToolTipText("Command zone");
    commandLabel.setBounds(25, 0, 21, 21);
    zonesPanel.add(commandLabel);
    cheat.setBounds(40, 2, 25, 21);
    zonesPanel.add(cheat);
    energyExperiencePanel = new JPanel();
    energyExperiencePanel.setPreferredSize(new Dimension(100, 20));
    energyExperiencePanel.setSize(100, 20);
    energyExperiencePanel.setLayout(null);
    energyExperiencePanel.setOpaque(false);
    // Energy count
    r = new Rectangle(18, 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);
    energy.setToolTipText("Energy");
    energy.setOpaque(false);
    setTextForLabel("energy", energyLabel, energy, 0, false);
    // Experience count
    r = new Rectangle(18, 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);
    experience.setToolTipText("Experience");
    experience.setOpaque(false);
    setTextForLabel("experience", experienceLabel, experience, 0, false);
    btnPlayer = new JButton();
    btnPlayer.setText("Player");
    btnPlayer.setVisible(false);
    btnPlayer.setToolTipText("Player");
    btnPlayer.addActionListener(e -> SessionHandler.sendPlayerUUID(gameId, playerId));
    // Add mana symbols
    // TODO: replace "button + label" to label on rework
    /*
        MouseAdapter manaMouseAdapter = new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent evt) {
                JLabel label =  (JLabel) evt.getSource();
                if (manaLabels.containsKey(label)) {
                    btnManaActionPerformed(manaLabels.get(label));
                }
            }
        };

        JLabel manaCountLabelW = new JLabel();
        manaCountLabelW.setToolTipText("White mana");
        setTextForLabel(manaCountLabelW, 0, false);
        manaCountLabelW.setIcon(new ImageIcon(ManaSymbols.getSizedManaSymbol("W", 15)));
        manaCountLabelW.addMouseListener(manaMouseAdapter);
        manaLabels.put(manaCountLabelW, ManaType.WHITE);l
        //*/
    // /*
    JLabel manaCountLabelW = new JLabel();
    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);
    btnWhiteMana.setOpaque(false);
    btnWhiteMana.setObserver(() -> btnManaActionPerformed(ManaType.WHITE));
    manaButtons.put(manaCountLabelW, btnWhiteMana);
    setTextForLabel(ManaType.WHITE.toString() + " mana", manaCountLabelW, btnWhiteMana, 0, false);
    // */
    JLabel manaCountLabelU = new JLabel();
    manaLabels.put(manaCountLabelU, ManaType.BLUE);
    r = new Rectangle(15, 15);
    BufferedImage imageManaU = ManaSymbols.getSizedManaSymbol("U", 15);
    HoverButton btnBlueMana = new HoverButton(null, imageManaU, imageManaU, imageManaU, r);
    btnBlueMana.setOpaque(false);
    btnBlueMana.setObserver(() -> btnManaActionPerformed(ManaType.BLUE));
    manaButtons.put(manaCountLabelU, btnBlueMana);
    setTextForLabel(ManaType.BLUE.toString() + " mana", manaCountLabelU, btnBlueMana, 0, false);
    JLabel manaCountLabelB = new JLabel();
    manaLabels.put(manaCountLabelB, ManaType.BLACK);
    r = new Rectangle(15, 15);
    BufferedImage imageManaB = ManaSymbols.getSizedManaSymbol("B", 15);
    HoverButton btnBlackMana = new HoverButton(null, imageManaB, imageManaB, imageManaB, r);
    btnBlackMana.setOpaque(false);
    btnBlackMana.setObserver(() -> btnManaActionPerformed(ManaType.BLACK));
    manaButtons.put(manaCountLabelB, btnBlackMana);
    setTextForLabel(ManaType.BLACK.toString() + " mana", manaCountLabelB, btnBlackMana, 0, false);
    JLabel manaCountLabelR = new JLabel();
    manaLabels.put(manaCountLabelR, ManaType.RED);
    r = new Rectangle(15, 15);
    BufferedImage imageManaR = ManaSymbols.getSizedManaSymbol("R", 15);
    HoverButton btnRedMana = new HoverButton(null, imageManaR, imageManaR, imageManaR, r);
    btnRedMana.setOpaque(false);
    btnRedMana.setObserver(() -> btnManaActionPerformed(ManaType.RED));
    manaButtons.put(manaCountLabelR, btnRedMana);
    setTextForLabel(ManaType.RED.toString() + " mana", manaCountLabelR, btnRedMana, 0, false);
    JLabel manaCountLabelG = new JLabel();
    manaLabels.put(manaCountLabelG, ManaType.GREEN);
    r = new Rectangle(15, 15);
    BufferedImage imageManaG = ManaSymbols.getSizedManaSymbol("G", 15);
    HoverButton btnGreenMana = new HoverButton(null, imageManaG, imageManaG, imageManaG, r);
    btnGreenMana.setOpaque(false);
    btnGreenMana.setObserver(() -> btnManaActionPerformed(ManaType.GREEN));
    manaButtons.put(manaCountLabelG, btnGreenMana);
    setTextForLabel(ManaType.GREEN.toString() + " mana", manaCountLabelG, btnGreenMana, 0, false);
    JLabel manaCountLabelX = new JLabel();
    manaLabels.put(manaCountLabelX, ManaType.COLORLESS);
    r = new Rectangle(15, 15);
    BufferedImage imageManaX = ManaSymbols.getSizedManaSymbol("C", 15);
    HoverButton btnColorlessMana = new HoverButton(null, imageManaX, imageManaX, imageManaX, r);
    btnColorlessMana.setOpaque(false);
    btnColorlessMana.setObserver(() -> btnManaActionPerformed(ManaType.COLORLESS));
    manaButtons.put(manaCountLabelX, btnColorlessMana);
    setTextForLabel(ManaType.COLORLESS.toString() + " mana", manaCountLabelX, btnColorlessMana, 0, false);
    GroupLayout gl_panelBackground = new GroupLayout(panelBackground);
    gl_panelBackground.setHorizontalGroup(gl_panelBackground.createParallelGroup(Alignment.LEADING).addGroup(gl_panelBackground.createSequentialGroup().addGap(9).addComponent(life, GroupLayout.PREFERRED_SIZE, 18, GroupLayout.PREFERRED_SIZE).addGap(3).addGroup(gl_panelBackground.createParallelGroup(Alignment.LEADING).addGroup(gl_panelBackground.createSequentialGroup().addGap(18).addComponent(hand, GroupLayout.PREFERRED_SIZE, 18, GroupLayout.PREFERRED_SIZE)).addComponent(lifeLabel, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE)).addGap(4).addComponent(handLabel, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)).addGroup(gl_panelBackground.createSequentialGroup().addGap(9).addComponent(poison, GroupLayout.PREFERRED_SIZE, 18, GroupLayout.PREFERRED_SIZE).addGap(3).addGroup(gl_panelBackground.createParallelGroup(Alignment.LEADING).addGroup(gl_panelBackground.createSequentialGroup().addGap(18).addComponent(library, GroupLayout.PREFERRED_SIZE, 18, GroupLayout.PREFERRED_SIZE)).addComponent(poisonLabel, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE)).addGap(4).addComponent(libraryLabel, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)).addGroup(gl_panelBackground.createSequentialGroup().addGap(9).addGroup(gl_panelBackground.createParallelGroup(Alignment.LEADING).addGroup(gl_panelBackground.createSequentialGroup().addComponent(energy, GroupLayout.PREFERRED_SIZE, 18, GroupLayout.PREFERRED_SIZE)).addGroup(gl_panelBackground.createSequentialGroup().addGap(2).addComponent(btnWhiteMana, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE)).addGroup(gl_panelBackground.createSequentialGroup().addGap(2).addComponent(btnBlueMana, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE)).addGroup(gl_panelBackground.createSequentialGroup().addGap(2).addComponent(btnBlackMana, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE)).addComponent(grave, GroupLayout.PREFERRED_SIZE, 21, GroupLayout.PREFERRED_SIZE)).addGroup(gl_panelBackground.createParallelGroup(Alignment.LEADING).addGroup(gl_panelBackground.createSequentialGroup().addGroup(gl_panelBackground.createParallelGroup(Alignment.LEADING).addGroup(gl_panelBackground.createSequentialGroup().addGap(18).addComponent(experience, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE)).addComponent(energyLabel, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE).addGroup(gl_panelBackground.createSequentialGroup().addGap(20).addComponent(btnRedMana, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE)).addGroup(gl_panelBackground.createSequentialGroup().addGap(1).addComponent(manaCountLabelW, GroupLayout.PREFERRED_SIZE, MANA_LABEL_SIZE_HORIZONTAL, GroupLayout.PREFERRED_SIZE))).addGap(3).addComponent(manaCountLabelR, GroupLayout.PREFERRED_SIZE, MANA_LABEL_SIZE_HORIZONTAL, GroupLayout.PREFERRED_SIZE)).addGroup(gl_panelBackground.createSequentialGroup().addGap(1).addGroup(gl_panelBackground.createParallelGroup(Alignment.LEADING).addComponent(manaCountLabelB, GroupLayout.PREFERRED_SIZE, MANA_LABEL_SIZE_HORIZONTAL, GroupLayout.PREFERRED_SIZE).addGroup(gl_panelBackground.createSequentialGroup().addGap(19).addComponent(btnColorlessMana, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE))).addGap(5).addComponent(manaCountLabelX, GroupLayout.PREFERRED_SIZE, MANA_LABEL_SIZE_HORIZONTAL, GroupLayout.PREFERRED_SIZE)).addGroup(gl_panelBackground.createSequentialGroup().addGap(20).addComponent(btnGreenMana, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE)).addGroup(gl_panelBackground.createSequentialGroup().addGap(40).addComponent(manaCountLabelG, GroupLayout.PREFERRED_SIZE, MANA_LABEL_SIZE_HORIZONTAL, GroupLayout.PREFERRED_SIZE)).addGroup(gl_panelBackground.createSequentialGroup().addGap(40).addComponent(experienceLabel, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE)).addGroup(gl_panelBackground.createSequentialGroup().addGap(18).addComponent(exileZone, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE)).addGroup(gl_panelBackground.createSequentialGroup().addGap(5).addComponent(graveLabel, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE)).addGroup(gl_panelBackground.createSequentialGroup().addGap(40).addComponent(exileLabel, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE)).addGroup(gl_panelBackground.createSequentialGroup().addGap(1).addComponent(manaCountLabelU, GroupLayout.PREFERRED_SIZE, MANA_LABEL_SIZE_HORIZONTAL, GroupLayout.PREFERRED_SIZE)))).addGroup(gl_panelBackground.createSequentialGroup().addGap(6).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(8)).addGroup(gl_panelBackground.createSequentialGroup().addGap(6).addComponent(zonesPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE).addGap(14)));
    gl_panelBackground.setVerticalGroup(gl_panelBackground.createParallelGroup(Alignment.LEADING).addGroup(gl_panelBackground.createSequentialGroup().addGap(6).addComponent(avatar, GroupLayout.PREFERRED_SIZE, 80, GroupLayout.PREFERRED_SIZE).addPreferredGap(ComponentPlacement.RELATED).addComponent(btnPlayer).addComponent(timerLabel).addGap(2).addGroup(gl_panelBackground.createParallelGroup(Alignment.LEADING).addGroup(gl_panelBackground.createSequentialGroup().addGap(1).addComponent(life, GroupLayout.PREFERRED_SIZE, 18, GroupLayout.PREFERRED_SIZE)).addGroup(gl_panelBackground.createSequentialGroup().addGap(1).addComponent(hand, GroupLayout.PREFERRED_SIZE, 18, GroupLayout.PREFERRED_SIZE)).addComponent(lifeLabel, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE).addComponent(handLabel, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)).addGroup(gl_panelBackground.createParallelGroup(Alignment.LEADING).addGroup(gl_panelBackground.createSequentialGroup().addGap(1).addComponent(poison, GroupLayout.PREFERRED_SIZE, 18, GroupLayout.PREFERRED_SIZE)).addGroup(gl_panelBackground.createSequentialGroup().addGap(1).addComponent(library, GroupLayout.PREFERRED_SIZE, 18, GroupLayout.PREFERRED_SIZE)).addComponent(poisonLabel, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE).addComponent(libraryLabel, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)).addGap(1).addGroup(gl_panelBackground.createParallelGroup(Alignment.LEADING).addGroup(gl_panelBackground.createSequentialGroup().addGap(2).addComponent(energy, GroupLayout.PREFERRED_SIZE, 18, GroupLayout.PREFERRED_SIZE).addGap(2).addComponent(btnWhiteMana, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE).addGap(2).addComponent(btnBlueMana, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE).addGap(2).addComponent(btnBlackMana, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE).addGap(3).addComponent(grave, GroupLayout.PREFERRED_SIZE, 21, GroupLayout.PREFERRED_SIZE)).addGroup(gl_panelBackground.createSequentialGroup().addGroup(gl_panelBackground.createParallelGroup(Alignment.LEADING).addGroup(gl_panelBackground.createSequentialGroup().addGroup(gl_panelBackground.createParallelGroup(Alignment.LEADING).addGroup(gl_panelBackground.createSequentialGroup().addGap(1).addComponent(experience, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE)).addComponent(energyLabel, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)).addGap(2).addComponent(btnRedMana, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE)).addGroup(gl_panelBackground.createSequentialGroup().addGap(14).addComponent(manaCountLabelW, GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE)).addGroup(gl_panelBackground.createSequentialGroup().addGap(14).addComponent(manaCountLabelR, GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE))).addGap(4).addGroup(gl_panelBackground.createParallelGroup(Alignment.LEADING).addComponent(manaCountLabelB, GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE).addGroup(gl_panelBackground.createSequentialGroup().addGap(8).addComponent(btnColorlessMana, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE)).addComponent(manaCountLabelX, GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE))).addGroup(gl_panelBackground.createSequentialGroup().addGap(39).addComponent(btnGreenMana, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE)).addGroup(gl_panelBackground.createSequentialGroup().addGap(31).addComponent(manaCountLabelG, GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE)).addComponent(experienceLabel, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE).addGroup(gl_panelBackground.createSequentialGroup().addGap(76).addComponent(exileZone, GroupLayout.PREFERRED_SIZE, 21, GroupLayout.PREFERRED_SIZE)).addGroup(gl_panelBackground.createSequentialGroup().addGap(76).addComponent(graveLabel, GroupLayout.PREFERRED_SIZE, 21, GroupLayout.PREFERRED_SIZE)).addGroup(gl_panelBackground.createSequentialGroup().addGap(76).addComponent(exileLabel, GroupLayout.PREFERRED_SIZE, 21, GroupLayout.PREFERRED_SIZE)).addGroup(gl_panelBackground.createSequentialGroup().addGap(31).addComponent(manaCountLabelU, GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE))).addGap(2).addComponent(zonesPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)));
    panelBackground.setLayout(gl_panelBackground);
    GroupLayout groupLayout = new GroupLayout(this);
    groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.LEADING).addGroup(groupLayout.createSequentialGroup().addComponent(panelBackground, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)));
    groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.LEADING).addGroup(groupLayout.createSequentialGroup().addComponent(panelBackground, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)));
    setLayout(groupLayout);
}
Also used : BufferedImage(java.awt.image.BufferedImage) BufferedImage(java.awt.image.BufferedImage) HoverButton(mage.client.components.HoverButton) MageRoundPane(mage.client.components.MageRoundPane) ImagePanel(mage.components.ImagePanel)

Aggregations

ImagePanel (mage.components.ImagePanel)5 BufferedImage (java.awt.image.BufferedImage)4 InputStream (java.io.InputStream)2 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 HoverButton (mage.client.components.HoverButton)1 MageRoundPane (mage.client.components.MageRoundPane)1