Java 类javax.swing.plaf.metal.MetalScrollBarUI 实例源码

项目:incubator-netbeans    文件:TreeTableView.java   
/** Initialize full support for horizontal scrolling.
 */
private void initializeTreeScrollSupport() {
    scrollPane = new JScrollPane();
    scrollPane.setName("TreeTableView.scrollpane"); //NOI18N
    scrollPane.setBorder(BorderFactory.createEmptyBorder());
    scrollPane.setViewportBorder(BorderFactory.createEmptyBorder());

    if (UIManager.getColor("Table.background") != null) { // NOI18N
        scrollPane.getViewport().setBackground(UIManager.getColor("Table.background")); // NOI18N
    }

    hScrollBar = new JScrollBar(JScrollBar.HORIZONTAL);
    hScrollBar.putClientProperty(MetalScrollBarUI.FREE_STANDING_PROP, Boolean.FALSE);
    hScrollBar.setVisible(false);

    listener = new ScrollListener();

    treeTable.addPropertyChangeListener(listener);
    scrollPane.getViewport().addComponentListener(listener);
    tree.addPropertyChangeListener(listener);
    hScrollBar.getModel().addChangeListener(listener);
}
项目:intellij-ce-playground    文件:BegScrollPaneUI.java   
protected PropertyChangeListener createScrollBarSwapListener() {
  return new PropertyChangeListener() {
    public void propertyChange(PropertyChangeEvent e) {
      String propertyName = e.getPropertyName();
      if (propertyName.equals(VERTICAL_SCROLL_BAR_PROPERTY) ||
          propertyName.equals(HORIZONTAL_SCROLL_BAR_PROPERTY)) {
        ((JScrollBar) e.getOldValue()).putClientProperty(MetalScrollBarUI.FREE_STANDING_PROP,
            null);
        ((JScrollBar) e.getNewValue()).putClientProperty(MetalScrollBarUI.FREE_STANDING_PROP,
            Boolean.FALSE);
      }
      else if (BORDER_PROPERTY.equals(propertyName)) {
        updateScrollbarsFreeStanding();
      }
    }
  };
}
项目:studio    文件:TreeTableView.java   
/** Initialize full support for horizontal scrolling.
    */
   private void initializeTreeScrollSupport() {
       scrollPane = new JScrollPane() {
           public void setBorder(Border b) {
               super.setBorder(null);
           }
       };
       scrollPane.getViewport().setBackground(UIManager.getColor("Table.background")); // NOI18N

       hScrollBar = new JScrollBar(JScrollBar.HORIZONTAL);
hScrollBar.putClientProperty(MetalScrollBarUI.FREE_STANDING_PROP, Boolean.FALSE);

       listener = new ScrollListener();

       treeTable.addPropertyChangeListener(listener);
       scrollPane.getViewport().addComponentListener(listener);
       tree.addPropertyChangeListener(listener);
       hScrollBar.getModel().addChangeListener(listener);
   }
项目:tools-idea    文件:BegScrollPaneUI.java   
protected PropertyChangeListener createScrollBarSwapListener() {
  return new PropertyChangeListener() {
    public void propertyChange(PropertyChangeEvent e) {
      String propertyName = e.getPropertyName();
      if (propertyName.equals(VERTICAL_SCROLL_BAR_PROPERTY) ||
          propertyName.equals(HORIZONTAL_SCROLL_BAR_PROPERTY)) {
        ((JScrollBar) e.getOldValue()).putClientProperty(MetalScrollBarUI.FREE_STANDING_PROP,
            null);
        ((JScrollBar) e.getNewValue()).putClientProperty(MetalScrollBarUI.FREE_STANDING_PROP,
            Boolean.FALSE);
      }
      else if (BORDER_PROPERTY.equals(propertyName)) {
        updateScrollbarsFreeStanding();
      }
    }
  };
}
项目:consulo    文件:BegScrollPaneUI.java   
protected PropertyChangeListener createScrollBarSwapListener() {
  return new PropertyChangeListener() {
    public void propertyChange(PropertyChangeEvent e) {
      String propertyName = e.getPropertyName();
      if (propertyName.equals(VERTICAL_SCROLL_BAR_PROPERTY) ||
          propertyName.equals(HORIZONTAL_SCROLL_BAR_PROPERTY)) {
        ((JScrollBar) e.getOldValue()).putClientProperty(MetalScrollBarUI.FREE_STANDING_PROP,
            null);
        ((JScrollBar) e.getNewValue()).putClientProperty(MetalScrollBarUI.FREE_STANDING_PROP,
            Boolean.FALSE);
      }
      else if (BORDER_PROPERTY.equals(propertyName)) {
        updateScrollbarsFreeStanding();
      }
    }
  };
}
项目:intellij-ce-playground    文件:BegScrollPaneUI.java   
/**
 * If the border of the scrollpane is an instance of
 * <code>MetalBorders.ScrollPaneBorder</code>, the client property
 * <code>FREE_STANDING_PROP</code> of the scrollbars
 * is set to false, otherwise it is set to true.
 */
private void updateScrollbarsFreeStanding() {
  if (scrollpane == null) {
    return;
  }
  Object value = Boolean.FALSE;
  scrollpane.getHorizontalScrollBar().putClientProperty
      (MetalScrollBarUI.FREE_STANDING_PROP, value);
  scrollpane.getVerticalScrollBar().putClientProperty
      (MetalScrollBarUI.FREE_STANDING_PROP, value);
}
项目:tools-idea    文件:BegScrollPaneUI.java   
/**
 * If the border of the scrollpane is an instance of
 * <code>MetalBorders.ScrollPaneBorder</code>, the client property
 * <code>FREE_STANDING_PROP</code> of the scrollbars
 * is set to false, otherwise it is set to true.
 */
private void updateScrollbarsFreeStanding() {
  if (scrollpane == null) {
    return;
  }
  Object value = Boolean.FALSE;
  scrollpane.getHorizontalScrollBar().putClientProperty
      (MetalScrollBarUI.FREE_STANDING_PROP, value);
  scrollpane.getVerticalScrollBar().putClientProperty
      (MetalScrollBarUI.FREE_STANDING_PROP, value);
}
项目:IBMDataMovementTool    文件:PlasticComboBoxUI.java   
/**
 * Configures the JScrollPane created by #createScroller().
 */
@Override
protected void configureScroller() {
    super.configureScroller();
    scroller.getVerticalScrollBar().putClientProperty(
        MetalScrollBarUI.FREE_STANDING_PROP,
        Boolean.FALSE);
}
项目:consulo    文件:BegScrollPaneUI.java   
/**
 * If the border of the scrollpane is an instance of
 * <code>MetalBorders.ScrollPaneBorder</code>, the client property
 * <code>FREE_STANDING_PROP</code> of the scrollbars
 * is set to false, otherwise it is set to true.
 */
private void updateScrollbarsFreeStanding() {
  if (scrollpane == null) {
    return;
  }
  Object value = Boolean.FALSE;
  scrollpane.getHorizontalScrollBar().putClientProperty
      (MetalScrollBarUI.FREE_STANDING_PROP, value);
  scrollpane.getVerticalScrollBar().putClientProperty
      (MetalScrollBarUI.FREE_STANDING_PROP, value);
}