The key window is converted to dockable windows.
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
// style = SWT.TITLE | SWT.CLOSE | SWT.MIN | SWT.BORDER;
// }
this.shell = new Shell(Display.getDefault(), style);
+ if (isOnTop == true) {
+ SkinUtil.setTopMost(shell, true);
+ }
this.currentState = state;
}
return isControlPanel;
}
- public void openKeyWindow() {
+ public void openKeyWindow(boolean attach) {
if (controlPanel != null) {
controlPanel.getShell().setVisible(true);
SkinUtil.setTopMost(controlPanel.getShell(), isOnTop);
+ controlPanel.setAttach(attach);
pairTagCanvas.setVisible(true);
return;
setIsControlPanel(isControlPanel);
if (isControlPanel == true) {
- openKeyWindow();
+ openKeyWindow((controlPanel == null) ?
+ true : controlPanel.isAttach());
} else {
hideKeyWindow();
}
skin.hideKeyWindow();
} else {
skin.setIsControlPanel(true);
- skin.openKeyWindow();
+ skin.openKeyWindow(true);
/* move a key window to right of the emulator window */
- skin.controlPanel.getShell().setLocation(
- shell.getLocation().x + shell.getSize().x,
- shell.getLocation().y + (shell.getSize().y / 2) -
- (skin.controlPanel.getShell().getSize().y / 2));
+ if (skin.controlPanel != null) {
+ skin.controlPanel.setShellPosition(
+ SWT.RIGHT | SWT.CENTER, false);
+ }
}
}
e.gc.drawImage(currentState.getCurrentImage(), 0, 0);
}
+ if (skin.controlPanel != null &&
+ skin.controlPanel.isAttach() == true) {
+ skin.controlPanel.setShellPosition(
+ SWT.RIGHT | SWT.CENTER, false);
+ }
}
};
int y = previousLocation.y + (e.y - grabPosition.y);
shell.setLocation(x, y);
- return;
+
+ if (skin.controlPanel != null &&
+ skin.controlPanel.isAttach() == true) {
+ skin.controlPanel.setShellPosition(
+ SWT.RIGHT | SWT.CENTER, false);
+ }
}
}
};
isGrabbedShell = false;
grabPosition.x = grabPosition.y = 0;
+
+ if (skin.controlPanel != null &&
+ skin.controlPanel.isAttach() == true) {
+ skin.controlPanel.setShellPosition(
+ SWT.RIGHT | SWT.CENTER, true);
+ }
}
}
30, 4);
if (childBounds.intersects(attachBounds) == true) {
- setShellPosition(SWT.RIGHT | SWT.CENTER);
+ setShellPosition(SWT.RIGHT | SWT.CENTER, true);
+ isAttach = true;
+ } else {
+ isAttach = false;
}
}
}
protected Shell shell;
protected Shell parent;
private int shellPositionType;
+ protected boolean isAttach;
public SkinWindow(Shell parent, int shellPositionType) {
this.parent = parent;
this.shellPositionType = shellPositionType;
+ this.isAttach = false;
}
public Shell getShell() {
return;
}
- setShellPosition(shellPositionType);
+ setShellPosition(shellPositionType, true);
+ isAttach = true;
shell.open();
}
}
- protected void setShellPosition(int shellPositionType) {
+ public void setShellPosition(int shellPositionType, boolean enableLogger) {
int x = 0;
int y = 0;
Rectangle monitorBounds = Display.getDefault().getBounds();
- logger.info("host monitor display bounds : " + monitorBounds);
Rectangle parentBounds = parent.getBounds();
- logger.info("current parent shell bounds : " + parentBounds);
Rectangle childBounds = shell.getBounds();
- logger.info("current child shell bounds : " + childBounds);
+
+ if (enableLogger == true) {
+ logger.info("host monitor display bounds : " + monitorBounds);
+ logger.info("current parent shell bounds : " + parentBounds);
+ logger.info("current child shell bounds : " + childBounds);
+ }
if (shellPositionType == (SWT.RIGHT | SWT.TOP)) {
x = parentBounds.x + parentBounds.width;
shell.setLocation(x, y);
}
+
+ public void setAttach(boolean attach) {
+ isAttach = attach;
+ }
+
+ public boolean isAttach() {
+ return isAttach;
+ }
}