Package com.starpoints.painter.menu
Class MenuEntry
- java.lang.Object
-
- com.starpoints.painter.menu.MenuEntry
-
- Direct Known Subclasses:
ClickMenuEntry,LabelMenuEntry,SelectionMenuEntry,TextEntryMenuEntry
public abstract class MenuEntry extends java.lang.ObjectAn abstract Menu entry for the game menues.
-
-
Field Summary
Fields Modifier and Type Field Description protected intcolorMenu entry display color.protected FontSizefontSizeFontSize for the entry.protected intindentThis entries indent.protected java.lang.StringtextThe menu entry text.protected booleanvisibleFlag, if menu entry is visible.protected intyposThis entries y position.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetColor()Gets the entries color.intgetDisplayColor(boolean mouseOver)Gets the entries display color.java.lang.StringgetDisplayText()Gets the current text to display.FontSizegetFontSize()Gets the entries font size.intgetIndent()Gets the horizontal indent of the entry.java.lang.StringgetText()intgetYpos()Gets the y position of this entry.booleanisActive()Checks, if the item is activated.booleanisEditable()Checks, if a text can be entered for this entry.booleanisSelectable()Checks, if the entry is selectable.booleanisVisible()Checks, if mennu entry is visible.voidsetActive(boolean active)voidsetColor(int color)Sets this entries color.voidsetDisplayText(java.lang.String text)Sets the display test for this entry.voidsetIndent(int i)Sets the menu entries indent.voidsetText(java.lang.String text)voidsetVisible(boolean visible)Sets the menu entries visibility.java.lang.StringtoString()Returns the string representation.
-
-
-
Field Detail
-
text
protected java.lang.String text
The menu entry text.
-
indent
protected int indent
This entries indent.
-
ypos
protected int ypos
This entries y position.
-
color
protected int color
Menu entry display color.
-
fontSize
protected FontSize fontSize
FontSize for the entry.
-
visible
protected boolean visible
Flag, if menu entry is visible.
-
-
Constructor Detail
-
MenuEntry
public MenuEntry(java.lang.String text, int ypos, int indent, int color, FontSize fontSize)Creates a simple clickable entry.- Parameters:
text- The textypos- The Y positionindent- The indent.color- The color.fontSize- The font size.
-
-
Method Detail
-
getDisplayText
public java.lang.String getDisplayText()
Gets the current text to display.- Returns:
- The text to display
-
setDisplayText
public void setDisplayText(java.lang.String text)
Sets the display test for this entry.- Parameters:
text- The display text.
-
getYpos
public int getYpos()
Gets the y position of this entry.- Returns:
- The y position
-
isSelectable
public boolean isSelectable()
Checks, if the entry is selectable.- Returns:
- true, if entry is selectable.
-
getIndent
public int getIndent()
Gets the horizontal indent of the entry.- Returns:
- The indent.
-
getDisplayColor
public int getDisplayColor(boolean mouseOver)
Gets the entries display color.- Returns:
- The color.
-
getColor
public int getColor()
Gets the entries color.- Returns:
- The color.
-
setColor
public void setColor(int color)
Sets this entries color.- Parameters:
color- The new color.
-
getFontSize
public FontSize getFontSize()
Gets the entries font size.- Returns:
- the Font size
-
isActive
public boolean isActive()
Checks, if the item is activated.- Returns:
- Flag, if menu item is active (editable, clickable, selectable)
-
isEditable
public boolean isEditable()
Checks, if a text can be entered for this entry.- Returns:
- true, if text editing is allowed.
-
toString
public java.lang.String toString()
Returns the string representation.- Overrides:
toStringin classjava.lang.Object- Returns:
- the string.
-
isVisible
public boolean isVisible()
Checks, if mennu entry is visible.- Returns:
- true, if visible.
-
setVisible
public void setVisible(boolean visible)
Sets the menu entries visibility.- Parameters:
visible- The visibility.
-
setIndent
public void setIndent(int i)
Sets the menu entries indent.- Parameters:
i- The indent.
-
getText
public java.lang.String getText()
- Returns:
- the text
-
setText
public void setText(java.lang.String text)
- Parameters:
text- the text to set
-
setActive
public void setActive(boolean active)
- Parameters:
active- the active to set
-
-