Class PainterMenuHorizontal

    • Field Detail

      • selectionIndex

        protected int selectionIndex
        Selected Menu entry index.
      • focussedIndex

        protected int focussedIndex
        Menu entry index with mouse focus
    • Constructor Detail

      • PainterMenuHorizontal

        public PainterMenuHorizontal()
    • Method Detail

      • getImage

        protected java.lang.String getImage​(MenuEntry me)
      • getMouseSelectionUpperYCoordinate

        protected int getMouseSelectionUpperYCoordinate()
        Gets the vertical coordinate, below which mouse coordinates must be to set the MenuEntry selected.
        Returns:
        50 as default.
      • keyPressed

        public boolean keyPressed​(KeyEvent e)
        Processes keys if focussed editor painter.
        Specified by:
        keyPressed in interface InputController
        Overrides:
        keyPressed in class PainterMenu
        Parameters:
        e - The event.
        Returns:
        true, if the event is handled by this InputController.
      • onSelectedIndexChange

        protected void onSelectedIndexChange()
      • applyLevelProperties

        protected abstract void applyLevelProperties()
      • paintMenuEntry

        protected void paintMenuEntry​(Graphics g,
                                      MenuEntry me,
                                      java.lang.String i)
        Paints a menu entry.
        Parameters:
        g -
        me -
      • showSelected

        protected boolean showSelected​(MenuEntry me)
        Parameters:
        me -
        Returns:
      • getSelectionIndex

        protected int getSelectionIndex()
        Returns:
      • getYTextCoordinate

        public int getYTextCoordinate​(MenuEntry me)
        Gets the draw y position for menu entries text.
        Parameters:
        me - The menu entry.
        Returns:
        6 or 16 for second column.
      • getYPercentageCoordinate

        public int getYPercentageCoordinate​(MenuEntry me)
        Gets the draw y position for menu entries percentage.
        Parameters:
        me - The menu entry.
        Returns:
        8 or 18 for second column.
      • getYCenter

        public int getYCenter​(MenuEntry me)
        Parameters:
        me -
        Returns:
      • getXCenter

        protected int getXCenter​(MenuEntry me)
        Parameters:
        me -
        Returns:
      • getDisplayText

        protected java.lang.String getDisplayText​(MenuEntry me)
        Returns the display text for the MenuEntry.
        Parameters:
        me - The MenuEntry
        Returns:
        me.getDisplayText();
      • getTextXPosition

        protected int getTextXPosition​(MenuEntry me)
        Returns the X position for the menu text to draw.
        Parameters:
        me - The MenuEntry
        Returns:
        me.getYpos()-2;
      • paintSelectionIcon

        protected void paintSelectionIcon​(Graphics g,
                                          MenuEntry me,
                                          boolean selected)
        Paints a selection icon to the menu entry.
        Parameters:
        g -
        me -
      • paintSelectionIcon

        protected void paintSelectionIcon​(Graphics g,
                                          MenuEntry me,
                                          boolean selected,
                                          double factor)
        Paints a selection icon to the menu entry with the given scaling factor.
        Parameters:
        g -
        me -
      • drawImageFrame

        protected void drawImageFrame​(Graphics g,
                                      MenuEntry me,
                                      int color)
        Draw a frame around an menu image
        Parameters:
        g - The Graphics.
        me - The menu entry.
        color - The frame color.
      • getImageScaleFactor

        protected double getImageScaleFactor()
        Gets a scaling factor for the menu image.
        Returns:
        Scaling factor.
      • getProbabilityString

        protected java.lang.String getProbabilityString​(SelectionMenuEntry me)
        Gets the probability string for the menu item.
        Parameters:
        me - The menu entry.
        Returns:
        Probability string.
      • drawProbability

        protected boolean drawProbability​(SelectionMenuEntry me)
        Checks, if the probability string should be drawn for the menu item.
        Parameters:
        me - The menu entry.
        Returns:
        true, if the probability string should be drawn for the menu item.
      • drawAmount

        protected void drawAmount​(Graphics g,
                                  MenuEntry me,
                                  int count)
        Draws an indication for the number of appearances for a menu entry.
        Parameters:
        g - The graphics.
        me - The MenuEntry.
        count - The count to draw.
      • setMouseArea

        protected void setMouseArea​(MouseEvent e)
        Sets the current mouse over area.
        Overrides:
        setMouseArea in class PainterMenu
        Parameters:
        e - The mouse event.
      • getMouseAreaYSplit

        protected int getMouseAreaYSplit()
        Gets the vertical coordinate, beyond which mouse coordinates are in second column.
        Returns:
        Baseheight / 2 as default