src/java/de/uapcore/lightpit/entities/Module.java

Sun, 08 Apr 2018 16:51:15 +0200

author
Mike Becker <universe@uap-core.de>
date
Sun, 08 Apr 2018 16:51:15 +0200
changeset 28
cfc3d11884ad
parent 26
65d5a0ca49ae
permissions
-rw-r--r--

smaller main menu with better main menu buttons

21
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
1 /*
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
3 *
24
8137ec335416 updates copyright header
Mike Becker <universe@uap-core.de>
parents: 21
diff changeset
4 * Copyright 2018 Mike Becker. All rights reserved.
21
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
5 *
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
6 * Redistribution and use in source and binary forms, with or without
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
7 * modification, are permitted provided that the following conditions are met:
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
8 *
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
9 * 1. Redistributions of source code must retain the above copyright
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
10 * notice, this list of conditions and the following disclaimer.
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
11 *
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
12 * 2. Redistributions in binary form must reproduce the above copyright
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
13 * notice, this list of conditions and the following disclaimer in the
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
14 * documentation and/or other materials provided with the distribution.
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
15 *
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
26 * POSSIBILITY OF SUCH DAMAGE.
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
27 *
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
28 */
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
29 package de.uapcore.lightpit.entities;
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
30
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
31 import de.uapcore.lightpit.LightPITModule;
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
32
26
65d5a0ca49ae Module names and descriptions + some more styling
Mike Becker <universe@uap-core.de>
parents: 24
diff changeset
33 public final class Module {
21
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
34 private int modID;
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
35 private String classname;
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
36 private boolean visible;
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
37
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
38 private LightPITModule.ELProxy annotatedInfos;
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
39
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
40 public int getModID() {
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
41 return modID;
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
42 }
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
43
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
44 public void setModID(int modID) {
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
45 this.modID = modID;
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
46 }
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
47
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
48 public String getClassname() {
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
49 return classname;
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
50 }
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
51
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
52 public void setClassname(String classname) {
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
53 this.classname = classname;
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
54 }
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
55
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
56 public boolean isVisible() {
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
57 return visible;
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
58 }
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
59
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
60 public void setVisible(boolean visible) {
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
61 this.visible = visible;
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
62 }
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
63
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
64 public LightPITModule.ELProxy getAnnotatedInfos() {
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
65 return annotatedInfos;
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
66 }
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
67
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
68 public void setAnnotatedInfos(LightPITModule.ELProxy annotatedInfos) {
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
69 this.annotatedInfos = annotatedInfos;
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
70 }
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
71
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
72 @Override
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
73 public int hashCode() {
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
74 int hash = 3;
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
75 hash = 41 * hash + this.modID;
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
76 return hash;
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
77 }
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
78
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
79 @Override
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
80 public boolean equals(Object obj) {
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
81 if (this == obj) {
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
82 return true;
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
83 }
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
84 if (obj == null || getClass() != obj.getClass()) {
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
85 return false;
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
86 } else {
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
87 return this.modID == ((Module) obj).modID;
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
88 }
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
89 }
b213fef2539e adds first part of a module manager UI
Mike Becker <universe@uap-core.de>
parents:
diff changeset
90 }

mercurial