int lcdWidth = Integer.parseInt( argsMap.get( ArgsConstants.RESOLUTION_WIDTH ) );
int lcdHeight = Integer.parseInt( argsMap.get( ArgsConstants.RESOLUTION_HEIGHT ) );
- EmulatorUI dbiContents = loadDbi( lcdWidth, lcdHeight );
+ String argSkinPath = (String) argsMap.get( ArgsConstants.SKIN_PATH );
+ EmulatorUI dbiContents = loadDbi( argSkinPath, lcdWidth, lcdHeight );
if ( null == dbiContents ) {
logger.severe( "Fail to load dbi file." );
return;
}
- private static EmulatorUI loadDbi( int lcdWidth, int lcdHeight ) {
+ private static EmulatorUI loadDbi( String argSkinPath, int lcdWidth, int lcdHeight ) {
- String skinPath = ImageRegistry.getSkinPath( lcdWidth, lcdHeight ) + File.separator + DBI_FILE_NAME;
+ String skinPath = ImageRegistry.getSkinPath( argSkinPath, lcdWidth, lcdHeight ) + File.separator + DBI_FILE_NAME;
FileInputStream fis = null;
EmulatorUI emulatorUI = null;
public static final String VM_PATH = "vm.path";
public static final String LOG_LEVEL = "log.level";
public static final String NET_BASE_PORT = "net.baseport";
+ public static final String SKIN_PATH = "skin.path";
}
-
+
public interface PropertiesConstants {
public static final String WINDOW_X = "window.x";
public static final String WINDOW_Y = "window.y";
int lcdWidth = Integer.parseInt( config.getArg( ArgsConstants.RESOLUTION_WIDTH ) );
int lcdHeight = Integer.parseInt( config.getArg( ArgsConstants.RESOLUTION_HEIGHT ) );
+ String skinPath = (String) config.getArg( ArgsConstants.SKIN_PATH );
this.resolutionWidth = lcdWidth;
this.resolutionHeight = lcdHeight;
this.skinImageMap = new HashMap<String, Image>();
this.iconMap = new HashMap<String, Image>();
- init();
+ init(skinPath);
}
- public static String getSkinPath( int lcdWidth, int lcdHeight ) {
- String skinPath = ".." + File.separator + SKIN_FOLDER + File.separator + IMAGE_FOLDER_PREFIX + lcdWidth + "x" + lcdHeight;
- return skinPath;
+ public static String getSkinPath( String argSkinPath, int lcdWidth, int lcdHeight ) {
+ String skinPath = null;
+
+ File f = new File(argSkinPath);
+ if (argSkinPath == null || f.isDirectory() == false) {
+ skinPath = ".." + File.separator + SKIN_FOLDER + File.separator + IMAGE_FOLDER_PREFIX + lcdWidth + "x" + lcdHeight;
+ return skinPath;
+ }
+
+ return argSkinPath;
}
- private void init() {
+ private void init(String argSkinPath) {
- String skinPath = getSkinPath( resolutionWidth, resolutionHeight );
+ String skinPath = getSkinPath( argSkinPath, resolutionWidth, resolutionHeight );
RotationsType rotations = dbiContents.getRotations();
List<RotationType> rotationList = rotations.getRotation();