MCPcopy Create free account
hub / github.com/GateNLP/gate-core / initGUI

Method initGUI

src/main/java/gate/gui/docview/CorefEditor.java:157–252  ·  view source on GitHub ↗

This method intiates the GUI for co-reference editor

()

Source from the content-addressed store, hash-verified

155 * This method intiates the GUI for co-reference editor
156 */
157 @Override
158 protected void initGUI() {
159
160 //get a pointer to the textual view used for highlights
161 Iterator<DocumentView> centralViewsIter = owner.getCentralViews().iterator();
162 while (textView == null && centralViewsIter.hasNext()) {
163 DocumentView aView = centralViewsIter.next();
164 if (aView instanceof TextualDocumentView)
165 textView = (TextualDocumentView) aView;
166 }
167 textPane = (JTextArea) ( (JScrollPane) textView.getGUI()).getViewport().
168 getView();
169 highlighter = textPane.getHighlighter();
170 chainToolTipAction = new ChainToolTipAction();
171 chainToolTipTimer = new javax.swing.Timer(500, chainToolTipAction);
172 chainToolTipTimer.setRepeats(false);
173 newCorefAction = new NewCorefAction();
174 newCorefActionTimer = new javax.swing.Timer(500, newCorefAction);
175 newCorefActionTimer.setRepeats(false);
176
177 colorGenerator = new ColorGenerator();
178
179 // main Panel
180 mainPanel = new JPanel();
181 mainPanel.setLayout(new BorderLayout());
182
183 // topPanel
184 topPanel = new JPanel();
185 topPanel.setLayout(new BorderLayout());
186
187 // subPanel
188 subPanel = new JPanel();
189 subPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
190
191 // showAnnotations Button
192 showAnnotations = new JToggleButton("Show");
193 showAnnotations.addActionListener(this);
194
195 // annotSets
196 annotSets = new JComboBox<String>();
197 annotSets.addActionListener(this);
198
199 // get all the annotationSets
200 Map<String,AnnotationSet> annotSetsMap = document.getNamedAnnotationSets();
201 annotSetsModel = new DefaultComboBoxModel<String>();
202 if (annotSetsMap != null) {
203 String [] array = annotSetsMap.keySet().toArray(new String[annotSetsMap.keySet().size()]);
204 for(int i=0;i<array.length;i++) {
205 annotSetsMap.get(array[i]).addAnnotationSetListener(this);
206 }
207 annotSetsModel = new DefaultComboBoxModel<String>(array);
208 }
209 document.getAnnotations().addAnnotationSetListener(this);
210 annotSetsModel.insertElementAt(DEFAULT_ANNOTSET_NAME, 0);
211 annotSets.setModel(annotSetsModel);
212
213 // annotTypes
214 annotTypesModel = new DefaultComboBoxModel<String>();

Callers

nothing calls this directly

Calls 15

initDataMethod · 0.95
getCentralViewsMethod · 0.80
setSelectedIndexMethod · 0.80
iteratorMethod · 0.65
hasNextMethod · 0.65
nextMethod · 0.65
getGUIMethod · 0.65
sizeMethod · 0.65
getMethod · 0.65
getAnnotationsMethod · 0.65

Tested by

no test coverage detected