more gui stuff

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@634 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Tom Copeland
2002-08-06 20:26:22 +00:00
parent 89ddec1e5a
commit e39f8566cd
6 changed files with 23 additions and 4 deletions

View File

@ -87,7 +87,7 @@ public class CPD {
public void go() {
listener.update("Starting to process " + tokenSets.size() + " files");
GST gst = new GST(this.tokenSets, minimumTileSize);
GST gst = new GST(tokenSets, minimumTileSize);
results = gst.crunch(listener);
}

View File

@ -10,4 +10,5 @@ import java.io.File;
public interface CPDListener {
public void update(String msg);
public void addedFile(File file);
public void addingTokens(String tokenSrcID);
}

View File

@ -11,8 +11,14 @@ public class CPDListenerImpl implements CPDListener{
public void update(String msg) {
System.out.println(msg);
}
public void addedFile(File file) {
update("Added file " + file.getAbsolutePath());
}
public void addingTokens(String tokenSrcID) {
update("Adding token set " + tokenSrcID);
}
}

View File

@ -10,4 +10,5 @@ import java.io.File;
public class CPDNullListener implements CPDListener{
public void update(String msg) {}
public void addedFile(File file) {}
public void addingTokens(String tokenSrcID) {}
}

View File

@ -38,6 +38,7 @@ public class GUI implements CPDListener {
//private JTextField rootDirectoryField= new JTextField("c:\\data\\cougaar\\core\\src");
private JTextField minimumLengthField= new JTextField("50");
private JTextField addingFileField = new JTextField(50);
private JTextField initialFrequencyField = new JTextField(50);
private JCheckBox recurseCheckbox = new JCheckBox("Recurse?", true);
private JFrame f;
public GUI() {
@ -59,8 +60,15 @@ public class GUI implements CPDListener {
inputPanel.add(buttonsPanel);
JPanel progressPanel = new JPanel();
progressPanel.add(new JLabel("Adding files"));
progressPanel.add(addingFileField);
progressPanel.setLayout(new BorderLayout());
JPanel panel1 = new JPanel();
panel1.add(new JLabel("Tokenizing files"));
panel1.add(addingFileField);
progressPanel.add(panel1, BorderLayout.NORTH);
JPanel panel2 = new JPanel();
panel2.add(new JLabel("Adding tokens"));
panel2.add(initialFrequencyField);
progressPanel.add(panel2, BorderLayout.SOUTH);
f.getContentPane().setLayout(new BorderLayout());
f.getContentPane().add(inputPanel, BorderLayout.NORTH);
@ -107,4 +115,7 @@ public class GUI implements CPDListener {
addingFileField.setText(file.getAbsolutePath());
}
public void addingTokens(String tokenSrcID) {
initialFrequencyField.setText(tokenSrcID);
}
}

View File

@ -21,7 +21,7 @@ public class Occurrences {
public Occurrences(TokenSets tss, CPDListener listener) {
for (Iterator j = tss.iterator();j.hasNext();) {
TokenList ts = (TokenList)j.next();
listener.update("Adding token set " + ts.getID() + " to the initial frequency table");
listener.addingTokens(ts.getID());
for (Iterator i = ts.iterator(); i.hasNext();) {
TokenEntry tok = (TokenEntry)i.next();
addTile(new Tile(tok), tok);