1 | /**
|
---|
2 | * ItemParentStateChangedEvent.java
|
---|
3 | * Copyright (C) 2010 New Zealand Digital Library, http://expeditee.org
|
---|
4 | *
|
---|
5 | * This program 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 3 of the License, or
|
---|
8 | * (at your option) any later version.
|
---|
9 | *
|
---|
10 | * This program is distributed in the hope that it will be useful,
|
---|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
13 | * GNU General Public License for more details.
|
---|
14 | *
|
---|
15 | * You should have received a copy of the GNU General Public License
|
---|
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>.
|
---|
17 | */
|
---|
18 |
|
---|
19 | package org.expeditee.items;
|
---|
20 |
|
---|
21 | import org.expeditee.gui.Frame;
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * Raised whenever the items parent (Frame) changes - when the frame is no longer in view
|
---|
25 | * or becomes in view, or if the item has no parent / has a new parent.
|
---|
26 | *
|
---|
27 | * @author Brook Novak
|
---|
28 | *
|
---|
29 | */
|
---|
30 | public class ItemParentStateChangedEvent {
|
---|
31 |
|
---|
32 | private Frame _src;
|
---|
33 | private UserAppliedPermission _overlayLevel;
|
---|
34 | private int _eventType;
|
---|
35 |
|
---|
36 | public static final int EVENT_TYPE_SHOWN = 1;
|
---|
37 | public static final int EVENT_TYPE_SHOWN_VIA_OVERLAY = 2;
|
---|
38 | public static final int EVENT_TYPE_HIDDEN = 3;
|
---|
39 | public static final int EVENT_TYPE_ADDED = 4;
|
---|
40 | public static final int EVENT_TYPE_ADDED_VIA_OVERLAY = 5;
|
---|
41 | public static final int EVENT_TYPE_REMOVED = 6;
|
---|
42 | public static final int EVENT_TYPE_REMOVED_VIA_OVERLAY = 7;
|
---|
43 |
|
---|
44 |
|
---|
45 | public ItemParentStateChangedEvent(Frame src, int eventType) {
|
---|
46 | this(src, eventType, UserAppliedPermission.none);
|
---|
47 | }
|
---|
48 |
|
---|
49 | public ItemParentStateChangedEvent(Frame src, int eventType, UserAppliedPermission overlayLevel) {
|
---|
50 | _src = src;
|
---|
51 | _overlayLevel = overlayLevel;
|
---|
52 | _eventType = eventType;
|
---|
53 | }
|
---|
54 |
|
---|
55 | /**
|
---|
56 | *
|
---|
57 | * @return
|
---|
58 | */
|
---|
59 | public UserAppliedPermission getOverlayLevel() {
|
---|
60 | return _overlayLevel;
|
---|
61 | }
|
---|
62 |
|
---|
63 | /**
|
---|
64 | * The parent that the item has been added to, removed from, shown on or hidden on.
|
---|
65 | * @return
|
---|
66 | */
|
---|
67 | public Frame getSource() {
|
---|
68 | return _src;
|
---|
69 | }
|
---|
70 |
|
---|
71 | public int getEventType() {
|
---|
72 | return _eventType;
|
---|
73 | }
|
---|
74 |
|
---|
75 |
|
---|
76 |
|
---|
77 | }
|
---|