import org.tizen.emulator.skin.config.EmulatorConfig;
import org.tizen.emulator.skin.config.EmulatorConfig.ArgsConstants;
import org.tizen.emulator.skin.config.EmulatorConfig.SkinPropertiesConstants;
-import org.tizen.emulator.skin.custom.ColorTag;
import org.tizen.emulator.skin.custom.CustomProgressBar;
import org.tizen.emulator.skin.custom.SkinWindow;
import org.tizen.emulator.skin.dbi.HoverType;
public Color colorVM;
private KeyWindowKeeper keyWindowKeeper;
- public ColorTag pairTag;
public CustomProgressBar bootingProgress;
public ScreenShotDialog screenShotDialog;
lcdCanvas.setFocus();
}
+ public void updateSkin() {
+ skinComposer.updateSkin();
+ }
+
public void updateDisplay() {
/* abstract */
}
isShutdownRequested = true;
- if (!this.shell.isDisposed()) {
- this.shell.getDisplay().asyncExec(new Runnable() {
+ if (!shell.isDisposed()) {
+ shell.getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
if (!shell.isDisposed()) {
- EmulatorSkin.this.shell.close();
+ shell.close();
}
}
});
import org.tizen.emulator.skin.custom.ColorTag;
import org.tizen.emulator.skin.custom.CustomButton;
import org.tizen.emulator.skin.custom.CustomProgressBar;
+import org.tizen.emulator.skin.custom.SkinWindow;
import org.tizen.emulator.skin.image.GeneralSkinImageRegistry;
import org.tizen.emulator.skin.image.GeneralSkinImageRegistry.GeneralSkinImageName;
import org.tizen.emulator.skin.image.ImageRegistry.IconName;
private Canvas displayCanvas;
private Color backgroundColor;
private CustomButton toggleButton;
+ private ColorTag pairTag;
private EmulatorSkinState currentState;
private SkinPatches frameMaker;
});
/* make a pair tag circle */
- skin.pairTag =
- new ColorTag(shell, SWT.NO_FOCUS, skin.getColorVM());
- skin.pairTag.setVisible(false);
+ pairTag = new ColorTag(shell, SWT.NO_FOCUS, skin.getColorVM());
+ pairTag.setVisible(false);
/* create a progress bar for booting status */
skin.bootingProgress = new CustomProgressBar(skin, SWT.NONE, true);
/* arrange the pair tag */
if (rotationId == RotationInfo.PORTRAIT.id()) {
- skin.pairTag.setBounds(
+ pairTag.setBounds(
PAIR_TAG_POSITION_X, PAIR_TAG_POSITION_Y,
- skin.pairTag.getWidth(), skin.pairTag.getHeight());
+ pairTag.getWidth(), pairTag.getHeight());
} else if (rotationId == RotationInfo.LANDSCAPE.id()) {
- skin.pairTag.setBounds(
+ pairTag.setBounds(
PAIR_TAG_POSITION_Y,
- shell.getSize().y - PAIR_TAG_POSITION_X - skin.pairTag.getHeight(),
- skin.pairTag.getWidth(), skin.pairTag.getHeight());
+ shell.getSize().y - PAIR_TAG_POSITION_X - pairTag.getHeight(),
+ pairTag.getWidth(), pairTag.getHeight());
} else if (rotationId == RotationInfo.REVERSE_PORTRAIT.id()) {
- skin.pairTag.setBounds(
- shell.getSize().x - PAIR_TAG_POSITION_X - skin.pairTag.getWidth(),
- shell.getSize().y - PAIR_TAG_POSITION_Y - skin.pairTag.getHeight(),
- skin.pairTag.getWidth(), skin.pairTag.getHeight());
+ pairTag.setBounds(
+ shell.getSize().x - PAIR_TAG_POSITION_X - pairTag.getWidth(),
+ shell.getSize().y - PAIR_TAG_POSITION_Y - pairTag.getHeight(),
+ pairTag.getWidth(), pairTag.getHeight());
} else if (rotationId == RotationInfo.REVERSE_LANDSCAPE.id()) {
- skin.pairTag.setBounds(
- shell.getSize().x - PAIR_TAG_POSITION_Y - skin.pairTag.getWidth(),
+ pairTag.setBounds(
+ shell.getSize().x - PAIR_TAG_POSITION_Y - pairTag.getWidth(),
PAIR_TAG_POSITION_X,
- skin.pairTag.getWidth(), skin.pairTag.getHeight());
+ pairTag.getWidth(), pairTag.getHeight());
}
/* custom window shape */
return region;
}
+ @Override
+ public void updateSkin() {
+ logger.info("update skin");
+
+ shell.getDisplay().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ /* update pair tag */
+ if (pairTag != null && pairTag.isDisposed() == false) {
+ SkinWindow keyWindow = skin.getKeyWindowKeeper().getKeyWindow();
+ if (keyWindow != null &&
+ keyWindow.getShell().isVisible() == true) {
+ pairTag.setVisible(true);
+ } else {
+ pairTag.setVisible(false);
+ }
+ }
+ }
+ });
+ }
+
public void addGeneralPurposeListener(final Shell shell) {
shellPaintListener = new PaintListener() {
@Override
toggleButton.dispose();
}
- if (skin.pairTag != null) {
- skin.pairTag.dispose();
+ if (pairTag != null) {
+ pairTag.dispose();
+ pairTag = null;
}
if (backgroundColor != null) {
/* show the Key Window */
selectKeyWindowMenu(skin.isKeyWindow = true);
- if (skin.pairTag != null) {
- skin.pairTag.setVisible(true);
- }
-
keyWindow.getShell().setVisible(true);
SkinUtil.setTopMost(keyWindow.getShell(), skin.isOnTop);
+ skin.updateSkin();
+
return;
} else {
logger.info("recreate a keywindow");
selectKeyWindowMenu(skin.isKeyWindow = true);
SkinUtil.setTopMost(keyWindow.getShell(), skin.isOnTop);
- if (skin.pairTag != null) {
- skin.pairTag.setVisible(true);
- }
-
keyWindow.open(dockValue);
+
+ skin.updateSkin();
}
public void closeKeyWindow() {
selectKeyWindowMenu(skin.isKeyWindow = false);
- if (skin.pairTag != null) {
- skin.pairTag.setVisible(false);
- }
-
if (keyWindow != null) {
keyWindow.getShell().close();
keyWindow = null;
}
+
+ skin.updateSkin();
}
public void hideKeyWindow() {
selectKeyWindowMenu(skin.isKeyWindow = false);
- if (skin.pairTag != null) {
- skin.pairTag.setVisible(false);
- }
-
if (keyWindow != null) {
keyWindow.getShell().setVisible(false);
}
+
+ skin.updateSkin();
}
public SkinWindow getKeyWindow() {