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


Java Text.setBounds方法代碼示例

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


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

示例1: relocate

import org.eclipse.swt.widgets.Text; //導入方法依賴的package包/類
@Override
public void relocate(CellEditor celleditor) {
	Text text = (Text) celleditor.getControl();
	Point pref = text.computeSize(SWT.DEFAULT, SWT.DEFAULT);
	Rectangle rect = nameLabel.getTextBounds().getCopy();
	nameLabel.translateToAbsolute(rect);
	text.setBounds(rect.x - 1, rect.y - 1, pref.x + 1, pref.y + 1);
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:9,代碼來源:VertextCellEditorLocator.java

示例2: addHeader

import org.eclipse.swt.widgets.Text; //導入方法依賴的package包/類
public Composite addHeader(){
	Composite composite = new Composite(container, SWT.NONE);
	GridLayout gl_composite = new GridLayout(textGridRow.getNumberOfColumn() + 1, false);
	gl_composite.horizontalSpacing = 7;
	gl_composite.marginWidth = 1;
	gl_composite.marginHeight = 0;
	gl_composite.verticalSpacing = 1;
	composite.setLayout(gl_composite);
		
	Button rowSelection = new Button(composite, SWT.CHECK);
	
	Map<Integer, TextGridColumnLayout> columns = textGridRow.getTextGridColumns();
	for(int columnNumber:columns.keySet()){
		Text text = new Text(composite, SWT.BORDER);
		if(!columns.get(columnNumber).grabHorizantalAccessSpace()){
			GridData gd_text = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
			gd_text.widthHint = columns.get(columnNumber).getColumnWidth();
			text.setLayoutData(gd_text);
			
			text.setEditable(false);
			text.setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
			text.setBackground(SWTResourceManager.getColor(SWT.COLOR_LIST_SELECTION));
		}else{
			text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
			text.setBounds(0, 0, 76, 21);
			text.setFocus();
			
			text.setEditable(false);
			text.setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
			text.setBackground(SWTResourceManager.getColor(SWT.COLOR_LIST_SELECTION));				
		}
		

		if(rowData!=null)
			text.setText(rowData.get(columnNumber));
	}
	
	return composite;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:40,代碼來源:TextGridRowBuilder.java

示例3: addRaw

import org.eclipse.swt.widgets.Text; //導入方法依賴的package包/類
public Composite addRaw(){
	Composite composite = new Composite(container, SWT.NONE);
	GridLayout gl_composite = new GridLayout(textGridRow.getNumberOfColumn() + 1, false);
	gl_composite.horizontalSpacing = 7;
	gl_composite.marginWidth = 1;
	gl_composite.marginHeight = 0;
	gl_composite.verticalSpacing = 1;
	composite.setLayout(gl_composite);
		
	Button rowSelection = new Button(composite, SWT.CHECK);
	rowSelection.setEnabled(enabled);
	
	Map<Integer, TextGridColumnLayout> columns = textGridRow.getTextGridColumns();
	for(int columnNumber:columns.keySet()){
		Text text = new Text(composite, SWT.BORDER);
		if(!columns.get(columnNumber).grabHorizantalAccessSpace()){
			GridData gd_text = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
			gd_text.widthHint = columns.get(columnNumber).getColumnWidth();
			text.setLayoutData(gd_text);
			
			text.setEditable(columns.get(columnNumber).isEditable());
			text.setEnabled(columns.get(columnNumber).isEnabled());
		}else{
			text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
			text.setBounds(0, 0, 76, 21);
			text.setFocus();
			
			text.setEditable(columns.get(columnNumber).isEditable());
			text.setEnabled(columns.get(columnNumber).isEnabled());
		}
		
		if(rowData!=null)
			text.setText(rowData.get(columnNumber));
	}
	
	return composite;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:38,代碼來源:TextGridRowBuilder.java

示例4: textBoxWidget

import org.eclipse.swt.widgets.Text; //導入方法依賴的package包/類
public Text textBoxWidget(Composite parent, int style, int[] bounds,
		String text, boolean value) {
	Text textWidget = new Text(parent, style);
	textWidget.setBounds(bounds[0], bounds[1], bounds[2], bounds[3]);
	textWidget.setText(text);
	textWidget.setEditable(value);

	return textWidget;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:10,代碼來源:ELTSWTWidgets.java

示例5: textBoxWidget

import org.eclipse.swt.widgets.Text; //導入方法依賴的package包/類
public Text textBoxWidget(Composite parent, int[] bounds, String textValue, boolean value) {
	Text text = new Text(parent, SWT.BORDER | SWT.READ_ONLY | SWT.LEFT);
	text.setBounds(bounds[0], bounds[1], bounds[2], bounds[3]);
	text.setText(textValue);
	text.setEditable(value);

	return text;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:9,代碼來源:ELTLookupConfigGrid.java

示例6: relocate

import org.eclipse.swt.widgets.Text; //導入方法依賴的package包/類
@Override
public void relocate(CellEditor celleditor) {
	Text text = (Text)celleditor.getControl();
	Rectangle rect = comment.getClientArea();
	comment.translateToAbsolute(rect);
	org.eclipse.swt.graphics.Rectangle trim = text.computeTrim(0, 0, 0, 0);
	rect.translate(trim.x, trim.y);
	rect.width += trim.width;
	rect.height += trim.height;
	//text.setBounds(rect.x, rect.y, rect.width, rect.height);
	
	text.setBounds(rect.x - 5, rect.y - 8, rect.width+10, rect.height+16);
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:14,代碼來源:CommentBoxCellEditorLocator.java

示例7: relocate

import org.eclipse.swt.widgets.Text; //導入方法依賴的package包/類
@Override
public void relocate(CellEditor celleditor) {
	Text text=(Text)celleditor.getControl();
	text.setBounds(node.getX(), node.getY(),node.getWidth(), node.getHeight());
}
 
開發者ID:bsteker,項目名稱:bdf2,代碼行數:6,代碼來源:NodeCellEditorLocator.java


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