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


Java Figure.setFont方法代碼示例

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


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

示例1: main

import org.eclipse.draw2d.Figure; //導入方法依賴的package包/類
public static void main(String[] args) {
	Shell shell = new Shell(new Display());
	shell.setSize(1200, 500);
	shell.setLayout(new GridLayout());
	shell.setLocation(100, 150);

	Figure root = new Figure();
	root.setFont(shell.getFont());
	//		XYLayout layout = new XYLayout();
	//		root.setLayoutManager(layout);

	org.eclipse.draw2d.GridLayout layout = new org.eclipse.draw2d.GridLayout(2,false);
	layout.horizontalSpacing = 100;
	root.setLayoutManager(layout);

	Canvas canvas = new Canvas(shell, SWT.DOUBLE_BUFFERED);
	canvas.setBackground(ColorConstants.white);
	canvas.setLayoutData(new GridData(GridData.FILL_BOTH));

	createDiagram(root);

	LightweightSystem lws = new LightweightSystem(canvas);
	lws.setContents(root);

	Display display = shell.getDisplay();
	shell.open();
	while (!shell.isDisposed()) {
		while (!display.readAndDispatch()) {
			display.sleep();
		}
	}
}
 
開發者ID:andre-santos-pt,項目名稱:pandionj,代碼行數:33,代碼來源:TestFigure.java

示例2: main

import org.eclipse.draw2d.Figure; //導入方法依賴的package包/類
public static void main(String[] args) {
	Shell shell = new Shell(new Display());
	shell.setSize(1200, 500);
	shell.setLayout(new GridLayout());
	shell.setLocation(100, 150);
	
	Figure root = new Figure();
	root.setFont(shell.getFont());
	//		XYLayout layout = new XYLayout();
	//		root.setLayoutManager(layout);
	
	org.eclipse.draw2d.GridLayout layout = new org.eclipse.draw2d.GridLayout(2,false);
	layout.horizontalSpacing = 100;
	root.setLayoutManager(layout);
	
	Canvas canvas = new Canvas(shell, SWT.DOUBLE_BUFFERED);
	canvas.setBackground(ColorConstants.white);
	canvas.setLayoutData(new GridData(GridData.FILL_BOTH));
	
	MatrixWidget widget = new MatrixWidget();
	MockArray array = new MockArray("int[]", new int[]{1,2,3}, new int[]{4,5,6}, new int[]{7,8,9}, new int[]{10,11,12});
	root.add(widget.createFigure(array));
	
	LightweightSystem lws = new LightweightSystem(canvas);
	lws.setContents(root);
	
	Display display = shell.getDisplay();
	shell.open();
	while (!shell.isDisposed()) {
		while (!display.readAndDispatch()) {
			display.sleep();
		}
	}
}
 
開發者ID:andre-santos-pt,項目名稱:pandionj,代碼行數:35,代碼來源:TestMatrixWidget.java

示例3: main

import org.eclipse.draw2d.Figure; //導入方法依賴的package包/類
public static void main(String[] args) {
	Shell shell = new Shell(new Display());
	shell.setSize(365, 280);
	shell.setLayout(new GridLayout());

	Figure root = new Figure();
	root.setFont(shell.getFont());
	XYLayout layout = new XYLayout();
	root.setLayoutManager(layout);

	Canvas canvas = new Canvas(shell, SWT.DOUBLE_BUFFERED);
	canvas.setBackground(ColorConstants.white);
	canvas.setLayoutData(new GridData(GridData.FILL_BOTH));

	VarParser parser = new VarParser("src/pt/iscte/pandionj/tests/Test.java");
	parser.run();
	System.out.println(parser.toText());
	
	createDiagram(root, parser);
	
	LightweightSystem lws = new LightweightSystem(canvas);
	lws.setContents(root);
	

	Display display = shell.getDisplay();
	shell.open();
	while (!shell.isDisposed()) {
		while (!display.readAndDispatch()) {
			display.sleep();
		}
	}
}
 
開發者ID:andre-santos-pt,項目名稱:pandionj,代碼行數:33,代碼來源:TestFigureParser.java

示例4: setFont

import org.eclipse.draw2d.Figure; //導入方法依賴的package包/類
public static void setFont(Figure figure, int size, FontStyle ... styles) {
	figure.setFont(getFont(size, styles));
}
 
開發者ID:andre-santos-pt,項目名稱:pandionj,代碼行數:4,代碼來源:FontManager.java


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