Interface Button

    • Method Detail

      • setCaptionText

        Button setCaptionText​(be.yildizgames.common.client.translation.TranslationKey text)
      • getCaptionFont

        Font getCaptionFont()
      • setCaptionFont

        void setCaptionFont​(Font font)
        Change the font for the button text.
        Parameters:
        font - New font to use.
      • setMaterial

        void setMaterial​(ButtonMaterial material)
        Change the button materials.
        Parameters:
        material - Background, highlight and inactive material data.
      • setMaterial

        void setMaterial​(Material m)
      • getHighlightMaterial

        Material getHighlightMaterial()
      • addMouseMoveListener

        void addMouseMoveListener​(be.yildizgames.module.window.input.MouseMoveListener l)
        Description copied from interface: Widget
        Add a new MouseMoveListener on this widget.
        Specified by:
        addMouseMoveListener in interface Widget
        Parameters:
        l - Listener to add.
      • addMouseLeftClickListener

        void addMouseLeftClickListener​(be.yildizgames.module.window.input.MouseLeftClickListener l)
        Description copied from interface: Widget
        Add a new MouseClickListener on this widget.
        Specified by:
        addMouseLeftClickListener in interface Widget
        Parameters:
        l - Listener to add.
      • mouseLeftClick

        void mouseLeftClick​(be.yildizgames.module.window.input.MousePosition position)
      • contains

        boolean contains​(be.yildizgames.module.window.input.MousePosition position)
        Description copied from interface: Widget
        Check if a point in contained in this container.
        Specified by:
        contains in interface Widget
        Parameters:
        position - Point coordinates.
        Returns:
        true if the point is contained in this container, false otherwise.
      • highlight

        void highlight​(boolean contains)
        Specified by:
        highlight in interface Widget
      • setData

        void setData​(ButtonData data)
        Replace all existing data for this button by new one. Old materials and click listeners will be removed and replaced by this ones.
        Parameters:
        data - New data for this button.
      • desactivate

        void desactivate()
        The button will no longer be clickable nor highlitable.
      • reactivate

        void reactivate()
        Reactive the button if it has been disabled.
      • setFocusable

        void setFocusable​(boolean b)
      • setCaptionTextLeftAlignment

        void setCaptionTextLeftAlignment​(PositionRelativeLeft alignment,
                                         int diff)
        Set the caption horizontal alignment.
        Parameters:
        alignment - Caption alignment.
        diff - Offset in pixels.
      • setCaptionTextLeftAlignment

        void setCaptionTextLeftAlignment​(PositionRelativeLeft alignment)
        Set the caption horizontal alignment.
        Parameters:
        alignment - Caption alignment.
      • setCaptionTextTopAlignment

        void setCaptionTextTopAlignment​(PositionRelativeTop alignment)
        Set the caption vertical alignment.
        Parameters:
        alignment - Caption alignment.
      • setCaptionTextTopAlignment

        void setCaptionTextTopAlignment​(PositionRelativeTop alignment,
                                        int diff)
        Set the caption vertical alignment.
        Parameters:
        alignment - Caption alignment.
        diff - Offset in pixels.
      • getInactiveMaterial

        Material getInactiveMaterial()
      • getInactiveFont

        Font getInactiveFont()
      • setInactiveMaterial

        void setInactiveMaterial​(Material material)
        Set a material for the button when in inactive state. If no material is set, base material will be used.
        Parameters:
        material - Material to use in inactive state.
      • getCaptionHorizontalPadding

        int getCaptionHorizontalPadding()
      • getCaptionVerticalPadding

        int getCaptionVerticalPadding()
      • setPushedMaterial

        void setPushedMaterial​(Material pushed)
      • setUnpushed

        void setUnpushed()
      • setPushed

        void setPushed()