Java Code Examples for javax.swing.plaf.ScrollBarUI

The following examples show how to use javax.swing.plaf.ScrollBarUI. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: consulo   Source File: JBScrollPane.java    License: Apache License 2.0 6 votes vote down vote up
public static boolean canBePreprocessed(MouseEvent e, JScrollBar bar) {
  if (e.getID() == MouseEvent.MOUSE_MOVED || e.getID() == MouseEvent.MOUSE_PRESSED) {
    ScrollBarUI ui = bar.getUI();
    if (ui instanceof BasicScrollBarUI) {
      BasicScrollBarUI bui = (BasicScrollBarUI)ui;
      try {
        Rectangle rect = (Rectangle)ReflectionUtil.getDeclaredMethod(BasicScrollBarUI.class, "getThumbBounds", ArrayUtil.EMPTY_CLASS_ARRAY).invoke(bui);
        Point point = SwingUtilities.convertPoint(e.getComponent(), e.getX(), e.getY(), bar);
        return !rect.contains(point);
      }
      catch (Exception e1) {
        return true;
      }
    }
  }
  return true;
}
 
Example 2
/**
 * Maps {@code JScrollBar.getUI()} through queue
 */
public ScrollBarUI getUI() {
    return (runMapping(new MapAction<ScrollBarUI>("getUI") {
        @Override
        public ScrollBarUI map() {
            return ((JScrollBar) getSource()).getUI();
        }
    }));
}
 
Example 3
Source Project: ghidra   Source File: SideKickVerticalScrollbar.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public ScrollBarUI getUI() {
	return delegate.getUI();
}
 
Example 4
Source Project: ghidra   Source File: SideKickVerticalScrollbar.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void setUI(ScrollBarUI ui) {
	delegate.setUI(ui);
}
 
Example 5
Source Project: consulo   Source File: DesktopEditorImpl.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void setUI(ScrollBarUI ui) {
  super.setUI(ui);
  setOpaque(false);
}