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"); super("fmframework");
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setLayout(new GridLayout(3, 2)); setLayout(new GridLayout(3, 2));
setSize(500, 500); setSize(300, 300);
setResizable(false); setResizable(false);
Reference.initGroupsList(); // Reference.initGroupsList();
ArrayList<FMObjList> groups = Reference.getGroups(); // ArrayList<FMObjList> groups = Reference.getGroups();
int counter; // int counter;
for (counter = 0; counter < groups.size(); counter++) { // for (counter = 0; counter < groups.size(); counter++) {
FMObjList group = groups.get(counter); // FMObjList group = groups.get(counter);
JButton view = new JButton("View " + group.getGroupName()); // JButton view = new JButton("View " + group.getGroupName());
view.addActionListener(new ActionListener() { // view.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) { // public void actionPerformed(ActionEvent arg0) {
group.view(); // group.view();
} // }
}); // });
add(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); node = wikiContents.item(counter);
if (node.getNodeName().equals("published")) { if (node.getNodeName().equals("published")) {
System.out.println(node.getNodeName() + node.getTextContent()); // System.out.println(node.getNodeName() + node.getTextContent());
date = node.getTextContent(); date = node.getTextContent();
} }
// if (node.getNodeName().equals("summary")) { // if (node.getNodeName().equals("summary")) {
@ -71,7 +71,7 @@ public class Parser {
// summary = node.getTextContent(); // summary = node.getTextContent();
// } // }
if (node.getNodeName().equals("content")) { if (node.getNodeName().equals("content")) {
System.out.println(node.getNodeName() + node.getTextContent()); // System.out.println(node.getNodeName() + node.getTextContent());
content = node.getTextContent(); content = node.getTextContent();
} }
} }

View File

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