Package com.starpoints.painter.menu
Class SelectionMenuEntry
- java.lang.Object
-
- com.starpoints.painter.menu.MenuEntry
-
- com.starpoints.painter.menu.SelectionMenuEntry
-
public class SelectionMenuEntry extends MenuEntry
-
-
Constructor Summary
Constructors Constructor Description SelectionMenuEntry(java.lang.String label, java.lang.String[] options, int ypos, int indent, int color, FontSize fontSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getDisplayColor(boolean mouseOver)
Gets the entries display color.java.lang.String
getDisplayText()
Gets the current text to display.java.lang.String[]
getEntries()
java.lang.String
getSelection()
Gets the currently selected option.int
getSelectionIndex()
Gets the selected index if multiple options can be selected.boolean
isSelectable()
Checks, if the entry is selectable.void
setEntries(java.lang.String[] options)
void
setSelectionIndex(int index)
Sets the selected index.int
switchBack()
Switches to the previous option.int
switchFore()
Switches to the next option.-
Methods inherited from class com.starpoints.painter.menu.MenuEntry
getColor, getFontSize, getIndent, getText, getYpos, isActive, isEditable, isVisible, setActive, setColor, setDisplayText, setIndent, setText, setVisible, toString
-
-
-
-
Constructor Detail
-
SelectionMenuEntry
public SelectionMenuEntry(java.lang.String label, java.lang.String[] options, int ypos, int indent, int color, FontSize fontSize)
-
-
Method Detail
-
getDisplayText
public java.lang.String getDisplayText()
Description copied from class:MenuEntry
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.
-
getSelectionIndex
public int getSelectionIndex()
Gets the selected index if multiple options can be selected.- Returns:
- The selected index.
-
setSelectionIndex
public void setSelectionIndex(int index)
Sets the selected index.- Parameters:
index
- The new index.
-
getSelection
public java.lang.String getSelection()
Gets the currently selected option.- Returns:
- The selected option.
-
switchFore
public int switchFore()
Switches to the next option.- Returns:
- index of the selected option.
-
switchBack
public int switchBack()
Switches to the previous option.- Returns:
- index of the selected option.
-
getEntries
public java.lang.String[] getEntries()
-
setEntries
public void setEntries(java.lang.String[] options)
-
isSelectable
public boolean isSelectable()
Checks, if the entry is selectable.- Overrides:
isSelectable
in classMenuEntry
- Returns:
- true, if entry is selectable.
-
-