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


Java ScrollbarPeer类代码示例

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


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

示例1: setLineIncrement

import java.awt.peer.ScrollbarPeer; //导入依赖的package包/类
/**
 * Sets the value added or subtracted to the scrollbar value when the
 * user selects the scroll by a "unit" amount control.
 *
 * @param lineIncrement The new unit increment amount.
 *
 * @deprecated This method is deprecated in favor of
 * <code>setUnitIncrement()</code>.
 */
public void setLineIncrement(int lineIncrement)
{
  if (lineIncrement < 0)
    throw new IllegalArgumentException("Unit increment less than zero.");

  if (lineIncrement == 0)
    lineIncrement = 1;

 if (lineIncrement == this.lineIncrement)
    return;

  this.lineIncrement = lineIncrement;

  ScrollbarPeer peer = (ScrollbarPeer) getPeer();
  if (peer != null)
    peer.setLineIncrement(this.lineIncrement);
}
 
开发者ID:vilie,项目名称:javify,代码行数:27,代码来源:Scrollbar.java

示例2: setPageIncrement

import java.awt.peer.ScrollbarPeer; //导入依赖的package包/类
/**
 * Sets the value added or subtracted to the scrollbar value when the
 * user selects the scroll by a "block" amount control.
 *
 * @param pageIncrement The new block increment amount.
 *
 * @deprecated This method is deprecated in favor of
 * <code>setBlockIncrement()</code>.
 */
public void setPageIncrement(int pageIncrement)
{
  if (pageIncrement < 0)
    throw new IllegalArgumentException("Block increment less than zero.");

  if (pageIncrement == 0)
    pageIncrement = 1;

  if (pageIncrement == this.pageIncrement)
    return;

  this.pageIncrement = pageIncrement;

  ScrollbarPeer peer = (ScrollbarPeer) getPeer();
  if (peer != null)
    peer.setPageIncrement(this.pageIncrement);
}
 
开发者ID:vilie,项目名称:javify,代码行数:27,代码来源:Scrollbar.java

示例3: setLineIncrement

import java.awt.peer.ScrollbarPeer; //导入依赖的package包/类
/**
 * Sets the value added or subtracted to the scrollbar value when the
 * user selects the scroll by a "unit" amount control.
 *
 * @param lineIncrement The new unit increment amount.
 *
 * @deprecated This method is deprecated in favor of
 * <code>setUnitIncrement()</code>.
 */
public void setLineIncrement(int lineIncrement)
{
  if (lineIncrement < 0)
    throw new IllegalArgumentException("Unit increment less than zero.");
  
  if (lineIncrement == 0)
    lineIncrement = 1;
       
 if (lineIncrement == this.lineIncrement)
    return;
  
  this.lineIncrement = lineIncrement;

  ScrollbarPeer peer = (ScrollbarPeer) getPeer();
  if (peer != null)
    peer.setLineIncrement(this.lineIncrement);
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:27,代码来源:Scrollbar.java

示例4: setPageIncrement

import java.awt.peer.ScrollbarPeer; //导入依赖的package包/类
/**
 * Sets the value added or subtracted to the scrollbar value when the
 * user selects the scroll by a "block" amount control.
 *
 * @param pageIncrement The new block increment amount.
 *
 * @deprecated This method is deprecated in favor of
 * <code>setBlockIncrement()</code>.
 */
public void setPageIncrement(int pageIncrement)
{
  if (pageIncrement < 0)
    throw new IllegalArgumentException("Block increment less than zero.");

  if (pageIncrement == 0)
    pageIncrement = 1;
  
  if (pageIncrement == this.pageIncrement)
    return;

  this.pageIncrement = pageIncrement;

  ScrollbarPeer peer = (ScrollbarPeer) getPeer();
  if (peer != null)
    peer.setPageIncrement(this.pageIncrement);
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:27,代码来源:Scrollbar.java

示例5: attachFakePeer

import java.awt.peer.ScrollbarPeer; //导入依赖的package包/类
public static boolean attachFakePeer(Component comp) {
    if (comp == null || comp.isDisplayable()
          || comp instanceof javax.swing.JComponent
          || comp instanceof javax.swing.RootPaneContainer)
        return false;

    FakePeer peer = null;

    if (comp instanceof Label)
        peer = getFakePeer(LabelPeer.class, new FakeLabelPeer((Label) comp));
    else if (comp instanceof Button)
        peer = getFakePeer(ButtonPeer.class, new FakeButtonPeer((Button) comp));                   
    else if (comp instanceof Panel)
        peer = getFakePeer(new Class[] {ContainerPeer.class, PanelPeer.class}, new FakePanelPeer((Panel) comp));
    else if (comp instanceof TextField)
        peer = getFakePeer(new Class[] {TextFieldPeer.class, TextComponentPeer.class}, new FakeTextFieldPeer((TextField) comp));
    else if (comp instanceof TextArea)
        peer = getFakePeer(new Class[] {TextAreaPeer.class, TextComponentPeer.class}, new FakeTextAreaPeer((TextArea) comp));
    else if (comp instanceof TextComponent)
        peer = getFakePeer(TextComponentPeer.class, new FakeTextComponentPeer((TextComponent) comp));
    else if (comp instanceof Checkbox)
        peer = getFakePeer(CheckboxPeer.class, new FakeCheckboxPeer((Checkbox) comp));
    else if (comp instanceof Choice)
        peer = getFakePeer(ChoicePeer.class, new FakeChoicePeer((Choice) comp));
    else if (comp instanceof List)
        peer = getFakePeer(ListPeer.class, new FakeListPeer((List) comp));
    else if (comp instanceof Scrollbar)
        peer = getFakePeer(ScrollbarPeer.class, new FakeScrollbarPeer((Scrollbar) comp));
    else if (comp instanceof ScrollPane)
        peer = getFakePeer(new Class[] {ContainerPeer.class, ScrollPanePeer.class}, new FakeScrollPanePeer((ScrollPane) comp));
    else if (comp instanceof Canvas)
        peer = getFakePeer(CanvasPeer.class, new FakeCanvasPeer((Canvas) comp));
    else
        return false;

    attachFakePeer(comp, peer);
    return true;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:39,代码来源:FakePeerSupport.java

示例6: setLineIncrement

import java.awt.peer.ScrollbarPeer; //导入依赖的package包/类
/**
 * @deprecated As of JDK version 1.1,
 * replaced by <code>setUnitIncrement(int)</code>.
 */
@Deprecated
public synchronized void setLineIncrement(int v) {
    int tmp = (v < 1) ? 1 : v;

    if (lineIncrement == tmp) {
        return;
    }
    lineIncrement = tmp;

    ScrollbarPeer peer = (ScrollbarPeer)this.peer;
    if (peer != null) {
        peer.setLineIncrement(lineIncrement);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:Scrollbar.java

示例7: setPageIncrement

import java.awt.peer.ScrollbarPeer; //导入依赖的package包/类
/**
 * @deprecated As of JDK version 1.1,
 * replaced by <code>setBlockIncrement()</code>.
 */
@Deprecated
public synchronized void setPageIncrement(int v) {
    int tmp = (v < 1) ? 1 : v;

    if (pageIncrement == tmp) {
        return;
    }
    pageIncrement = tmp;

    ScrollbarPeer peer = (ScrollbarPeer)this.peer;
    if (peer != null) {
        peer.setPageIncrement(pageIncrement);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:Scrollbar.java

示例8: setLineIncrement

import java.awt.peer.ScrollbarPeer; //导入依赖的package包/类
/**
 * Sets the unit increment for this scroll bar.
 *
 * @param  v the increment value
 *
 * @deprecated As of JDK version 1.1,
 * replaced by {@code setUnitIncrement(int)}.
 */
@Deprecated
public synchronized void setLineIncrement(int v) {
    int tmp = (v < 1) ? 1 : v;

    if (lineIncrement == tmp) {
        return;
    }
    lineIncrement = tmp;

    ScrollbarPeer peer = (ScrollbarPeer)this.peer;
    if (peer != null) {
        peer.setLineIncrement(lineIncrement);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:23,代码来源:Scrollbar.java

示例9: setPageIncrement

import java.awt.peer.ScrollbarPeer; //导入依赖的package包/类
/**
 * Sets the block increment for this scroll bar.
 *
 * @param  v the block increment
 * @deprecated As of JDK version 1.1,
 * replaced by {@code setBlockIncrement()}.
 */
@Deprecated
public synchronized void setPageIncrement(int v) {
    int tmp = (v < 1) ? 1 : v;

    if (pageIncrement == tmp) {
        return;
    }
    pageIncrement = tmp;

    ScrollbarPeer peer = (ScrollbarPeer)this.peer;
    if (peer != null) {
        peer.setPageIncrement(pageIncrement);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:22,代码来源:Scrollbar.java

示例10: setValues

import java.awt.peer.ScrollbarPeer; //导入依赖的package包/类
/**
 * Sets the current value, visible amount, minimum, and maximum for this
 * scrollbar.  These values are adjusted to be internally consistent
 * if necessary.
 *
 * @param value The new value for this scrollbar.
 * @param visibleAmount The new visible amount for this scrollbar.
 * @param minimum The new minimum value for this scrollbar.
 * @param maximum The new maximum value for this scrollbar.
 */
public synchronized void setValues(int value, int visibleAmount,
                                   int minimum, int maximum)
{
  if (visibleAmount <= 0)
    visibleAmount = 1;

  if (maximum <= minimum)
    maximum = minimum + 1;

  if (value < minimum)
    value = minimum;

  if (visibleAmount > maximum - minimum)
    visibleAmount = maximum - minimum;

  // According to documentation, the actual maximum
  // value is (maximum - visibleAmount)
  if (value > maximum - visibleAmount)
    value = maximum - visibleAmount;

  ScrollbarPeer peer = (ScrollbarPeer) getPeer();
  if (peer != null
      && (this.value != value || this.visibleAmount != visibleAmount
          || this.minimum != minimum || this.maximum != maximum))
    peer.setValues(value, visibleAmount, minimum, maximum);

  this.value = value;
  this.visibleAmount = visibleAmount;
  this.minimum = minimum;
  this.maximum = maximum;
}
 
开发者ID:vilie,项目名称:javify,代码行数:42,代码来源:Scrollbar.java

示例11: setValues

import java.awt.peer.ScrollbarPeer; //导入依赖的package包/类
/**
 * Sets the current value, visible amount, minimum, and maximum for this
 * scrollbar.  These values are adjusted to be internally consistent
 * if necessary.
 *
 * @param value The new value for this scrollbar.
 * @param visibleAmount The new visible amount for this scrollbar.
 * @param minimum The new minimum value for this scrollbar.
 * @param maximum The new maximum value for this scrollbar.
 */
public synchronized void setValues(int value, int visibleAmount,
                                   int minimum, int maximum)
{
  if (visibleAmount <= 0)
    visibleAmount = 1;
  
  if (maximum <= minimum)
    maximum = minimum + 1;

  if (value < minimum)
    value = minimum;

  if (visibleAmount > maximum - minimum)
    visibleAmount = maximum - minimum;
  
  // According to documentation, the actual maximum
  // value is (maximum - visibleAmount)
  if (value > maximum - visibleAmount)
    value = maximum - visibleAmount;

  ScrollbarPeer peer = (ScrollbarPeer) getPeer();
  if (peer != null
      && (this.value != value || this.visibleAmount != visibleAmount
          || this.minimum != minimum || this.maximum != maximum))
    peer.setValues(value, visibleAmount, minimum, maximum);

  this.value = value;
  this.visibleAmount = visibleAmount;
  this.minimum = minimum;
  this.maximum = maximum;      
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:42,代码来源:Scrollbar.java

示例12: setLineIncrement

import java.awt.peer.ScrollbarPeer; //导入依赖的package包/类
/**
 * @deprecated As of JDK version 1.1,
 * replaced by <code>setUnitIncrement(int)</code>.
 */
@Deprecated
public synchronized void setLineIncrement(int v) {
    int tmp = (v < 1) ? 1 : v; 

    if (lineIncrement == tmp) {
        return; 
    }
    lineIncrement = tmp; 

    ScrollbarPeer peer = (ScrollbarPeer)this.peer;
    if (peer != null) {
        peer.setLineIncrement(lineIncrement);
    }
}
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:19,代码来源:Scrollbar.java

示例13: setPageIncrement

import java.awt.peer.ScrollbarPeer; //导入依赖的package包/类
/**
 * @deprecated As of JDK version 1.1,
 * replaced by <code>setBlockIncrement()</code>.
 */
@Deprecated
public synchronized void setPageIncrement(int v) {
    int tmp = (v < 1) ? 1 : v; 

    if (pageIncrement == tmp) {
        return; 
    }
    pageIncrement = tmp; 

    ScrollbarPeer peer = (ScrollbarPeer)this.peer;
    if (peer != null) {
        peer.setPageIncrement(pageIncrement);
    }
}
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:19,代码来源:Scrollbar.java


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