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.Object
An abstract Menu entry for the game menues.
-
-
Field Summary
Fields Modifier and Type Field Description protected int
color
Menu entry display color.protected FontSize
fontSize
FontSize for the entry.protected int
indent
This entries indent.protected java.lang.String
text
The menu entry text.protected boolean
visible
Flag, if menu entry is visible.protected int
ypos
This entries y position.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getColor()
Gets the entries color.int
getDisplayColor(boolean mouseOver)
Gets the entries display color.java.lang.String
getDisplayText()
Gets the current text to display.FontSize
getFontSize()
Gets the entries font size.int
getIndent()
Gets the horizontal indent of the entry.java.lang.String
getText()
int
getYpos()
Gets the y position of this entry.boolean
isActive()
Checks, if the item is activated.boolean
isEditable()
Checks, if a text can be entered for this entry.boolean
isSelectable()
Checks, if the entry is selectable.boolean
isVisible()
Checks, if mennu entry is visible.void
setActive(boolean active)
void
setColor(int color)
Sets this entries color.void
setDisplayText(java.lang.String text)
Sets the display test for this entry.void
setIndent(int i)
Sets the menu entries indent.void
setText(java.lang.String text)
void
setVisible(boolean visible)
Sets the menu entries visibility.java.lang.String
toString()
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:
toString
in 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
-
-