本文整理汇总了Java中org.eclipse.swt.SWT.NO_TRIM属性的典型用法代码示例。如果您正苦于以下问题:Java SWT.NO_TRIM属性的具体用法?Java SWT.NO_TRIM怎么用?Java SWT.NO_TRIM使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.swt.SWT
的用法示例。
在下文中一共展示了SWT.NO_TRIM属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: StartupSplashShell
/**
* 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();
//}
}
示例2: shell
protected static Composite shell(Composite parent) {
return new Shell(parent.getShell(), SWT.NO_TRIM | SWT.ON_TOP);
}
示例3: PopupDialog
/**
* Constructs a new instance of <code>PopupDialog</code>.
*
* @param parent
* The parent shell.
* @param shellStyle
* The shell style.
* @param takeFocusOnOpen
* A boolean indicating whether focus should be taken by this
* popup when it opens.
* @param persistSize
* A boolean indicating whether the size should be persisted upon
* close of the dialog. The size can only be persisted if the
* dialog settings for persisting the bounds are also specified.
* If a menu action will be provided that allows the user to
* control this feature and the user hasn't changed that setting,
* then this flag is used as initial default for the menu.
* @param persistLocation
* A boolean indicating whether the location should be persisted
* upon close of the dialog. The location can only be persisted
* if the dialog settings for persisting the bounds are also
* specified. If a menu action will be provided that allows the
* user to control this feature and the user hasn't changed that
* setting, then this flag is used as initial default for the
* menu. default for the menu until the user changed it.
* @param showDialogMenu
* A boolean indicating whether a menu for moving and resizing
* the popup should be provided.
* @param showPersistActions
* A boolean indicating whether actions allowing the user to
* control the persisting of the dialog bounds and location
* should be shown in the dialog menu. This parameter has no
* effect if <code>showDialogMenu</code> is <code>false</code>.
* @param titleText
* Text to be shown in an upper title area, or <code>null</code>
* if there is no title.
* @param infoText
* Text to be shown in a lower info area, or <code>null</code>
* if there is no info area.
* @param use34API
* <code>true</code> if 3.4 API should be used
*
* @see PopupDialog#getDialogSettings()
*
* @since 1.1
*/
private PopupDialog(Shell parent, int shellStyle, boolean takeFocusOnOpen,
boolean persistSize, boolean persistLocation, boolean showDialogMenu,
boolean showPersistActions, String titleText, String infoText,
boolean use34API) {
super(parent);
// Prior to 3.4, we encouraged use of SWT.NO_TRIM and provided a
// border using a black composite background and margin. Now we
// use SWT.TOOL to get the border for some cases and this conflicts
// with SWT.NO_TRIM. Clients who previously have used SWT.NO_TRIM
// and still had a border drawn for them would find their border go
// away unless we do the following:
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=219743
if ((shellStyle & SWT.NO_TRIM) != 0) {
// shellStyle &= ~(SWT.NO_TRIM | SWT.SHELL_TRIM);
}
setShellStyle(shellStyle);
this.takeFocusOnOpen = takeFocusOnOpen;
this.showDialogMenu = showDialogMenu;
this.showPersistActions = showPersistActions;
this.titleText = titleText;
this.infoText = infoText;
setBlockOnOpen(false);
this.isUsing34API = use34API;
this.persistSize = persistSize;
this.persistLocation = persistLocation;
migrateBoundsSetting();
initializeWidgetState();
}
示例4: showColorDialog
public static RGB
showColorDialog(
Shell parent_shell,
RGB existing )
{
Shell centerShell = new Shell( parent_shell, SWT.NO_TRIM );
try{
Rectangle displayArea;
try{
displayArea = parent_shell.getMonitor().getClientArea();
}catch (NoSuchMethodError e) {
displayArea = parent_shell.getDisplay().getClientArea();
}
// no way to get actual dialog size - guess...
final int x = displayArea.x + displayArea.width / 2 - 120;
final int y = displayArea.y + displayArea.height / 2 - 170;
centerShell.setLocation( x, y );
ColorDialog cd = new ColorDialog(centerShell);
cd.setRGB( existing );
List<RGB> custom_colours = Utils.getCustomColors();
if ( existing != null ){
custom_colours.remove( existing );
}
cd.setRGBs( custom_colours.toArray( new RGB[0]));
RGB rgb = cd.open();
if ( rgb != null ){
updateCustomColors( cd.getRGBs());
}
return( rgb );
}finally{
centerShell.dispose();
}
}