Class BlockingLayerUI2

  • All Implemented Interfaces:
    Serializable

    public class BlockingLayerUI2
    extends org.jdesktop.jxlayer.plaf.AbstractLayerUI<JComponent>
    A JXLayer ui implementation that permits to block a component but still allow an action when clicking everywhere on the layer. Moreover, an icon can be added on the right-top icon painted and changed when the mouse is over the layer. You can change the blocking and accepting icon. To hook an click on the layer's icon, you can :
    Since:
    1.3
    Author:
    Tony Chemit - dev@tchemit.fr
    See Also:
    Serialized Form
    • Field Detail

      • acceptAction

        protected Action acceptAction
        Action to be treated when click on icon
      • blockIcon

        protected BufferedImage blockIcon
        Icon when you can not click
      • acceptIcon

        protected BufferedImage acceptIcon
        Icon when you can click
      • blockingColor

        protected Color blockingColor
        Optinal color to put fill background when blocking
      • canClick

        protected boolean canClick
        Internal state to known when we can accept click
    • Constructor Detail

      • BlockingLayerUI2

        public BlockingLayerUI2()
    • Method Detail

      • setAcceptAction

        public void setAcceptAction​(Action acceptAction)
      • setAcceptIcon

        public void setAcceptIcon​(ImageIcon acceptIcon)
      • setBlockIcon

        public void setBlockIcon​(ImageIcon blockIcon)
      • setCanClick

        public void setCanClick​(boolean canClick)
      • setDirty

        public void setDirty​(boolean isDirty)
        Overrides:
        setDirty in class org.jdesktop.jxlayer.plaf.AbstractLayerUI<JComponent>
      • setBlockingColor

        public void setBlockingColor​(Color blockingColor)
      • setBlockIcon

        public void setBlockIcon​(BufferedImage blockIcon)
      • isCanClick

        public boolean isCanClick()
      • processKeyEvent

        protected void processKeyEvent​(KeyEvent e,
                                       org.jdesktop.jxlayer.JXLayer<? extends JComponent> l)
        Overrides:
        processKeyEvent in class org.jdesktop.jxlayer.plaf.AbstractLayerUI<JComponent>
      • processMouseMotionEvent

        protected void processMouseMotionEvent​(MouseEvent e,
                                               org.jdesktop.jxlayer.JXLayer<? extends JComponent> l)
        Overrides:
        processMouseMotionEvent in class org.jdesktop.jxlayer.plaf.AbstractLayerUI<JComponent>
      • processMouseWheelEvent

        protected void processMouseWheelEvent​(MouseWheelEvent e,
                                              org.jdesktop.jxlayer.JXLayer<? extends JComponent> l)
        Overrides:
        processMouseWheelEvent in class org.jdesktop.jxlayer.plaf.AbstractLayerUI<JComponent>
      • processMouseEvent

        protected void processMouseEvent​(MouseEvent e,
                                         org.jdesktop.jxlayer.JXLayer<? extends JComponent> l)
        Overrides:
        processMouseEvent in class org.jdesktop.jxlayer.plaf.AbstractLayerUI<JComponent>
      • paintLayer

        protected void paintLayer​(Graphics2D g2,
                                  org.jdesktop.jxlayer.JXLayer<? extends JComponent> l)
        Overrides:
        paintLayer in class org.jdesktop.jxlayer.plaf.AbstractLayerUI<JComponent>
      • acceptEvent

        protected void acceptEvent​(MouseEvent e,
                                   org.jdesktop.jxlayer.JXLayer<? extends JComponent> l)
      • updateCanClickState

        protected void updateCanClickState​(org.jdesktop.jxlayer.JXLayer<JComponent> l,
                                           MouseEvent e)