本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
}
}
示例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);
}
}