}
resolution = resolution.substring(0, resolution.length() - 3);
commandList.add(new Command("r", Actions.OP_RESOLUTION,
- "Resolution of vm. (" + resolution + ")"
+ "Resolution of vm. (" + resolution + ")" + StringResources.NEW_LINE +
+ "\t\t(Custom resolution is supported as experimental feature." +
+ " Range is from 320 to 1920)."
, RESOLUTION.HD.getType(), false, true));
commandList.add(new Command("d", Actions.OP_DPI,
"DPI. (100 ~ 480)", Integer.toString(RESOLUTION.HD.getDPI()), false, true));
}
resolution = resolution.substring(0, resolution.length() - 3);
commandList.add(new Command("r", Actions.OP_RESOLUTION,
- "Resolution of vm. (" + resolution + ")"
+ "Resolution of vm. (" + resolution + ")" + StringResources.NEW_LINE +
+ "\t\t(Custom resolution is supported as experimental feature." +
+ " Range is from 320 to 1920)."
, RESOLUTION.HD.getType(), false, true));
commandList.add(new Command("d", Actions.OP_DPI,
"DPI. (100 ~ 480)", Integer.toString(RESOLUTION.HD.getDPI()), false, true));
import java.io.IOException;
import java.util.ArrayList;
+import org.tizen.emulator.manager.logging.EMLogger;
import org.tizen.emulator.manager.platform.BaseImage;
import org.tizen.emulator.manager.platform.CustomPlatform;
import org.tizen.emulator.manager.platform.Platform;
return r;
}
}
+ // Check custom resolution.
+ String[] arr = value.toLowerCase().split("x");
+ if (arr != null && arr.length == 2) {
+ try {
+ int width = Integer.parseInt(arr[0]);
+ int height = Integer.parseInt(arr[1]);
+ int dpi = 316; // TODO
+ if ( (width >= 320 && width <= 1920)
+ && (height >= 320 && height <= 1920)) {
+ return new RESOLUTION(width, height, "", dpi);
+ }
+ } catch (NumberFormatException e) {
+ EMLogger.getLogger().warning(e.getMessage());
+ }
+ }
throw new ConsoleException("This " + Actions.OP_RESOLUTION + " (" +
value + ") is not avaliable.");
}