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


Java Window.setPositionX方法代碼示例

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


在下文中一共展示了Window.setPositionX方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: placeWindow

import com.vaadin.ui.Window; //導入方法依賴的package包/類
protected void placeWindow(Window window) {
	window.setPositionX(xCurrent);
	window.setPositionY(yCurrent);
	
	xCurrent += 30;
	yCurrent += 30;
	
	if(xCurrent >= 400) {
		xCurrent = xStart;
	}
	
	if(yCurrent >= 300) {
		yCurrent = yStart;
	}
	
}
 
開發者ID:alejandro-du,項目名稱:enterprise-app,代碼行數:17,代碼來源:MDIWindow.java

示例2: buttonClick

import com.vaadin.ui.Window; //導入方法依賴的package包/類
@Override
public void buttonClick(final ClickEvent event) {
	final SetGoogleAuthenticatorCredentialResponse response = (SetGoogleAuthenticatorCredentialResponse) ApplicationMangerAccess.getApplicationManager().service(googleAuthRequest);

	if (ServiceResult.SUCCESS == response.getResult()) {

		try {
			final URI keyUri = new URI(response.getOtpAuthTotpURL());
			final QRCode qrCode = new QRCode(QR_CODE, keyUri.toASCIIString());
			qrCode.setHeight(QR_CODE_IMAGE_SIZE);
			qrCode.setWidth(QR_CODE_IMAGE_SIZE);

			final Window mywindow = new Window(GOOGLE_AUTHENTICATOR_QR_CODE);
			mywindow.setHeight(MODAL_WINDOW_SIZE);
			mywindow.setWidth(MODAL_WINDOW_SIZE);

			mywindow.setPositionX(WINDOW_POSITION);
			mywindow.setPositionY(WINDOW_POSITION);

			final VerticalLayout panelContent = new VerticalLayout();

			mywindow.setContent(panelContent);
			panelContent.addComponent(qrCode);

			mywindow.setModal(true);
			UI.getCurrent().addWindow(mywindow);

		} catch (final URISyntaxException e) {
			LOGGER.warn(PROBLEM_DISPLAYING_QR_CODE,e);
			Notification.show(PROBLEM_DISPLAYING_QR_CODE,
	                  ERROR_MESSAGE,
	                  Notification.Type.WARNING_MESSAGE);
		}

	} else {
		Notification.show(PROBLEM_ENABLE_GOOGLE_AUTHENTICATOR,
                  ERROR_MESSAGE,
                  Notification.Type.WARNING_MESSAGE);
		LOGGER.info(PROBLEM_ENABLE_GOOGLE_AUTHENTICATOR_SESSIONID,googleAuthRequest.getSessionId());
	}
}
 
開發者ID:Hack23,項目名稱:cia,代碼行數:42,代碼來源:SetGoogleAuthenticatorCredentialClickListener.java

示例3: getGraph

import com.vaadin.ui.Window; //導入方法依賴的package包/類
/**
 * Get a Vaadin Window element that contains the corresponding R plot
 * generated by submitting and evaluating the RPlotCall String. The
 * imageName corresponds to the downloadable .png image name. The full name
 * of the images shown in the browser are of the format
 * {@code imageName_ISODate_runningId_[sessionId].png}, e.g.
 * 'Image_2012-08-29_001_[bmgolmfgvk].png' to keep them chronologically
 * ordered.
 * 
 * @param RPlotCall
 *            the String to be evaluated by R
 * @param width
 *            the width of the graphical image
 * @param height
 *            the height of the graphical image
 * @param imageName
 *            the image name attached to the right-click downloadable file
 * @param windowName
 *            the title name of the Vaadin window element
 * @return Vaadin Window object
 */
public Window getGraph(final String RPlotCall, final int width,
		final int height, final String imageName, String windowName) {

	/* Construct a Window to show the graphics */
	Window RGraphics = new Window(windowName);
	HorizontalLayout root = new HorizontalLayout();
	root.setMargin(true);

	RGraphics.setContent(root);
	RGraphics.setSizeUndefined();

	/* Control the image position */
	final int imageXoffset = 180;
	final int imageYoffset = 60;

	int imageYpos = rand.nextInt(50);
	int imageXpos = rand.nextInt(90);

	RGraphics.setPositionX(imageXoffset + imageXpos);
	RGraphics.setPositionY(imageYoffset + imageYpos);

	/* Call R for the graphics */
	Embedded rPlot = getEmbeddedGraph(RPlotCall, width, height, imageName);
	root.addComponent(rPlot);

	/*
	 * Button bar to generate PDF (and for other options in the future)
	 */
	if (showButtonsInGraph) {
		final HorizontalLayout buttonLayout = new HorizontalLayout();
		Button open = new Button("PDF");
		open.setStyleName(Reindeer.BUTTON_SMALL);
		buttonLayout.addComponent(open);

		Button.ClickListener openClicked = new Button.ClickListener() {

			private static final long serialVersionUID = 1L;

			@Override
			public void buttonClick(ClickEvent event) {
				StreamResource s = getImageResource(RPlotCall, width
						/ screen_dpi, height / screen_dpi, imageName, "pdf");

				Link pdfLink = new Link("Open pdf", s);
				pdfLink.setTargetName("_blank");

				buttonLayout.removeAllComponents();
				buttonLayout.addComponent(pdfLink);
			}
		};
		open.addClickListener(openClicked);
		root.addComponent(buttonLayout);
	}

	return RGraphics;
}
 
開發者ID:avirkki,項目名稱:RVaadin,代碼行數:78,代碼來源:RContainer.java


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