source: trunk/src/org/expeditee/gui/Overlay.java@ 1102

Last change on this file since 1102 was 1102, checked in by davidb, 6 years ago

Reworking of the code-base to separate logic from graphics. This version of Expeditee now supports a JFX graphics as an alternative to SWING

File size: 1.7 KB
Line 
1/**
2 * Overlay.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
19package org.expeditee.gui;
20
21import java.util.Collection;
22import java.util.LinkedList;
23import java.util.List;
24
25import org.expeditee.items.UserAppliedPermission;
26import org.expeditee.items.widgets.Widget;
27
28/** TODO: Comment. cts16 */
29public class Overlay {
30 /** TODO: Comment. cts16 */
31 public Frame Frame;
32
33 /** TODO: Comment. cts16 */
34 public UserAppliedPermission permission;
35
36 /** TODO: Comment. cts16 */
37 public Overlay(Frame overlay, UserAppliedPermission level) {
38 Frame = overlay;
39 permission = level;
40 }
41
42 @Override
43 public boolean equals(Object o)
44 {
45 if (!(o instanceof Overlay)) return false;
46
47 return ((Overlay) o).Frame == Frame;
48 }
49
50 @Override
51 public int hashCode()
52 {
53 // TODO: Comment. cts16
54 return 0;
55 }
56
57 /** TODO: Comment. cts16 */
58 public static Overlay getOverlay(Collection<Overlay> overlays, Frame frame)
59 {
60 // Check the frame is in the list of overlays
61 for (Overlay o : overlays) {
62 if (o.Frame.equals(frame)) {
63 return o;
64 }
65 }
66 return null;
67 }
68}
Note: See TracBrowser for help on using the repository browser.