|
@@ -0,0 +1,48 @@
|
|
|
|
|
+package org.leumasjaffe.charsheet.view.magic;
|
|
|
|
|
+
|
|
|
|
|
+import javax.swing.JPanel;
|
|
|
|
|
+
|
|
|
|
|
+import org.jdesktop.swingx.VerticalLayout;
|
|
|
|
|
+import org.leumasjaffe.charsheet.model.DDCharacterClass;
|
|
|
|
|
+import org.leumasjaffe.charsheet.model.magic.impl.Prepared;
|
|
|
|
|
+import java.awt.GridBagLayout;
|
|
|
|
|
+import javax.swing.JScrollPane;
|
|
|
|
|
+import java.awt.GridBagConstraints;
|
|
|
|
|
+
|
|
|
|
|
+public class PrepareSpellsDialog extends JPanel {
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ *
|
|
|
|
|
+ */
|
|
|
|
|
+ private static final long serialVersionUID = 1L;
|
|
|
|
|
+
|
|
|
|
|
+ public PrepareSpellsDialog(DDCharacterClass dclass) {
|
|
|
|
|
+ GridBagLayout gridBagLayout = new GridBagLayout();
|
|
|
|
|
+ gridBagLayout.columnWidths = new int[]{0, 0};
|
|
|
|
|
+ gridBagLayout.rowHeights = new int[]{0, 0};
|
|
|
|
|
+ gridBagLayout.columnWeights = new double[]{1.0, Double.MIN_VALUE};
|
|
|
|
|
+ gridBagLayout.rowWeights = new double[]{1.0, Double.MIN_VALUE};
|
|
|
|
|
+ setLayout(gridBagLayout);
|
|
|
|
|
+
|
|
|
|
|
+ JScrollPane scrollPane = new JScrollPane();
|
|
|
|
|
+ GridBagConstraints gbc_scrollPane = new GridBagConstraints();
|
|
|
|
|
+ gbc_scrollPane.fill = GridBagConstraints.BOTH;
|
|
|
|
|
+ gbc_scrollPane.gridx = 0;
|
|
|
|
|
+ gbc_scrollPane.gridy = 0;
|
|
|
|
|
+ add(scrollPane, gbc_scrollPane);
|
|
|
|
|
+
|
|
|
|
|
+ JPanel panel = new JPanel(new VerticalLayout(5));
|
|
|
|
|
+ scrollPane.setViewportView(panel);
|
|
|
|
|
+
|
|
|
|
|
+// final List<List<DDSpell>> prepare = new ArrayList<>();
|
|
|
|
|
+// final List<Collection<DDSpell>> known = new ArrayList<>();
|
|
|
|
|
+//
|
|
|
|
|
+ final Prepared spellBook = (Prepared) dclass.getSpellBook().get();
|
|
|
|
|
+ for (int i = 0; i < dclass.getHighestSpellLevel(); ++i) {
|
|
|
|
|
+// prepare.add(spellBook.getSpellsPreparedPreviouslyForLevel(i));
|
|
|
|
|
+// known.add(spellBook.spellsKnownAtLevel(i));
|
|
|
|
|
+ panel.add(new SelectPreparedSpellsPanel(spellBook.getSpellsPreparedPreviouslyForLevel(i), spellBook.spellsKnownAtLevel(i)));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+}
|