[919] | 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 |
|
---|
[4] | 19 | package org.expeditee.gui;
|
---|
| 20 |
|
---|
[154] | 21 | import java.util.Collection;
|
---|
[1102] | 22 | import java.util.LinkedList;
|
---|
| 23 | import java.util.List;
|
---|
[154] | 24 |
|
---|
[454] | 25 | import org.expeditee.items.UserAppliedPermission;
|
---|
[1102] | 26 | import org.expeditee.items.widgets.Widget;
|
---|
[108] | 27 |
|
---|
[1102] | 28 | /** TODO: Comment. cts16 */
|
---|
[4] | 29 | public class Overlay {
|
---|
[1102] | 30 | /** TODO: Comment. cts16 */
|
---|
[4] | 31 | public Frame Frame;
|
---|
| 32 |
|
---|
[1102] | 33 | /** TODO: Comment. cts16 */
|
---|
[454] | 34 | public UserAppliedPermission permission;
|
---|
[4] | 35 |
|
---|
[1102] | 36 | /** TODO: Comment. cts16 */
|
---|
[454] | 37 | public Overlay(Frame overlay, UserAppliedPermission level) {
|
---|
[4] | 38 | Frame = overlay;
|
---|
[115] | 39 | permission = level;
|
---|
[4] | 40 | }
|
---|
| 41 |
|
---|
| 42 | @Override
|
---|
[1102] | 43 | public boolean equals(Object o)
|
---|
| 44 | {
|
---|
| 45 | if (!(o instanceof Overlay)) return false;
|
---|
[4] | 46 |
|
---|
| 47 | return ((Overlay) o).Frame == Frame;
|
---|
| 48 | }
|
---|
| 49 |
|
---|
| 50 | @Override
|
---|
[1102] | 51 | public int hashCode()
|
---|
| 52 | {
|
---|
| 53 | // TODO: Comment. cts16
|
---|
[4] | 54 | return 0;
|
---|
| 55 | }
|
---|
[1102] | 56 |
|
---|
| 57 | /** TODO: Comment. cts16 */
|
---|
| 58 | public static Overlay getOverlay(Collection<Overlay> overlays, Frame frame)
|
---|
| 59 | {
|
---|
[154] | 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 | }
|
---|
[4] | 68 | }
|
---|