Skip to content

Commit

Permalink
Add a couple of generic types.
Browse files Browse the repository at this point in the history
  • Loading branch information
manning authored and Stanford NLP committed Jan 14, 2015
1 parent 8249cbb commit d1b2b0c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/edu/stanford/nlp/trees/tregex/gui/InputPanel.java
Expand Up @@ -79,8 +79,8 @@ public class InputPanel extends JPanel implements ActionListener, ChangeListener
private JButton cancel;
private JButton help;
private JTextArea tregexPattern;
private JComboBox recentTregexPatterns;
private DefaultComboBoxModel recentTregexPatternsModel;
private JComboBox<String> recentTregexPatterns;
private DefaultComboBoxModel<String> recentTregexPatternsModel;
private int numRecentPatterns = 5;// we save the last n patterns in our combo box, where n = numRecentPatterns
private JTextArea tsurgeonScript;
private TregexPatternCompiler compiler;//this should change only when someone changes the headfinder/basic category finder
Expand Down Expand Up @@ -249,8 +249,8 @@ private Box makeTSurgeonScriptArea() {
//separated out to make constructor more readable
private JPanel makeTregexPatternArea() {
//combo box with recent searches
recentTregexPatternsModel = new DefaultComboBoxModel();
recentTregexPatterns = new JComboBox(recentTregexPatternsModel);
recentTregexPatternsModel = new DefaultComboBoxModel<>();
recentTregexPatterns = new JComboBox<>(recentTregexPatternsModel);
recentTregexPatterns.setMinimumSize(new Dimension(120, 24));
recentTregexPatterns.addActionListener(this);

Expand Down Expand Up @@ -442,6 +442,7 @@ private static void useProgressBarHelper(Container parent, JComponent add, JComp
parent.repaint();
}

@Override
public void actionPerformed(ActionEvent e) {
Object source = e.getSource();
if (source == findMatches) {
Expand Down Expand Up @@ -471,6 +472,7 @@ public void actionPerformed(ActionEvent e) {
}
}

@Override
public void stateChanged(ChangeEvent e) {
JSlider source = (JSlider) e.getSource();
int fontSize = source.getValue();
Expand Down Expand Up @@ -755,8 +757,9 @@ private TRegexGUITreeVisitor getMatchTreeVisitor(String patternString, Thread t)


/**
* Called when a pattern cannot be compiled or some other error occurs; resets gui to valid state
* Thread safe
* Called when a pattern cannot be compiled or some other error occurs; resets gui to valid state.
* Thread safe.
*
* @param txt Error message text (friendly text appropriate for users)
* @param e The exception that caused the problem
*/
Expand Down

0 comments on commit d1b2b0c

Please sign in to comment.