|
@@ -13,14 +13,14 @@ import org.leumasjaffe.charsheet.model.magic.DDSpellbook;
|
|
|
import org.leumasjaffe.charsheet.model.observable.IntValue;
|
|
import org.leumasjaffe.charsheet.model.observable.IntValue;
|
|
|
import java.awt.Dimension;
|
|
import java.awt.Dimension;
|
|
|
|
|
|
|
|
-public class SpellsPerDayHeader extends JPanel {
|
|
|
|
|
|
|
+class SpellsPerDayHeader extends JPanel {
|
|
|
/**
|
|
/**
|
|
|
*
|
|
*
|
|
|
*/
|
|
*/
|
|
|
private static final long serialVersionUID = 1L;
|
|
private static final long serialVersionUID = 1L;
|
|
|
private JTextField textFieldRemaining;
|
|
private JTextField textFieldRemaining;
|
|
|
|
|
|
|
|
- public SpellsPerDayHeader(int level, int elems, int perDay, IntValue ability) {
|
|
|
|
|
|
|
+ public SpellsPerDayHeader(int level, DDSpellbook model, IntValue ability) {
|
|
|
setPreferredSize(new Dimension(350, 20));
|
|
setPreferredSize(new Dimension(350, 20));
|
|
|
GridBagLayout gridBagLayout = new GridBagLayout();
|
|
GridBagLayout gridBagLayout = new GridBagLayout();
|
|
|
gridBagLayout.columnWidths = new int[]{0, 30, 0, 30, 0, 30, 0, 30, 0, 0};
|
|
gridBagLayout.columnWidths = new int[]{0, 30, 0, 30, 0, 30, 0, 30, 0, 0};
|
|
@@ -72,7 +72,7 @@ public class SpellsPerDayHeader extends JPanel {
|
|
|
gbc_lblSpellsPerDay.gridy = 0;
|
|
gbc_lblSpellsPerDay.gridy = 0;
|
|
|
add(lblSpellsPerDay, gbc_lblSpellsPerDay);
|
|
add(lblSpellsPerDay, gbc_lblSpellsPerDay);
|
|
|
|
|
|
|
|
- textFieldRemaining = new JTextField(Integer.toString(perDay));
|
|
|
|
|
|
|
+ textFieldRemaining = new JTextField(Integer.toString(model.numSpellsPerDayRemainingAtLevel(level)));
|
|
|
GridBagConstraints gbc_textFieldRemaining = new GridBagConstraints();
|
|
GridBagConstraints gbc_textFieldRemaining = new GridBagConstraints();
|
|
|
gbc_textFieldRemaining.fill = GridBagConstraints.HORIZONTAL;
|
|
gbc_textFieldRemaining.fill = GridBagConstraints.HORIZONTAL;
|
|
|
gbc_textFieldRemaining.insets = new Insets(0, 0, 0, 5);
|
|
gbc_textFieldRemaining.insets = new Insets(0, 0, 0, 5);
|
|
@@ -89,7 +89,7 @@ public class SpellsPerDayHeader extends JPanel {
|
|
|
gbc_label.gridy = 0;
|
|
gbc_label.gridy = 0;
|
|
|
add(label, gbc_label);
|
|
add(label, gbc_label);
|
|
|
|
|
|
|
|
- JTextField textFieldOutOf = new JTextField(Integer.toString(perDay));
|
|
|
|
|
|
|
+ JTextField textFieldOutOf = new JTextField(Integer.toString(model.numSpellsPerDayAtLevel(level)));
|
|
|
GridBagConstraints gbc_textFieldOutOf = new GridBagConstraints();
|
|
GridBagConstraints gbc_textFieldOutOf = new GridBagConstraints();
|
|
|
gbc_textFieldOutOf.insets = new Insets(0, 0, 0, 5);
|
|
gbc_textFieldOutOf.insets = new Insets(0, 0, 0, 5);
|
|
|
gbc_textFieldOutOf.fill = GridBagConstraints.HORIZONTAL;
|
|
gbc_textFieldOutOf.fill = GridBagConstraints.HORIZONTAL;
|