lists view quicker, lists called from api one by one not on menu load

This commit is contained in:
aj 2018-04-02 20:15:34 -07:00
parent 122b91ead3
commit 837d79cf99
3 changed files with 72 additions and 27 deletions

View File

@ -16,22 +16,67 @@ public class RefListsView extends JFrame {
super("fmframework");
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setLayout(new GridLayout(3, 2));
setSize(500, 500);
setSize(300, 300);
setResizable(false);
Reference.initGroupsList();
ArrayList<FMObjList> groups = Reference.getGroups();
int counter;
for (counter = 0; counter < groups.size(); counter++) {
FMObjList group = groups.get(counter);
JButton view = new JButton("View " + group.getGroupName());
view.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
group.view();
}
});
add(view);
}
// Reference.initGroupsList();
// ArrayList<FMObjList> groups = Reference.getGroups();
// int counter;
// for (counter = 0; counter < groups.size(); counter++) {
// FMObjList group = groups.get(counter);
// JButton view = new JButton("View " + group.getGroupName());
// view.addActionListener(new ActionListener() {
// public void actionPerformed(ActionEvent arg0) {
// group.view();
// }
// });
// add(view);
// }
JButton viewTDE = new JButton("View TDE");
viewTDE.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
Reference.getTDE().view();
}
});
add(viewTDE);
JButton viewBPHQ = new JButton("View BPHQ");
viewBPHQ.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
Reference.getBPHQ().view();
}
});
add(viewBPHQ);
JButton viewDre = new JButton("View Dre");
viewDre.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
Reference.getDre().view();
}
});
add(viewDre);
JButton viewWu = new JButton("View Wu");
viewWu.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
Reference.getWu().view();
}
});
add(viewWu);
JButton viewHopeless = new JButton("View Hopeless");
viewHopeless.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
Reference.getHopeless().view();
}
});
add(viewHopeless);
JButton viewSaturation = new JButton("View Saturation");
viewSaturation.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
Reference.getSaturation().view();
}
});
add(viewSaturation);
}
}

View File

@ -63,7 +63,7 @@ public class Parser {
node = wikiContents.item(counter);
if (node.getNodeName().equals("published")) {
System.out.println(node.getNodeName() + node.getTextContent());
// System.out.println(node.getNodeName() + node.getTextContent());
date = node.getTextContent();
}
// if (node.getNodeName().equals("summary")) {
@ -71,7 +71,7 @@ public class Parser {
// summary = node.getTextContent();
// }
if (node.getNodeName().equals("content")) {
System.out.println(node.getNodeName() + node.getTextContent());
// System.out.println(node.getNodeName() + node.getTextContent());
content = node.getTextContent();
}
}

View File

@ -27,14 +27,14 @@ public class Reference {
private static ArrayList<FMObjList> groups = new ArrayList<FMObjList>();
public static void initGroupsList() {
groups.add(getTDE());
groups.add(getBPHQ());
groups.add(getDre());
groups.add(getWu());
groups.add(getHopeless());
groups.add(getSaturation());
}
// public static void initGroupsList() {
// groups.add(getTDE());
// groups.add(getBPHQ());
// groups.add(getDre());
// groups.add(getWu());
// groups.add(getHopeless());
// groups.add(getSaturation());
// }
public static FMObjList getSaturation() {
FMObjList saturation = new FMObjList("Saturation");
@ -46,9 +46,9 @@ public class Reference {
return saturation;
}
public static ArrayList<FMObjList> getGroups() {
return groups;
}
// public static ArrayList<FMObjList> getGroups() {
// return groups;
// }
public static FMObjList getHopeless() {
FMObjList hopeless = new FMObjList("Hopless");