private static ViewCanvas<?> getViewCanvas(InputEvent e) { Object source = e.getSource(); if (source instanceof ViewCanvas) { return (ViewCanvas<?>) source; } return null; }
protected ViewCanvas<? extends ImageElement> getViewCanvas(InputEvent e) { Object source = e.getSource(); if (source instanceof ViewCanvas) { return (ViewCanvas<?>) source; } return null; }
public void eventListenerMethod(InputEvent e) { JTextField fieldThatGeneratedEvent= e.getSource(); TrainingClass tClass= myMap.get(fieldThatGeneratedEvent); }
/** Check whether the source of the event is located in this instance.*/ private boolean isOrigin(final InputEvent event) { final Object source = event.getSource(); // find it ... check the canvas for now TODO if (canvas == source) { return true; } return false; }
private TreeItem<TreeItemContent> getSourceItem(InputEvent e){ return ((TreeCell)e.getSource()).getTreeItem(); }
/** * Resets the associated component's transform. */ protected void resetTransform(InputEvent e) { JGVTComponent c = (JGVTComponent)e.getSource(); c.resetRenderingTransform(); finished = true; } }
/** * Resets the associated component's transform. */ protected void resetTransform(InputEvent e) { JGVTComponent c = (JGVTComponent)e.getSource(); c.resetRenderingTransform(); finished = true; } }
/** * Resets the associated component's transform. */ protected void resetTransform(InputEvent e) { JGVTComponent c = (JGVTComponent)e.getSource(); c.resetRenderingTransform(); finished = true; } }
private void openResult(InputEvent e) { JTable table = (JTable) e.getSource(); Integer selectedLine = table.getSelectionModel().getLeadSelectionIndex(); FindAction.jumpToResult(searchResults.get(selectedLine)); }
protected boolean acceptEventOrConsumeIt(InputEvent e) { Object source = e.getSource(); boolean accept = source instanceof JComponent; if (accept) { JComponent component = (JComponent) source; accept = acceptedComponentNames.contains(component.getName()); if (!accept) { for (Class<?> acceptedComponentType : acceptedComponentTypes) { accept = acceptedComponentType.isAssignableFrom(component.getClass()); if (accept) { break; } } } } if (!accept) { e.consume(); } return accept; }
protected boolean acceptEventOrConsumeIt(InputEvent e) { Object source = e.getSource(); boolean accept = source instanceof JComponent; if (accept) { JComponent component = (JComponent) source; accept = acceptedComponentNames.contains(component.getName()); if (!accept) { for (Class<?> acceptedComponentType : acceptedComponentTypes) { accept = acceptedComponentType.isAssignableFrom(component.getClass()); if (accept) { break; } } } } if (!accept) { e.consume(); } return accept; }
@FXML public void onMouseClickedCancelBtn(InputEvent e) { final Node source = (Node) e.getSource(); final Stage stage = (Stage) source.getScene().getWindow(); stage.close(); }
public void handleInitialInputEvent(InputEvent e) { System.err.println("HandleInitialInputEvent"); getLayout().layoutContainer(this); if (e instanceof MouseEvent) { Point p = SwingUtilities.convertPoint((JComponent) e.getSource(), ((MouseEvent) e).getPoint(), this); Component c = getComponentAt(p); if (c instanceof JRadioButton) { ((JRadioButton) c).setSelected(true); c.requestFocus(); fireActionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, InplaceEditor.COMMAND_SUCCESS)); } } else { Component[] c = getComponents(); for (int i = 0; i < c.length; i++) { if (c[i] instanceof JRadioButton) { if (((JRadioButton) c[i]).isSelected()) { c[i].requestFocusInWindow(); } } } } }
/** Opens up the Google Login panel as a popup. */ private static void showPopup(AnActionEvent event) { GoogleLoginUsersPanel usersPanel = new GoogleLoginUsersPanel(); ComponentPopupBuilder popupBuilder = JBPopupFactory.getInstance().createComponentPopupBuilder(usersPanel, usersPanel.getList()); JBPopup popup = popupBuilder.setCancelOnWindowDeactivation(true).createPopup(); Optional<JComponent> sourceComponentOptional = Optional.ofNullable(event.getInputEvent()).map(e -> (JComponent) e.getSource()); if (sourceComponentOptional.isPresent()) { popup.showUnderneathOf(sourceComponentOptional.get()); } else { popup.showInFocusCenter(); } } }
public void handleInitialInputEvent(InputEvent e) { System.err.println("HandleInitialInputEvent"); getLayout().layoutContainer(this); if (e instanceof MouseEvent) { Point p = SwingUtilities.convertPoint( (JComponent)e.getSource(), ((MouseEvent) e).getPoint(), this); Component c = getComponentAt(p); if (c instanceof JRadioButton) { ((JRadioButton) c).setSelected(true); c.requestFocus(); fireActionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, InplaceEditor.COMMAND_SUCCESS)); } } else { Component[] c = getComponents(); for (int i=0; i < c.length; i++) { if (c[i] instanceof JRadioButton) { if (((JRadioButton) c[i]).isSelected()) { c[i].requestFocusInWindow(); } } } } }
public void handleInitialInputEvent(InputEvent e) { System.err.println("HandleInitialInputEvent"); getLayout().layoutContainer(this); if (e instanceof MouseEvent) { Point p = SwingUtilities.convertPoint( (JComponent)e.getSource(), ((MouseEvent) e).getPoint(), this); Component c = getComponentAt(p); if (c instanceof JRadioButton) { ((JRadioButton) c).setSelected(true); c.requestFocus(); fireActionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, InplaceEditor.COMMAND_SUCCESS)); } } else { Component[] c = getComponents(); for (int i=0; i < c.length; i++) { if (c[i] instanceof JRadioButton) { if (((JRadioButton) c[i]).isSelected()) { c[i].requestFocusInWindow(); } } } } }
|| ((KeyEvent) event).isMetaDown()); boolean canvasIsSource = inputEvent.getSource() == mainCanvas || VSwingUtil.isChildOf( (Component) inputEvent.getSource(), mainCanvas); boolean dockIsSource = inputEvent.getSource() == mainCanvas.getDock() || VSwingUtil.isChildOf( (Component) inputEvent.getSource(), mainCanvas.getDock()); boolean msgBoxIsSource = inputEvent.getSource() == mainCanvas.getMessageBox() || VSwingUtil.isChildOf( (Component) inputEvent.getSource(), mainCanvas.getMessageBox()); inputEvent.getSource().getClass()) || VSwingUtil.getParent((Component) inputEvent.getSource(), VDialogWindow.class) != null;