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

Method processMouseEvent

src/main/java/gate/gui/CorpusEditor.java:264–284  ·  view source on GitHub ↗
(MouseEvent e)

Source from the content-addressed store, hash-verified

262 if(e.isPopupTrigger()) { processMouseEvent(e); }
263 }
264 private void processMouseEvent(MouseEvent e) {
265 int row = docTable.rowAtPoint(e.getPoint());
266 if(row == -1) { return; }
267
268 if(e.isPopupTrigger()) {
269 // context menu
270 if(!docTable.isRowSelected(row)) {
271 // if right click outside the selection then reset selection
272 docTable.getSelectionModel().setSelectionInterval(row, row);
273 }
274 JPopupMenu popup = new XJPopupMenu();
275 popup.add(openDocumentsAction);
276 popup.add(removeDocumentsAction);
277 popup.show(docTable, e.getPoint().x, e.getPoint().y);
278
279 } else if(e.getID() == MouseEvent.MOUSE_CLICKED
280 && e.getClickCount() == 2) {
281 // open document on double-click
282 openDocumentsAction.actionPerformed(null);
283 }
284 }
285 });
286
287 // Enter key opens the selected documents

Callers 3

mouseClickedMethod · 0.95
mousePressedMethod · 0.95
mouseReleasedMethod · 0.95

Calls 7

rowAtPointMethod · 0.80
getIDMethod · 0.80
getSelectionModelMethod · 0.65
addMethod · 0.65
setSelectionIntervalMethod · 0.45
showMethod · 0.45
actionPerformedMethod · 0.45

Tested by

no test coverage detected