| 1 | /* Copyright (C) 2000, 2002 Free Software Foundation
|
|---|
| 2 |
|
|---|
| 3 | This file is part of GNU Classpath.
|
|---|
| 4 |
|
|---|
| 5 | GNU Classpath is free software; you can redistribute it and/or modify
|
|---|
| 6 | it under the terms of the GNU General Public License as published by
|
|---|
| 7 | the Free Software Foundation; either version 2, or (at your option)
|
|---|
| 8 | any later version.
|
|---|
| 9 |
|
|---|
| 10 | GNU Classpath is distributed in the hope that it will be useful, but
|
|---|
| 11 | WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|---|
| 13 | General Public License for more details.
|
|---|
| 14 |
|
|---|
| 15 | You should have received a copy of the GNU General Public License
|
|---|
| 16 | along with GNU Classpath; see the file COPYING. If not, write to the
|
|---|
| 17 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
|---|
| 18 | 02111-1307 USA.
|
|---|
| 19 |
|
|---|
| 20 | Linking this library statically or dynamically with other modules is
|
|---|
| 21 | making a combined work based on this library. Thus, the terms and
|
|---|
| 22 | conditions of the GNU General Public License cover the whole
|
|---|
| 23 | combination.
|
|---|
| 24 |
|
|---|
| 25 | As a special exception, the copyright holders of this library give you
|
|---|
| 26 | permission to link this library with independent modules to produce an
|
|---|
| 27 | executable, regardless of the license terms of these independent
|
|---|
| 28 | modules, and to copy and distribute the resulting executable under
|
|---|
| 29 | terms of your choice, provided that you also meet, for each linked
|
|---|
| 30 | independent module, the terms and conditions of the license of that
|
|---|
| 31 | module. An independent module is a module which is not derived from
|
|---|
| 32 | or based on this library. If you modify this library, you may extend
|
|---|
| 33 | this exception to your version of the library, but you are not
|
|---|
| 34 | obligated to do so. If you do not wish to do so, delete this
|
|---|
| 35 | exception statement from your version. */
|
|---|
| 36 |
|
|---|
| 37 | package java.awt.event;
|
|---|
| 38 | import java.awt.*;
|
|---|
| 39 |
|
|---|
| 40 | /**
|
|---|
| 41 | * @since 1.3
|
|---|
| 42 | * @author Bryce McKinlay
|
|---|
| 43 | */
|
|---|
| 44 |
|
|---|
| 45 | /* Status: thought to be complete and correct. */
|
|---|
| 46 |
|
|---|
| 47 | public class HierarchyEvent extends AWTEvent
|
|---|
| 48 | {
|
|---|
| 49 | public static final int PARENT_CHANGED = 1 << 0,
|
|---|
| 50 | DISPLAYABILITY_CHANGED = 1 << 1,
|
|---|
| 51 | SHOWING_CHANGED = 1 << 2,
|
|---|
| 52 | HIERARCHY_FIRST = 1400,
|
|---|
| 53 | HIERARCHY_CHANGED = 1400,
|
|---|
| 54 | ANCESTOR_MOVED = 1401,
|
|---|
| 55 | ANCESTOR_RESIZED = 1402,
|
|---|
| 56 | HIERARCHY_LAST = 1402;
|
|---|
| 57 |
|
|---|
| 58 | /* Serialized fields from the serialization spec. */
|
|---|
| 59 | Component changed;
|
|---|
| 60 | Container changedParent;
|
|---|
| 61 | long changeFlags = 0;
|
|---|
| 62 |
|
|---|
| 63 | public HierarchyEvent(Component source, int id, Component changed,
|
|---|
| 64 | Container changedParent)
|
|---|
| 65 | {
|
|---|
| 66 | super(source, id);
|
|---|
| 67 | this.changed = changed;
|
|---|
| 68 | this.changedParent = changedParent;
|
|---|
| 69 | }
|
|---|
| 70 |
|
|---|
| 71 | public HierarchyEvent(Component source, int id, Component changed,
|
|---|
| 72 | Container changedParent, long changeFlags)
|
|---|
| 73 | {
|
|---|
| 74 | super(source,id);
|
|---|
| 75 | this.changed = changed;
|
|---|
| 76 | this.changedParent = changedParent;
|
|---|
| 77 | this.changeFlags = changeFlags;
|
|---|
| 78 | }
|
|---|
| 79 |
|
|---|
| 80 | public Component getComponent()
|
|---|
| 81 | {
|
|---|
| 82 | return (Component) source;
|
|---|
| 83 | }
|
|---|
| 84 |
|
|---|
| 85 | public Component getChanged()
|
|---|
| 86 | {
|
|---|
| 87 | return changed;
|
|---|
| 88 | }
|
|---|
| 89 |
|
|---|
| 90 | public Container getChangedParent()
|
|---|
| 91 | {
|
|---|
| 92 | return changedParent;
|
|---|
| 93 | }
|
|---|
| 94 |
|
|---|
| 95 | public long getChangeFlags()
|
|---|
| 96 | {
|
|---|
| 97 | return changeFlags;
|
|---|
| 98 | }
|
|---|
| 99 |
|
|---|
| 100 | public String paramString()
|
|---|
| 101 | {
|
|---|
| 102 | String r;
|
|---|
| 103 | switch (id)
|
|---|
| 104 | {
|
|---|
| 105 | case HIERARCHY_CHANGED:
|
|---|
| 106 | r = "HIERARCHY_CHANGED";
|
|---|
| 107 | break;
|
|---|
| 108 |
|
|---|
| 109 | case ANCESTOR_MOVED:
|
|---|
| 110 | r = "ANCESTOR_MOVED";
|
|---|
| 111 | break;
|
|---|
| 112 |
|
|---|
| 113 | case ANCESTOR_RESIZED:
|
|---|
| 114 | r = "ANCESTOR_RESIZED";
|
|---|
| 115 | break;
|
|---|
| 116 |
|
|---|
| 117 | default:
|
|---|
| 118 | return "unknown type";
|
|---|
| 119 | }
|
|---|
| 120 |
|
|---|
| 121 | r += "(" + changed + "," + changedParent + ")";
|
|---|
| 122 | return r;
|
|---|
| 123 | }
|
|---|
| 124 | }
|
|---|