Class MaterialButtonUI

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected class  MaterialButtonUI.MaterialListenerButtonEvent
      This class was implement receive the change propriety from button and change the default value inside this component, as, background, foreground.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected javax.swing.plaf.basic.BasicButtonListener createButtonListener​(javax.swing.AbstractButton b)  
      static javax.swing.plaf.ComponentUI createUI​(javax.swing.JComponent c)  
      protected void installDefaults​(javax.swing.AbstractButton b)
      The installDefaults method is a good place to add the default setting, because it is called before to install methods and this give to the user the possibility to change the button style inside the installation method without worried about the order pre and post super.install call.
      protected void installListeners​(javax.swing.AbstractButton b)  
      void installUI​(javax.swing.JComponent c)
      Inside the installUI method are init only proprieties used inside this component the background or foreground ara managed to BasicButtonUI, @see BasicButtonUI
      java.lang.Boolean isDefaultButton()  
      protected boolean isToolBarButton​(java.awt.Component component)  
      void paint​(java.awt.Graphics g, javax.swing.JComponent c)  
      protected void paintBackground​(java.awt.Graphics g, javax.swing.JComponent c)
      This method paint background, inside it will paint the border to buttons.
      protected void paintBorderButton​(java.awt.Graphics graphics, javax.swing.JComponent b)  
      protected void paintButtonPressed​(java.awt.Graphics g, javax.swing.AbstractButton b)  
      protected void paintFocus​(java.awt.Graphics g, javax.swing.AbstractButton b, java.awt.Rectangle viewRect, java.awt.Rectangle textRect, java.awt.Rectangle iconRect)  
      protected void paintFocusRing​(java.awt.Graphics g, javax.swing.JButton b)  
      protected void paintText​(java.awt.Graphics g, javax.swing.JComponent c, java.awt.Rectangle textRect, java.lang.String text)  
      void setColorMouseHoverDefaultButton​(java.awt.Color colorMouseHoverDefaultButton)
      This method is used inside the TimerUI to set a new MouseHover color.
      void setColorMouseHoverNormalButton​(java.awt.Color colorMouseHoverNormalButton)
      This method is used inside the TimerUI to set a new MouseHover color.
      protected void uninstallListeners​(javax.swing.AbstractButton b)  
      void uninstallUI​(javax.swing.JComponent c)  
      • Methods inherited from class javax.swing.plaf.basic.BasicButtonUI

        clearTextShiftOffset, getBaseline, getBaselineResizeBehavior, getDefaultTextIconGap, getMaximumSize, getMinimumSize, getPreferredSize, getPropertyPrefix, getTextShiftOffset, installKeyboardActions, paintIcon, paintText, setTextShiftOffset, uninstallDefaults, uninstallKeyboardActions
      • Methods inherited from class javax.swing.plaf.ComponentUI

        contains, getAccessibleChild, getAccessibleChildrenCount, update
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • button

        protected javax.swing.AbstractButton button
      • mouseHoverEnabled

        protected java.lang.Boolean mouseHoverEnabled
      • foreground

        protected java.awt.Color foreground
      • background

        protected java.awt.Color background
      • disabledBackground

        protected java.awt.Color disabledBackground
      • disabledForeground

        protected java.awt.Color disabledForeground
      • defaultBackground

        protected java.awt.Color defaultBackground
      • defaultForeground

        protected java.awt.Color defaultForeground
      • colorMouseHoverDefaultButton

        protected java.awt.Color colorMouseHoverDefaultButton
      • colorMouseHoverNormalButton

        protected java.awt.Color colorMouseHoverNormalButton
      • borderColor

        protected java.awt.Color borderColor
      • defaultButton

        protected java.lang.Boolean defaultButton
      • borderEnabled

        protected java.lang.Boolean borderEnabled
      • arch

        protected int arch
      • enableButton

        protected java.beans.PropertyChangeListener enableButton
      • buttonBorderToAll

        protected boolean buttonBorderToAll
      • mouseHoverRunning

        protected boolean mouseHoverRunning
      • buttonToolBarInit

        protected boolean buttonToolBarInit
    • Constructor Detail

      • MaterialButtonUI

        public MaterialButtonUI()
    • Method Detail

      • createUI

        public static javax.swing.plaf.ComponentUI createUI​(javax.swing.JComponent c)
      • installUI

        public void installUI​(javax.swing.JComponent c)
        Inside the installUI method are init only proprieties used inside this component the background or foreground ara managed to BasicButtonUI, @see BasicButtonUI
        Overrides:
        installUI in class javax.swing.plaf.basic.BasicButtonUI
      • installDefaults

        protected void installDefaults​(javax.swing.AbstractButton b)
        The installDefaults method is a good place to add the default setting, because it is called before to install methods and this give to the user the possibility to change the button style inside the installation method without worried about the order pre and post super.install call.

        FIXME: starting the transition to the workflow described in the comment

        Overrides:
        installDefaults in class javax.swing.plaf.basic.BasicButtonUI
      • uninstallUI

        public void uninstallUI​(javax.swing.JComponent c)
        Overrides:
        uninstallUI in class javax.swing.plaf.basic.BasicButtonUI
      • paint

        public void paint​(java.awt.Graphics g,
                          javax.swing.JComponent c)
        Overrides:
        paint in class javax.swing.plaf.basic.BasicButtonUI
      • paintText

        protected void paintText​(java.awt.Graphics g,
                                 javax.swing.JComponent c,
                                 java.awt.Rectangle textRect,
                                 java.lang.String text)
        Overrides:
        paintText in class javax.swing.plaf.basic.BasicButtonUI
      • paintBackground

        protected void paintBackground​(java.awt.Graphics g,
                                       javax.swing.JComponent c)
        This method paint background, inside it will paint the border to buttons.

        param g Graphics Object, with this object is possible paint the component JButton param c Component Object, represent the button, if possible use this object or the propriety called button inside this class

      • paintFocus

        protected void paintFocus​(java.awt.Graphics g,
                                  javax.swing.AbstractButton b,
                                  java.awt.Rectangle viewRect,
                                  java.awt.Rectangle textRect,
                                  java.awt.Rectangle iconRect)
        Overrides:
        paintFocus in class javax.swing.plaf.basic.BasicButtonUI
      • paintButtonPressed

        protected void paintButtonPressed​(java.awt.Graphics g,
                                          javax.swing.AbstractButton b)
        Overrides:
        paintButtonPressed in class javax.swing.plaf.basic.BasicButtonUI
      • createButtonListener

        protected javax.swing.plaf.basic.BasicButtonListener createButtonListener​(javax.swing.AbstractButton b)
        Overrides:
        createButtonListener in class javax.swing.plaf.basic.BasicButtonUI
      • installListeners

        protected void installListeners​(javax.swing.AbstractButton b)
        Overrides:
        installListeners in class javax.swing.plaf.basic.BasicButtonUI
      • uninstallListeners

        protected void uninstallListeners​(javax.swing.AbstractButton b)
        Overrides:
        uninstallListeners in class javax.swing.plaf.basic.BasicButtonUI
      • paintFocusRing

        protected void paintFocusRing​(java.awt.Graphics g,
                                      javax.swing.JButton b)
      • paintBorderButton

        protected void paintBorderButton​(java.awt.Graphics graphics,
                                         javax.swing.JComponent b)
      • setColorMouseHoverDefaultButton

        public void setColorMouseHoverDefaultButton​(java.awt.Color colorMouseHoverDefaultButton)
        This method is used inside the TimerUI to set a new MouseHover color.

        For example: if you set a personal color on the mouseHove effect, you need to create a new mouseHover event on this component with a code as MaterialUIMovement.getMovement(COMPONENT, COLOR); The event creates to previous system call need to refresh the mouseHover color in this class to have the correct effect when the button is pressed

        This should be remove e override the logic with a listener, but for the moment is implemented only this solution.

      • setColorMouseHoverNormalButton

        public void setColorMouseHoverNormalButton​(java.awt.Color colorMouseHoverNormalButton)
        This method is used inside the TimerUI to set a new MouseHover color.

        For example: if you set a personal color on the mouseHove effect, you need to create a new mouseHover event on this component with a code as MaterialUIMovement.getMovement(COMPONENT, COLOR); The event creates to previous system call need to refresh the mouseHover color in this class to have the correct effect when the button is pressed

        This should be remove e override the logic with a listener, but for the moment is implemented only this solution.

      • isDefaultButton

        public java.lang.Boolean isDefaultButton()
      • isToolBarButton

        protected boolean isToolBarButton​(java.awt.Component component)