Вы находитесь на странице: 1из 2

/* CC2 - 2017 - PJ1 */

public class BmpHandler {

public static void runHandler(ImageHandler imgh) throws Exception {


/** NO CAMBIE ESTE CODIGO **/
System.out.println("--------------------------------------");
System.out.println(imgh.getClass().getTypeName().toUpperCase() + ": ");
System.out.println("\nLeyendo imagen : " + imgh.getFileName());
imgh.readFile();
System.out.println("Proceso de lectura de imagen terminado!");
System.out.println("\nGenerando imagenes : ");
imgh.generateFiles();
System.out.println("Proceso de generacion de archivos terminado!");
System.out.println("\n--------------------------------------");
/** --------------------- **/
}

public static void main(String[] args) throws Exception {


String runoption = args[0];
String filename = args[1];
switch(runoption) {
case "-colors":{
BmpImageHandlerColors bhc = new
BmpImageHandlerColors(filename);
runHandler(bhc);
break;
}
case "-rotate":{
BmpImageHandlerRotator bhc = new
BmpImageHandlerRotator(filename);
runHandler(bhc);
break;
}
case "-help":{
System.out.println("-------Bmp Image Handler
Options-------");
System.out.println("1. -colors + filename");
System.out.println(" This option allows you to
generate");
System.out.println(" with different tone colors, in
Red,");
System.out.println(" Green, Blue and Sepia.");
System.out.println("2. -Rotator + filename");
System.out.println(" This option generates a mirror
image");
System.out.println(" in Horizontal and Vertical way.");
System.out.println("3. -copy");
System.out.println(" Creates a copy of the file.");
System.out.println("4. -all");
System.out.println(" Operates all the options.");
}
case "-copy": {
BmpHandlerCopy bhc = new BmpHandlerCopy(filename);
runHandler(bhc);
break;
}
case "-all": {
BmpHandlerCopy bhc = new BmpHandlerCopy(filename);
runHandler(bhc);
BmpImageHandlerRotator abc = new
BmpImageHandlerrotator(filename);
runHandler(abc);
BmpImageHandlerColors cde = new
BmpHandlerRotator(filename);
runHandler(cde);
break;
}

default: {
System.out.println("Opcion de ejecucion invalida");
}
}
}
}

Вам также может понравиться