mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jvergara
03.58.2009 854fd532eeb13266d2125e942d384385a1216aaa
Fix for issue 4335 (Scroll wheel in Control Panel is waaay too slow)
Increase the value of the unit increment in the scroll panes used by the control panel.
2 files modified
18 ■■■■■ changed files
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/ColorAndFontConstants.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/util/Utilities.java 15 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/ColorAndFontConstants.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 */
package org.opends.guitools.controlpanel.ui;
@@ -85,6 +85,7 @@
    try
    {
      JScrollPane scroll = new JScrollPane();
      Utilities.setScrollIncrementUnit(scroll);
      border = scroll.getBorder();
      // If the border is of class MetalBorders$ScrollPaneBorder it cannot
      // be used.
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/util/Utilities.java
@@ -402,6 +402,7 @@
    scroll.getViewport().setOpaque(false);
    scroll.getViewport().setBackground(ColorAndFontConstants.background);
    scroll.setBackground(ColorAndFontConstants.background);
    setScrollIncrementUnit(scroll);
    return scroll;
  }
@@ -417,10 +418,24 @@
    scroll.setOpaque(false);
    scroll.getViewport().setBackground(ColorAndFontConstants.background);
    scroll.setBackground(ColorAndFontConstants.background);
    setScrollIncrementUnit(scroll);
    return scroll;
  }
  /**
   * Sets the scroll increment unit for the scroll.
   * @param scroll the scroll to be updated.
   */
  public static void setScrollIncrementUnit(JScrollPane scroll)
  {
    if (scroll.getVerticalScrollBar() != null)
    {
      int increment = scroll.getVerticalScrollBar().getUnitIncrement();
      scroll.getVerticalScrollBar().setUnitIncrement(increment * 3);
    }
  }
  /**
   * Creates a button.
   * @param text the message to be displayed by the button.
   * @return the created button.