本文整理汇总了Java中org.apache.harmony.awt.wtk.CreationParams类的典型用法代码示例。如果您正苦于以下问题:Java CreationParams类的具体用法?Java CreationParams怎么用?Java CreationParams使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CreationParams类属于org.apache.harmony.awt.wtk包,在下文中一共展示了CreationParams类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setDecorType
import org.apache.harmony.awt.wtk.CreationParams; //导入依赖的package包/类
void setDecorType(long winId, int decorType, boolean undecorated) {
long styles[] = null;
if(undecorated || decorType == CreationParams.DECOR_TYPE_UNDECOR) {
styles = new long[] {
KDE_NET_WM_WINDOW_TYPE_OVERRIDE,
NET_WM_WINDOW_TYPE_NORMAL };
} else if (decorType == CreationParams.DECOR_TYPE_FRAME) {
styles = new long[] { NET_WM_WINDOW_TYPE_NORMAL };
} else if (decorType == CreationParams.DECOR_TYPE_DIALOG) {
styles = new long[] { NET_WM_WINDOW_TYPE_DIALOG };
}
if (styles != null) {
changeWindowProperty(winId, NET_WM_WINDOW_TYPE, XA_ATOM, styles);
}
if (undecorated || decorType == CreationParams.DECOR_TYPE_UNDECOR) {
long hint[] = new long[] { 2, 0, 0, 0, 0 };
changeWindowProperty(winId, XA_MOTIF_WM_HINTS, XA_MOTIF_WM_HINTS, hint);
}
}
示例2: createWindow
import org.apache.harmony.awt.wtk.CreationParams; //导入依赖的package包/类
public NativeWindow createWindow(CreationParams p) {
LinuxWindow lw = new LinuxWindow(this, p);
allWindows.put(lw);
if (!lw.isChild() && !lw.isUndecorated()) {
p.child = true;
p.parentId = lw.getId();
p.x = 0;
p.y = 0;
ContentWindow cw = new ContentWindow(this, p);
allWindows.put(cw);
lw.setContentWindow(cw);
lw = cw;
}
x11.XFlush(display);
return lw;
}
示例3: getStyleEx
import org.apache.harmony.awt.wtk.CreationParams; //导入依赖的package包/类
private static int getStyleEx(CreationParams p) {
int styleEx = 0;
if (p.topmost) {
styleEx |= WindowsDefs.WS_EX_TOPMOST;
}
switch(p.decorType) {
case CreationParams.DECOR_TYPE_FRAME:
styleEx |= WindowsDefs.WS_EX_APPWINDOW; // Show in taskbar
break;
case CreationParams.DECOR_TYPE_POPUP:
styleEx |= WindowsDefs.WS_EX_NOACTIVATE;
break;
}
return styleEx;
}
示例4: WinWindow
import org.apache.harmony.awt.wtk.CreationParams; //导入依赖的package包/类
WinWindow(long hwnd, WinWindowFactory factory, CreationParams cp) {
this.hwnd = hwnd;
this.factory = factory;
focusable = true;
if (cp != null) {
child = cp.child;
iconified = cp.iconified;
maximized = (cp.maximizedState == cp.MAXIMIZED);
popup = (cp.decorType == CreationParams.DECOR_TYPE_POPUP);
undecorated = (cp.decorType == CreationParams.DECOR_TYPE_UNDECOR) ||
cp.undecorated || popup;
focusable = (cp.decorType != CreationParams.DECOR_TYPE_POPUP);
} else {
undecorated = false;
child = false;
popup = false;
}
}
示例5: createEmbeddedNativeWindow
import org.apache.harmony.awt.wtk.CreationParams; //导入依赖的package包/类
NativeWindow createEmbeddedNativeWindow(EmbeddedWindow ew) {
windows.add(ew);
CreationParams cp = new CreationParams();
cp.child = true;
cp.disabled = false;
cp.name = "EmbeddedWindow"; //$NON-NLS-1$
cp.parentId = ew.nativeWindowId;
cp.x = 0;
cp.y = 0;
Dimension size = getWindowFactory().getWindowSizeById(ew.nativeWindowId);
cp.w = size.width;
cp.h = size.height;
recentNativeWindowComponent = ew;
NativeWindow win = getWindowFactory().createWindow(cp);
nativeWindowCreated(win);
shutdownWatchdog.setWindowListEmpty(false);
return win;
}
示例6: createFocusProxyNativeWindow
import org.apache.harmony.awt.wtk.CreationParams; //导入依赖的package包/类
NativeWindow createFocusProxyNativeWindow(Window owner) {
CreationParams cp = new CreationParams();
cp.child = true;
cp.disabled = false;
cp.resizable = false;
cp.undecorated = true;
cp.iconified = false;
cp.visible = true;
cp.maximizedState = 0;
cp.decorType = CreationParams.DECOR_TYPE_NONE;
cp.parentId = owner.getNativeWindow().getId();
cp.x = -10;
cp.y = -10;
cp.w = 1;
cp.h = 1;
NativeWindow win = getWindowFactory().createWindow(cp);
windowFocusProxyMap.put(win, owner);
return win;
}
示例7: ContentWindow
import org.apache.harmony.awt.wtk.CreationParams; //导入依赖的package包/类
/**
* @param factory
* @param p
*/
public ContentWindow(LinuxWindowFactory factory,
CreationParams p) {
super(factory, p);
frame = (LinuxWindow) factory.getWindowById(p.parentId);
super.setTitle("Content Window"); //$NON-NLS-1$
}
示例8: createWindow
import org.apache.harmony.awt.wtk.CreationParams; //导入依赖的package包/类
public NativeWindow createWindow(final CreationParams p) {
WinEventQueue.Task task = new WinEventQueue.Task () {
@Override
public void perform() {
String title = (p.name != null) ? p.name : ""; //$NON-NLS-1$
Rectangle rect = new Rectangle(p.x, p.y, p.w, p.h);
int style = getStyle(p);
int styleEx = getStyleEx(p);
if (p.locationByPlatform) {
rect.x = rect.y = WindowsDefs.CW_USEDEFAULT;
}
if (p.parentId != 0 && p.child) {
Insets insets = getInsets(p.parentId);
rect.x -= insets.left;
rect.y -= insets.top;
}
creationParams = p;
long hwnd = win32.CreateWindowExW(styleEx,
WindowProcHandler.windowClassName, title, style,
rect.x, rect.y, rect.width, rect.height,
p.parentId, 0, 0, null);
creationParams = null;
NativeWindow win = getWindowById(hwnd);
assert win != null;
returnValue = win;
}
};
eventQueue.performTask(task);
return (WinWindow) task.returnValue;
}
示例9: getStyle
import org.apache.harmony.awt.wtk.CreationParams; //导入依赖的package包/类
private static int getStyle(CreationParams p) {
int style = WindowsDefs.WS_CLIPCHILDREN|WindowsDefs.WS_CLIPSIBLINGS;
style |= p.child ? WindowsDefs.WS_CHILD : WindowsDefs.WS_POPUP;
switch (p.decorType) {
case CreationParams.DECOR_TYPE_FRAME:
style |= WindowsDefs.WS_SYSMENU | WindowsDefs.WS_MINIMIZEBOX;
if (!p.undecorated) {
style |= WindowsDefs.WS_CAPTION | WindowsDefs.WS_BORDER |
WindowsDefs.WS_MAXIMIZEBOX | WindowsDefs.WS_SIZEBOX; }
break;
case CreationParams.DECOR_TYPE_DIALOG:
style |= WindowsDefs.WS_SYSMENU;
if (!p.undecorated) {
style |= WindowsDefs.WS_CAPTION | WindowsDefs.WS_BORDER | WindowsDefs.WS_SIZEBOX;
}
break;
case CreationParams.DECOR_TYPE_POPUP:
break;
case CreationParams.DECOR_TYPE_UNDECOR:
break;
}
if (p.visible) {
style |= WindowsDefs.WS_VISIBLE;
}
if (p.disabled) {
style |= WindowsDefs.WS_DISABLED;
}
if (p.iconified) {
style |= WindowsDefs.WS_MINIMIZE;
}
if (p.maximizedState == p.MAXIMIZED) {
style |= WindowsDefs.WS_MAXIMIZE;
}
return style;
}
示例10: postCreate
import org.apache.harmony.awt.wtk.CreationParams; //导入依赖的package包/类
void postCreate(CreationParams cp) {
if (cp == null) {
return;
}
if (!cp.resizable && !cp.child) {
modifyStyle(WindowsDefs.WS_SIZEBOX|WindowsDefs.WS_MAXIMIZEBOX, false);
}
}
示例11: createNativeWindow
import org.apache.harmony.awt.wtk.CreationParams; //导入依赖的package包/类
NativeWindow createNativeWindow(Component c) {
if (c instanceof Window) {
windows.add(c);
}
Component parent = null;
Point location = c.getLocation();
CreationParams cp = new CreationParams();
cp.child = !(c instanceof Window);
cp.disabled = !c.isEnabled();
if (c instanceof Window) {
Window w = (Window) c;
cp.resizable = w.isResizable();
cp.undecorated = w.isUndecorated();
parent = w.getOwner();
cp.locationByPlatform = w.locationByPlatform;
if (c instanceof Frame) {
Frame frame = (Frame) c;
int state = frame.getExtendedState();
cp.name = frame.getTitle();
cp.iconified = (state & Frame.ICONIFIED) != 0;
cp.maximizedState = 0;
if ((state & Frame.MAXIMIZED_BOTH) != 0) {
cp.maximizedState |= cp.MAXIMIZED;
}
if ((state & Frame.MAXIMIZED_HORIZ) != 0) {
cp.maximizedState |= cp.MAXIMIZED_HORIZ;
}
if ((state & Frame.MAXIMIZED_VERT) != 0) {
cp.maximizedState |= cp.MAXIMIZED_VERT;
}
cp.decorType = CreationParams.DECOR_TYPE_FRAME;
} else if (c instanceof Dialog) {
Dialog dlg = (Dialog) c;
cp.name = dlg.getTitle();
cp.decorType = CreationParams.DECOR_TYPE_DIALOG;
} else if (w.isPopup()) {
cp.decorType = CreationParams.DECOR_TYPE_POPUP;
} else {
cp.decorType = CreationParams.DECOR_TYPE_UNDECOR;
}
} else {
parent = c.getHWAncestor();
cp.name = c.getName();
//set location relative to the nearest heavy weight ancestor
location = MouseDispatcher.convertPoint(c, 0, 0, parent);
}
if (parent != null) {
NativeWindow nativeParent = parent.getNativeWindow();
if (nativeParent == null) {
if (cp.child) {
return null; //component's window will be created when its parent is created ???
}
parent.mapToDisplay(true); //TODO: verify it
nativeParent = parent.getNativeWindow();
}
cp.parentId = nativeParent.getId();
}
cp.x = location.x;
cp.y = location.y;
cp.w = c.getWidth();
cp.h = c.getHeight();
recentNativeWindowComponent = c;
NativeWindow win = getWindowFactory().createWindow(cp);
nativeWindowCreated(win);
if (c instanceof Window) {
shutdownWatchdog.setWindowListEmpty(false);
}
return win;
}