Gridarta Editor
ArchetypeAttribute.java
Go to the documentation of this file.
1 /*
2  * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games.
3  * Copyright (C) 2000-2015 The Gridarta Developers.
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 2 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 along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 package net.sf.gridarta.model.archetypetype;
21 
22 import org.jetbrains.annotations.NotNull;
23 
28 public abstract class ArchetypeAttribute {
29 
33  public static final int TEXTFIELD_COLUMNS = 18;
34 
38  @NotNull
39  private final String archetypeAttributeName;
40 
44  @NotNull
45  private final String attributeName;
46 
50  @NotNull
51  private final String description;
52 
56  private final int inputLength;
57 
65  protected ArchetypeAttribute(@NotNull final String archetypeAttributeName, @NotNull final String attributeName, @NotNull final String description, final int inputLength) {
66  this.archetypeAttributeName = archetypeAttributeName;
67  this.attributeName = attributeName;
68  this.description = description;
69  this.inputLength = inputLength;
70  }
71 
76  @NotNull
77  public String getArchetypeAttributeName() {
79  }
80 
85  @NotNull
86  public String getAttributeName() {
87  return attributeName;
88  }
89 
94  @NotNull
95  public String getDescription() {
96  return description;
97  }
98 
103  public int getInputLength() {
104  return inputLength;
105  }
106 
107  @NotNull
108  @Override
109  public String toString() {
110  return "editor=" + archetypeAttributeName + ",arch=" + attributeName;
111  }
112 
117  public abstract void visit(@NotNull ArchetypeAttributeVisitor visitor);
118 
119 }
This Class contains the data of one archetype attribute.
final String archetypeAttributeName
The archetype attribute name.
String getDescription()
Returns the attribute's description.
ArchetypeAttribute(@NotNull final String archetypeAttributeName, @NotNull final String attributeName, @NotNull final String description, final int inputLength)
Creates a new instance.
String getArchetypeAttributeName()
Returns the archetype attribute name.
final int inputLength
The input length in characters for text input fields.
abstract void visit(@NotNull ArchetypeAttributeVisitor visitor)
Calls the.
String getAttributeName()
Returns the user interface attribute name.
static final int TEXTFIELD_COLUMNS
The width (columns) for input fields like textfields or JChooseBoxes.
int getInputLength()
Returns the input length in characters for text input fields.
final String description
The attribute's description.
final String attributeName
The user interface attribute name.