1 /*
2 * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
897 // Routines to support deferred window positioning.
898 public void beginLayout() {
899 // Skip all painting till endLayout
900 isLayouting = true;
901 }
902
903 public void endLayout() {
904 if(!paintArea.isEmpty() && !paintPending &&
905 !((Component)target).getIgnoreRepaint()) {
906 // if not waiting for native painting repaint damaged area
907 postEvent(new PaintEvent((Component)target, PaintEvent.PAINT,
908 new Rectangle()));
909 }
910 isLayouting = false;
911 }
912
913 public native void beginValidate();
914 public native void endValidate();
915
916 /**
917 * DEPRECATED
918 */
919 public Dimension preferredSize() {
920 return getPreferredSize();
921 }
922
923 /**
924 * register a DropTarget with this native peer
925 */
926
927 @Override
928 public synchronized void addDropTarget(DropTarget dt) {
929 if (nDropTargets == 0) {
930 nativeDropTargetContext = addNativeDropTarget();
931 }
932 nDropTargets++;
933 }
934
935 /**
936 * unregister a DropTarget with this native peer
937 */
938
939 @Override
940 public synchronized void removeDropTarget(DropTarget dt) {
941 nDropTargets--;
942 if (nDropTargets == 0) {
943 removeNativeDropTarget();
|
1 /*
2 * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
897 // Routines to support deferred window positioning.
898 public void beginLayout() {
899 // Skip all painting till endLayout
900 isLayouting = true;
901 }
902
903 public void endLayout() {
904 if(!paintArea.isEmpty() && !paintPending &&
905 !((Component)target).getIgnoreRepaint()) {
906 // if not waiting for native painting repaint damaged area
907 postEvent(new PaintEvent((Component)target, PaintEvent.PAINT,
908 new Rectangle()));
909 }
910 isLayouting = false;
911 }
912
913 public native void beginValidate();
914 public native void endValidate();
915
916 /**
917 * register a DropTarget with this native peer
918 */
919
920 @Override
921 public synchronized void addDropTarget(DropTarget dt) {
922 if (nDropTargets == 0) {
923 nativeDropTargetContext = addNativeDropTarget();
924 }
925 nDropTargets++;
926 }
927
928 /**
929 * unregister a DropTarget with this native peer
930 */
931
932 @Override
933 public synchronized void removeDropTarget(DropTarget dt) {
934 nDropTargets--;
935 if (nDropTargets == 0) {
936 removeNativeDropTarget();
|