1 /*
   2  * Copyright (c) 2010, 2014, 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
  23  * questions.
  24  */
  25 package com.sun.glass.events;
  26 
  27 public class WindowEvent {
  28     final static public int RESIZE                = 511;
  29     final static public int MOVE                  = 512;
  30     final static public int RESCALE               = 513;
  31 
  32     final static public int CLOSE                 = 521;
  33     final static public int DESTROY               = 522;
  34 
  35     final static public int MINIMIZE              = 531;
  36     final static public int MAXIMIZE              = 532;
  37     final static public int RESTORE               = 533;
  38 
  39     final static public int _FOCUS_MIN            = 541;
  40     final static public int FOCUS_LOST            = 541;
  41     final static public int FOCUS_GAINED          = 542;
  42     final static public int FOCUS_GAINED_FORWARD  = 543;
  43     final static public int FOCUS_GAINED_BACKWARD = 544;
  44     final static public int _FOCUS_MAX            = 544;
  45 
  46     final static public int FOCUS_DISABLED        = 545;
  47     final static public int FOCUS_UNGRAB          = 546;
  48 
  49     public static String getEventName(final int eventType) {
  50         switch(eventType) {
  51             case WindowEvent.RESIZE:
  52                 return "RESIZE";
  53             case WindowEvent.MOVE:
  54                 return "MOVE";
  55             case WindowEvent.RESCALE:
  56                 return "RESCALE";
  57             case WindowEvent.CLOSE:
  58                 return "CLOSE";
  59             case WindowEvent.DESTROY:
  60                 return "DESTROY";
  61             case WindowEvent.MINIMIZE:
  62                 return "MINIMIZE";
  63             case WindowEvent.MAXIMIZE:
  64                 return "MAXIMIZE";
  65             case WindowEvent.RESTORE:
  66                 return "RESTORE";
  67             case WindowEvent.FOCUS_LOST:
  68                 return "FOCUS_LOST";
  69             case WindowEvent.FOCUS_GAINED:
  70                 return "FOCUS_GAINED";
  71             case WindowEvent.FOCUS_GAINED_FORWARD:
  72                 return "FOCUS_GAINED_FORWARD";
  73             case WindowEvent.FOCUS_GAINED_BACKWARD:
  74                 return "FOCUS_GAINED_BACKWARD";
  75             case WindowEvent.FOCUS_DISABLED:
  76                 return "FOCUS_DISABLED";
  77             case WindowEvent.FOCUS_UNGRAB:
  78                 return "FOCUS_UNGRAB";
  79             default:
  80                 return "UNKNOWN";
  81         }
  82     }
  83 }