Package com.starpoints.painter.menu
Class TextEntryMenuEntry
- java.lang.Object
-
- com.starpoints.painter.menu.MenuEntry
-
- com.starpoints.painter.menu.TextEntryMenuEntry
-
public class TextEntryMenuEntry extends MenuEntry
-
-
Constructor Summary
Constructors Constructor Description TextEntryMenuEntry(java.lang.String label, int ypos, int indent, int color, FontSize fontSize, java.lang.String entryText, int maxLength)
Creates a text entry MenuEntry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChar(char c)
Adds a char to the entry.int
getDisplayColor(boolean mouseOver)
Gets the entries display color.java.lang.String
getDisplayText()
Gets the current text to display.java.lang.String
getEntryText()
Gets the entered text.boolean
isEditable()
Checks, if a text can be entered for this entry.boolean
isSelectable()
Checks, if the entry is selectable.void
removeChar()
Removes the last char from the entered text.void
setEntryText(java.lang.String text)
Sets the entered text.-
Methods inherited from class com.starpoints.painter.menu.MenuEntry
getColor, getFontSize, getIndent, getText, getYpos, isActive, isVisible, setActive, setColor, setDisplayText, setIndent, setText, setVisible, toString
-
-
-
-
Constructor Detail
-
TextEntryMenuEntry
public TextEntryMenuEntry(java.lang.String label, int ypos, int indent, int color, FontSize fontSize, java.lang.String entryText, int maxLength)
Creates a text entry MenuEntry.- Parameters:
label
-ypos
-indent
-color
-fontSize
-
-
-
Method Detail
-
getDisplayText
public java.lang.String getDisplayText()
Gets the current text to display.- Overrides:
getDisplayText
in classMenuEntry
- Returns:
- The text to display
-
getDisplayColor
public int getDisplayColor(boolean mouseOver)
Gets the entries display color.- Overrides:
getDisplayColor
in classMenuEntry
- Returns:
- The color.
-
getEntryText
public java.lang.String getEntryText()
Gets the entered text.- Returns:
- The text.
-
setEntryText
public void setEntryText(java.lang.String text)
Sets the entered text.- Parameters:
text
- The text.
-
addChar
public void addChar(char c)
Adds a char to the entry.- Parameters:
c
- The char.
-
removeChar
public void removeChar()
Removes the last char from the entered text.
-
isEditable
public boolean isEditable()
Checks, if a text can be entered for this entry.- Overrides:
isEditable
in classMenuEntry
- Returns:
- true, if text editing is allowed.
-
isSelectable
public boolean isSelectable()
Checks, if the entry is selectable.- Overrides:
isSelectable
in classMenuEntry
- Returns:
- true, if entry is selectable.
-
-