Component focused = (Component) evt.getNewValue(); if (focused != null && SwingUtilities.isDescendingFrom(focused, parent)) { parent.scrollRectToVisible(focused.getBounds());
if (SwingUtilities.isDescendingFrom(e.getOppositeWindow(), ClickAwayDialog.this)) { return;
private boolean isMyChildIsFocusedNow() { final Component owner = getFocusOwner(); if (owner == null) return false; if (mySelectedInfo != null) { if (!SwingUtilities.isDescendingFrom(owner, mySelectedInfo.getComponent())) return false; } return SwingUtilities.isDescendingFrom(owner, this); }
@Deprecated @Override public boolean requestDefaultFocus() { if ((customComponent != null) && !SwingUtilities.isDescendingFrom(pane, customComponent)) { return customComponent.requestFocusInWindow(); } else if (pane != null) { return pane.requestFocusInWindow(); } return false; }
public static boolean isFocusAncestor(@NotNull final JComponent component) { final Component owner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); if (owner == null) return false; if (owner == component) return true; return SwingUtilities.isDescendingFrom(owner, component); }
@Override public void propertyChange(PropertyChangeEvent ev) { Component c = focusManager.getPermanentFocusOwner(); if (c == null) return; for (Iterator<Container> iter = getTargets().iterator(); iter.hasNext();) { Container element = iter.next(); if ((element == c) || (SwingUtilities.isDescendingFrom(c, element))) { return; } } endSearching(); }
public boolean requestDefaultFocus() { if(customComponent != null && !SwingUtilities.isDescendingFrom(pane, customComponent)) { return customComponent.requestFocusInWindow(); } else if(pane != null) { return pane.requestFocusInWindow(); } return false; }
private EditorWindow findWindowWith(Component component) { if (component == null) return null; for (EditorWindow window : editorManager.getWindows()) { if (isDescendingFrom(component, panelOf(window))) { return window; } } return null; }
float getZoom() { final MapView mapView = attributeView.getMapView(); if(SwingUtilities.isDescendingFrom(this, mapView)) { return mapView.getZoom(); } return 1f; }
public boolean isSelected(final NodeView n) { if(isPrinting || (! selectedsValid && (selection.selectedNode == null || ! SwingUtilities.isDescendingFrom(selection.selectedNode, this) || ! selection.selectedNode.getContent().isVisible()))) return false; return selection.contains(n); }
/** Transfer the focus to the editor pane. */ public boolean requestFocusInWindow() { super.requestFocusInWindow(); if(customComponent != null && !SwingUtilities.isDescendingFrom(pane, customComponent)) { return customComponent.requestFocusInWindow(); } else if(pane != null) { return pane.requestFocusInWindow(); } return false; }
/** Transfer the focus to the editor pane. */ public void requestFocus() { super.requestFocus (); if(customComponent != null && !SwingUtilities.isDescendingFrom(pane, customComponent)) { customComponent.requestFocus(); } else if(pane != null) { pane.requestFocus(); } }
/** Transfer the focus to the editor pane. */ public boolean requestFocusInWindow() { super.requestFocusInWindow(); if(customComponent != null && !SwingUtilities.isDescendingFrom(pane, customComponent)) { return customComponent.requestFocusInWindow(); } else if(pane != null) { return pane.requestFocusInWindow(); } return false; }
/** Invokes execution of init code in non-ED thread. * @param evt ignored */ public void eventDispatched (AWTEvent event) { if (event.getSource() instanceof Component && SwingUtilities.isDescendingFrom(comp4Init, (Component)(event.getSource()))) { start(); } }
@Override public void menuSelectionChanged(boolean isIncluded) { if (!isIncluded) { final Object source = EventQueue.getCurrentEvent().getSource(); if (source instanceof Component) { final Component c = (Component) source; isIncluded = SwingUtilities.isDescendingFrom(c, this); } } super.menuSelectionChanged(isIncluded); } }
@Override public void windowClosing(DockingWindow window) throws OperationAbortedException { for(Component mapViewComponent : mapViews.toArray(new Component[]{})) if(SwingUtilities.isDescendingFrom(mapViewComponent, window)) if (!Controller.getCurrentController().getMapViewManager().close(mapViewComponent)) throw new OperationAbortedException("can not close view"); }
@Override public void moveFocusFromDescendantToSelection(Component ancestor) { Component focusOwner = FocusManager.getCurrentManager().getFocusOwner(); boolean toolbarLostFocus = focusOwner != null && SwingUtilities.isDescendingFrom(focusOwner, ancestor); if (toolbarLostFocus) { final Component selectedComponent = getSelectedComponent(); if (selectedComponent != null) selectedComponent.requestFocus(); } }
@Override protected void paintComponent(Graphics g) { if(gridColor == null){ final NodeView nodeView = attributeView.getNodeView(); if(SwingUtilities.isDescendingFrom(this, nodeView)) setGridAndBorderColor(nodeView.getMainView().getBorderColor()); } super.paintComponent(g); }
private void processFocusChange() { Component owner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); if (owner == null) { setFocused(false); return; } if (owner == this || SwingUtilities.isDescendingFrom(owner, this)) { setFocused(true); } else { setFocused(false); } }
private void docEvent() { final Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); if (focusOwner == null || !SwingUtilities.isDescendingFrom(focusOwner, htmlEditorPanel)) { return; } final ModeController modeController = Controller.getCurrentModeController(); final MapController mapController = modeController.getMapController(); final MapModel map = modeController.getController().getMap(); mapController.setSaved(map, false); }