7
7
8
8
import javax .swing .*;
9
9
import java .awt .*;
10
- import java .io .IOException ;
11
10
import java .util .Map ;
12
11
import java .util .Set ;
13
12
13
+ /**
14
+ * Abstract class that represents a panel for all flashcard set panels for a user.
15
+ * This panel includes all FlashcardSetDataPanel objects and their buttons.
16
+ * Frameworks & Drivers
17
+ * @author Justin Li
18
+ */
14
19
public class ListOfFlashcardSetsDataPanel extends JPanel {
15
-
20
+ /**
21
+ *Creates a ListOfFlashcardSetDataPanel object that includes the idsToFlashcardSetData,
22
+ * gateway, user, and home.
23
+ * @param idsToFlashcardSetData the ids of the flashcard sets.
24
+ * @param gateway the gateway to reach all the flashcard sets.
25
+ * @param user the user that contains all the flashcard sets.
26
+ * @param home the home page that the list of flashcard set panels will be displayed on.
27
+ */
16
28
public ListOfFlashcardSetsDataPanel (Map <Integer , String []> idsToFlashcardSetData ,
17
29
DBGateway gateway , UserLoginResponseModel user , HomeScreen home ) {
18
30
Set <Integer > flashcardSetIds = idsToFlashcardSetData .keySet ();
@@ -29,19 +41,4 @@ public ListOfFlashcardSetsDataPanel(Map<Integer, String[]> idsToFlashcardSetData
29
41
this .setComponentOrientation (ComponentOrientation .LEFT_TO_RIGHT );
30
42
this .setPreferredSize (new Dimension (500 , 1000 ));
31
43
}
32
-
33
- public static void main (String [] args ) throws IOException {
34
- // JFrame f = new JFrame();
35
- //
36
- // Map<Integer, String[]> map = new HashMap<>();
37
- // map.put(0, new String[] {"test set", "for testing study use case"});
38
- // map.put(1, new String[] {"empty test set", "for testing study use case with empty set"});
39
- // DBGateway gateway = new DBGateway(new FlashcardDataAccess(DBGateway.getFlashcardPath()),
40
- // new FlashcardSetDataAccess(DBGateway.getFlashcardSetPath()),
41
- // null);
42
- //
43
- // f.add(new ListOfFlashcardSetsDataPanel(map, gateway, user));
44
- // f.setVisible(true);
45
- // f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
46
- }
47
44
}
0 commit comments