}
}
- DisplayStateData lcdStateData = new DisplayStateData(
+ DisplayStateData stateData = new DisplayStateData(
currentState.getCurrentScale(),
currentState.getCurrentRotationId());
communicator.sendToQEMU(SendCommand.SEND_DISPLAY_STATE,
- lcdStateData, false);
+ stateData, false);
}
};
}
});
- DisplayStateData lcdStateData = new DisplayStateData(
+ DisplayStateData stateData = new DisplayStateData(
currentState.getCurrentScale(), rotationId);
communicator.sendToQEMU(SendCommand.SEND_DISPLAY_STATE,
- lcdStateData, false);
+ stateData, false);
}
};
}
});
- DisplayStateData lcdStateData = new DisplayStateData(scale,
+ DisplayStateData stateData = new DisplayStateData(scale,
currentState.getCurrentRotationId());
communicator.sendToQEMU(SendCommand.SEND_DISPLAY_STATE,
- lcdStateData, false);
+ stateData, false);
}
};
import org.tizen.emulator.skin.dbi.ImageListType;
import org.tizen.emulator.skin.dbi.RotationType;
import org.tizen.emulator.skin.dbi.RotationsType;
+import org.tizen.emulator.skin.layout.rotation.Rotation;
import org.tizen.emulator.skin.layout.rotation.SkinRotations;
import org.tizen.emulator.skin.log.SkinLogger;
logger.info("get skin image from " + skinPath);
- RotationType targetRotation = SkinRotations.getRotation(id);
+ Rotation targetRotation = SkinRotations.getRotation(id);
if (targetRotation == null) {
return null;
}
package org.tizen.emulator.skin.layout;
-import org.tizen.emulator.skin.util.HWKeyRegion;
import org.tizen.emulator.skin.util.SkinUtil;
public class HWKey {
*
*/
-package org.tizen.emulator.skin.util;
+package org.tizen.emulator.skin.layout;
/**
*
import org.tizen.emulator.skin.custom.CustomProgressBar;
import org.tizen.emulator.skin.dbi.DisplayType;
import org.tizen.emulator.skin.dbi.RegionType;
-import org.tizen.emulator.skin.dbi.RotationType;
import org.tizen.emulator.skin.image.ImageRegistry.IconName;
import org.tizen.emulator.skin.image.ProfileSkinImageRegistry;
import org.tizen.emulator.skin.image.ProfileSkinImageRegistry.SkinImageType;
import org.tizen.emulator.skin.info.EmulatorSkinState;
+import org.tizen.emulator.skin.layout.rotation.Rotation;
import org.tizen.emulator.skin.layout.rotation.SkinRotations;
import org.tizen.emulator.skin.log.SkinLogger;
import org.tizen.emulator.skin.menu.KeyWindowKeeper;
import org.tizen.emulator.skin.menu.PopupMenu;
-import org.tizen.emulator.skin.util.HWKeyRegion;
import org.tizen.emulator.skin.util.SkinUtil;
import org.tizen.emulator.skin.util.SwtUtil;
Rectangle displayBounds = new Rectangle(0, 0, 0, 0);
float convertedScale = SkinUtil.convertScale(scale);
- RotationType rotation = SkinRotations.getRotation(rotationId);
+ Rotation rotation = SkinRotations.getRotation(rotationId);
if (rotation == null) {
return null;
}
}
final HWKey hwKey = SkinUtil.getHWKey(e.x, e.y,
- currentState.getCurrentRotationId(), currentState.getCurrentScale());
+ currentState.getCurrentScale(),
+ currentState.getCurrentRotationId());
if (hwKey == null) {
shell.setToolTipText(null);
/* HW key handling */
final HWKey hwKey = SkinUtil.getHWKey(e.x, e.y,
- currentState.getCurrentRotationId(), currentState.getCurrentScale());
+ currentState.getCurrentScale(),
+ currentState.getCurrentRotationId());
if (hwKey == null) {
logger.info("mouseDown in Skin : " + e.x + ", " + e.y);
package org.tizen.emulator.skin.layout.rotation;
+import java.util.List;
+
+import org.tizen.emulator.skin.dbi.KeyMapListType;
+import org.tizen.emulator.skin.dbi.KeyMapType;
import org.tizen.emulator.skin.dbi.RotationType;
public class Rotation extends RotationType {
private int angle;
+ private List<KeyMapType> listHWKey;
+
+ public int getAngle() {
+ return angle;
+ }
public void setAngle(int degree) {
this.angle = degree;
}
- public int getAngle() {
- return angle;
+ public List<KeyMapType> getListHWKey() {
+ if (listHWKey == null) {
+ KeyMapListType list = getKeyMapList();
+ if (list == null) {
+ /* try to using a KeyMapList of portrait */
+ Rotation rotation = SkinRotations.getRotation(SkinRotations.PORTRAIT_ID);
+ if (rotation == null) {
+ return null;
+ }
+
+ list = rotation.getKeyMapList();
+ if (list == null) {
+ return null;
+ }
+ }
+
+ listHWKey = list.getKeyMap();
+ }
+
+ return listHWKey;
}
}
import org.tizen.emulator.skin.keywindow.dbi.KeyWindowUI;
import org.tizen.emulator.skin.keywindow.dbi.RegionType;
import org.tizen.emulator.skin.layout.HWKey;
-import org.tizen.emulator.skin.util.HWKeyRegion;
+import org.tizen.emulator.skin.layout.HWKeyRegion;
import org.tizen.emulator.skin.util.IOUtil;
import org.tizen.emulator.skin.util.JaxbUtil;
import org.tizen.emulator.skin.util.SkinUtil;
import org.tizen.emulator.skin.config.EmulatorConfig;
import org.tizen.emulator.skin.config.EmulatorConfig.ArgsConstants;
import org.tizen.emulator.skin.dbi.EventInfoType;
-import org.tizen.emulator.skin.dbi.KeyMapListType;
import org.tizen.emulator.skin.dbi.KeyMapType;
import org.tizen.emulator.skin.dbi.RegionType;
-import org.tizen.emulator.skin.dbi.RotationType;
import org.tizen.emulator.skin.layout.HWKey;
+import org.tizen.emulator.skin.layout.HWKeyRegion;
+import org.tizen.emulator.skin.layout.rotation.Rotation;
import org.tizen.emulator.skin.layout.rotation.SkinRotations;
import org.tizen.emulator.skin.log.SkinLogger;
}
public static List<KeyMapType> getHWKeyMapList(short rotationId) {
- RotationType rotation = SkinRotations.getRotation(rotationId);
+ Rotation rotation = SkinRotations.getRotation(rotationId);
if (rotation == null) {
return null;
}
- KeyMapListType list = rotation.getKeyMapList();
- if (list == null) {
- /* try to using a KeyMapList of portrait */
- rotation = SkinRotations.getRotation(SkinRotations.PORTRAIT_ID);
- if (rotation == null) {
- return null;
- }
-
- list = rotation.getKeyMapList();
- if (list == null) {
- return null;
- }
- }
-
- return list.getKeyMap();
+ return rotation.getListHWKey();
}
- public static HWKey getHWKey(
- int currentX, int currentY, short rotationId, int scale) {
+ public static HWKey getHWKey(int currentX, int currentY,
+ int scale, short rotationId) {
float convertedScale = convertScale(scale);
List<KeyMapType> keyMapList = getHWKeyMapList(rotationId);
return null;
}
+ RegionType region = null;
for (KeyMapType keyEntry : keyMapList) {
- RegionType region = keyEntry.getRegion();
+ region = keyEntry.getRegion();
int scaledX = (int) (region.getLeft() * convertedScale);
int scaledY = (int) (region.getTop() * convertedScale);