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


Java Scrollbar.VERTICAL屬性代碼示例

本文整理匯總了Java中java.awt.Scrollbar.VERTICAL屬性的典型用法代碼示例。如果您正苦於以下問題:Java Scrollbar.VERTICAL屬性的具體用法?Java Scrollbar.VERTICAL怎麽用?Java Scrollbar.VERTICAL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在java.awt.Scrollbar的用法示例。


在下文中一共展示了Scrollbar.VERTICAL屬性的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: Calque

/** Creation de l'objet calque */
protected Calque(Aladin aladin) {
   this.aladin = aladin;

   select = new Select(aladin);
   zoom = new Zoom(aladin);
   scroll = new ScrollbarStack(aladin,Scrollbar.VERTICAL,FIRSTBLOC-1,1,0,FIRSTBLOC);

   // Creation des composantes de l'objet (plan, select et zoom)
   reallocPlan();
   flagOverlay = true;
   reticleMode=aladin.configuration.get(Configuration.RETICLE)!=null ? 2 : 1;
   flagTip=aladin.configuration.get(Configuration.TOOLTIP)!=null;
   flagAutoDist = aladin.configuration.getAutoDist();
   flagSimbad = aladin.configuration.getSimbadFlag();
   flagVizierSED = aladin.configuration.getVizierSEDFlag();
   
   setOverlayList("label,scale,size,NE,target,reticle,target,pixel");

   // Panel principal : contient le selecteur de plans et le zoom
   setLayout( new BorderLayout(0,5) );
   add(select,BorderLayout.CENTER);
   add(zoom,BorderLayout.SOUTH);
}
 
開發者ID:jankotek,項目名稱:asterope,代碼行數:24,代碼來源:Calque.java

示例3: Calque

/** Creation de l'objet calque */
protected Calque(Aladin aladin) {
   this.aladin = aladin;

   select = new Select(aladin);
   zoom = new Zoom(aladin);
   scroll = new ScrollbarStack(aladin,Scrollbar.VERTICAL,FIRSTBLOC-1,1,0,FIRSTBLOC);

   // Creation des composantes de l'objet (plan, select et zoom)
   reallocPlan();
   flagOverlay = true;
   reticleMode=aladin.configuration.get(Configuration.RETICLE)!=null ? 2 : 1;
   flagTip=aladin.configuration.get(Configuration.TOOLTIP)!=null;
   flagAutoDist = aladin.configuration.getAutoDist();
   flagSimbad = aladin.configuration.getSimbadFlag();
   flagVizierSED = aladin.configuration.getVizierSEDFlag();
   
   setOverlayList("label,scale,size,NE,target,reticle,target,pixel,sofiaimagers");

   // Panel principal : contient le selecteur de plans et le zoom
   setLayout( new BorderLayout(0,5) );
   add(select,BorderLayout.CENTER);
   add(zoom,BorderLayout.SOUTH);
}
 
開發者ID:svvatters,項目名稱:SOFIAladin,代碼行數:24,代碼來源:Calque.java

示例4: 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

示例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: getAsText

@Override
public String getAsText() {
    int i = ((Integer) getValue()).intValue();
    getTags();
    return i == Scrollbar.VERTICAL ? tags[1] : tags[0];
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:6,代碼來源:ScrollbarBeanInfo.java

示例7: getJavaInitializationString

@Override
public String getJavaInitializationString() {
    int i = ((Integer) getValue()).intValue();
    return i == Scrollbar.VERTICAL ? "java.awt.Scrollbar.VERTICAL" : "java.awt.Scrollbar.HORIZONTAL"; // NOI18N
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:5,代碼來源:ScrollbarBeanInfo.java

示例8: PDFViewerBuffer

/**
 * It render the section of the manual specified by @marker. 
 * 
 * @param title
 * @param marker
 * @throws IOException
 */
public PDFViewerBuffer(String title, ManualBookmarkers marker)
		throws IOException {
	super(title);

	/**	To avoid out of
	 * memory issue, it uses a buffer to load the pages.	
	 */	
	buffer = new Image[BUFFER_SIZE];
	bufferIndex = new int[BUFFER_SIZE];
	JPanel omni = new JPanel(new BorderLayout());
	canvas = new JPanel();

	loadManual(marker);
	loadPage(0);

	updateCanvas();

	/**	
	 * creation and management scrollbars	
	 */
	bar = new Scrollbar(Scrollbar.VERTICAL, 0, 1, 0, (pageEnd - pageStart)
			* SCROLLBAR_ACCURACY);
	bar.addAdjustmentListener(this);
	JScrollPane scroller = new JScrollPane(canvas);
	scroller.getVerticalScrollBar().setPreferredSize(new Dimension(0, 0));
	scroller.getHorizontalScrollBar().setPreferredSize(new Dimension(0, 0));
	omni.add(scroller, BorderLayout.CENTER);

	omni.add(bar, BorderLayout.WEST);
	omni.add(bar, BorderLayout.EAST);
	setContentPane(omni);

	this.addWindowListener(new CloseHelpFileAdapter());
	this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
	Toolkit tk = Toolkit.getDefaultToolkit();
	setPreferredSize(new Dimension((int) Math.min(imageWidth, tk.getScreenSize().getWidth()),
			(int) Math.min(imageHeight * 1.9, tk.getScreenSize().getHeight())));
	pack();
	setVisible(true);
}
 
開發者ID:max6cn,項目名稱:jmt,代碼行數:47,代碼來源:PDFViewerBuffer.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: sliderVertical

public static Scrollbar sliderVertical(int value, int minScrollWidth, int maxScrollWidth, AdjustmentListener listener) {
    Scrollbar slider = new Scrollbar(Scrollbar.VERTICAL, value, 1, minScrollWidth, maxScrollWidth);
    slider.addAdjustmentListener(listener);
    return slider;
}
 
開發者ID:vocobox,項目名稱:vocobox,代碼行數:5,代碼來源:EzLayout.java


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