javax.swing.JScrollPane.getVerticalScrollBarPolicy()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(8.4k)|赞(0)|评价(0)|浏览(125)

本文整理了Java中javax.swing.JScrollPane.getVerticalScrollBarPolicy()方法的一些代码示例,展示了JScrollPane.getVerticalScrollBarPolicy()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JScrollPane.getVerticalScrollBarPolicy()方法的具体详情如下:
包路径:javax.swing.JScrollPane
类名称:JScrollPane
方法名:getVerticalScrollBarPolicy

JScrollPane.getVerticalScrollBarPolicy介绍

暂无

代码示例

代码示例来源:origin: ron190/jsql-injection

private ControlPanel(JScrollPane scrollPane) {
    this.setLayout(new BorderLayout());
    this.setOpaque(false);
    this.vScrollBar = new JMyScrollBar(Adjustable.VERTICAL);
    scrollPane.setVerticalScrollBar(this.vScrollBar);
    scrollPane.remove(this.vScrollBar);
    if (scrollPane.getVerticalScrollBarPolicy() != ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER) {
      this.add(this.vScrollBar, BorderLayout.EAST);
    }
    this.hScrollBar = new JMyScrollBar(Adjustable.HORIZONTAL);
    scrollPane.setHorizontalScrollBar(this.hScrollBar);
    scrollPane.remove(this.hScrollBar);
    if (scrollPane.getHorizontalScrollBarPolicy() != ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER) {
      this.add(this.hScrollBar, BorderLayout.SOUTH);
    }
  }
}

代码示例来源:origin: com.eas.platypus/platypus-js-forms

@ScriptFunction
@Override
public int getVerticalScrollBarPolicy() {
  int res = super.getVerticalScrollBarPolicy();
  switch (res) {
    case ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER:
      return ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER;
    case ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS:
      return ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS;
    default:
      return ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED;
  }
}

代码示例来源:origin: org.swinglabs.swingx/swingx-core

/**
 * Configures the upper trailing corner of an enclosing
 * <code>JScrollPane</code>.
 * 
 * Adds the <code>ColumnControl</code> if the
 * <code>columnControlVisible</code> property is true.
 * <p>
 * 
 * @see #setColumnControlVisible(boolean)
 * @see #setColumnControl(JComponent)
 */
protected void configureColumnControl() {
  if (!isColumnControlVisible())
    return;
  JScrollPane scrollPane = getEnclosingScrollPane();
  if (scrollPane == null) return;
  if (verticalScrollPolicy == 0) {
    verticalScrollPolicy = scrollPane.getVerticalScrollBarPolicy();
  }
  scrollPane.setCorner(JScrollPane.UPPER_TRAILING_CORNER,
      getColumnControl());
  scrollPane
      .setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
}

代码示例来源:origin: org.swinglabs.swingx/swingx-all

/**
 * Configures the upper trailing corner of an enclosing
 * <code>JScrollPane</code>.
 * 
 * Adds the <code>ColumnControl</code> if the
 * <code>columnControlVisible</code> property is true.
 * <p>
 * 
 * @see #setColumnControlVisible(boolean)
 * @see #setColumnControl(JComponent)
 */
protected void configureColumnControl() {
  if (!isColumnControlVisible())
    return;
  JScrollPane scrollPane = getEnclosingScrollPane();
  if (scrollPane == null) return;
  if (verticalScrollPolicy == 0) {
    verticalScrollPolicy = scrollPane.getVerticalScrollBarPolicy();
  }
  scrollPane.setCorner(JScrollPane.UPPER_TRAILING_CORNER,
      getColumnControl());
  scrollPane
      .setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
}

代码示例来源:origin: com.haulmont.thirdparty/swingx-core

/**
 * Configures the upper trailing corner of an enclosing
 * <code>JScrollPane</code>.
 * 
 * Adds the <code>ColumnControl</code> if the
 * <code>columnControlVisible</code> property is true.
 * <p>
 * 
 * @see #setColumnControlVisible(boolean)
 * @see #setColumnControl(JComponent)
 */
protected void configureColumnControl() {
  if (!isColumnControlVisible())
    return;
  JScrollPane scrollPane = getEnclosingScrollPane();
  if (scrollPane == null) return;
  if (verticalScrollPolicy == 0) {
    verticalScrollPolicy = scrollPane.getVerticalScrollBarPolicy();
  }
  scrollPane.setCorner(JScrollPane.UPPER_TRAILING_CORNER,
      getColumnControl());
  scrollPane
      .setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
}

代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-core

/**
 * Configures the upper trailing corner of an enclosing
 * <code>JScrollPane</code>.
 * 
 * Adds the <code>ColumnControl</code> if the
 * <code>columnControlVisible</code> property is true.
 * <p>
 * 
 * @see #setColumnControlVisible(boolean)
 * @see #setColumnControl(JComponent)
 */
protected void configureColumnControl() {
  if (!isColumnControlVisible())
    return;
  JScrollPane scrollPane = getEnclosingScrollPane();
  if (scrollPane == null) return;
  if (verticalScrollPolicy == 0) {
    verticalScrollPolicy = scrollPane.getVerticalScrollBarPolicy();
  }
  scrollPane.setCorner(JScrollPane.UPPER_TRAILING_CORNER,
      getColumnControl());
  scrollPane
      .setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
}

代码示例来源:origin: org.codehaus.jtstand/jtstand-desktop

if (verticalScrollPolicy == 0) {
  verticalScrollPolicy = scrollPane
      .getVerticalScrollBarPolicy();

代码示例来源:origin: JetBrains/jediterm

viewSize.width = extentSize.width;
if (ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER == pane.getVerticalScrollBarPolicy()) {
  viewPosition.y = 0;
  viewSize.height = extentSize.height;

代码示例来源:origin: com.eas.platypus/platypus-js-forms

/**
 * This method is invoked after the ScrollPaneLayout is set as the
 * LayoutManager of a <code>JScrollPane</code>.
 * It initializes all of the internal fields that
 * are ordinarily set by <code>addLayoutComponent</code>.  For example:
 * <pre>
 * ScrollPaneLayout mySPLayout = new ScrollPanelLayout() {
 *     public void layoutContainer(Container p) {
 *         super.layoutContainer(p);
 *         // do some extra work here ...
 *     }
 * };
 * scrollpane.setLayout(mySPLayout):
 * </pre>
 */
public void syncWithScrollPane(JScrollPane sp) {
  viewport = sp.getViewport();
  vsb = sp.getVerticalScrollBar();
  hsb = sp.getHorizontalScrollBar();
  rowHead = sp.getRowHeader();
  colHead = sp.getColumnHeader();
  lowerLeft = sp.getCorner(LOWER_LEFT_CORNER);
  lowerRight = sp.getCorner(LOWER_RIGHT_CORNER);
  upperLeft = sp.getCorner(UPPER_LEFT_CORNER);
  upperRight = sp.getCorner(UPPER_RIGHT_CORNER);
  vsbPolicy = sp.getVerticalScrollBarPolicy();
  hsbPolicy = sp.getHorizontalScrollBarPolicy();
}

代码示例来源:origin: com.eas.platypus/platypus-js-forms

vsbPolicy = scrollPane.getVerticalScrollBarPolicy();
hsbPolicy = scrollPane.getHorizontalScrollBarPolicy();

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf

vsbPolicy = scrollPane.getVerticalScrollBarPolicy();
hsbPolicy = scrollPane.getHorizontalScrollBarPolicy();

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf

/**
 * This method is invoked after the ScrollPaneLayout is set as the
 * LayoutManager of a <code>JScrollPane</code>.
 * It initializes all of the internal fields that
 * are ordinarily set by <code>addLayoutComponent</code>.  For example:
 * <pre>
 * ScrollPaneLayout mySPLayout = new ScrollPanelLayout() {
 *     public void layoutContainer(Container p) {
 *         super.layoutContainer(p);
 *         // do some extra work here ...
 *     }
 * };
 * scrollpane.setLayout(mySPLayout):
 * </pre>
 */
 public void syncWithScrollPane(JScrollPane sp) {
viewport = sp.getViewport();
vsb = sp.getVerticalScrollBar();
hsb = sp.getHorizontalScrollBar();
rowHead = sp.getRowHeader();
colHead = sp.getColumnHeader();
lowerLeft = sp.getCorner(LOWER_LEFT_CORNER);
lowerRight = sp.getCorner(LOWER_RIGHT_CORNER);
upperLeft = sp.getCorner(UPPER_LEFT_CORNER);
upperRight = sp.getCorner(UPPER_RIGHT_CORNER);
vsbPolicy = sp.getVerticalScrollBarPolicy();
hsbPolicy = sp.getHorizontalScrollBarPolicy();
 }

代码示例来源:origin: com.jidesoft/jide-oss

return preferredLayoutSize(parent);
vsbPolicy = scrollPane.getVerticalScrollBarPolicy();
hsbPolicy = scrollPane.getHorizontalScrollBarPolicy();

代码示例来源:origin: com.synaptix/SynaptixSwing

public Dimension minimumLayoutSize(Container parent) {
  JScrollPane scrollPane = (JScrollPane) parent;
  vsbPolicy = scrollPane.getVerticalScrollBarPolicy();
  hsbPolicy = scrollPane.getHorizontalScrollBarPolicy();

代码示例来源:origin: com.jidesoft/jide-oss

vsbPolicy = scrollPane.getVerticalScrollBarPolicy();
hsbPolicy = scrollPane.getHorizontalScrollBarPolicy();

代码示例来源:origin: com.jidesoft/jide-oss

vsbPolicy = scrollPane.getVerticalScrollBarPolicy();
hsbPolicy = scrollPane.getHorizontalScrollBarPolicy();
boolean flatLayout = scrollPane instanceof JideScrollPane && ((JideScrollPane) scrollPane).isFlatLayout();

代码示例来源:origin: com.eas.platypus/platypus-js-forms

vsbPolicy = scrollPane.getVerticalScrollBarPolicy();
hsbPolicy = scrollPane.getHorizontalScrollBarPolicy();

代码示例来源:origin: net.java.dev.laf-widget/laf-widget

private void superlayoutContainer(Container parent) {
  JScrollPane scrollPane = (JScrollPane) parent;
  vsbPolicy = scrollPane.getVerticalScrollBarPolicy();
  hsbPolicy = scrollPane.getHorizontalScrollBarPolicy();

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf

vsbPolicy = scrollPane.getVerticalScrollBarPolicy();
hsbPolicy = scrollPane.getHorizontalScrollBarPolicy();

代码示例来源:origin: com.jidesoft/jide-oss

vsbPolicy = scrollPane.getVerticalScrollBarPolicy();
hsbPolicy = scrollPane.getHorizontalScrollBarPolicy();

相关文章

JScrollPane类方法