当前位置: 首页>>代码示例>>Java>>正文


Java BasicScrollBarUI类代码示例

本文整理汇总了Java中javax.swing.plaf.basic.BasicScrollBarUI的典型用法代码示例。如果您正苦于以下问题:Java BasicScrollBarUI类的具体用法?Java BasicScrollBarUI怎么用?Java BasicScrollBarUI使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BasicScrollBarUI类属于javax.swing.plaf.basic包,在下文中一共展示了BasicScrollBarUI类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getDecScrollButtonHeight

import javax.swing.plaf.basic.BasicScrollBarUI; //导入依赖的package包/类
/**
 * This is helper method. It returns height of the top (decrease) scroll bar
 * button. Please note, that it's possible to return real height only if scroll bar
 * is instance of BasicScrollBarUI. Otherwise it returns fake (but good enough :) )
 * value.
 */
int getDecScrollButtonHeight() {
  ScrollBarUI barUI = getUI();
  Insets insets = getInsets();
  int top = Math.max(0, insets.top);
  if (barUI instanceof ButtonlessScrollBarUI) {
    return top + ((ButtonlessScrollBarUI)barUI).getDecrementButtonHeight();
  }
  if (barUI instanceof BasicScrollBarUI) {
    try {
      JButton decrButtonValue = (JButton)decrButtonField.get(barUI);
      LOG.assertTrue(decrButtonValue != null);
      return top + decrButtonValue.getHeight();
    }
    catch (Exception exc) {
      throw new IllegalStateException(exc);
    }
  }
  return top + 15;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:bigFile.java

示例2: getIncScrollButtonHeight

import javax.swing.plaf.basic.BasicScrollBarUI; //导入依赖的package包/类
/**
 * This is helper method. It returns height of the bottom (increase) scroll bar
 * button. Please note, that it's possible to return real height only if scroll bar
 * is instance of BasicScrollBarUI. Otherwise it returns fake (but good enough :) )
 * value.
 */
int getIncScrollButtonHeight() {
  ScrollBarUI barUI = getUI();
  Insets insets = getInsets();
  if (barUI instanceof ButtonlessScrollBarUI) {
    return insets.top + ((ButtonlessScrollBarUI)barUI).getIncrementButtonHeight();
  }
  if (barUI instanceof BasicScrollBarUI) {
    try {
      JButton incrButtonValue = (JButton)incrButtonField.get(barUI);
      LOG.assertTrue(incrButtonValue != null);
      return insets.bottom + incrButtonValue.getHeight();
    }
    catch (Exception exc) {
      throw new IllegalStateException(exc);
    }
  }
  if (APPLE_LAF_AQUA_SCROLL_BAR_UI_CLASS.equals(barUI.getClass().getName())) {
    return insets.bottom + 30;
  }
  return insets.bottom + 15;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:bigFile.java

示例3: canBePreprocessed

import javax.swing.plaf.basic.BasicScrollBarUI; //导入依赖的package包/类
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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:JBScrollPane.java

示例4: canBePreprocessed

import javax.swing.plaf.basic.BasicScrollBarUI; //导入依赖的package包/类
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 {
        Method m = BasicScrollBarUI.class.getDeclaredMethod("getThumbBounds", ArrayUtil.EMPTY_CLASS_ARRAY);
        m.setAccessible(true);
        Rectangle rect = (Rectangle)m.invoke(bui);
        Point point = SwingUtilities.convertPoint(e.getComponent(), e.getX(), e.getY(), bar);
        return !rect.contains(point);
      }
      catch (Exception e1) {
        return true;
      }
    }
  }
  return true;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:JBScrollPane.java

示例5: getDecScrollButtonHeight

import javax.swing.plaf.basic.BasicScrollBarUI; //导入依赖的package包/类
/**
 * This is helper method. It returns height of the top (decrease) scroll bar
 * button. Please note, that it's possible to return real height only if scroll bar
 * is instance of BasicScrollBarUI. Otherwise it returns fake (but good enough :) )
 * value.
 */
int getDecScrollButtonHeight() {
  ScrollBarUI barUI = getUI();
  Insets insets = getInsets();
  if (barUI instanceof ButtonlessScrollBarUI) {
    return insets.top + ((ButtonlessScrollBarUI)barUI).getDecrementButtonHeight();
  }
  else if (barUI instanceof BasicScrollBarUI) {
    try {
      JButton decrButtonValue = (JButton)decrButtonField.get(barUI);
      LOG.assertTrue(decrButtonValue != null);
      return insets.top + decrButtonValue.getHeight();
    }
    catch (Exception exc) {
      throw new IllegalStateException(exc);
    }
  }
  else {
    return insets.top + 15;
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:27,代码来源:EditorImpl.java

示例6: createTransparent

import javax.swing.plaf.basic.BasicScrollBarUI; //导入依赖的package包/类
public static BasicScrollBarUI createTransparent() {
  return new ButtonlessScrollBarUI() {
    @Override
    public boolean alwaysShowTrack() {
      return false;
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:ButtonlessScrollBarUI.java

示例7: createNormal

import javax.swing.plaf.basic.BasicScrollBarUI; //导入依赖的package包/类
public static BasicScrollBarUI createNormal() {
  return new ButtonlessScrollBarUI();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ButtonlessScrollBarUI.java

示例8: changeUI

import javax.swing.plaf.basic.BasicScrollBarUI; //导入依赖的package包/类
@Override
public void changeUI(){
    super.changeUI();  
    jScrollPane2.getHorizontalScrollBar().setUI((BasicScrollBarUI)MyBasicScrollBarUI.createUI(jScrollPane2));
    jScrollPane2.getVerticalScrollBar().setUI((BasicScrollBarUI)MyBasicScrollBarUI.createUI(jScrollPane2));  
}
 
开发者ID:R3d-Dragon,项目名称:jMovieManager,代码行数:7,代码来源:CreateSerieGUI.java

示例9: createNormal

import javax.swing.plaf.basic.BasicScrollBarUI; //导入依赖的package包/类
public static BasicScrollBarUI createNormal() {
  return new DarculaScrollBarUI();
}
 
开发者ID:bulenkov,项目名称:Darcula,代码行数:4,代码来源:DarculaScrollBarUI.java

示例10: createTransparent

import javax.swing.plaf.basic.BasicScrollBarUI; //导入依赖的package包/类
public static BasicScrollBarUI createTransparent() {
  return new Transparent();
}
 
开发者ID:JetBrains,项目名称:jediterm,代码行数:4,代码来源:ButtonlessScrollBarUI.java


注:本文中的javax.swing.plaf.basic.BasicScrollBarUI类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。