Skip to content

Instantly share code, notes, and snippets.

@wilsenhc
Last active December 10, 2017 21:05
Show Gist options
  • Save wilsenhc/9f44d5d420a01c897ef8a7d45b29f17d to your computer and use it in GitHub Desktop.
Save wilsenhc/9f44d5d420a01c897ef8a7d45b29f17d to your computer and use it in GitHub Desktop.
Tarea Cesar
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package gestor_de_ventana;
/**
*
* @author cart_
*/
public class Main {
private static Gestor gestorVentanas;
private static void ejecutarComando(String comando, int[] dato) {
switch (comando) {
case "ABRIR":
gestorVentanas.abrir(dato[0], dato[1], dato[2], dato[3]);
break;
case "REDIMENSIONAR":
gestorVentanas.redimensionar(dato[0], dato[1], dato[2], dato[3]);
break;
case "MOVER":
gestorVentanas.mover(dato[0], dato[1], dato[2], dato[3]);
break;
case "CERRAR":
gestorVentanas.cerrar(dato[0], dato[1]);
break;
}
}
public static void main(String[] args) {
gestorVentanas = new Gestor(400, 400);
String comandos[] = {"ABRIR",
"ABRIR",
"ABRIR",
"REDIMENSIONAR",
"REDIMENSIONAR",
"MOVER",
"CERRAR",
"CERRAR",
"MOVER"};
int matrizDatos[][]={{50,50,10,10},
{70,55,10,10},
{90,50,10,10},
{55,55,40,40},
{70,55,15,15},
{50,40,40,0},
{70,55},
{110,60},
{95,55,0,-100}};
int cantidadComandos = comandos.size();
for (int i = 0; i < cantidadComandos; i++) {
ejecutarComando(comandos[i], matrizDatos[i]);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment