Package docking

Class DockingUtils


  • public class DockingUtils
    extends java.lang.Object
    • Field Detail

      • CONTROL_KEY_MODIFIER_MASK

        public static final int CONTROL_KEY_MODIFIER_MASK
        System dependent mask for the Ctrl key
      • CONTROL_KEY_MODIFIER_MASK_DEPRECATED

        @Deprecated
        public static final int CONTROL_KEY_MODIFIER_MASK_DEPRECATED
        Deprecated.
        A version the control key modifiers that is based upon the pre-Java 9 InputEvent usage. This mask is here for those clients that cannot be upgraded, such as those with dependencies on 3rd-party libraries that still use the old mask style.
      • CONTROL_KEY_NAME

        public static final java.lang.String CONTROL_KEY_NAME
    • Constructor Detail

      • DockingUtils

        public DockingUtils()
    • Method Detail

      • createToolbarSeparator

        public static javax.swing.JSeparator createToolbarSeparator()
      • scaleIconAsNeeded

        public static javax.swing.Icon scaleIconAsNeeded​(javax.swing.Icon icon)
      • isControlModifier

        public static boolean isControlModifier​(java.awt.event.MouseEvent mouseEvent)
        Checks if the mouseEvent has the "control" key down. On windows, this is actually the control key. On Mac, it is the command key.
        Parameters:
        mouseEvent - the event to check
        Returns:
        true if the control key is pressed
      • isControlModifier

        public static boolean isControlModifier​(java.awt.event.KeyEvent keyEvent)
        Checks if the mouseEvent has the "control" key down. On windows, this is actually the control key. On Mac, it is the command key.
        Parameters:
        keyEvent - the event to check
        Returns:
        true if the control key is pressed
      • installUndoRedo

        public static UndoRedoKeeper installUndoRedo​(javax.swing.text.JTextComponent textComponent)
      • setTransparent

        public static void setTransparent​(javax.swing.JComponent c)
        Sets the given component to transparent, which allows the parent component's background to be painted.

        Notes Historically, to make a component transparent you would call JComponent.setOpaque(boolean) with a false value. However, it turns out that the definition and the implementation of this method are at odds. setOpaque(false) is meant to signal that some part of the component is transparent, so the parent component needs to be painted. Most LaFs implemented this by not painting the background of the component, but used the parent's color instead. The Nimbus LaF actually honors the contract of setOpaque(), which has the effect of painting the components background by default.

        This method allows components to achieve transparency when they used to rely on setOpaque(false).

        Parameters:
        c - the component to be made transparent