本文整理汇总了Java中java.awt.Scrollbar.HORIZONTAL属性的典型用法代码示例。如果您正苦于以下问题:Java Scrollbar.HORIZONTAL属性的具体用法?Java Scrollbar.HORIZONTAL怎么用?Java Scrollbar.HORIZONTAL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.awt.Scrollbar
的用法示例。
在下文中一共展示了Scrollbar.HORIZONTAL属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getClickPoint
@Override
protected Point getClickPoint(ComponentOperator oper, int direction, int orientation) {
int x, y;
if (orientation == Scrollbar.HORIZONTAL) {
if (direction == ScrollAdjuster.INCREASE_SCROLL_DIRECTION) {
x = oper.getWidth() - 1 - CLICK_OFFSET;
} else if (direction == ScrollAdjuster.DECREASE_SCROLL_DIRECTION) {
x = CLICK_OFFSET;
} else {
return null;
}
y = oper.getHeight() / 2;
} else if (orientation == Scrollbar.VERTICAL) {
if (direction == ScrollAdjuster.INCREASE_SCROLL_DIRECTION) {
y = oper.getHeight() - 1 - CLICK_OFFSET;
} else if (direction == ScrollAdjuster.DECREASE_SCROLL_DIRECTION) {
y = CLICK_OFFSET;
} else {
return null;
}
x = oper.getWidth() / 2;
} else {
return null;
}
return new Point(x, y);
}
示例2: setAsText
@Override
public void setAsText(String s) {
Integer i;
getTags();
if (s.equals(tags[0])) i = new Integer(Scrollbar.HORIZONTAL);
else i = new Integer(Scrollbar.VERTICAL);
setValue(i);
}
示例3: scrollToMinimum
@Override
public void scrollToMinimum(ComponentOperator oper, final int orientation) {
final Adjustable adj
= (orientation == Scrollbar.HORIZONTAL)
? ((ScrollPaneOperator) oper).getHAdjustable()
: ((ScrollPaneOperator) oper).getVAdjustable();
scroll(oper,
new ScrollAdjuster() {
@Override
public int getScrollDirection() {
return ((adj.getMinimum() < adj.getValue())
? DECREASE_SCROLL_DIRECTION
: DO_NOT_TOUCH_SCROLL_DIRECTION);
}
@Override
public int getScrollOrientation() {
return orientation;
}
@Override
public String getDescription() {
return "Scroll to minimum";
}
@Override
public String toString() {
return "scrollToMinimum.ScrollAdjuster{description = " + getDescription() + '}';
}
});
}
示例4: scrollToMaximum
@Override
public void scrollToMaximum(ComponentOperator oper, final int orientation) {
final Adjustable adj
= (orientation == Scrollbar.HORIZONTAL)
? ((ScrollPaneOperator) oper).getHAdjustable()
: ((ScrollPaneOperator) oper).getVAdjustable();
scroll(oper,
new ScrollAdjuster() {
@Override
public int getScrollDirection() {
return (((adj.getMaximum() - adj.getVisibleAmount()) > adj.getValue())
? INCREASE_SCROLL_DIRECTION
: DO_NOT_TOUCH_SCROLL_DIRECTION);
}
@Override
public int getScrollOrientation() {
return orientation;
}
@Override
public String getDescription() {
return "Scroll to maximum";
}
@Override
public String toString() {
return "scrollToMaximum.ScrollAdjuster{description = " + getDescription() + '}';
}
});
}
示例5: HVScroll
/**
* Constructor with a TGPanel <tt>tgp</tt> and TGLensSet <tt>tgls</tt>.
*/
public HVScroll(TGPanel tgp, TGLensSet tgls)
{
tgPanel = tgp;
tgLensSet = tgls;
offset = new TGPoint2D(0, 0);
scrolling = false;
adjustmentIsInternal = false;
horizontalSB = new DScrollbar(Scrollbar.HORIZONTAL, 0, 100, -1000, 1100);
horizontalSB.setBlockIncrement(100);
horizontalSB.setUnitIncrement(20);
horizontalSB.addAdjustmentListener(new horizAdjustmentListener());
verticalSB = new DScrollbar(Scrollbar.VERTICAL, 0, 100, -1000, 1100);
verticalSB.setBlockIncrement(100);
verticalSB.setUnitIncrement(20);
verticalSB.addAdjustmentListener(new vertAdjustmentListener());
hvLens = new HVLens();
hvDragUI = new HVDragUI(); // Hopefully this approach won't eat too much memory
hvScrollToCenterUI = new HVScrollToCenterUI();
tgPanel.addGraphListener(this);
}
示例6: initializeSlider
protected void initializeSlider( double min, double max, double initial) {
// System.out.println("min="+min+ " max="+max+ " initial=" +initial);
Hashtable labels = new Hashtable();
int scale= DEFAULT_RANGE;
this.curFloat = initial;
this.minFloat = min;
this.maxFloat = max;
// System.out.println("minimum10="+minimum10);
/* if (minimumRange10){ // in order to show ticks
if (maxv-minv<10)
maxv = minv+10;s
}*/
// System.out.println("minv="+minv+" maxv="+maxv+ " dvalue= "+dvalue+ " scale="+scale);
slider = new JScrollBar(Scrollbar.HORIZONTAL, 0, DEFAULT_VISIBLE, 0, DEFAULT_RANGE);
slider.addAdjustmentListener(new AdjustmentListener() {
public void adjustmentValueChanged(AdjustmentEvent ae) {
int
ival = slider.getValue(),
vis = slider.getVisibleAmount(),
min = slider.getMinimum(),
max = slider.getMaximum();
double dval = transformRange(false, min, max-vis, ival,
isLogScale, minFloat, maxFloat);
//System.out.println("getting: ival="+ival+" -> dval="+dval);
setFloatValue(dval);
setTextAreaValue(dval);
}
});
setTextAreaValue();
}
示例7: s_bar
public void s_bar(String st, int numa, int numb, int numc) {
this.textur.pan[numa] = new Panel();
this.textur.pan[numa].setLayout(new GridLayout(1, 2));
this.textur.but[numa] = new Button("" + numb);
this.textur.pan[numa].add("West", new Button(st));
this.textur.pan[numa].add("East", this.textur.but[numa]);
this.textur.scr[numa] = new Scrollbar(Scrollbar.HORIZONTAL, numb, 50, 0, numc);
this.textur.p1.add(this.textur.pan[numa]);
this.textur.p1.add(this.textur.scr[numa]);
}
示例8: BagWindow
public BagWindow() {
/* The lowest level displayed -- will need adjusted for variable bag sizes*/
int showLevel = (int)(Parameters.BAG_THRESHOLD * Parameters.BAG_LEVEL);
getContentPane().setBackground(MULTIPLE_WINDOW_COLOR);
text = new JTextArea("");
text.setBackground(DISPLAY_BACKGROUND_COLOR);
text.setEditable(false);
JScrollPane textScrollPane = new JScrollPane(text);
valueLabel = new JLabel( "00", JLabel.RIGHT);
valueBar = new JScrollBar(Scrollbar.HORIZONTAL, showLevel, 0, 1, Parameters.BAG_LEVEL);
valueBar.addAdjustmentListener(this);
stopButton = new JButton(Window.OFF_LABEL);
stopButton.addActionListener(this);
playButton = new JButton(Window.ON_LABEL);
playButton.addActionListener(this);
closeButton = new JButton("Close");
closeButton.addActionListener(this);
applyBorderLayout(textScrollPane);
setBounds(600, 60 + counter * 40, 600, 300);
counter++;
adjustLabelAndCursor(showLevel);
setVisible(true);
}
示例9: Tree
/**
* Constructor declaration
*
*/
Tree() {
super();
vData = new Vector();
setLayout(null);
sbHoriz = new Scrollbar(Scrollbar.HORIZONTAL);
add(sbHoriz);
sbVert = new Scrollbar(Scrollbar.VERTICAL);
add(sbVert);
}
示例10: Grid
/**
* Constructor declaration
*
*/
public Grid() {
super();
fFont = new Font("Dialog", Font.PLAIN, 12);
setLayout(null);
sbHoriz = new Scrollbar(Scrollbar.HORIZONTAL);
add(sbHoriz);
sbVert = new Scrollbar(Scrollbar.VERTICAL);
add(sbVert);
}
示例11: sliderHorizontal
public static Scrollbar sliderHorizontal(int value, int minScrollWidth, int maxScrollWidth, AdjustmentListener listener) {
Scrollbar slider = new Scrollbar(Scrollbar.HORIZONTAL, value, 1, minScrollWidth, maxScrollWidth);
slider.addAdjustmentListener(listener);
return slider;
}