< prev index next >
src/java.desktop/share/classes/javax/swing/SwingUtilities.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 308,318 ****
public static Component getDeepestComponentAt(Component parent, int x, int y) {
if (!parent.contains(x, y)) {
return null;
}
if (parent instanceof Container) {
! Component components[] = ((Container)parent).getComponents();
for (Component comp : components) {
if (comp != null && comp.isVisible()) {
Point loc = comp.getLocation();
if (comp instanceof Container) {
comp = getDeepestComponentAt(comp, x - loc.x, y - loc.y);
--- 308,318 ----
public static Component getDeepestComponentAt(Component parent, int x, int y) {
if (!parent.contains(x, y)) {
return null;
}
if (parent instanceof Container) {
! Component[] components = ((Container)parent).getComponents();
for (Component comp : components) {
if (comp != null && comp.isVisible()) {
Point loc = comp.getLocation();
if (comp instanceof Container) {
comp = getDeepestComponentAt(comp, x - loc.x, y - loc.y);
*** 604,614 ****
return new Rectangle[0];
}
Rectangle t = new Rectangle();
Rectangle a=null,b=null,c=null,d=null;
! Rectangle result[];
int rectCount = 0;
/* rectA contains rectB */
if (isRectangleContainingRectangle(rectA,rectB)) {
t.x = rectA.x; t.y = rectA.y; t.width = rectB.x - rectA.x; t.height = rectA.height;
--- 604,614 ----
return new Rectangle[0];
}
Rectangle t = new Rectangle();
Rectangle a=null,b=null,c=null,d=null;
! Rectangle[] result;
int rectCount = 0;
/* rectA contains rectB */
if (isRectangleContainingRectangle(rectA,rectB)) {
t.x = rectA.x; t.y = rectA.y; t.width = rectB.x - rectA.x; t.height = rectA.height;
< prev index next >