* To react to Ctrl+F keys combination calling Search/Replace general action
* (and nodes/edges context menu mappings)
* @param event
*/
public void eventDispatched(AWTEvent event) {
KeyEvent evt = (KeyEvent) event;
if (evt.getID() == KeyEvent.KEY_RELEASED && (evt.getModifiersEx() & KeyEvent.CTRL_DOWN_MASK) != 0) {
DataLaboratoryHelper dlh = DataLaboratoryHelper.getDefault();
if (evt.getKeyCode() == KeyEvent.VK_F) {//Call Search replace with 'F' without general actions key mappings support:
GeneralActionsManipulator gam = dlh.getGeneralActionsManipulatorByName("SearchReplace");
if (gam != null) {
dlh.executeManipulator(gam);
}
evt.consume();
} else {//Nodes/edges mappings:
if (classDisplayed == ClassDisplayed.NODE) {
final ContextMenuItemManipulator item = nodesActionMappings.get(evt.getKeyCode());
if (item != null) {
Node[] nodes = nodeTable.getNodesFromSelectedRows();
if (nodes.length > 0) {
((NodesManipulator) item).setup(nodes, nodes[0]);
if (item.isAvailable() && item.canExecute()) {
DataLaboratoryHelper.getDefault().executeManipulator(item);
}
}
evt.consume();
}
} else if (classDisplayed == ClassDisplayed.EDGE) {
final ContextMenuItemManipulator item = edgesActionMappings.get(evt.getKeyCode());
if (item != null) {
Edge[] edges = edgeTable.getEdgesFromSelectedRows();
if (edges.length > 0) {
((EdgesManipulator) item).setup(edges, edges[0]);
if (item.isAvailable() && item.canExecute()) {
DataLaboratoryHelper.getDefault().executeManipulator(item);
}
}
evt.consume();
}
}
}
}
}