foul-magics/Mage.Client/src/main/java/mage/client/game/ManaPool.java
2018-06-02 17:59:49 +02:00

163 lines
7.5 KiB
Java

/*
* ManaPool.java
*
* Created on Dec 22, 2009, 9:52:00 AM
*/
package mage.client.game;
import mage.view.ManaPoolView;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class ManaPool extends javax.swing.JPanel {
/** Creates new form ManaPool */
public ManaPool() {
initComponents();
}
public void update(ManaPoolView pool) {
this.btnBlack.setText(Integer.toString(pool.getBlack()));
this.btnRed.setText(Integer.toString(pool.getRed()));
this.btnWhite.setText(Integer.toString(pool.getWhite()));
this.btnGreen.setText(Integer.toString(pool.getGreen()));
this.btnBlue.setText(Integer.toString(pool.getBlue()));
this.btnColorless.setText(Integer.toString(pool.getColorless()));
}
/** 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")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
lblBlack = new javax.swing.JLabel();
btnBlack = new javax.swing.JButton();
btnBlue = new javax.swing.JButton();
lblBlue = new javax.swing.JLabel();
lblGreen = new javax.swing.JLabel();
btnGreen = new javax.swing.JButton();
btnColorless = new javax.swing.JButton();
lblWhite = new javax.swing.JLabel();
lblColorless = new javax.swing.JLabel();
btnWhite = new javax.swing.JButton();
btnRed = new javax.swing.JButton();
lblRed = new javax.swing.JLabel();
lblBlack.setLabelFor(btnBlack);
lblBlack.setText("Black");
btnBlack.setText("0");
btnBlue.setText("0");
lblBlue.setLabelFor(btnBlack);
lblBlue.setText("Blue");
lblGreen.setLabelFor(btnBlack);
lblGreen.setText("Green");
btnGreen.setText("0");
btnColorless.setText("0");
lblWhite.setLabelFor(btnBlack);
lblWhite.setText("White");
lblColorless.setLabelFor(btnBlack);
lblColorless.setText("Colorless");
btnWhite.setText("0");
btnRed.setText("0");
lblRed.setLabelFor(btnBlack);
lblRed.setText("Red");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(lblGreen)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 18, Short.MAX_VALUE)
.addComponent(btnGreen, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(lblColorless)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnColorless, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(lblWhite)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 19, Short.MAX_VALUE)
.addComponent(btnWhite, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(lblRed)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 28, Short.MAX_VALUE)
.addComponent(btnRed, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(lblBlack)
.addComponent(lblBlue))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 23, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(btnBlack, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btnBlue, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lblBlack)
.addComponent(btnBlack, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(1, 1, 1)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnBlue, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lblBlue))
.addGap(1, 1, 1)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lblGreen)
.addComponent(btnGreen, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(1, 1, 1)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lblRed)
.addComponent(btnRed, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(1, 1, 1)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lblWhite)
.addComponent(btnWhite, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(1, 1, 1)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lblColorless)
.addComponent(btnColorless, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)))
);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnBlack;
private javax.swing.JButton btnBlue;
private javax.swing.JButton btnColorless;
private javax.swing.JButton btnGreen;
private javax.swing.JButton btnRed;
private javax.swing.JButton btnWhite;
private javax.swing.JLabel lblBlack;
private javax.swing.JLabel lblBlue;
private javax.swing.JLabel lblColorless;
private javax.swing.JLabel lblGreen;
private javax.swing.JLabel lblRed;
private javax.swing.JLabel lblWhite;
// End of variables declaration//GEN-END:variables
}