Package gamedata
Class ClassMap.Entry
- java.lang.Object
-
- gamedata.ClassMap.Entry
-
- All Implemented Interfaces:
IconProvider,java.lang.Comparable<ClassMap.Entry>
- Enclosing class:
- ClassMap
public static final class ClassMap.Entry extends java.lang.Object implements java.lang.Comparable<ClassMap.Entry>, IconProvider
An entry in a class map file.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(ClassMap.Entry rhs)Compares this entry to another entry.StrangeEonsEditorcreateEditor()Creates an editor for this entry, adding it to the application window.StrangeEonsEditorcreateEditor(boolean debug)Creates an editor for this entry, adding it to the application window.booleanequals(java.lang.Object rhs)Returnstrueif the specified object is an entry with the same mapping.javax.swing.IcongetBanner()Returns the custom category banner to display for this item, ornullif the category should use the default banner.ClassMap.EntrygetCategory()Returns the category that this entry belongs to.GamegetGame()Returns the game that this entry is associated with.javax.swing.IcongetIcon()Returns this entry's icon.java.lang.StringgetKey()Returns the original entry name.java.lang.StringgetMapping()Returns the class name or script resource description that this entry maps to.java.lang.StringgetName()Returns the localized entry name.ClassMap.EntryTypegetType()Returns the type of entry that this represents.inthashCode()java.lang.StringtoString()
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the localized entry name. This is the key from the original entry, or the localized string obtained from the key if the key starts with '@'.- Returns:
- the localized entry name
- See Also:
getKey()
-
getKey
public java.lang.String getKey()
Returns the original entry name. This is the unlocalized key that defined the entry.- Returns:
- the original entry key
- See Also:
getName()
-
getIcon
public javax.swing.Icon getIcon()
Returns this entry's icon. This method never returnsnull.- Specified by:
getIconin interfaceIconProvider- Returns:
- the icon for the entry
-
getBanner
public javax.swing.Icon getBanner()
Returns the custom category banner to display for this item, ornullif the category should use the default banner.- Returns:
- the custom category banner, or
null
-
getMapping
public java.lang.String getMapping()
Returns the class name or script resource description that this entry maps to. If the entry represents a category, the mapping will benull.- Returns:
- the class mapped to by this entry, or
null
-
getCategory
public ClassMap.Entry getCategory()
Returns the category that this entry belongs to.- Returns:
- this entry's category, or
nullif this entry is a category
-
getType
public ClassMap.EntryType getType()
Returns the type of entry that this represents.- Returns:
- the type of the entry
-
getGame
public Game getGame()
Returns the game that this entry is associated with. Class map files designed for older versions of the application do not define the game for an entry. Entries created from such class maps will returnnull.- Returns:
- the game associated with this entry, or
null
-
compareTo
public int compareTo(ClassMap.Entry rhs)
Compares this entry to another entry. Returns an integer less than, equal to or greater than zero depending on whether this entry should fall before, in the same position as, or after the other entry in a sorted list.- Specified by:
compareToin interfacejava.lang.Comparable<ClassMap.Entry>- Parameters:
rhs- the target entry to compare this with- Returns:
- returns a negative, zero, or positive value as this entry is less than, equal to, or greater than the target entry
-
equals
public boolean equals(java.lang.Object rhs)
Returnstrueif the specified object is an entry with the same mapping.- Overrides:
equalsin classjava.lang.Object- Parameters:
rhs- the object to compare this with- Returns:
trueif the target object has the same class map value
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
createEditor
public StrangeEonsEditor createEditor()
Creates an editor for this entry, adding it to the application window.- Returns:
- the new editor, or
nullif creation failed
-
createEditor
public StrangeEonsEditor createEditor(boolean debug)
Creates an editor for this entry, adding it to the application window.This version of the method allows you to create scripted components in debug mode. In debug mode, a script breakpoint will be triggered at the start of the component creation. Note that this will effectively freeze the application until execution is resumed from an attached script debugging client. Creating a component in debug mode has no effect is script debugging is not enabled, or if the component is created from compiled code rather than a script.
- Parameters:
debug- iftrue, component types that use scripts will be created in debug mode- Returns:
- the new editor, or
nullif creation failed - Throws:
java.lang.UnsupportedOperationException- if called on a category entry
-
-