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


Java Shell.setSize方法代碼示例

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


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

示例1: main

import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
/**
 * Starting point for the demonstration application.
 *
 * @param args  ignored.
 */
public static void main( String[] args ) 
{
    JFreeChart chart = createChart(createDataset());
    Display display = new Display();
    Shell shell = new Shell(display);
    shell.setSize(600, 400);
    shell.setLayout(new FillLayout());
    shell.setText("Test for jfreechart running with SWT");
    final ChartComposite frame = new ChartComposite(shell, SWT.NONE, chart, true);
    //frame.setDisplayToolTips(false);
    frame.pack();
    shell.open();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch())
            display.sleep();
    }
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:23,代碼來源:SWTPieChartDemo1.java

示例2: runSetup

import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
public static boolean runSetup() {
	Display display = Display.getDefault();
	WizardDialog wizardDialog = new WizardDialog(display.getActiveShell(), new SetupWizard()) {
		
		@Override
		protected void configureShell(Shell shell) {
			super.configureShell(shell);
			shell.setSize(730, 700);
			setReturnCode(WizardDialog.CANCEL);
		}
		
	};
	
	int ret = wizardDialog.open(); 
	
	return ret == WizardDialog.OK;
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:18,代碼來源:SetupAction.java

示例3: createContents

import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
private void createContents(String str) {
	aboutToolsShell = new Shell(getParent(), getStyle());
	aboutToolsShell.setImage(SWTResourceManager.getImage(ShortcutKeyExplain.class, Resource.IMAGE_ICON));
	aboutToolsShell.setSize(400, 391);
	aboutToolsShell.setText(getText());
	PubUtils.setCenterinParent(getParent(), aboutToolsShell);

	Link link = new Link(aboutToolsShell, SWT.NONE);
	link.setBounds(143, 336, 108, 17);
	link.setText("<a>www.itlaborer.com</a>");
	link.addSelectionListener(new LinkSelection());

	StyledText readMeTextLabel = new StyledText(aboutToolsShell,
			SWT.BORDER | SWT.READ_ONLY | SWT.WRAP | SWT.V_SCROLL);
	readMeTextLabel.setBounds(3, 33, 389, 297);
	readMeTextLabel.setText(str);

	Label label_2 = new Label(aboutToolsShell, SWT.NONE);
	label_2.setFont(org.eclipse.wb.swt.SWTResourceManager.getFont("微軟雅黑", 9, SWT.BOLD));
	label_2.setText("快捷鍵說明:");
	label_2.setBounds(3, 12, 136, 17);
}
 
開發者ID:cnldw,項目名稱:APITools,代碼行數:23,代碼來源:ShortcutKeyExplain.java

示例4: StartupSplashShell

import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
/**
 * create the startup splash shell and display it
 * @param display
 */
public StartupSplashShell(Display display){
	shell = new Shell(display, SWT.NO_TRIM);
	
	setupShell(); 				// place components in the main avoCADo shell
	
	shell.setText("avoCADo");
	shell.setBackgroundImage(ImageUtils.getIcon("./avoCADo-Splash.jpg", 360, 298));
	shell.setSize(360, 298);	//TODO: set intial size to last known size
	Rectangle b = display.getBounds();
	int xPos = Math.max(0, (b.width-360)/2);
	int yPos = Math.max(0, (b.height-298)/2);
	shell.setLocation(xPos, yPos);
	shell.setImage(ImageUtils.getIcon("./avoCADo.png", 32, 32));
	shell.open();
	
	// handle events while the shell is not disposed
	//while (!shell.isDisposed()) {
	//	if (!display.readAndDispatch())
	//		display.sleep();
	//}
}
 
開發者ID:avoCADo-3d,項目名稱:avoCADo,代碼行數:26,代碼來源:StartupSplashShell.java

示例5: AboutAvoCADoGPLShell

import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
/**
 * create the startup splash shell and display it
 * @param display
 */
public AboutAvoCADoGPLShell(Display display){
	shell = new Shell(display, SWT.PRIMARY_MODAL);
	
	setupShell(); 				// place components in the avoCADo license shell
	
	shell.setText("avoCADo GPLv2");
	shell.setSize(583, 350);	//TODO: set initial size to last known size
	Rectangle b = display.getBounds();
	int xPos = Math.max(0, (b.width-583)/2);
	int yPos = Math.max(0, (b.height-350)/2);
	shell.setLocation(xPos, yPos);
	shell.open();
	
	// handle events while the shell is not disposed
	while (!shell.isDisposed()) {
		if (!display.readAndDispatch())
			display.sleep();
	}
}
 
開發者ID:avoCADo-3d,項目名稱:avoCADo,代碼行數:24,代碼來源:AboutAvoCADoGPLShell.java

示例6: main

import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
/**
 * Starting point for the demonstration application.
 *
 * @param args  ignored.
 */
public static void main( String[] args ) 
{
    final JFreeChart chart = createChart();
    final Display display = new Display();
    Shell shell = new Shell(display);
    shell.setSize(600, 300);
    shell.setLayout(new FillLayout());
    shell.setText("Test for jfreechart running with SWT");
    ChartComposite frame = new ChartComposite(shell, SWT.NONE, chart, true);
    frame.setDisplayToolTips(false);
    frame.setHorizontalAxisTrace(true);
    frame.setVerticalAxisTrace(true);
    shell.open();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch())
            display.sleep();
    }
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:24,代碼來源:SWTMultipleAxisDemo1.java

示例7: createShell

import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
@Override
protected Shell createShell(Display display) throws Exception {

	this.viewer = interfaceService.createModelViewer();

	Shell shell = new Shell(display);
	shell.setText("Point Model");
	shell.setLayout(new GridLayout(1, false));
       viewer.createPartControl(shell);

	shell.pack();
	shell.setSize(500, 500);
	shell.open();

	return shell;
}
 
開發者ID:eclipse,項目名稱:scanning,代碼行數:17,代碼來源:KnownModelsTest.java

示例8: main

import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
/**
 * Starting point for the demonstration application.
 *
 * @param args  ignored.
 */
public static void main(String[] args) {
    final JFreeChart chart = createChart(createDataset());
    final Display display = new Display();
    Shell shell = new Shell(display);
    shell.setSize(600, 300);
    shell.setLayout(new FillLayout());
    shell.setText("Time series demo for jfreechart running with SWT");
    ChartComposite frame = new ChartComposite(shell, SWT.NONE, chart, true);
    frame.setDisplayToolTips(true);
    frame.setHorizontalAxisTrace(false);
    frame.setVerticalAxisTrace(false);
    shell.open();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch())
            display.sleep();
    }
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:23,代碼來源:SWTTimeSeriesDemo.java

示例9: createShell

import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
@Override
protected Shell createShell(Display display) throws Exception {

	this.model = new MultiStepModel();

	Shell shell = new Shell(display);
	shell.setText("Multi-Step");
	shell.setLayout(new GridLayout(1, false));

	this.ui = new MultiStepComposite(shell, SWT.NONE);

	this.controller = BeanService.getInstance().createController(ui, model);
	controller.beanToUI();
	controller.switchState(true);

	this.service = new MockScannableConnector(null);
	AnnotationManager manager = new AnnotationManager(Inject.class);
	manager.addDevices(ui);
	manager.invoke(Inject.class, service, model);

	shell.pack();
	shell.setSize(500, 500);
	shell.open();
	return shell;
}
 
開發者ID:eclipse,項目名稱:scanning,代碼行數:26,代碼來源:MultiStepCompositeTest.java

示例10: createShell

import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
@Override
protected Shell createShell(Display display) throws Exception {

	this.config = new SampleData();
	config.setName("Sample name");
	config.setDescription("Hello World");

	this.viewer = interfaceService.createModelViewer();

	Shell shell = new Shell(display);
	shell.setText("Sample");
	shell.setLayout(new GridLayout(1, false));
       viewer.createPartControl(shell);
	viewer.setModel(config);

	shell.pack();
	shell.setSize(500, 500);
	shell.open();

	return shell;
}
 
開發者ID:eclipse,項目名稱:scanning,代碼行數:22,代碼來源:SampleInformationTest.java

示例11: createShell

import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
@Override
protected Shell createShell(Display display) throws Exception {

	this.viewer = new ScannableViewer();

	Shell shell = new Shell(display);
	shell.setText("Monitors");
	shell.setLayout(new GridLayout(1, false));
       viewer.createPartControl(shell);

	shell.pack();
	shell.setSize(500, 500);
	shell.open();

	return shell;
}
 
開發者ID:eclipse,項目名稱:scanning,代碼行數:17,代碼來源:ScannableViewerTest.java

示例12: layout

import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
/**
 * 
 */
@Override
public void layout(XCalendar popup, Composite parent, Rectangle bounds) {
	//
	this.prevParent = parent;
	this.prevBounds = bounds;
	final XCalendarModel model = popup.getModel();
	final XCalendarTheme theme = model.getTheme();
	int x = theme.getMargin(), y = theme.getMargin();
	int m = theme.getMargin(), w = theme.getWidth() - 2 * m;
	
	//
	List<XCalendarWidget> widgets = popup.getWidgets();
	for(int i = 0; i < widgets.size(); i++) {
		final XCalendarWidget v = widgets.get(i);
		final Pair<Point> points = v.locate(x, y, w, m);
		v.setBounds(x, y, points.getV1().x, points.getV1().y);
		x = points.getV2().x; y = points.getV2().y;
	}
	
	//
	final Shell shell = popup.getShell();
	shell.setSize(new Point(theme.getWidth(), y + m)); setLocation(popup);
}
 
開發者ID:nextopcn,項目名稱:xcalendar,代碼行數:27,代碼來源:XCalendarDefaultLayout.java

示例13: handleAdvancedButtonSelect

import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
/**
 * Shows/hides the advanced option widgets.
 */
protected void handleAdvancedButtonSelect() {
	Shell shell = getShell();
	Point shellSize = shell.getSize();
	Composite composite = (Composite) getControl();

	if (linkedResourceComposite != null) {
		linkedResourceComposite.dispose();
		linkedResourceComposite = null;
		composite.layout();
		shell.setSize(shellSize.x, shellSize.y - linkedResourceGroupHeight);
		advancedButton.setText(IDEWorkbenchMessages.showAdvanced);
	} else {
		linkedResourceComposite = linkedResourceGroup
				.createContents(linkedResourceParent);
		setupLinkedResourceTarget();
		if (linkedResourceGroupHeight == -1) {
			Point groupSize = linkedResourceComposite.computeSize(
					SWT.DEFAULT, SWT.DEFAULT, true);
			linkedResourceGroupHeight = groupSize.y;
		}
		shell.setSize(shellSize.x, shellSize.y + linkedResourceGroupHeight);
		composite.layout();
		advancedButton.setText(IDEWorkbenchMessages.hideAdvanced);
	}
}
 
開發者ID:bsteker,項目名稱:bdf2,代碼行數:29,代碼來源:WizardNewFileCreationPage.java

示例14: configureShell

import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
@Override
public void configureShell(Shell newShell) {
	super.configureShell(newShell);
	newShell.setText("Limit chars logs");
	newShell.setSize(nWidth, nHeight);

	int nLeft = 0;
	int nTop = 0;

	Display display = newShell.getDisplay();

	Point pt = display.getCursorLocation();
	Monitor[] monitors = display.getMonitors();

	for (int i = 0; i < monitors.length; i++) {
		if (monitors[i].getBounds().contains(pt)) {
			Rectangle rect = monitors[i].getClientArea();

			if (rect.x < 0)
				nLeft = ((rect.width - nWidth) / 2) + rect.x;
			else
				nLeft = (rect.width - nWidth) / 2;

			if (rect.y < 0)
				nTop = ((rect.height - nHeight) / 2) + rect.y;
			else
				nTop = (rect.height - nHeight) / 2;

			break;
		}
	}

	newShell.setBounds(nLeft, nTop, nWidth, nHeight);
	
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:36,代碼來源:LimitCharsLogsPreferenceDialog.java

示例15: configureShell

import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
@Override
public void configureShell(Shell newShell) {
	super.configureShell(newShell);
	newShell.setText("Engine Log settings");
	newShell.setSize(nWidth, nHeight);

	int nLeft = 0;
	int nTop = 0;

	Display display = newShell.getDisplay();

	Point pt = display.getCursorLocation();
	Monitor[] monitors = display.getMonitors();

	for (int i = 0; i < monitors.length; i++) {
		if (monitors[i].getBounds().contains(pt)) {
			Rectangle rect = monitors[i].getClientArea();

			if (rect.x < 0)
				nLeft = ((rect.width - nWidth) / 2) + rect.x;
			else
				nLeft = (rect.width - nWidth) / 2;

			if (rect.y < 0)
				nTop = ((rect.height - nHeight) / 2) + rect.y;
			else
				nTop = (rect.height - nHeight) / 2;

			break;
		}
	}

	newShell.setBounds(nLeft, nTop, nWidth, nHeight);
	
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:36,代碼來源:EnginePreferenceDialog.java


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