本文整理匯總了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();
}
}
示例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;
}
示例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);
}
示例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();
//}
}
示例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();
}
}
示例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();
}
}
示例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;
}
示例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();
}
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}