Revision: 17861
http://sourceforge.net/p/gate/code/17861
Author: markagreenwood
Date: 2014-04-17 17:04:10 +0000 (Thu, 17 Apr 2014)
Log Message:
-----------
bunch more java warnings cleared up
Modified Paths:
--------------
gate/trunk/src/main/gate/gui/MainFrame.java
gate/trunk/src/main/gate/gui/TextAttributesChooser.java
gate/trunk/src/main/gate/gui/annedit/SearchExpressionsAction.java
gate/trunk/src/main/gate/gui/creole/manager/AvailablePlugins.java
gate/trunk/src/main/gate/gui/docview/AnnotationEditor.java
Modified: gate/trunk/src/main/gate/gui/MainFrame.java
===================================================================
--- gate/trunk/src/main/gate/gui/MainFrame.java 2014-04-17 15:13:32 UTC (rev
17860)
+++ gate/trunk/src/main/gate/gui/MainFrame.java 2014-04-17 17:04:10 UTC (rev
17861)
@@ -3010,7 +3010,7 @@
}
});
- JComboBox asie = new JComboBox(new String[]{"include", "exclude"});
+ JComboBox<String> asie = new JComboBox<String>(new String[]{"include",
"exclude"});
inputAS.setToolTipText("Leave blank for indexing all annotation sets.
\""
+ Constants.DEFAULT_ANNOTATION_SET_NAME +
"\" indicates the default annotation set");
@@ -3053,7 +3053,7 @@
}
});
- JComboBox ftie = new JComboBox(new String[]{"include", "exclude"});
+ JComboBox<String> ftie = new JComboBox<String>(new String[]{"include",
"exclude"});
ftie.setSelectedIndex(1);
fte.setToolTipText("Leave blank for inclusion of all features");
@@ -3484,7 +3484,7 @@
if(!dsTypeByName.isEmpty()) {
JLabel label = new JLabel("Select a type of Datastore:");
- final JList list = new JList(dsTypeByName.keySet().toArray());
+ final JList<String> list = new
JList<String>(dsTypeByName.keySet().toArray(new
String[dsTypeByName.keySet().size()]));
String initialSelection = Gate.getUserConfig().getString(
MainFrame.class.getName()+".datastoretype");
if (dsTypeByName.containsKey(initialSelection)) {
@@ -4042,7 +4042,7 @@
if(!dsTypeByName.isEmpty()) {
JLabel label = new JLabel("Select a type of Datastore:");
- final JList list = new JList(dsTypeByName.keySet().toArray());
+ final JList<String> list = new
JList<String>(dsTypeByName.keySet().toArray(new
String[dsTypeByName.keySet().size()]));
String initialSelection = Gate.getUserConfig().getString(
MainFrame.class.getName()+".datastoretype");
if (dsTypeByName.containsKey(initialSelection)) {
Modified: gate/trunk/src/main/gate/gui/TextAttributesChooser.java
===================================================================
--- gate/trunk/src/main/gate/gui/TextAttributesChooser.java 2014-04-17
15:13:32 UTC (rev 17860)
+++ gate/trunk/src/main/gate/gui/TextAttributesChooser.java 2014-04-17
17:04:10 UTC (rev 17861)
@@ -33,8 +33,8 @@
@SuppressWarnings("serial")
public class TextAttributesChooser extends JDialog {
- JComboBox fontFamilyCombo;
- JComboBox fontSizeCombo;
+ JComboBox<String> fontFamilyCombo;
+ JComboBox<String> fontSizeCombo;
JCheckBox boldChk;
JCheckBox italicChk;
JCheckBox underlineChk;
@@ -109,12 +109,12 @@
//Font stuff
Box fontBox = Box.createVerticalBox();
- fontFamilyCombo = new JComboBox(
+ fontFamilyCombo = new JComboBox<String>(
GraphicsEnvironment.getLocalGraphicsEnvironment().
getAvailableFontFamilyNames()
);
fontFamilyCombo.setSelectedItem(StyleConstants.getFontFamily(currentStyle));
- fontSizeCombo = new JComboBox(new String[]{"6", "8", "10", "12", "14",
"16",
+ fontSizeCombo = new JComboBox<String>(new String[]{"6", "8", "10", "12",
"14", "16",
"18", "20", "22", "24", "26"});
fontSizeCombo.setSelectedItem(new Integer(
StyleConstants.getFontSize(currentStyle)).toString());
Modified: gate/trunk/src/main/gate/gui/annedit/SearchExpressionsAction.java
===================================================================
--- gate/trunk/src/main/gate/gui/annedit/SearchExpressionsAction.java
2014-04-17 15:13:32 UTC (rev 17860)
+++ gate/trunk/src/main/gate/gui/annedit/SearchExpressionsAction.java
2014-04-17 17:04:10 UTC (rev 17861)
@@ -118,7 +118,7 @@
modifiedTextField.setText(sourceTextField.getText());
JPanel vspace1 = new JPanel();
vspace1.setSize(0, 5);
- final JList list1 = new JList(values1);
+ final JList<String> list1 = new JList<String>(values1);
list1.setVisibleRowCount(Math.min(10, values1.length));
list1.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
JScrollPane jsp1 = new JScrollPane(list1);
@@ -126,7 +126,7 @@
b1.setEnabled(false);
JPanel vspace2 = new JPanel();
vspace2.setSize(0, 5);
- final JList list2 = new JList(values2);
+ final JList<String> list2 = new JList<String>(values2);
list2.setVisibleRowCount(Math.min(10, values2.length));
list2.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
JScrollPane jsp2 = new JScrollPane(list2);
@@ -134,7 +134,7 @@
b2.setEnabled(false);
JPanel vspace3 = new JPanel();
vspace3.setSize(0, 5);
- final JList list3 = new JList(values3);
+ final JList<String> list3 = new JList<String>(values3);
list3.setVisibleRowCount(Math.min(10, values3.length));
list3.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
JScrollPane jsp3 = new JScrollPane(list3);
Modified: gate/trunk/src/main/gate/gui/creole/manager/AvailablePlugins.java
===================================================================
--- gate/trunk/src/main/gate/gui/creole/manager/AvailablePlugins.java
2014-04-17 15:13:32 UTC (rev 17860)
+++ gate/trunk/src/main/gate/gui/creole/manager/AvailablePlugins.java
2014-04-17 17:04:10 UTC (rev 17861)
@@ -104,7 +104,7 @@
private ResourcesListModel resourcesListModel;
- private JList resourcesList;
+ private JList<ResourceInfo> resourcesList;
private JTextField filterTextField;
@@ -176,7 +176,7 @@
.setCellRenderer(cbCellRenderer);
resourcesListModel = new ResourcesListModel();
- resourcesList = new JList(resourcesListModel);
+ resourcesList = new JList<ResourceInfo>(resourcesListModel);
resourcesList.setCellRenderer(new ResourcesListCellRenderer());
// this is needed because otherwise the list gets really narrow most of the
@@ -493,10 +493,10 @@
}
}
- private class ResourcesListModel extends AbstractListModel {
+ private class ResourcesListModel extends AbstractListModel<ResourceInfo> {
@Override
- public Object getElementAt(int index) {
+ public ResourceInfo getElementAt(int index) {
int row = mainTable.getSelectedRow();
if(row == -1) return null;
row = mainTable.rowViewToModel(row);
@@ -522,7 +522,7 @@
private class ResourcesListCellRenderer extends DefaultListCellRenderer {
@Override
- public Component getListCellRendererComponent(JList list, Object value,
+ public Component getListCellRendererComponent(JList<?> list, Object value,
int index, boolean isSelected, boolean cellHasFocus) {
Gate.ResourceInfo rInfo = (Gate.ResourceInfo)value;
// prepare the renderer
Modified: gate/trunk/src/main/gate/gui/docview/AnnotationEditor.java
===================================================================
--- gate/trunk/src/main/gate/gui/docview/AnnotationEditor.java 2014-04-17
15:13:32 UTC (rev 17860)
+++ gate/trunk/src/main/gate/gui/docview/AnnotationEditor.java 2014-04-17
17:04:10 UTC (rev 17861)
@@ -248,7 +248,7 @@
pane.add(dismissButton, constraints);
constraints.anchor = GridBagConstraints.CENTER;
constraints.insets = insets0;
- typeCombo = new JComboBox();
+ typeCombo = new JComboBox<String>();
typeCombo.setEditable(true);
typeCombo.setBackground(UIManager.getLookAndFeelDefaults().getColor(
"ToolTip.background"));
@@ -455,7 +455,7 @@
this.ann = ann;
this.set = set;
if(ann == null) {
- typeCombo.setModel(new DefaultComboBoxModel());
+ typeCombo.setModel(new DefaultComboBoxModel<String>());
featuresEditor.setSchema(new AnnotationSchema());
// popupWindow.doLayout();
popupWindow.validate();
@@ -468,7 +468,7 @@
types.addAll(set.getAllTypes());
java.util.List<String> typeList = new ArrayList<String>(types);
Collections.sort(typeList);
- typeCombo.setModel(new DefaultComboBoxModel(typeList.toArray()));
+ typeCombo.setModel(new DefaultComboBoxModel<String>(typeList.toArray(new
String[typeList.size()])));
typeCombo.setSelectedItem(annType);
featuresEditor.setSchema(schemasByType.get(annType));
featuresEditor.setTargetFeatures(ann.getFeatures());
@@ -820,7 +820,7 @@
/**
* Combobox for annotation type.
*/
- protected JComboBox typeCombo;
+ protected JComboBox<String> typeCombo;
/**
* Component for features editing.
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs