From 837d79cf991dee0d3684975855b599c09eb036e7 Mon Sep 17 00:00:00 2001 From: aj Date: Mon, 2 Apr 2018 20:15:34 -0700 Subject: [PATCH] lists view quicker, lists called from api one by one not on menu load --- .../sarsoo/fmframework/gui/RefListsView.java | 73 +++++++++++++++---- .../src/sarsoo/fmframework/parser/Parser.java | 4 +- .../sarsoo/fmframework/util/Reference.java | 22 +++--- 3 files changed, 72 insertions(+), 27 deletions(-) diff --git a/fmframework/src/sarsoo/fmframework/gui/RefListsView.java b/fmframework/src/sarsoo/fmframework/gui/RefListsView.java index a546a86..a97f09a 100644 --- a/fmframework/src/sarsoo/fmframework/gui/RefListsView.java +++ b/fmframework/src/sarsoo/fmframework/gui/RefListsView.java @@ -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 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 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); } } diff --git a/fmframework/src/sarsoo/fmframework/parser/Parser.java b/fmframework/src/sarsoo/fmframework/parser/Parser.java index 52289c3..863a8ff 100644 --- a/fmframework/src/sarsoo/fmframework/parser/Parser.java +++ b/fmframework/src/sarsoo/fmframework/parser/Parser.java @@ -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(); } } diff --git a/fmframework/src/sarsoo/fmframework/util/Reference.java b/fmframework/src/sarsoo/fmframework/util/Reference.java index 04d234e..00dbeb2 100644 --- a/fmframework/src/sarsoo/fmframework/util/Reference.java +++ b/fmframework/src/sarsoo/fmframework/util/Reference.java @@ -27,14 +27,14 @@ public class Reference { private static ArrayList groups = new ArrayList(); - 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 getGroups() { - return groups; - } +// public static ArrayList getGroups() { +// return groups; +// } public static FMObjList getHopeless() { FMObjList hopeless = new FMObjList("Hopless");