< prev index next >

src/java.desktop/unix/classes/sun/awt/X11/XTextFieldPeer.java

Print this page


   1 /*
   2  * Copyright (c) 2003, 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


 392 
 393     @Override
 394     void handleJavaKeyEvent(KeyEvent e) {
 395         AWTAccessor.getComponentAccessor().processEvent(xtext,e);
 396     }
 397 
 398 
 399     @Override
 400     public void handleJavaMouseEvent( MouseEvent mouseEvent ) {
 401         super.handleJavaMouseEvent(mouseEvent);
 402         if (xtext != null)  {
 403             mouseEvent.setSource(xtext);
 404             int id = mouseEvent.getID();
 405             if (id == MouseEvent.MOUSE_DRAGGED || id == MouseEvent.MOUSE_MOVED)
 406                 xtext.processMouseMotionEventImpl(mouseEvent);
 407             else
 408                 xtext.processMouseEventImpl(mouseEvent);
 409         }
 410     }
 411 
 412     /**
 413      * DEPRECATED
 414      */
 415     @Override
 416     public Dimension minimumSize() {
 417         return getMinimumSize();
 418     }
 419 
 420     @Override
 421     public void setVisible(boolean b) {
 422         super.setVisible(b);
 423         if (xtext != null) xtext.setVisible(b);
 424     }
 425 
 426     @Override
 427     public void setBounds(int x, int y, int width, int height, int op) {
 428         super.setBounds(x, y, width, height, op);
 429         if (xtext != null) {
 430             /*
 431              * Fixed 6277332, 6198290:
 432              * the coordinates is coming (to peer): relatively to closest HW parent
 433              * the coordinates is setting (to textField): relatively to closest ANY parent
 434              * the parent of peer is target.getParent()
 435              * the parent of textField is the same
 436              * see 6277332, 6198290 for more information
 437              */
 438             int childX = x;
 439             int childY = y;


   1 /*
   2  * Copyright (c) 2003, 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


 392 
 393     @Override
 394     void handleJavaKeyEvent(KeyEvent e) {
 395         AWTAccessor.getComponentAccessor().processEvent(xtext,e);
 396     }
 397 
 398 
 399     @Override
 400     public void handleJavaMouseEvent( MouseEvent mouseEvent ) {
 401         super.handleJavaMouseEvent(mouseEvent);
 402         if (xtext != null)  {
 403             mouseEvent.setSource(xtext);
 404             int id = mouseEvent.getID();
 405             if (id == MouseEvent.MOUSE_DRAGGED || id == MouseEvent.MOUSE_MOVED)
 406                 xtext.processMouseMotionEventImpl(mouseEvent);
 407             else
 408                 xtext.processMouseEventImpl(mouseEvent);
 409         }
 410     }
 411 








 412     @Override
 413     public void setVisible(boolean b) {
 414         super.setVisible(b);
 415         if (xtext != null) xtext.setVisible(b);
 416     }
 417 
 418     @Override
 419     public void setBounds(int x, int y, int width, int height, int op) {
 420         super.setBounds(x, y, width, height, op);
 421         if (xtext != null) {
 422             /*
 423              * Fixed 6277332, 6198290:
 424              * the coordinates is coming (to peer): relatively to closest HW parent
 425              * the coordinates is setting (to textField): relatively to closest ANY parent
 426              * the parent of peer is target.getParent()
 427              * the parent of textField is the same
 428              * see 6277332, 6198290 for more information
 429              */
 430             int childX = x;
 431             int childY = y;


< prev index next >