當前位置: 首頁>>代碼示例>>Java>>正文


Java Scrollbar.HORIZONTAL屬性代碼示例

本文整理匯總了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);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:26,代碼來源:ScrollbarDriver.java

示例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);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:ScrollbarBeanInfo.java

示例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() + '}';
        }
    });
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:31,代碼來源:ScrollPaneDriver.java

示例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() + '}';
        }
    });
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:31,代碼來源:ScrollPaneDriver.java

示例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);
}
 
開發者ID:dvorka,項目名稱:mindraider,代碼行數:30,代碼來源:HVScroll.java

示例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();
      

   }
 
開發者ID:SOCR,項目名稱:HTML5_WebSite,代碼行數:40,代碼來源:FloatSlider.java

示例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]);
}
 
開發者ID:sp4cerat,項目名稱:Java-Random-Texture-Generator,代碼行數:10,代碼來源:TexturWindow.java

示例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);
}
 
開發者ID:automenta,項目名稱:opennars,代碼行數:29,代碼來源:BagWindow.java

示例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);
}
 
開發者ID:tiweGH,項目名稱:OpenDiabetes,代碼行數:20,代碼來源:Tree.java

示例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);
}
 
開發者ID:tiweGH,項目名稱:OpenDiabetes,代碼行數:20,代碼來源:Grid.java

示例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;
}
 
開發者ID:vocobox,項目名稱:vocobox,代碼行數:5,代碼來源:EzLayout.java


注:本文中的java.awt.Scrollbar.HORIZONTAL屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。