code
stringlengths
1
2.01M
repo_name
stringlengths
3
62
path
stringlengths
1
267
language
stringclasses
231 values
license
stringclasses
13 values
size
int64
1
2.01M
void copiar_bordes (unsigned char *src, unsigned char *dst, int m, int n, int row_size) { for(int j = 0; j<n; j++) { // superior dst[0*row_size+j] = src[0*row_size+j]; // inferior dst[(m-1)*row_size+j] = src[(m-1)*row_size+j]; } for(int i = 0; i<m; i++) { // izquierdo dst[i*row_size+0] = src[i*row_size+0]; // derecho dst[i*row_size+(n-1)] = src[i*row_size+(n-1)]; } }
022011-tp-o2
trunk/tp2-entregable/src/utils.c
C
gpl3
396
void suavizar_c (unsigned char *src, unsigned char *dst, int m, int n, int row_size) { for(unsigned int i=1; i < m-1; i++){ for(unsigned int j=1; j < n-1 ; j++){ unsigned int res=0; res += src[(i-1)*row_size+(j-1)] + 2 * src[(i-1)*row_size+j] + src[(i-1)*row_size+(j+1)]; res += 2 * src[i*row_size+(j-1)] + 4 * src[i*row_size+j] + 2 * src[i*row_size+(j+1)]; res += src[(i+1)*row_size+(j-1)] + 2 * src[(i+1)*row_size+j] + src[(i+1)*row_size+(j+1)]; dst[i*row_size+j] = (unsigned char) (res/16); } } }
022011-tp-o2
trunk/tp2-entregable/src/suavizar_c.c
C
gpl3
611
#define max(a, b) ((a)>(b))?(a):(b) void monocromatizar_inf_c(unsigned char *src, unsigned char *dst, int h, int w, int src_row_size, int dst_row_size) { for(int contadorFilas=0; contadorFilas<h;contadorFilas++){ int desplazamiento=0; //cada pixel esta compuesto por 3 bytes en la matriz de src // estan en el orden B| G | R | for(int contadorColumnas=0; contadorColumnas<w;contadorColumnas++){ int blue = src[desplazamiento+(contadorFilas*src_row_size)]; int green = src[desplazamiento+(contadorFilas*src_row_size)+1]; int red= src[desplazamiento+(contadorFilas*src_row_size)+2]; int resultado = max(red,max(blue,green)); dst[contadorColumnas+(contadorFilas*dst_row_size)] = resultado; desplazamiento = desplazamiento+3; } } }
022011-tp-o2
trunk/tp2-entregable/src/monocromatizar_inf_c.c
C
gpl3
775
; void suavizar_asm (unsigned char *src, unsigned char *dst, int h, int w, int row_size) global suavizar_asm %define parte_baja [ebp-16] ;================================================================================== ; Template para recorrer las imagenes controlando el padding ; esi <- *src ; edi <- *dst ; REGISTROS QUE USA PARA ITERAR: eax, ebx, ecx ;================================================================================== %include "macros.asm" section .text suavizar_asm: convencion_c_in 16 ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ; INICIALIZAR VARIABLES ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX mov esi, src ; esi <- *src mov edi, dst ; edi <- dst mov ecx, h ; ecx <- h sub ecx,2 add edi,row_size ;empiezo de la segunda linea ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ;---------------------------------- ; esi <- *src ; edi <- dst ; ecx <- h ; ebx <- #columnas_procesada ;---------------------------------- cicloFila: ; WHILE(h7,!=0) DO xor ebx,ebx ; #columnas_p <- 0 cicloColumna: ; WHILE(#columnas_p < row_size) DO ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ; INSERTE SU CODIGO PARA ITERAR AQUI! ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ; matriz de imagen : ; a0 a1 a2 ; b0 b1 b2 ; c0 c1 c2 ;Cuenta ; out_b1 = ( a0 + 2a1 + a2 + 2b0 + 4b1 + 2b2 + c0 + 2c1 + c2 ) +_)/ 16 ; ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ;*******************************************; ; PRIMER LINEA DE LA MATRIZ(ALTA) ; ;*******************************************; ; XMM0 ACUMULADOR PARTE ALTA ; ;*******************************************; movdqu xmm1, [esi+ebx] ; xmm1 <- a15|a14|a13|a12|a11|a10|a9|a8|a7|a6|a5|a4|a3|a2|a1|a0 movdqu xmm2, [esi+ebx+1] ; xmm2 <- a16|a15|a14|a13|a12|a11|a10|a9|a8|a7|a6|a5|a4|a3|a2|a1| movdqu xmm3, [esi+ebx+2] ; xmm3 <- a17|a16|a15|a14|a13|a12|a11|a10|a9|a8|a7|a6|a5|a4|a3|a2| movdqu xmm4,xmm1 ; xmm4 <- xmm1 movdqu xmm5,xmm2 ; xmm5 <- xmm2 movdqu xmm6,xmm3 ; xmm6 <- xmm3 ;desempaqueto y me quedo con los primeros pixeles pxor xmm7,xmm7 punpcklbw xmm1, xmm7 ; parte baja xmm1 <- |0 a7|0 a6|0 a5|0 a4|0 a3|0 a2|0 a1|0 a0| punpcklbw xmm2, xmm7 ; parte baja xmm2 <- |0 a8|0 a7|0 a6|0 a5|0 a4|0 a3|0 a2|0 a1| punpcklbw xmm3, xmm7 ; parte baja xmm3 <- |0 a9|0 a8|0 a7|0 a6|0 a5|0 a4|0 a3|0 a2| punpckhbw xmm4,xmm7 ; parte alta xmm4 <- |0 a15|0 a14|0 a13|0 a12|0 a11|0 a10|0 a9|0 a8| punpckhbw xmm5,xmm7 ; parte alta xmm5 <- |0 a16|0 a15|0 a14|0 a13|0 a12|0 a11|0 a10|0 a9| punpckhbw xmm6,xmm7 ; parte alta xmm6 <- |0 a17|0 a16|0 a15|0 a14|0 a13|0 a12|0 a11|0 a10| ;hago cuentas en la parte baja psllw xmm2,1 ;|0 a8|0 a7|0 a6|0 a5|0 a4|0 a3|0 a2|0 a1| *2 paddw xmm1,xmm3 ;xmm1 <- |0 a7|0 a6|0 a5|0 a4|0 a3|0 a2|0 a1|0 a0| ;xmm3 <- |0 a9|0 a8|0 a7|0 a6|0 a5|0 a4|0 a3|0 a2| paddw xmm1,xmm2 ;------------------------------------------------- ;xmm1 <- |a7+a9|a6+a8|a5+a7|a4+a6|a3+a5|a2+a4|a1+a3|a0+a2| ;xmm2 <- |0 a8|0 a7|0 a6|0 a5|0 a4|0 a3|0 a2|0 a1| ;------------------------------------------------------- ;xmm1 <-|a7+a9+a8|a6+a8+a7|a5+a7+a6|a4+a6+a5|a3+a5+a4|a2+a4+a3|a1+a3+a2|a0+a2+a1| xmm1 <- xmm1 + xmm3 + 2*xmm2 ( primer fila de la matriz armada) ;hago cuentas en la parte alta psllw xmm5,1 ;xmm5 <- |0 a16|0 a15|0 a14|0 a13|0 a12|0 a11|0 a10|0 a9| * 2 paddw xmm4,xmm5 ;xmm4 <-|0 a15|0 a14|0 a13|0 a12|0 a11|0 a10|0 a9|0 a8| paddw xmm4,xmm6 ;------------------------------------------------------------ ;xmm4 <-| a15+a16|a14+a15|a13+a14|a12+a13|a11+a12|a10+a11|a9+a10|a8+a9| ;xmm6 <-|0 a17|0 a16|0 a15|0 a14|0 a13|0 a12|0 a11|0 a10| ;--------------------------------------------------------------------- ;xmm4 <-| a15+a16+a17|a14+a15+a16|a13+a14+a15|a12+a13+a14|a11+a12+a13|a10+a11+a12|a9+a10+a11|a8+a9+a10| movdqu xmm0,xmm1 ;xmm0 <-|a7+a9+a8|a6+a8+a7|a5+a7+a6|a4+a6+a5|a3+a5+a4|a2+a4+a3|a1+a3+a2|a0+a2+a1| guardo en xmm0 mi valor movdqu parte_baja,xmm4 ;calculo lo correspondiente a la segunda fila de la matriz add esi,row_size ;paso a la segunda fila movdqu xmm1, [esi+ebx] ; xmm1 <- b15|b14|b13|b12|b11|b10|b9|b8|b7|b6|b5|b4|b3|b2|b1|b0 movdqu xmm2, [esi+ebx+1] ; xmm2 <- b16|b15|b14|b13|b12|b11|b10|b9|b8|b7|b6|b5|b4|b3|b2|b1| movdqu xmm3, [esi+ebx+2] ; xmm3 <- b17|b16|b15|b14|b13|b12|b11|b10|b9|b8|b7|b6|b5|b4|b3|b2| movdqu xmm4,xmm1 ; xmm4 <- b15|b14|b13|b12|b11|b10|b9|b8|b7|b6|b5|b4|b3|b2|b1|b0 movdqu xmm5,xmm2 ; xmm5 <- b16|b15|b14|b13|b12|b11|b10|b9|b8|b7|b6|b5|b4|b3|b2|b1| movdqu xmm6,xmm3 ; xmm6 <- b17|b16|b15|b14|b13|b12|b11|b10|b9|b8|b7|b6|b5|b4|b3|b2| ;desempaqueto y me quedo con los primeros pixeles pxor xmm7,xmm7 punpcklbw xmm1, xmm7 ;xmm1 <- |0 b7|0 b6|0 b5|0 b4|0 b3|0 b2|0 b1|0 b0|;parte baja xmm1 punpcklbw xmm2, xmm7 ;xmm2 <- |0 b8|0 b7|0 b6|0 b5|0 b4|0 b3|0 b2|0 b1|;parte baja xmm2 punpcklbw xmm3, xmm7 ;xmm3 <- |0 b9|0 b8|0 b7|0 b6|0 b5|0 b4|0 b3|0 b2|;parte baja xmm3 punpckhbw xmm4,xmm7 ;xmm4<- |0 b15|0 b14|0 b13|0 b12|0 b11|0 b10|0 b9|0 b8|;parte alta xmm1 punpckhbw xmm5,xmm7 ;xmm5 <- |0 b16|0 b15|0 b14|0 b13|0 b12|0 b11|0 b10|0 b9|;parte alta xmm2 punpckhbw xmm6,xmm7 ;xmm6 <- |0 b17|0 b16|0 b15|0 b14|0 b13|0 b12|0 b11|0 b10|;parte alta xmm3 psllw xmm1,1 ;xmm1 <- |0 b7|0 b6|0 b5|0 b4|0 b3|0 b2|0 b1|0 b0| * 2 psllw xmm2,2 ;xmm2 <- |0 b8|0 b7|0 b6|0 b5|0 b4|0 b3|0 b2|0 b1| * 4 psllw xmm3,1 ;xmm3 <- |0 b9|0 b8|0 b7|0 b6|0 b5|0 b4|0 b3|0 b2| * 2 psllw xmm4,1 ;xmm4<- |0 b15|0 b14|0 b13|0 b12|0 b11|0 b10|0 b9|0 b8| * 2 psllw xmm5,2 ;xmm5 <- |0 b16|0 b15|0 b14|0 b13|0 b12|0 b11|0 b10|0 b9|* 4 psllw xmm6,1 ;xmm6 <- |0 b17|0 b16|0 b15|0 b14|0 b13|0 b12|0 b11|0 b10|*2 ;trabajo parte baja paddw xmm1,xmm2 ;xmm1 <- |0 b7|0 b6|0 b5|0 b4|0 b3|0 b2|0 b1|0 b0| * 2 paddw xmm1,xmm3 ;xmm2 <- |0 b8|0 b7|0 b6|0 b5|0 b4|0 b3|0 b2|0 b1| * 4 paddw xmm0,xmm1 ;--------------------------------------------------------- ;xmm1 <- |b7+b8|b6+b7|b5+b6|b4+b5|b3+b4|b2+b3|b1+b2|b0+b1| ;xmm3 <- |0 b9|0 b8|0 b7|0 b6|0 b5|0 b4|0 b3|0 b2| * 2 ;------------------------------------------------------------ ;xmm1 <- |b7+b8+b9|b6+b7+b8|b5+b6+b7|b4+b5+b6|b3+b4+b5|b2+b3+b4|b1+b2+b3|b0+b1+b2| ;xmm0 <- |a[7:9].b[7:9]|a[6:8].b[6:9]|a[5:7].b[5:7]||a[4:6].b[4:6]|a[3:5].b[3:5]|a[2:4].b[2:4]|a[1:3].b[1:3]|a[0:2].b[0:2]| guardo en xmm0 mi valor de a+b's ;trabajo parte alta movdqu xmm7,parte_baja ;xmm7<-| a15+a16+a17|a14+a15+a16|a13+a14+a15|a12+a13+a14|a11+a12+a13|a10+a11+a12|a9+a10+a11|a8+a9+a10| paddw xmm7,xmm4 ;xmm7<-| a15+a16+a17|a14+a15+a16|a13+a14+a15|a12+a13+a14|a11+a12+a13|a10+a11+a12|a9+a10+a11|a8+a9+a10| paddw xmm7,xmm5 paddw xmm7,xmm6 ;xmm7<-|a[15:17].b[15:17]|a[14:16].b[14:16]|a[13:15].b[13:15]||a[12:14].b[12:14]|a[11:13].b[11:13]|a[10:12].b[10:12]|a[9:11].b[9:11]|a[8:10].b[8:10]| movdqu parte_baja , xmm7 ;parte baja<-|a[15:17].b[15:17]|a[14:16].b[14:16]|a[13:15].b[13:15]||a[12:14].b[12:14]|a[11:13].b[11:13]|a[10:12].b[10:12]|a[9:11].b[9:11]|a[8:10].b[8:10]| ;paso a la tercer fila de la matriz para calcular (Igual a la primer fila.) add esi,row_size movdqu xmm1, [esi+ebx] ; xmm1 <- c15|c14|c13|c12|c11|c10|c9|c8|c7|c6|c5|c4|c3|c2|c1|c0 movdqu xmm2, [esi+ebx+1] ; xmm2 <- c16|c15|c14|c13|c12|c11|c10|c9|c8|c7|c6|c5|c4|c3|c2|c1| movdqu xmm3, [esi+ebx+2] ; xmm3 <- c17|c16|c15|c14|c13|c12|c11|c10|c9|c8|c7|c6|c5|c4|c3|c2| movdqu xmm4,xmm1 ; xmm4 <- c15|c14|c13|c12|c11|c10|c9|c8|c7|c6|c5|c4|c3|c2|c1|c0 movdqu xmm5,xmm2 ; xmm5 <- c16|c15|c14|c13|c12|c11|c10|c9|c8|c7|c6|c5|c4|c3|c2|c1| movdqu xmm6,xmm3 ; xmm6 <- c17|c16|c15|c14|c13|c12|c11|c10|c9|c8|c7|c6|c5|c4|c3|c2| ;desempaqueto y me quedo con los primeros pixeles pxor xmm7,xmm7 punpcklbw xmm1, xmm7 ;xmm1 <- |0 c7|0 c6|0 c5|0 c4|0 c3|0 c2|0 c1|0 c0| punpcklbw xmm2, xmm7 ;xmm2 <- |0 c8|0 c7|0 c6|0 c5|0 c4|0 c3|0 c2|0 c1| punpcklbw xmm3, xmm7 ;xmm3 <- |0 c9|0 c8|0 c7|0 c6|0 c5|0 c4|0 c3|0 c2| punpckhbw xmm4,xmm7 ;xmm4<- |0 c15|0 c14|0 c13|0 c12|0 c11|0 c10|0 c9|0 c8| punpckhbw xmm5,xmm7 ;xmm5<- |0 c16|0 c15|0 c14|0 c13|0 c12|0 c11|0 c10|0 c9| punpckhbw xmm6,xmm7 ;xmm6<- |0 c17|0 c16|0 c15|0 c14|0 c13|0 c12|0 c11|0 c10| psllw xmm2,1 ;xmm2 <- |0 c8|0 c7|0 c6|0 c5|0 c4|0 c3|0 c2|0 c1|*2 paddw xmm1,xmm3 ;xmm1 <- |0 c7|0 c6|0 c5|0 c4|0 c3|0 c2|0 c1|0 c0| paddw xmm1,xmm2 ;xmm3 <- |0 c9|0 c8|0 c7|0 c6|0 c5|0 c4|0 c3|0 c2| paddw xmm0,xmm1 ;---------------------------------------------------- ;xmm1 <- |c7+c9|c6+c8|c5+c7|c4+c6|c3+c5|c2+c4|c1+c3|c0+c2| ;xmm2 <- |0 c8|0 c7|0 c6|0 c5|0 c4|0 c3|0 c2|0 c1| ;----------------------------------------------------- ;xmm1 <- |c7+c8+c9|c6+c7+c8|c5+c6+c7|c4+c5+c6|c3+c4+c5|c2+c3+c4|c1+c2+c3|c0+c1+c2| ;xmm0 <- |a[7:9].b[7:9].c[7:9] |a[6:8].b[6:9].c[6:9]|a[5:7].b[5:7].c[5:7]||a[4:6].b[4:6].c[4:6] |a[3:5].b[3:5].c[3:5] |a[2:4].b[2:4].c[2:4] |a[1:3].b[1:3].c[1:3]|a[0:2].b[0:2].c[0:2]| psllw xmm5,1 ;xmm5<- |0 c16|0 c15|0 c14|0 c13|0 c12|0 c11|0 c10|0 c9| paddw xmm4,xmm5 ;xmm4<- |0 c15|0 c14|0 c13|0 c12|0 c11|0 c10|0 c9|0 c8| paddw xmm4,xmm6 ;---------------------------------------------------------------- movdqu xmm7,parte_baja ;xmm4<- |c15+c16|c14+c15|c13+c14|c12+c13|c11+c12|c10+c11|c9+c10|c8+c9| paddw xmm7,xmm4 ;xmm6<- |0 c17|0 c16|0 c15|0 c14|0 c13|0 c12|0 c11|0 c10| ;----------------------------------------------------------------------- ;xmm4<- |c15+c16+c17|c14+c15+c16|c13+c14+c15|c12+c13+c14|c11+c12+c13|c10+c11+c12|c9+c10+c11|c8+c9+c10| ;xmm7<-|a[15:17].b[15:17].c[15:17]|a[14:16].b[14:16].c[14:16]|a[13:15].b[13:15].c[13:15]||a[12:14].b[12:14].c[12:14]|a[11:13].b[11:13].c[11:13]|a[10:12].b[10:12].c[10:12]|a[9:11].b[9:11].c[9:11]|a[8:10].b[8:10].c[8:10]| psrlw xmm0,4 ;xmm0 <- |a[7:9].b[7:9].c[7:9] |a[6:8].b[6:9].c[6:9]|a[5:7].b[5:7].c[5:7]||a[4:6].b[4:6].c[4:6] |a[3:5].b[3:5].c[3:5] |a[2:4].b[2:4].c[2:4] |a[1:3].b[1:3].c[1:3]|a[0:2].b[0:2].c[0:2]| / 16 psrlw xmm7,4 ;xmm7 <- |a[15:17].b[15:17].c[15:17]|a[14:16].b[14:16].c[14:16]|a[13:15].b[13:15].c[13:15]||a[12:14].b[12:14].c[12:14]|a[11:13].b[11:13].c[11:13]|a[10:12].b[10:12].c[10:12]|a[9:11].b[9:11].c[9:11]|a[8:10].b[8:10].c[8:10]| / 16 packuswb xmm0,xmm7 ;xmm0 <- |res15 res14|res13 res12|res11 res10|res9 res8|res7 res6|res5 res4|res3 res2|res1 res0| ; me paro en la primer linea otra vez sub esi, row_size sub esi, row_size movdqu [edi+ebx+1 ],xmm0 add ebx ,15 ; #columnas_p <- #columnas_p + 16 mov eax, w ; eax <- row_size sub eax,2 sub eax, ebx ;~ add ebx ,16 ; #columnas_p <- #columnas_p + 16 ;~ mov eax, w ; eax <- row_size ;~ sub eax,2 ;~ sub eax, ebx ; eax <- row_size - #columnas_p cmp eax, 16 ; IF (row_size - #columnas_p) < 16 jge cicloColumna ; CONTINUE cmp eax,0 ; IF (row_size - #columnas_p) jle termineCol ; BREAK mov ebx, w ; ebx <- row_size sub ebx,16 ; ebx <- row_size - 17 jmp cicloColumna ;ultimos pixeles ;~ mov ebx, w ; ebx <- row_size ;~ sub ebx,16 ; ebx <- row_size - 17 ;~ jmp cicloColumna ; ENDWHILE termineCol: add esi,row_size ; src <- src + row_size add edi,row_size ; dst <- dst + row_size dec ecx ; h-- jnz cicloFila ; ENDWHILE fin_invertir: convencion_c_out 16 ret
022011-tp-o2
trunk/tp2-entregable/src/suavizar_asm.asm
Assembly
gpl3
12,797
#ifndef __UTILS__H__ #define __UTILS__H__ void copiar_bordes (unsigned char *src, unsigned char *dst, int m, int n, int row_size); #endif /* !__UTILS__H__ */
022011-tp-o2
trunk/tp2-entregable/src/utils.h
C
gpl3
160
void separar_canales_c (unsigned char *src, unsigned char *dst_r, unsigned char *dst_g, unsigned char *dst_b, int m, int n, int src_row_size, int dst_row_size) { //recorre el src for(unsigned int i=0; i < m; i++){ for(unsigned int j=0; j < n; j++){ dst_b[i*dst_row_size+j] = src[i*src_row_size+3*j]; dst_g[i*dst_row_size+j] = src[i*src_row_size+3*j+1]; dst_r[i*dst_row_size+j] = src[i*src_row_size+3*j+2]; } } /********************************************* * Implementacion con mejor acceso a memoria *********************************************/ /* src_row_size = src_row_size-3*n; dst_row_size = dst_row_size-n; //recorre el src for(unsigned int i=m; i > 0; i--){ for(unsigned int j=n; j > 0; j--){ *(dst_b++) = *(src++); *(dst_g++) = *(src++); *(dst_r++) = *(src++); } src += src_row_size; dst_b += dst_row_size; dst_g += dst_row_size; dst_r += dst_row_size; } */ }
022011-tp-o2
trunk/tp2-entregable/src/separar_canales_c.c
C
gpl3
1,091
; void monocromatizar_uno_asm(unsigned char *src, unsigned char *dst, int h, int w, int src_row_size, int dst_row_size) global monocromatizar_uno_asm %define src_row_size [ebp+24] %define dst_row_size [ebp+28] %include "macros.asm" section .text monocromatizar_uno_asm: convencion_c_in 0 pxor xmm7, xmm7 mov ecx, 0xFFFFFFFF pinsrw xmm7, ecx, 0 pinsrw xmm7, ecx, 3 pinsrw xmm7, ecx, 6 ; xmm7 <- |FF|00|00|FF|00|00|FF|00 ; xmm7 <- |00|FF|00|00|FF|00|00|FF pxor xmm3, xmm3 ; xmm3 <- 0 util para desempaquetado y empaquetados mov esi, src ; esi <- *src mov edi, dst ; edi <- dst mov ecx, h ; ecx <- h ;---------------------------------- ; esi <- *src ; edi <- dst ; ecx <- h ; ebx <- #columnas_procesada ;---------------------------------- cicloFila: ; WHILE(h!=0) DO xor ebx,ebx ; #columnas_p <- 0 xor edx, edx ; #columnas_p_dst <- 0 cicloColumna: ; WHILE(#columnas_p < row_size) DO movdqu xmm0, [esi+ebx]; xmm0 <- B5|R4|G4|B4|R3|G3|B3|R2|G2|B2|R1|G1|B1|R0|G0|B0 carga_distinto_ultima_columna: movdqu xmm1, xmm0 ; xmm1 <- B5|R4|G4|B4|R3|G3|B3|R2|G2|B2|R1|G1|B1|R0|G0|B0 movdqu xmm2, xmm0 ; xmm2 <- B5|R4|G4|B4|R3|G3|B3|R2|G2|B2|R1|G1|B1|R0|G0|B0 psrldq xmm1, 1 ; xmm1 <- 0 |B5|R4|G4|B4|R3|G3|B3|R2|G2|B2|R1|G1|B1|R0|G0| (byte packed) psrldq xmm2, 2 ; xmm2 <- 0 |0 |B5|R4|G4|B4|R3|G3|B3|R2|G2|B2|R1|G1|B1|R0| (byte packed) ;------------------------------------------------------------------------- ; xmm0 <- src_0 = |B5|R4|G4|B4|R3|G3|B3|R2|G2|B2|R1|G1|B1|R0|G0|B0| (byte packed) ; xmm1 <- src_1 = |0 |B5|R4|G4|B4|R3|G3|B3|R2|G2|B2|R1|G1|B1|R0|G0| (byte packed) ; xmm2 <- src_2 = |0 |0 |B5|R4|G4|B4|R3|G3|B3|R2|G2|B2|R1|G1|B1|R0| (byte packed) ; xmm3 <- 0 ;------------------------------------------------------------------------- movdqu xmm5, xmm1 ; xmm5 <- 0 |B5|R4|G4|B4|R3|G3|B3|R2|G2|B2|R1|G1|B1|R0|G0| punpcklbw xmm1, xmm3 ; xmm1 <- 0|R2|0|G2|0|B2|0|R1|0|G1|0|B1|0|R0|0|G0| (word packed) xmm1 parte baja de operndo 2 punpckhbw xmm5, xmm3 ; xmm5 <- 0| 0|0|B5|0|R4|0|G4|0|B4|0|R3|0|G3|0|B3| (word packed) xmm5 parte alta de operando2 psllw xmm1,1 ; xmm1 <- 0|R2|0|G2|0|B2|0|R1|0|G1|0|B1|0|R0|0|G0| *2 de a words psllw xmm5,1 ; xmm5 <- 0|0|0|B5|0|R4|0|G4|0|B4|0|R3|0|G3|0|B3 *2 de a words ;------------------------------------------------------------------------- ; xmm1 <- src_1_l = |0|R2|0|G2|0|B2|0|R1|0|G1|0|B1|0|R0|0|G0| (word packed) ; xmm5 <- src_1_h = |0| 0|0|B5|0|R4|0|G4|0|B4|0|R3|0|G3|0|B3| (word packed) ;------------------------------------------------------------------------- movdqu xmm4, xmm0 punpcklbw xmm0, xmm3 ; xmm0 <- |0|G2|0|B2|0|R1|0|G1|0|B1|0|R0|0|G0|0|B0| xmm0 parte baja de operando 1 punpckhbw xmm4, xmm3 ; xmm4 <- |0|B5|0|R4|0|G4|0|B4|0|R3|0|G3|0|B3|0|R2| xmm4 pate alta de operando1 ;------------------------------------------------------------------------- ; xmm0 <- src_0_l = |0|G2|0|B2|0|R1|0|G1|0|B1|0|R0|0|G0|0|B0| (word packed) ; xmm4 <- src_0_h = |0|B5|0|R4|0|G4|0|B4|0|R3|0|G3|0|B3|0|R2| (word packed) ;------------------------------------------------------------------------- movdqu xmm6, xmm2 ; xmm6 <- |0 |0|B5|R4|G4|B4|R3|G3|B3|R2|G2|B2|R1|G1|B1|R0| punpcklbw xmm2, xmm3 ; xmm2 <- |0|B3|0|R2|0|G2|0|B2|0|R1|0|G1|0|B1|0|R0| xmm2 parte baja de operando 3 punpckhbw xmm6, xmm3 ; xmm6 <- |0|0 |0|0 |0|B5|0|R4|0|G4|0|B4|0|R3|0|G3| xmm6 parte alta de operando 3 ;------------------------------------------------------------------------- ; xmm2 <- src_2_l = |0|B3|0|R2|0|G2|0|B2|0|R1|0|G1|0|B1|0|R0| (word packed) ; xmm6 <- src_2_h = |0|0 |0|0 |0|B5|0|R4|0|G4|0|B4|0|R3|0|G3| (word packed) ;------------------------------------------------------------------------- ;sumemos partes bajas paddw xmm0,xmm1 ;xmm0 <- + |0|G2|0|B2|0|R1|0|G1|0|B1|0|R0|0|G0|0|B0| ; + |0|R2|0|G2|0|B2|0|R1|0|G1|0|B1|0|R0|0|G0| *2 de a words paddw xmm0,xmm2 ; |0|B3|0|R2|0|G2|0|B2|0|R1|0|G1|0|B1|0|R0| ;xmm0 <- |xxxx| S2|xxxx|xxxx| S1|xxxx|xxxx| S0| donde S = B+2*G+R ; xmm0 suma partes bajas llamo "s" a la suma sin la division por 4 paddw xmm4, xmm6 ;xmm4 suma partes altas paddw xmm4, xmm5 ;xmm4 <- |xxxx|xxxx|xxxx| S4|xxxx|xxxx| S3|xxxx| donde S = B+2*G+R ; divido por 4 casa suma y tengo la cuenta que queria llamo c a la cuenta que quiero psrlw xmm0, 2 ;xmm0 <- |xx|C2|xx|xx|C1|xx|xx|C0| donde C = (B+2*G+R)/16 psrlw xmm4, 2 ;xmm4 <- |xx|xx|xx|C4|xx|xx|C3|xx| donde C = (B+2*G+R)/16 ; xmm7 <- |00|FF|00|00|FF|00|00|FF| pand xmm0,xmm7 ; xmm0 <- |00|c2|00|00|c1|00|00|c0| (word packed) pslldq xmm7, 2 ; xmm7 <- |FF|00|00|FF|00|00|FF|00| pand xmm4, xmm7 ; xmm4 <- |xx|00|00|c4|00|00|c3|00| (word packed) psrldq xmm7, 2 ; xmm7 <- |00|FF|00|00|FF|00|00|FF| , shift a iz dos bytes reacomodo mask por xmm0, xmm4 ; xmm0 <- |xx|c2|00|c4|c1|00|c3|c0| pshuflw xmm0, xmm0, 10011100b ; xmm0 <- |xx|c2|00|c4|00|c3|c1|c0| pshufd xmm0,xmm0, 11011000b ; xmm0 <- |xx|c2|00|c3|00|c4|c1|c0| pshufhw xmm0, xmm0, 11010010b ; xmm0 <- |xx|00|c3|c2|00|c4|c1|c0| pshufd xmm0, xmm0, 11011000b ; xmm0 <- |xx|00|00|c4|c3|c2|c1|c0| (word packed) packuswb xmm0,xmm3 ; xmm0 <- |0 |0| 0| 0 |0 |0| 0| 0| 0|0|x|c4|c3|c2|c1|c0 movd [edi+edx], xmm0 psrldq xmm0, 4 movd eax, xmm0 ; eax <- |0|0|0|c4| mov [edi+edx+4], al ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX add edx ,5 ; #columnas_p_dst <- #columnas_p_dst + 4 ; #columnas_p <- #columnas_p + 16 add ebx ,15 mov eax, w ; eax <- w lea eax, [eax + 2*eax] ; eax <- 3*w sub eax, ebx ; eax <- 3*w - #columnas_p cmp eax, 16 ; IF (3*w - #columnas_p) < 16 jge cicloColumna ; CONTINUE cmp eax, 1 ; IF (3*w - #columnas_p) je termineCol ; BREAK ;ultimos pixeles add ebx, eax ; ebx <- 3*w sub ebx,16 ; ebx <- 3*w - 16 mov edx, w ; edx <- dst_row_size sub edx,5 ; edx <- dst_row_size - 5 movdqu xmm0, [esi+ebx] ; xmm0 <- ultimos_16b(src) |R B|GR|BG|RB|GR|BG|RB|GR| psrldq xmm0, 1 jmp carga_distinto_ultima_columna ; ENDWHILE termineCol: add esi,src_row_size ; src <- src + row_size add edi,dst_row_size ; dst <- dst + row_size dec ecx ; h-- jnz cicloFila ; ENDWHILE fin_invertir: convencion_c_out 0 ret
022011-tp-o2
trunk/tp2-entregable/src/monocromatizar_uno_asm.asm
Assembly
gpl3
7,875
void monocromatizar_uno_c(unsigned char *src, unsigned char *dst, int h, int w, int src_row_size, int dst_row_size) { // me pasan una "martiz" en realidad es un vector muy grande de los cuales tengo que fijarme que hacer // obs usar i filas, i columnas inv: forall i, j src[i][j] == dst[i][j-3] AND i <h, j<w AND // blue == src[i][j] AND green == src[i][j+1] AND red == src[i][j+2] for(int contadorFilas=0;contadorFilas<h;contadorFilas++){ int desplazamiento=0; for(int contadorColumnas =0;contadorColumnas<w;contadorColumnas++){ //cada pixel esta compuesto por 3 bytes en la matriz de src // estan en el orden B| G | R | int blue = src[desplazamiento+(contadorFilas*src_row_size)]; int green = src[desplazamiento+(contadorFilas*src_row_size)+1]; int red= src[desplazamiento+(contadorFilas*src_row_size)+2]; int resultado = (red+(2*green)+blue)/4; dst[contadorColumnas+(contadorFilas*dst_row_size)] = resultado; desplazamiento = desplazamiento+3; } } }
022011-tp-o2
trunk/tp2-entregable/src/monocromatizar_uno_c.c
C
gpl3
1,017
void normalizar_c (unsigned char *src, unsigned char *dst, int m, int n, int row_size) { unsigned char max = 0; unsigned char min = 255; //busca max y min for(unsigned int i=0; i < m; i++){ for(unsigned int j=0; j < n; j++){ unsigned char val= src[i*row_size+j]; if(val > max) max = val; if(val < min) min = val; } } float k = 255/(float)(max-min); //modifica src for(unsigned int i=0; i < m; i++){ for(unsigned int j=0; j < n; j++){ dst[i*row_size +j] = k* (float)( src[i*row_size+j] - min ); } } //printf("min:%d, max:%d, k:%30.30f\n", min, max, k); }
022011-tp-o2
trunk/tp2-entregable/src/normalizar_c.c
C
gpl3
702
; void monocromatizar_inf_asm(unsigned char *src, unsigned char *dst, int h, int w, int src_row_size, int dst_row_size) global monocromatizar_inf_asm %define src_row_size [ebp+24] %define dst_row_size [ebp+28] %include "macros.asm" section .text monocromatizar_inf_asm: convencion_c_in 0 ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ; INSERTE SU CODIGO PARA INICIALIZAR VARIABLES AQUI! ;mask : dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000 no funciono pero podria haber funcionado con los movs adecuados probemos mejor por la idea de fer pxor xmm7, xmm7 mov ecx, 0xFFFFFFFF pinsrw xmm7, ecx, 0 pinsrw xmm7, ecx, 3 pinsrw xmm7, ecx, 6 ; xmm7 <- |FF|00|00|FF|00|00|FF|00 ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX mov esi, src ; esi <- *src mov edi, dst ; edi <- dst mov ecx, h ; ecx <- h ;---------------------------------- ; esi <- *src ; edi <- dst ; ecx <- h ; ebx <- #columnas_procesada ;---------------------------------- cicloFila: ; WHILE(h!=0) DO xor ebx,ebx ; #columnas_p_src <- 0 xor edx, edx ; #columnas_p_dst <- 0 cicloColumna: ; WHILE(#columnas_p < row_size) DO ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ; INSERTE SU CODIGO PARA ITERAR AQUI! ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX movdqu xmm0, [esi+ebx] carga_distinto_ultima_columna: movdqu xmm1, xmm0 ; movdqu xmm2, xmm0 ; xmm0 <- B5|R4|G4|B4|R3|G3|B3|R2|G2|B2|R1|G1|B1|R0|G0|B0 psrldq xmm1, 1 ; xmm1 <- 0 |B5|R4|G4|B4|R3|G3|B3|R2|G2|B2|R1|G1|B1|R0|G0| psrldq xmm2, 2 ; xmm2 <- 0 |0 |B5|R4|G4|B4|R3|G3|B3|R2|G2|B2|R1|G1|B1|R0| pmaxub xmm0,xmm1 pmaxub xmm0, xmm2 ;xmm0 <- B5|x|x|max|x|x|max|x|x|max|x|x|max|x|x|max ; xmm0 <- max{B0,GO,R0)}|G0|R0|max{B1,G1,R1}|--|--|max ...|G2|R2|max..|G3|R3|max..|G4|R4|B5 movdqu xmm1, xmm0 ; lo copio porque lo voy a usar despues pero por ahora me olvido psllw xmm1,8 ; xmm1 <- x 0 |m4 0| x 0 | x 0 |m2 0 | x 0 | x 0 |m0 0 movdqu xmm2, xmm1 ; xmm1 <- x 0 |m4 0| x 0 | x 0 |m2 0 | x 0 | x 0 |m0 0 psrlw xmm0, 8 ; xmm0 <- 0 m5|0 x|0 x| 0 m3 | 0 x | 0 x| 0 m1|0 x psllw xmm0, 8 ; xmm0 <- m5 0|x 0|x 0| m3 0| x 0 | x 0| m1 0| x 0 pand xmm1, xmm7 ; xmm1 <- 0 0|m4 0| 0 0 | 0 0 |m2 0 | 0 0 | 0 0 |m0 0 hasta aca ok pslldq xmm7, 2 ; xmm7 <- |00 |00 |FF |00 |00 |FF |00 pand xmm0, xmm7 ; xmm0 <- 0 0|0 0|0 0| m3 0| 0 0 | 0 0| m1 0| 0 0 psrldq xmm7, 2 ; xmm7 <- 00 |FF |00 |00 |FF |00 |00 |FF | , shift a iz dos bytes reacomodo mask por xmm0,xmm1 ; xmm0 <- m5 0|m4 0|0 0| m3 0| m2 0 | 0 0| m1 0| m0 0 ; no ok vr si es 0 y arrastrar pshufd xmm0, xmm0, 01101100b ;xmm0 <- m2 0|0 0|0 0| m3 0| m5 0 |m4 0| m1 0| m0 0 pshufhw xmm0, xmm0, 01100011b ;xmm0 <- 0 0|0 0|m3 0| m2 0| m5 0 |m4 0| m1 0| m0 0 si no s car esta bien pshufd xmm0,xmm0, 11011000b ;xmm0 <- 0 0|0 0|m5 0| m4 0| m3 0 |m2 0| m1 0| m0 0 psrlw xmm0, 8 ;xmm0 <- 0 0|0 0|0 m5| 0 m4| 0 m3 |0 m2| 0 m1| 0 m0 ;~ pxor xmm3, xmm3 packuswb xmm0,xmm3 ; xmm0 <- 0 |0| 0| 0 |0 |0| 0| 0| 0|0|m5|m4|m3|m2|m1|m0 movd [edi+edx], xmm0 psrldq xmm0, 4 movd eax, xmm0 ; eax <- |xx|xx|xx|m5| mov [edi+edx+4], al ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX add edx ,5 ; #columnas_p_dst <- #columnas_p_dst + 4 add ebx ,15 ; #columnas_p <- #columnas_p + 16 mov eax, w ; eax <- w lea eax, [eax + 2*eax] ; eax <- 3*w sub eax, ebx ; eax <- 3*w - #columnas_p cmp eax, 16 ; IF (3*w - #columnas_p) < 16 jge cicloColumna ; CONTINUE cmp eax, 1 ; IF (3*w - #columnas_p) je termineCol ; BREAK ;ultimos pixeles add ebx, eax ; ebx <- 3*w sub ebx,16 ; ebx <- 3*w - 16 mov edx, w ; edx <- dst_row_size sub edx,5 ; edx <- dst_row_size - 4 movdqu xmm0, [esi+ebx] ; xmm0 <- ultimos_16b(src) |R B|GR|BG|RB|GR|BG|RB|GR| psrldq xmm0, 1 jmp carga_distinto_ultima_columna ; ENDWHILE termineCol: add esi,src_row_size ; src <- src + row_size add edi,dst_row_size ; dst <- dst + row_size dec ecx ; h-- jnz cicloFila ; ENDWHILE fin_invertir: convencion_c_out 0 ret
022011-tp-o2
trunk/tp2-entregable/src/monocromatizar_inf_asm.asm
Assembly
gpl3
5,438
; void separar_canales_asm (unsigned char *src, unsigned char *dst_r, unsigned char *dst_g, unsigned char *dst_b, int m, int n, int src_row_size, int dst_row_size) global separar_canales_asm %include "macros.asm" %define dst_r [ebp+12] %define dst_g [ebp+16] %define dst_b [ebp+20] %define h [ebp+24] %define w [ebp+28] %define src_row_size [ebp+32] %define dst_row_size [ebp+36] section .text separar_canales_asm: convencion_c_in 0 ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ; INSERTE SU CODIGO PARA INICIALIZAR VARIABLES AQUI! ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX pxor xmm7, xmm7 ; xmm7 <- |00...00| mov ecx, 0xFFFFFFFF ; ecx <- 0 pinsrw xmm7, ecx, 0 pinsrw xmm7, ecx, 3 pinsrw xmm7, ecx, 6 ; xmm7 <- |00|FF|00|00|FF|00|00|FF| movdqu xmm6, xmm7 ; xmm6 <- |00|FF|00|00|FF|00|00|FF| psrldq xmm6, 2 ; xmm6 <- |00|00|FF|00|00|FF|00|00| ; xmm7 <- mascara_B ; xmm <- mascara_G ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX mov esi, src ; esi <- *src mov ecx, h ; ecx <- h ;---------------------------------- ; esi <- *src ; edi <- dst ; ecx <- h ; ebx <- #columnas_procesada_src ; edx <- #columnas_procesada_dst ;---------------------------------- cicloFila: ; WHILE(h!=0) DO xor ebx, ebx ; #columnas_p_src <- 0 xor edx, edx ; #columnas_p_dst <- 0 cicloColumna: ; WHILE(#columnas_p < row_size) DO ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ; INSERTE SU CODIGO PARA ITERAR AQUI! ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX movdqu xmm0, [esi+ebx] ; xmm0 <- src carga_distinto_ultima_columna: ;----------------- ; Prepara los datos ;----------------- movdqu xmm1, xmm0 ; xmm1 <- |BR|GB|RG|BR|GB|RG|BR|GB| psllw xmm1, 8 ; psrlw xmm1, 8 ; xmm1 <- |0R|0B|0G|0R|0B|0G|0R|0B| psrlw xmm0, 8 ; xmm0 <- |0B|0G|0R|0B|0G|0R|0B|0G| ; GUARDO LOS REGISTROS movdqu xmm3, xmm1 ; xmm3 <- |0R|0B|0G|0R|0B|0G|0R|0B| movdqu xmm2, xmm0 ; xmm2 <- |0B|0G|0R|0B|0G|0R|0B|0G| ;----------------- ; Proceso B ;----------------- mov edi, dst_b ; edi <- dst_b ; xmm7 <- |00|FF|00|00|FF|00|00|FF| pand xmm1, xmm7 ; xmm1 <- |00|0B|00|00|0B|00|00|0B| pslldq xmm7, 1 ; xmm7 <- |FF|00|00|FF|00|00|FF|00| ajusto mascara pand xmm0, xmm7 ; xmm0 <- |0B|00|00|0B|00|00|0B|00| ; xmm0 <- |0B|00|00|0B|00|00|0B|00| ; xmm1 <- |00|0B|00|00|0B|00|00|0B| por xmm0, xmm1 ; xmm0 <- |B6|B5|00|B4|B3|00|B2|B1| pshufd xmm0, xmm0, 11000110b ; xmm0 <- |B6|B5|B2|B1|B3|00|00|B4| pshuflw xmm0, xmm0, 00110110b ; xmm0 <- |B6|B5|B2|B1|B4|B3|00|00| pshufd xmm0, xmm0, 11011000b ; xmm0 <- |B6|B5|B4|B3|B2|B1|00|00| (word-packed) packuswb xmm0, xmm0 ; xmm0 <- |B6|B5|B4|B3|B2|B1|0|0|B6|B5|B4|B3|B2|B1|0|0| (byte-packed) psrldq xmm0, 2 ; xmm0 <- |0|0|B6|B5|B4|B3|B2|B1|0|0|B6|B5|B4|B3|B2|B1| (byte-packed) movd [edi+edx], xmm0 ; eax <- |B4|B3|B2|B1| psrldq xmm0, 4 movd eax, xmm0 ; eax <- |xx|xx|xx|B5| mov [edi+edx+4], al ;----------------- ; Proceso R ;----------------- mov edi, dst_r ; edi <- dst_b movdqu xmm1, xmm3 ; xmm3 <- |0R|0B|0G|0R|0B|0G|0R|0B| movdqu xmm0, xmm2 ; xmm2 <- |0B|0G|0R|0B|0G|0R|0B|0G| ; xmm7 <- |FF|00|00|FF|00|00|FF|00| pand xmm1, xmm7 ; xmm1 <- |0R|00|00|0R|00|00|0R|00| ; xmm6 <- |00|00|FF|00|00|FF|00|00| pand xmm0, xmm6 ; xmm0 <- |00|00|0R|00|00|0R|00|00| ; xmm0 <- |00|00|0R|00|00|0R|00|00| ; xmm1 <- |0R|00|00|0R|00|00|0R|00| por xmm0, xmm1 ; xmm0 <- |R5|00|R4|R3|00|R2|R1|00| pshuflw xmm0, xmm0, 11001001b ; xmm0 <- |R5|00|R4|R3|00|00|R2|R1| pshufd xmm0, xmm0, 11011000b ; xmm0 <- |R5|00|00|00|R4|R3|R2|R1| packuswb xmm0, xmm0 ; xmm0 <- |R5|0|0|0|R4|R3|R2|R1|R5|0|0|0|R4|R3|R2|R1| (byte-packed) movd [edi+edx], xmm0 ; eax <- |R4|R3|R2|R1| psrldq xmm0, 7 movd eax, xmm0 ; eax <- |xx|xx|xx|R5| mov [edi+edx+4], al ;----------------- ; Proceso G ;----------------- psrldq xmm7, 1 ; xmm7 <- |00|FF|00|00|FF|00|00|FF| retorno mascara mov edi, dst_g ; edi <- dst_b pand xmm2, xmm7 ; xmm0 <- |00|0G|00|00|0G|00|00|0G| ; xmm6 <- |00|00|FF|00|00|FF|00|00| pand xmm3, xmm6 ; xmm1 <- |00|00|0G|00|00|0G|00|00| ; xmm0 <- |00|0G|00|00|0G|00|00|0G| ; xmm1 <- |00|00|0G|00|00|0G|00|00| por xmm2, xmm3 ; xmm0 <- |00|G5|G4|00|G3|G2|00|G1| pshuflw xmm2, xmm2, 01111000b ; xmm0 <- |00|G5|G4|00|00|G3|G2|G1| pshufd xmm2, xmm2, 01101100b ; xmm0 <- |00|G3|G4|00|00|G5|G2|G1| pshufhw xmm2, xmm2, 11000110b ; xmm0 <- |00|00|G4|G3|00|G5|G2|G1| pshufd xmm2, xmm2, 11011000b ; xmm0 <- |00|00|00|G5|G4|G3|G2|G1| packuswb xmm2, xmm2 ; xmm0 <- |00|00|00|G5|G4|G3|G2|G1|00|00|00|G5|G4|G3|G2|G1| (byte-packed) movd [edi+edx], xmm2 ; eax <- |G4|G3|G2|G1| psrldq xmm2, 4 movd eax, xmm2 ; eax <- |0|0|0|G5| mov [edi+edx+4], al ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX add edx ,5 ; #columnas_p_dst <- #columnas_p_dst + 4 add ebx ,15 ; #columnas_p_src <- #columnas_p_src + 12 mov eax, w ; eax <- w lea eax, [eax + 2*eax] ; eax <- 3*w sub eax, ebx ; eax <- 3*w - #columnas_p_src cmp eax, 16 ; IF (3*w - #columnas_p_src) < 16 jge cicloColumna ; CONTINUE cmp eax, 1 ; IF (3*w - #columnas_p_src) == 0 je termineCol ; BREAK ;ultimos pixeles add ebx, eax ; ebx <- 3*w sub ebx,16 ; ebx <- 3*w - 17 mov edx, w ; edx <- dst_row_size sub edx,5 ; edx <- dst_row_size - 4 movdqu xmm0, [esi+ebx] ; xmm0 <- ultimos_16b(src) |R B|GR|BG|RB|GR|BG|RB|GR| psrldq xmm0, 1 jmp carga_distinto_ultima_columna ; ENDWHILE termineCol: add esi, src_row_size ; src <- src + src_row_size mov edi, dst_row_size add dst_b, edi ; dst_b <- dst + dst_row_size add dst_g, edi ; dst_g <- dst + dst_row_size add dst_r, edi ; dst_r <- dst + dst_row_size dec ecx ; h-- jnz cicloFila ; ENDWHILE fin_invertir: convencion_c_out 0 ret
022011-tp-o2
trunk/tp2-entregable/src/separar_canales_asm.asm
Assembly
gpl3
8,014
;************************************************************************************************************ ; DEFINES PARAMETROS GENERICOS ;************************************************************************************************************ %define src [ebp+8] %define dst [ebp+12] %define h [ebp+16] %define w [ebp+20] %define row_size [ebp+24] ;************************************************************************************************************ ; MACROS ;************************************************************************************************************ %macro convencion_c_in 1 push ebp mov ebp, esp sub esp, %1 push esi push edi push ebx %endmacro %macro convencion_c_out 1 pop ebx pop edi pop esi add esp, %1 pop ebp %endmacro
022011-tp-o2
trunk/tp2-entregable/src/macros.asm
Assembly
gpl3
804
; void umbralizar_asm (unsigned char *src, unsigned char *dst, int h, int w, int row_size, unsigned char umbral_min, unsigned char umbral_max) global umbralizar_asm %include "macros.asm" section .text umbralizar_asm: convencion_c_in 0 ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ; INSERTE SU CODIGO PARA INICIALIZAR VARIABLES AQUI! ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX pxor xmm7, xmm7 ; xmm7 <- 0 ;----------------------- ; Mascara con 128 ;----------------------- mov eax, 80808080h ; eax <- 128 (byte packed) movd xmm6, eax ; xmm6 <- |0..0|128| (byte packed) pshufd xmm6, xmm6, 0 ; xmm6 <- 128 (byte packed) ;----------------------- ; Mascara umbral minimo ;----------------------- mov eax, [ebp+28] ; eax <- umbral_min mov ebx, eax shl eax, 8 add eax, ebx shl eax, 8 add eax, ebx shl eax, 8 add eax, ebx shl eax, 8 add eax, ebx ; eax <- umbral_min (byte packed) movd xmm5, eax ; xmm5 <- |0..0|umbral_min| (byte packed) pshufd xmm5, xmm5, 0 ; xmm5 <- umbral_min (byte packed) ;----------------------- ; Mascara umbral maximo ;----------------------- mov eax, [ebp+32] ; eax <- umbral_max inc eax ; eax <- umbral_max + 1 mov ebx, eax shl eax, 8 add eax, ebx shl eax, 8 add eax, ebx shl eax, 8 add eax, ebx shl eax, 8 add eax, ebx ; eax <- umbral_max (byte packed) movd xmm4, eax ; xmm4 <- |0..0|umbral_max| (byte packed) pshufd xmm4, xmm4, 0 ; xmm4 <- umbral_max (byte packed) ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX mov esi, src ; esi <- *src mov edi, dst ; edi <- dst mov ecx, h ; ecx <- h ;---------------------------------- ; esi <- *src ; edi <- dst ; ecx <- h ; ebx <- #columnas_procesada ;---------------------------------- cicloFila: ; WHILE(h!=0) DO xor ebx,ebx ; #columnas_p <- 0 cicloColumna: ; WHILE(#columnas_p < row_size) DO ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ; INSERTE SU CODIGO PARA ITERAR AQUI! ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX movdqu xmm0, [esi+ebx] ; xmm1 <- src[16] ;---------------------------------- ; xmm0 <- src[16] ; xmm7 <- 0 ; xmm6 <- 128 (byte packed) ; xmm5 <- umbral_min (byte packed) ; xmm4 <- umbral_max (byte packed) ;---------------------------------- movdqu xmm3, xmm4 ; xmm3 <- umbral_max psubusb xmm3, xmm0 ; xmm3 <- umbral_max - src[16] pcmpeqb xmm3, xmm7 ; xmm1 <- |F..0..F..F..0| tengo F donde me sirve ;xmm3 <- mascara maxima psubusb xmm0, xmm5 ; xmm0 <- src[16] -umbral_min pcmpeqb xmm0, xmm7 ; xmm0 <- |F..0..F..F..0| tengo F donde me sirve ;xmm0 <- mascara minima por xmm0, xmm3 ; xmm0 <- |F..0..F..F..0| tengo 0 donde me sirve ;xmm0 <- mascara con 0 en medios y F en extremos pcmpeqb xmm0, xmm7 ; xmm0 <- |F..0..F..F..0| tengo F donde me sirve movdqu xmm2, xmm6 ; xmm2 <- 128 (byte packed) pand xmm2, xmm0 ; xmm2 <- |128..0..128..128..0| tengo 128 donde me sirve por xmm2, xmm3 ; xmm2 <- |128..0..F..128..F..0| tengo 0 donde me sirve movdqu [edi+ebx],xmm2 ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX add ebx ,16 ; #columnas_p <- #columnas_p + 16 mov eax, w ; eax <- w sub eax, ebx ; eax <- w - #columnas_p cmp eax, 16 ; IF (w - #columnas_p) < 16 jge cicloColumna ; CONTINUE cmp eax,0 ; IF (w - #columnas_p) je termineCol ; BREAK ;ultimos pixeles mov ebx, w ; ebx <- w sub ebx, 16 ; ebx <- w - 17 jmp cicloColumna ; ENDWHILE termineCol: add esi,row_size ; src <- src + row_size add edi,row_size ; dst <- dst + row_size dec ecx ; h-- jnz cicloFila ; ENDWHILE fin_invertir: convencion_c_out 0 ret
022011-tp-o2
trunk/tp2-entregable/src/umbralizar_asm.asm
Assembly
gpl3
5,698
; void invertir_asm (unsigned char *src, unsigned char *dst, int h, int w, int row_size) global invertir_asm %include "macros.asm" section .text invertir_asm: convencion_c_in 0 mov esi, src ; esi <- *src mov edi, dst ; edi <- dst mov ecx, h ; ecx <- h ;---------------------------------- ; esi <- *src ; edi <- dst ; ecx <- h ; ebx <- #columnas_procesada ;---------------------------------- cicloFila: ; WHILE(h!=0) DO xor ebx,ebx ; #columnas_p <- 0 cicloColumna: ; WHILE(#columnas_p < row_size) DO ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ; INSERTE SU CODIGO PARA ITERAR AQUI! ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX movdqu xmm0, [esi+ebx] pcmpeqb xmm7, xmm7 ; xmm7 <- |FFFF....FFFF| psubb xmm7, xmm0 ; xmm0 <- |255-src[i]| movdqu [edi+ebx],xmm7 ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX add ebx ,16 ; #columnas_p <- #columnas_p + 16 mov eax, w ; eax <- w sub eax, ebx ; eax <- w - #columnas_p cmp eax, 16 ; IF (w - #columnas_p) < 16 jge cicloColumna ; CONTINUE cmp eax,0 ; IF (w - #columnas_p) je termineCol ; BREAK ;ultimos pixeles mov ebx, w ; ebx <- w sub ebx, 16 ; ebx <- row_size - 16 jmp cicloColumna ; ENDWHILE termineCol: add esi,row_size ; src <- src + row_size add edi,row_size ; dst <- dst + row_size dec ecx ; h-- jnz cicloFila ; ENDWHILE fin_invertir: convencion_c_out 0 ret
022011-tp-o2
trunk/tp2-entregable/src/invertir_asm.asm
Assembly
gpl3
2,409
; void normalizar_asm (unsigned char *src, unsigned char *dst, int h, int w, int row_size) global normalizar_asm %include "macros.asm" section .text normalizar_asm: convencion_c_in 0 mov esi, src ; esi <- *src mov edi, dst ; edi <- dst mov ecx, h ; ecx <- h pcmpeqb xmm6, xmm6 ; min <- |FFFF....FFFF| pxor xmm5, xmm5 ; max <- |0000....0000| ;---------------------------------- ; esi <- *src ; edi <- dst ; ecx <- h ; ebx <- #columnas_procesada ;---------------------------------- b_cicloFila: ; WHILE(h!=0) DO xor ebx,ebx ; #columnas_p <- 0 b_cicloColumna: ; WHILE(#columnas_p < row_size) DO ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ; BUSCA MAXIMO Y MINIMO ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX movdqu xmm7, [esi+ebx] ; xmm7 <- *src (16px) pminub xmm6, xmm7 ; min <- |min(src[i_0]),...,min(src[i_15])| pmaxub xmm5, xmm7 ; max <- |max(src[i_0]),...,max(src[i_15])| ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX add ebx ,16 ; #columnas_p <- #columnas_p + 16 mov eax, w ; eax <- w sub eax, ebx ; eax <- w - #columnas_p cmp eax, 16 ; IF (w - #columnas_p) < 16 jge b_cicloColumna ; CONTINUE cmp eax,0 ; IF (w - #columnas_p) je b_termineCol ; BREAK ;ultimos pixeles mov ebx, w ; ebx <- w sub ebx, 16 ; ebx <- row_size - 16 jmp b_cicloColumna ; ENDWHILE b_termineCol: add esi,row_size ; src <- src + row_size dec ecx ; h-- jnz b_cicloFila ; ENDWHILE ;===================================================== ; CALCULO EL MINIMO ;===================================================== pshufd xmm4, xmm6, 01001110b ; xmm4 <- |lasts_8B(xmm6)|firsts_8B(xmm6)| MASK: 01 00 11 10b pminub xmm6, xmm4 ; xmm6 <- |min(lasts_8B(xmm6), firsts_8B(xmm6))|min(lasts_8B(xmm6), firsts_8B(xmm6))| pshufhw xmm4,xmm6, 01001110b ; xmm4 <- |lasts_4B(xmm6)|firsts_4B(xmm6)|lasts_8B(xmm6)| MASK: 01 00 11 10b pminub xmm6, xmm4 ; xmm6 <- |min(lasts_4B(xmm6), firsts_4B(xmm6))|min(lasts_4B(xmm6), firsts_4B(xmm6))|lasts_8B(xmm6)| pshufhw xmm4,xmm6, 10110001b ; xmm4 <- |word2(xmm6)|word3(xmm6)|word0(xmm6)|word1(xmm6)|lasts_8B(xmm6)| MASK: 10 11 00 01b pminub xmm6, xmm4 ; xmm6 <- |min_2B(xmm6)|min_2B(xmm6)|min_2B(xmm6)|min_2B(xmm6)|lasts_8B(xmm6)| movdqu xmm4, xmm6 psllq xmm4, 8 ; desfaso los dos bytes que me faltan comparar pminub xmm6, xmm4 ; xmm6 <- |min|........| psrldq xmm6, 3 ; xmm6 <- |0|0|0|min|..............| (byte packed) pshufd xmm6, xmm6, 11111111b ; xmm6 <- |min|min|min|min| MASK: 11 11 11 11b (double-word packed) cvtdq2ps xmm6, xmm6 ; xmm6 <- |min|min|min|min| (single floating-point packed) ;----------------------------------------------- ; xmm6 <- min (single floating-point packed) ;----------------------------------------------- ;===================================================== ; CALCULO EL MAXIMO ;===================================================== pshufd xmm4, xmm5, 01001110b ; xmm4 <- |lasts_8B(xmm6)|firsts_8B(xmm6)| MASK: 01 00 11 10b pmaxub xmm5, xmm4 ; xmm6 <- |max(lasts_8B(xmm6), firsts_8B(xmm6))|max(lasts_8B(xmm6), firsts_8B(xmm6))| pshufhw xmm4,xmm5, 01001110b ; xmm4 <- |lasts_4B(xmm6)|firsts_4B(xmm6)|lasts_8B(xmm6)| MASK: 01 00 11 10b pmaxub xmm5, xmm4 ; xmm6 <- |max(lasts_4B(xmm6), firsts_4B(xmm6))|max(lasts_4B(xmm6), firsts_4B(xmm6))|lasts_8B(xmm6)| pshufhw xmm4,xmm5, 10110001b ; xmm4 <- |word2(xmm6)|word3(xmm6)|word0(xmm6)|word1(xmm6)|lasts_8B(xmm6)| MASK: 10 11 00 01b pmaxub xmm5, xmm4 ; xmm6 <- |max_2B(xmm6)|max_2B(xmm6)|max_2B(xmm6)|max_2B(xmm6)|lasts_8B(xmm6)| movdqu xmm4, xmm5 psllq xmm5, 8 ; desfaso los dos bytes que me faltan comparar pmaxub xmm5, xmm4 ; xmm6 <- |max|........| psrldq xmm5, 3 ; xmm5 <- |0|0|0|max|..............| (byte packed) pshufd xmm5, xmm5, 11111111b ; xmm5 <- |max|max|max|max| MASK: 11 11 11 11b (double-word packed) cvtdq2ps xmm5, xmm5 ; xmm5 <- |max|max|max|max| (single floating-point packed) ;--------------------------------------------- ; xmm5 <- max (single floating-point packed) ;--------------------------------------------- ;===================================================== ; CALCULA LA CONSTANTE DE NORMALIZACION ;===================================================== subps xmm5, xmm6 ; xmm5 <- max-min (single fp packed) mov ecx, 255 ; ecx <- 255 cvtsi2ss xmm4, ecx ; xmm4 <- 255 (scalar) pshufd xmm4, xmm4, 0 ; xmm5 <- |255|255|255|255| MASK: 00 00 00 00b (single fp packed) divps xmm4, xmm5 ; xmm4 <- |K|K|K|K| con K=255*(max-min) ;===================================================== ; ESCRIBO EN LA MATRIZ ;===================================================== mov esi, src ; esi <- *src mov edi, dst ; edi <- dst mov ecx, h ; ecx <- h ;---------------------------------- ; esi <- *src ; edi <- dst ; ecx <- h ; ebx <- #columnas_procesada ;---------------------------------- cicloFila: ; WHILE(h!=0) DO xor ebx,ebx ; #columnas_p <- 0 cicloColumna: ; WHILE(#columnas_p < row_size) DO ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ; INSERTE SU CODIGO PARA ITERAR AQUI! ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX movdqu xmm7, [esi+ebx] ; xmm7 <- *src (16px) ;----------------------------- ; ultimos 8 bytes ;---------------------------- movdqu xmm5, xmm7 ; xmm5 <- *src (16px) punpckhbw xmm5, xmm3 ; xmm5 <- |src[8..15]| (word-packed) movdqu xmm2, xmm5 ; xmm2 <- |src[8..15]| (word-packed) ; prepara y procesa los ultimos 4 bytes punpckhwd xmm5, xmm3 ; xmm5 <- |src[12..15]| (doubleword-packed) cvtdq2ps xmm5, xmm5 ; xmm5 <- |src[12..15]| (single fp packed) subps xmm5, xmm6 ; xmm5 <- |src[12..15]-min| (single fp packed) mulps xmm5, xmm4 ; xmm5 <- |k*(src[12..15]-min)| (single fp packed) <- src[12..15] PROCESADO ; prepara y procesa los primeros 4 bytes punpcklwd xmm2, xmm3 ; xmm2 <- |src[8..11]| (doubleword-packed) cvtdq2ps xmm2, xmm2 ; xmm2 <- |src[8..11]| (single fp packed) subps xmm2, xmm6 ; xmm2 <- |src[8..11]-min| (single fp packed) mulps xmm2, xmm4 ; xmm2 <- |k*(src[8..11]-min)| (single fp packed) <- src[8..11] PROCESADO cvtps2dq xmm5, xmm5 ; xmm5 <- src[12..15] procesado (double-word packed) cvtps2dq xmm2, xmm2 ; xmm2 <- src[8..11] procesado (double-word packed) packssdw xmm2, xmm5 ; xmm2 <- src[8..15] procesado (word packed) <- src[8..15] PROCESADO ; xmm2 <- src[8..15] PROCESADO (word packed) ;----------------------------- ; primeros 8 bytes ;---------------------------- movdqu xmm5, xmm7 ; xmm5 <- *src (16px) punpcklbw xmm5, xmm3 ; xmm5 <- |src[0..7]| (word-packed) movdqu xmm1, xmm5 ; xmm1 <- |src[0..7]| (word-packed) ; prepara y procesa los ultimos 4 bytes punpckhwd xmm5, xmm3 ; xmm5 <- |src[4..7]| (doubleword-packed) cvtdq2ps xmm5, xmm5 ; xmm5 <- |src[4..7]| (single fp packed) subps xmm5, xmm6 ; xmm5 <- |src[4..7]-min| (single fp packed) mulps xmm5, xmm4 ; xmm5 <- |k*(src[4..7]-min)| (single fp packed) <- src[4..7] PROCESADO ; prepara y procesa los primeros 4 bytes punpcklwd xmm1, xmm3 ; xmm1 <- |src[0..3]| (doubleword-packed) cvtdq2ps xmm1, xmm1 ; xmm1 <- |src[0..3]| (single fp packed) subps xmm1, xmm6 ; xmm1 <- |src[0..3]-min| (single fp packed) mulps xmm1, xmm4 ; xmm1 <- |k*(src[0..3]-min)| (single fp packed) <- src[0..3] PROCESADO cvtps2dq xmm5, xmm5 ; xmm5 <- src[4..7] procesado (double-word packed) cvtps2dq xmm1, xmm1 ; xmm1 <- src[0..3] procesado (double-word packed) packssdw xmm1, xmm5 ; xmm2 <- src[0..7] procesado (word packed) <- src[0..7] PROCESADO packuswb xmm1, xmm2 ; xmm1 <- src[0..15] procesado (byte packed) movdqu [edi+ebx], xmm1 ; dst <- (src-min)*255/(min-max) ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX add ebx ,16 ; #columnas_p <- #columnas_p + 16 mov eax, w ; eax <- w sub eax, ebx ; eax <- w - #columnas_p cmp eax, 16 ; IF (w - #columnas_p) < 16 jge cicloColumna ; CONTINUE cmp eax,0 ; IF (w - #columnas_p) je termineCol ; BREAK ;ultimos pixeles mov ebx, w ; ebx <- w sub ebx, 16 ; ebx <- row_size - 16 jmp cicloColumna ; ENDWHILE termineCol: add esi,row_size ; src <- src + row_size add edi,row_size ; dst <- dst + row_size dec ecx ; h-- jnz cicloFila ; ENDWHILE convencion_c_out 0 ret
022011-tp-o2
trunk/tp2-entregable/src/normalizar_asm.asm
Assembly
gpl3
12,410
#ifndef __FILTROS__H__ #define __FILTROS__H__ void invertir_c (unsigned char *src, unsigned char *dst, int m, int n, int row_size); void monocromatizar_inf_c(unsigned char *src, unsigned char *dst, int h, int w, int src_row_size, int dst_row_size); void monocromatizar_uno_c(unsigned char *src, unsigned char *dst, int h, int w, int src_row_size, int dst_row_size); void normalizar_c (unsigned char *src, unsigned char *dst, int m, int n, int row_size); void separar_canales_c (unsigned char *src, unsigned char *dst_r, unsigned char *dst_g, unsigned char *dst_b, int m, int n, int src_row_size, int dst_row_size); void suavizar_c (unsigned char *src, unsigned char *dst, int m, int n, int row_size); void umbralizar_c (unsigned char *src, unsigned char *dst, int m, int n, int row_size, unsigned char umbral_min, unsigned char umbral_max); void invertir_asm (unsigned char *src, unsigned char *dst, int m, int n, int row_size); void monocromatizar_inf_asm(unsigned char *src, unsigned char *dst, int h, int w, int src_row_size, int dst_row_size); void monocromatizar_uno_asm(unsigned char *src, unsigned char *dst, int h, int w, int src_row_size, int dst_row_size); void normalizar_asm (unsigned char *src, unsigned char *dst, int m, int n, int row_size); void separar_canales_asm (unsigned char *src, unsigned char *dst_r, unsigned char *dst_g, unsigned char *dst_b, int m, int n, int src_row_size, int dst_row_size); void suavizar_asm (unsigned char *src, unsigned char *dst, int m, int n, int row_size); void umbralizar_asm (unsigned char *src, unsigned char *dst, int m, int n, int row_size, unsigned char umbral_min, unsigned char umbral_max); #endif /* !__FILTROS__H__ */
022011-tp-o2
trunk/tp2-entregable/src/filtros.h
C
gpl3
1,682
\subsection{Invertir} En este filtro, dada una im'agen en escala de grises, debemos calcular la resta entre el valor m'aximo de un p'ixel y el valor de la imagen, es decir, calcular la resta entre 255 y el p'ixel dado. La implementaci'on en \C\ es mas que trivial, ademas del ciclo ya explicado (con su correspondiente procesamiento lineal de a byte), es solo una resta lo que realiza la funci'on. Por otra parte en \ass\ lo primero que realizamos es cargar un registro con el valor 255 en cada byte. Para esto usando cualquier registro aplicamos la instrucci'on \textit{pcmpeqb} contra si mismo, dejando todos bits en uno, con lo cual el registro queda completo del valor deseado. Luego realizamos la resta entera saturada \textit{psubb} (aunqe podria ser tambien la no saturada), asi de esta manera obtenemos los valores procesados.
022011-tp-o2
trunk/tp2-entregable/informe/src/invertir.tex
TeX
gpl3
837
\subsection{Monocromatizar} \subsubsection{Monocromatizar \protect{$\epsilon = 1$} } El objetivo de la funcion monocromatizar es convertir una imagen color a escala de grises. En la implementaci'on en \C\ la imagen se recorre linealmente como una matriz, p'ixel a p'ixel, accediendo a los valores de cada componente de color para realizar el siguiente c'alculo: \textbf{(R+2*G+B)/4}, siendo el resultado lo que se almacena en la imagen destino. La idea en \ass es similar solo que, aprovechando la capacidad de almacenamiento de los registros de 128 bits y teniendo en cuenta que en cada uno de estos registros entran 16 bytes, podemos procesar de hasta 5 p'ixeles por cada lectura de memoria, en lugar de avanzar de a uno. En importante destacar que, como dijimos en la secci'on \ref{sec:ciclos-color}, inicialmente cuando leemos en memoria la imagen fuente, tambi'en cargamos un tercio del sexto p'ixel sin embargo esta informaci'on se descarta. Lo primero que hacemos, es triplicar lo leido en memoria y aplicar desplazamientos a derecha con el fin de queden alineados los registros para una posterior suma. La figura \ref{est:m-dos} muestra como quedan los registros despu'es de dichos desplazamientos. En este momento, por ejemplo, en el byte menos significativo de cada registro tenemos el valor de color del primero p'ixel. Los valores del siguiente p'ixel se encuentran en la cuarta posici'on, y asi sucesivamente se pueden identificar cuales son los bytes que contienen los valores alineados. \begin{figure}[h!] \xmmW{carga}{B_5R_4 & G_4\textbf{B_4} & R_3G_3 & \textbf{B_3}R_2 & G_2\textbf{B_2} & R_1G_1 & \textbf{B_1}R_0 & G_0\textbf{B_0}} \xmmW{desplazamiento_1}{ 00B_5&R_4\textbf{G_4} & B_4R_3 & \textbf{G_3}B_3 & R_2\textbf{G_2} & B_2R_1 & \textbf{G_1}B_1 & R_0\textbf{G_0}} \xmmW{desplazamiento_2}{ 0000 & B_5\textbf{R_4} & G_4B_4 & \textbf{R_3}G_3 & B_3\textbf{R_2} & G_2B_2 & \textbf{R_1}G_1 & B_1\textbf{R_0}} %\xmmD{texto}{0G_2 0B_2 & R_1G_1 & B_1R_0 & G_0B_0} \caption{como se corren los datos de manera favorable} \label{est:m-dos} \end{figure} Es claro de observar que no es posible hacer el c'alculo anteriormente descripto sin antes desempaquetar los datos, ya que de lo contrario se perderia podria saturar alguna suma. No obstante, tambi'en es claro que el resultado deberia poder ser expresado en byte. Es importante destacar que no utilizamos punto flotante ya que nuestra estrategia fue primero realizar las sumas y las multiplicaciones y por ultimo aplicar la divisi'on. Es por esto que podemos trabajar con enteros sin perder precisi'on. Por cada uno de los registros mencionados anteriormente, desempaquetamos a words tomando como segundo operando un registro de 128 bits con ceros, y los dividimos en partes bajas y altas, como muestra la figura \ref{est:m-tres}. Luego multiplicamos el segundo registro (el que contiene los valores correspondientes al verde), luego sumamos todas las partes altas entre si y las partes bajas entre si, y por 'ultimo dividimos los resultados por cuatro. \begin{figure}[h!] \xmmW{parte baja}{ 0G_2 & 0\textbf{B_2} & 0R_1 & 0G_1 & 0\textbf{B_1} & 0R_0 & 0G_0 & 0\textbf{B_0}} \xmmW{parte alta}{ 0B_5 & 0R_4 & 0G_4 & 0\textbf{B_4} & 0R_3 & 0G_3 & 0\textbf{B_3} & 0R_2} \caption{desempaquetado del registro base} \label{est:m-tres} \end{figure} Para multiplicar y dividir usamos las instrucciones \textit{psrlw} y \textit{psllw} para realizar un desplazamiento de bits a derecha e izquierda respectivamente en cada word del registro, pues el multiplicando y el divisor son potencias de dos. Una vez realizados los c'alculos necesarios notemos que tenemos los resultados en dos registros separados con lo cual debemos proceder a unirlos para luego copiarlos. El proceso para unirlos consiste en dos partes, una es aplicar una m'ascara para generar ceros en las posiciones que tengo basura en los dos registros, y luego combinarlos realizando un \textit{pand}. De esta manera me quedan los datos necesarios separados por ceros (figura\ref{est:m-cuatro}). \begin{figure}[h!] \xmmW{datos1}{ 00 & c_2 & 00 & 00 & c_1 & 00 & 00 & c_0} \xmmW{datos2}{ 00 & 00 & 00 & c_4 & 00 & 00 & c_3 & 00} \xmmW{datos combinados}{ 00 & c_2 & 00 & c_4 & c_1 & 00 & c_3 & c_0} \caption{filtrado y combinaci'on usando m'ascaras \sc{\scriptsize 00FF0000FF0000FF} y \sc{\scriptsize FF0000FF0000FF00}} \label{est:m-cuatro} \end{figure} Una vez que los resultados quedaron combinados en un 'unico registro utilizamos instrucciones que provee la arquitectura para intercambiar datos dentro de un registro (similar a lo realizado en \textbf{separar canales}) con el fin de colocarlos de manera contigua y luego empaquetar. Si bien estas instrucciones pueden afectar la performance son realmente 'utiles e indispensables para obtener la funcionalidad deseada. Una vez empaquetado nuevamente a bytes, copiamos el \textit{double word} menos significativo a memoria y con eso cubrimos los primeros 4 p'ixeles procesados. Luego hacemos un corrimiento del registro a fin que el 'ultimo dato procesado quede en la posci'on menos significativa. Aqui nuevamente nos vemos obligados a usar un registro de prop'osito general para copiar el 'ultimo byte a memoria. \subsubsection{Monocromatizar \protect{$\epsilon = \infty $} } Esta funcion es bastante similar a la anterior. La implementaci'on en \C\ es identica a la anterior solo que esta vez en lugar de combinar los valores de color, debemos quedarnos con el m'aximo. El procedimiento para la implentaci'on en \ass\ es similar cuando $\epsilon= 1$, al menos la primera parte cuando triplicamos los registros y los desplazamos adecuadamente para alinear los valores de color. Es interesante notar que contamos con una ventaja con respecto al caso anterior ya que no necesitamos desempaquetar pues el set de instrucciones cuenta con una funcion (\textit{pmaxub}) que calcula en m'aximo byte a byte entre dos registros SSE. Esto no solo facilita el desarrollo sino que adem'as incrementa la performance con respecto al otro monocromatizar, ya que nos ahorramos la conversi'on de empaquetados. El resultado despues de calcular el m'aximo entre las tres copias del registro puede observarse en la figura \ref{est:m-seis}. \begin{figure}[h!] \xmmW{pmaxub}{xxxx & xxm_4 & xx & m_3xx & xxm_2 & xx & m_1xx & xxm_0} \caption{registro una vez calculado los valores m'aximos para cada p'ixel} \label{est:m-seis} \end{figure} Una vez obtenidos los m'aximos de cada p'ixel(solo nos interesan 5 de ellos), debemos reubicarlos para que queden de manera contigua. Para esto utilizamos la misma estrategia que en separar canales. Duplicamos el registro y realizamos un corrimiento de un byte a izquierda en cada \textit{word} para obtener ceros a la izquierda de cada una de las partes bajas de cada \textit{word}. En la otra copia hacemos un corrimiento a derecha y luego a izquierda separando esta vez los valores que fueron perdidos en la operaci'on del otro registro (figura \ref{est:m-siete}). \begin{figure}[h!] \xmmW{corrimiento byte a izq}{xx00& m_400 & xx00 & xx00 & m_200 & xx00 & xx00 & m_000 } \xmmW{corrimiento byte a der}{m_500 & xx00 & xx00 & m_300 & xx00 & xx00 & m_100 & xx00 } \caption{corrimientos para generar ceros} \label{est:m-siete} \end{figure} Una vez logrado esto debemos combinar los resultados en un 'unico registro, para ello utilizamos m'ascaras como lo hicimos en $\epsilon= 1$ para colocar ceros, y luego realizamos un \textit{por} para unirlos, como muestra la figura \ref{est:m-ocho}. \begin{figure}[h!] \xmmW{datos1}{0000& m_400 & 0000 & 0000 & m_200 & 0000 & 0000 & m_000 } \xmmW{datos2}{m_500 & 0000 & 0000 & m_300 & 0000 & 0000 & m_100 & 0000 } \xmmW{datos combinados}{m5_00& m_400 & 0000 & m_300 & m_200 &0000 & m_100 & m_000 } \caption{filtrado y combinaci'on usando m'ascaras \sc{\scriptsize 00FF0000FF0000FF} y \sc{\scriptsize FF0000FF0000FF00}} \label{est:m-ocho} \end{figure} Nuevamente ordenamos los contenidos de los registros utilizando las instrucciones de intercambio de words y double words, empaquetamos y de forma an'aloga a otro monocromatizar, realizamos el proceso de copiado a la imagen destino.
022011-tp-o2
trunk/tp2-entregable/informe/src/monocromatizar.tex
TeX
gpl3
8,148
\subsection{Suavizado Gaussiano} El objetivo de este filtro es obtener una imagen resultante con reducci'on de ruido y difuminaci'on. Para ello debemos procesar cada p'ixel utilizando la informaci'on de sus aleda'nos. La idea es calcluar un tipo de promedio ponderado de los valores del punto que estoy analizando con sus nueve vecinos inmediatos. En la figura \ref{tab:s-uno} podemos ver los coeficientes de multiplicaci'on de los p'ixeles. \begin{figure}[h!] \begin{center} \begin{tabular}{| c | c | c |} \hline 1/16 & 2/16 & 1/16 \\ \hline 2/16 & 4/16 & 2/16 \\ \hline 1/16 & 2/16 & 1/16 \\ \hline \end{tabular} \end{center} \caption{Promedio ponderado del entorno} \label{tab:s-uno} \end{figure} Con lo cual el p'ixel resultante sera el p'ixel que se encuentra en el centro del entorno, y el mismo tendra el siguiente valor: \\ $$ \begin{array}{rl} I_{out}(i,j) =& I_{in}(i-1,j-1) \cdot{} 1/16 + I_{in}(i-1,j) \cdot{} 2/16 + I_{in}(i-1,j+1) \cdot{} 1/16 +\\ & I_{in}(i+0,j-1) \cdot{} 2/16 + I_{in}(i+0,j) \cdot{} 4/16 + I_{in}(i+0,j+1) \cdot{} 2/16 +\\ & I_{in}(i+1,j-1) \cdot{} 1/16 + I_{in}(i+1,j) \cdot{} 2/16 + I_{in}(i+1,j+1) \cdot{} 1/16 \end{array} $$ \\ Aca tambi'en la implementaci'on en C es trivial teniendo la formula mencionada anteriormente. B'asicamente nos valemos de que acceder a las posiciones de la matriz en \C\ es inmediato y directo. Es decir que en cualquier momento podemos acceder a cualquier posicion de la matriz con los 'indices correspondientes. Por el lado de la implementacion en \ass\ vuelve a ser mas compleja. Al ver que cada p'ixel deb'ia ser la suma de su entorno ponderado, decidimos dividir en 3 partes el algoritmo para tratar cada una de las lineas de la matriz resultante. Comenzamos el algoritmo realizando una lectura de 16 bytes, luego realizamos una segunda y tercer lectura sucesiva(para guarda informaci'on del entorno) desplazando el puntero base en uno y dos bytes respectivamente. La figura \ref{est:s-dos} muestra esas lecturas. El objetivo aca nuevamente es que queden alineados los datos que necesito sumar. \newcolumntype{C}{>{\footnotesize\centering}p{22pt}} \begin{figure}[h!] \xmmW{paso 1.}{a_{15}a_{14} & a_{13}a_{12} & a_{11}a_{10} & a_9a_8 & a_7a_6 & a_5a_4 & a_3a_2 & a_1a_0} \xmmW{paso 2.}{a_{16}a_{15} & a_{14}a_{13} & a_{12}a_{11} & a_{10}a_9 & a_8a_7 & a_6a_5 & a_4a_3 & a_2a_1} \xmmW{paso 3.}{a_{17}a_{16} & a_{15}a_{14} & a_{13}a_{12} & a_{11}a_{10} & a_9a_8 & a_7a_6 & a_5a_4 & a_3a_2} \caption{Levantado de datos de la primer linea} \label{est:s-dos} \end{figure} \newcolumntype{C}{>{\footnotesize\centering}p{18pt}} Luego desempaquetamos los datos para operar como words, obteniendo asi dos registros por cada uno de los anteriores, uno para la parte baja y otro para la alta. Es importante destacar que los desempaquetamientos siempre los hacemos con registros que tienen todo ceros, de esta manera el valor que nos interesa se ve inalterado. Luego se utiliza la operaci'on \textit{psllw} para realizar un desplazamiento empaquetado de a words de un bit (que ser'ia equivalente a multiplicar por 2) en los registros de la segunda lectura y sumamos las partes bajas guard'andolas en los acumuladores. Ya procesada la primer linea del entorno procedemos a la segunda. Sumamos a nuestro 'indice el ancho de la im'agen (contemplando el \textit{padding}) para pararnos en la segunda fila de la matriz, realizamos nuevamente tres lecturas desplazadas, desempaquetamos y multiplicamos los registros por sus correspondientes valores. En este caso 4 para el centro y 2 para los extremos. Aca nuevamente utilizamos instrucciones de desplazamiento para la multiplicaci'on. Una vez procesada la parte alta y baja de la segunda linea, la acumulamos con los resultados de la primera. Por 'ultimo pasamos a la tercer linea de la misma manera que la anterior, y realizamos el mismo procedimiento: tres lecturas desfazadas, desempaquetamos, multiplicamos, y acumulamos los valores correspondientes a la parte alta y parte baja. En este punto s'olo nos queda dividirlos por 16. Lo realizamos nuevamente con una operaci'on de desplazamiento de bits. Ahora solo nos queda empaquetar los datos con saturaci'on y escribirlos en la imagen destino. Es importante notar que en este algoritmo utilizamos muchos registros debido a las lecturas desplazadas. En cierto punto no tuvimos mas registros libres por lo que tuvimos que utilizar una variable local de 16 bytes para guardar uno de los acumuladores. Que como trabajo a futuro ver si es posible realizar una implementaci'on que no utilice esa memoria auxiliar, ni que realice tantos accesos a memoria. Probablemente utilizando la misma estrategia aqui descripta pero procesando de a menos datos, es decir utilizando solamente las informaci'on que obtenemos con una sola lectura y no con tres desfazadas. \subsubsection*{Iterando la imagen} Primero tuvimos que tener en cuenta ciertas limitaciones en la el c'alculo de los p'ixeles que nos impon'ia el procedimiento, ya que al utilizar un entorno de 3x3 para calcular el p'ixel del centro, en los bordes no es posible calcularlo. Es por esto que nuestro algoritmo recorre todo menos los bordes de la imagen de entrada. Por otro lado, en ciclo se leen mas de 16 p'ixeles, a diferencia de los otros algoritmos, ya que al realizar 3 lecturas moviendose de a 1 p'ixel se estan levantando 18 y se procesan solo 15. Entonces debemos asegurarnos de siempre tener esos 18 p'ixeles delante nuestro. Si no los tenemos debemos realizar el reajuste para procesar los 'ultimos p'ixeles.
022011-tp-o2
trunk/tp2-entregable/informe/src/suavizar.tex
TeX
gpl3
5,563
\section{Conclusiones} \label{sec:conclusiones} \begin{itemize} \item En todos los filtros y las im'agenes que procesamos la tecnolog'ia \textit{SSE} supera ampliamente la implementaci'on en \C \ en t'erminos de \textit{performance}, a'un en los casos borde. Sin embargo tambi'en ese ahorro tiempo de ejecuci'on se ve traducido en un esfuerzo mucho mayor en la etapa de desarrollo de los filtros. Mientras que cada algoritmo se resolv'ia en \C\ en minutos, la implementaci'on en \ass\ llevaba varias horas y tal vez dias. Es cierto que esto se debe que no estabamos acostumbrados a trabajar con dicha tecnolog'ia, sin embargo no solo el desarrollo fue lento sino tambien fue tedioso y a veces encontramos muchas dificultades a la hora de encontrar errores. Inmaginamos que en ciertos casos tal es la diferencia de \textit{performance} es determinante y por ende es redituable el costo extra de la implementaci'on,\textit{debugging} y adaptaci'on al lenguaje ensamblador. \item Nuestra conjetura inicial era que la implementaci'on en C deberia ser alrededor de 16 veces mas lenta que la de \ass. Nunca inmaginamos que pudiera ser tan grande la diferencia, tal vez sobreestimamos lo que el compilador de C hace a la hora de compilar. Tal vez utilizando opciones de optimizaci'on nos hubiesemos acercado mas a esa realci'on te'orica. \item La distribuci'on de p'ixeles dentro de una im'agen puede llegar a ser un factor a tener en cuenta para cuando se aplica la versi'on optimizada. Por el contrario, las implentaciones en \C\ se comportaron de manera estable a lo largo de todos los experimentos. \item La manera de recorrer las im'agenes en determinados tipos de filtro pudieron reutilizarse como es el caso de las funciones que van de color a escala de grises, an'alogamente lo mismo ocurre con las im'agenes en blanco y negro. \item Siempre hay un menor porcentaje de penalizaci'on en los filtros que realizan m'as operaciones y accesos a memoria ya que no hay tanta diferencia entre reprocesar datos y las operaciones intermedias en cada iteraci'on de un ciclo. \item Seguramente no estamos contemplando cierta informacion, pues si bien los resultados en general daban como esperabamos a veces las diferencias son mas grandes o mas peque'nas de lo que esperabamos o podemos justificar con los elementos que contamos. Creemos que un an'alisis mas profundo, en conjunto con otros experimentos que individualicen otros aspectos del procesador podrian echar mas luz sobre los misterios de la optimizaci'on de bajo nivel. \item El set de instrucciones de la verion 2 fue m'as que suficiente para realizar las tareas pedidas. \item Compartivamente, el desarrollo en \ass \ fue la actvidad que m'as tiempo abarc'o, con respecto al desarrollo de este informe, mediciones y el desarrollo en \C. \item Los casos de prueba seleccionados ayudaron a probar nuestras conjeturas iniciales y experimentalmente pudimos corroborar que la selecci'on fue correcta. \item Hubieron experimentos que no pudimos realizar por limitaciones de tiempo pero que nos hubiesen gustado ver, entre ellos: alinear la memoria a 16 bytes para utilizar la instruccion de movimiento alineado y ver las diferencias de \textit{performance}, realizar mediciones contra los filtros en \C \ usando las opciones de optimizaci'on del compilador e implementar cada filtro en \ass \ sin utilizar tecnolog'ia \textit{SSE}. \end{itemize}
022011-tp-o2
trunk/tp2-entregable/informe/src/conclusiones.tex
TeX
gpl3
3,406
\subsection{Umbralizar} Este filtro proproduce im'agenes con solamente tres colores (blanco, gris y negro), dependiendo del valor que tenga cada p'ixel. El procesamiento de cada p'ixel esta definido por la siguiente funci'on: $$I_{out}(p) = \left\{\begin{array}{lcc} 0 & \text{si } p \leq umbralMin\\ 128 & \text{si } umbralMin < p \leq umbralMax \\ 255 & \text{si } p > umbralMax \end{array} \right. $$ La implementaci'on en \C\ es nuevamente trival. Recorremos, como siempre en estos casos, secuencialmente de a un byte mientras que el procesamiento de cada p'ixel se reduce a dos comparaciones para elegir el valor correcto del resultado. En cambio, para la implementaci'on en \ass\ procesaremos de a 16 bytes, y no tendremos que desempaquetar los valores tenemos varios pasos. Primero vimos que para realizar las comparaciones era necesario tener los umbrales empaquetados(de a bytes) en los registros de 128 bits. Para esto cargamos los valores que recibimos como par'ametro de entrada en un registro de proposito general. Luego realizamos desplazamientos de a de 8 bits a la izquierda y sucesivas sumas del valor hasta que conseguimos un doble \textit{word} lleno. Despues movemos a dos registros de 128 bits el registro de prop'osito general con el umbral m'inimo y m'aximo y utilizamos la instruccion de intercambio \textit{shufle} de double words para replicar el valor a lo largo de todo el registro SSE. Por otro lado tambi'en necesitabamos un registro que contenga el n'umero 128, que representa el gris en la im'agen. Para obtenerlo realizamos el mismo procedimiento que hicimos con los valores m'inimos y m'aximos, solo que el valor inicial lo obtenemos a aprtir de la constante 8080h\footnote{el valor 80h corresponde al valor 128 en decimal} . El resultado de este proceso se ve en la figura \ref{est:u-uno}. \begin{figure}[h!] \xmmW{umbral m'inimo}{Umin & Umin & Umin & Umin & Umin & Umin & Umin & Umin} \xmmW{umbral m'aximo}{Umax & Umax & Umax & Umax & Umax & Umax & Umax & Umax} \xmmW{gris}{128 & 128 & 128 & 128 & 128 & 128 & 128 & 128} \caption{constantes necesarias para el proceso del algoritmo} \label{est:u-uno} \end{figure} Una vez ya definidos los umbrales en los registros comenzamos a procesar los datos. Para saber cuales son los elementos que estan por sobre el umbral hacemos una resta saturada entre el registro que contiene el umbral m'aximo y los valores originales de la im'agen. De esta manera nos quedan ceros en los valores que eran mayores o iguales al m'aximo y valores distintos a cero en las otras posiciones. Entonces utilizamos la instrucci'on \textit{pcmpeqb} para armar una m'ascara a partir de la comparaci'on de este resultado contra un registro lleno de ceros, obteniendo por resultado Fh en las posiciones donde el valor original era mayor al umbral y ceros en las otras posiciones. Ahora realizo un procedimiento similar. Hacemos una resta saturada es entre el valor original y el valor m'inimo, dando por resultado un registro con ceros en los bytes que estan debajo del umbral m'inimo (nuevamente gracias a la saturacion). Luego, utilizando la instrucci'on \textit{pcmpeqb} contra un registro lleno de ceros, armamos otra m'ascara con Fh en los bytes que estan debajo del umbral m'inimo. Luego combinamos las dos m'ascaras con un \textit{por} y al resultado le aplicamos la instrucci'on \textit{pcmpeqb} con un registro con ceros. Esta 'ultima operacion es, en este caso, similar a una negacion bit a bit. Por lo que obtenemos Fh donde hab'ia antes ceros, es decir, en las posiciones donde se encuentran los valores medios de la imagen. Por 'ultimo, utilizamos esta 'ultima m'ascara junto con el registro que contiene la constante 128 para realizar un \textit{pand} y obtener como resultado un registro con los grises en sus posiciones correspondientes. Por 'ultimo solo queda colocar blancos en las posiciones donde la imagen es mayor al umbral. Recordamos que tenemos calculada una mascara con Fh en esas posiciones y ceros en las dem'as, por lo que un simple \textit{por} combinaria este registro el con registro con grises, obteniendo los bytes necesarios para escribirlos en la nueva imagen.
022011-tp-o2
trunk/tp2-entregable/informe/src/umbralizar.tex
TeX
gpl3
4,165
\renewcommand{\arraystretch}{1.3} \section{Mediciones} \label{sec:mediciones} Para realizar las mediciones utilizamos las herramientas provistas por la c'atedra para la medici'on de ciclos de \textit{clock}, utilizando una computadora con procesador Intel T2500 2.0GHz Core Duo. El objetivo ser'a medir los distintos algoritmos, comparando las distintas versiones para distintos tipos de imagenes de entrada. Para ello creamos un conjunto de \textit{scripts} de \textit{bash} que realizan las distintas mediciones que necesitamos. Los mismos se encuentran en la carpeta mediciones junto con una explicaci'on de como utilizarlo. \subsection{Estableciendo Criterios} Antes de comenzar tuvimos que tomar ciertas decisiones de c'omo ibamos a realizar dichas mediciones. El primer problema que encontramos al utilizar el reloj del procesador para medir es que nuestro proceso puede llegar a ser interrumpido por otros procesos o por el sistema operativo. Hemos tomado dos medidas al respecto, la primera es ejecutar las mediciones estableciendo m'axima la priodidad del proceso. Para ello Linux provee el comando \texttt{nice}, que ejecut'andolo como \textit{root}, permite decirle al sistema operativo que nuestras mediciones tienen prioridad sobre los otros programas en ejecuci'on. Mientras que la segunda medida fue realizar mil mediciones por cada prueba, promediando el resultado. El n'umero elegido aparece como una soluci'on de compromiso con el tiempo de ejecuci'on de las muestras. Otro factor a analizar fue que muestras seleccionamos para medir. Debido a la naturaleza de los algoritmos implementados, podemos ver facilmente que la complejidad esta relacionada directamente con el tama'no de la entrada. Es decir que las dos implementaciones de cada filtro se van a comportar diferente dependiendo del tama'no de la im'agen\footnote{Es importante aclarar que consideramos como tama'no de la imagen, la cantidad total de p'ixeles que esta tiene} y no del tipo de imagen a procesar. Por lo tanto podriamos tomar imagenes de distinto tama'no y comparar como se comportan los distintos filtros y las distintas implementaciones, observando las variaciones de \textit{clocks} con respecto a la cantidad de p'ixeles procesados. Sin embargo elegimos otro camino. Decidimos utilizar un tama'no fijo (dentro de los posibles) de p'ixeles y analizar el comportamiento de los algoritmos al variar la relaci'on entre la cantidad de filas y de columnas de la imagen. Para las mediciones base utilizamos una imagen de 800x600. Es decir que estamos trabajando con im'agenes de 480.000 p'ixeles (aprox. 0,5Mp). Luego tomamos distintas im'agenes reacomodando las filas y columnas, seg'un criterios que explicaremos en la siguiente secci'on. Sin embargo a veces no fue posible llegar a la misma cantidad exacta de p'ixeles. En estos casos elegimos combinaciones donde la diferencia sea m'inima y podemos asegurar que en ning'un caso la diferencia de tama'no supera un $0,1\%$ del total. \subsection{An'alisis de factores} Antes de decidir las combinaciones de filas y columnas, analizamos con que tipo de im'agenes nuestros algoritmos pod'ian llegar a comportarse una una manera especial. Como conjetura inicial establecimos que no deberia haber fluctuaciones en el las funciones desarrolladas en \C \ ya que el recorrido de la matriz es lineal y de a un elemento por vez, con lo cual las dimensiones no deber'ian ser un factor relevante. En cambio, para el caso de las funciones en \ass, podemos observar que su gran ventaja es que pueden procesar de a muchos datos. Sin embargo su desventaja es que si la imagen no es m'ultiplo de la cantidad de p'ixeles que procesa por iteracion, entonces se debe realizar un reajuste (ver secci'on \ref{sec:algoritmos}), con el objetivo de procesar los 'ultimos p'ixeles de la fila. Entonces, para elegir exactamente las combinaciones de filas/columnas tenemos que diferenciar dos tipos de filtros: Los que toman como par'ametro de entrada im'agenes a color (monocromatizar, separar canales) y los que toman im'agenes en blanco y negro (umbralizar, invertir, normalizar, suavizar). Para los que toman imagen blanco y negro, los algoritmos procesan de a 16 p'ixeles por vez, con lo cual si el ancho es multiplo de 16, el algoritmo realizar'ia una cantidad justa de lecturas en memoria (\textit{caso favorable}). Por el contrario, cuando la anchura no es multiplo de 5 el algoritmo debe realizar una lectura extra al final de cada fila para procesar los bytes restantes(\textit{caso desfavorable}). Es posible que esta lectura extra se haga solo para procesar un p'ixel. Es decir que estariamos recalculando 15 bytes para procesar solo uno. Esta penalizaci'on se ver'ia acrecentada conforme aumenta la cantidad de filas. En cambio, los algoritmos que procesan im'agenes a color avanzan de a cinco p'ixeles. Por lo que podemos aplicar el mismo razonamiento que para los algoritmos en blanco y negro modificando el factor de multiplicidad a 5. Cabe destacar que el filtro suavizar debido a su naturaleza procesa de a 15 p'ixeles, por lo que el caso favorable se calcula como un m'ultiplo de 15 sum'andole dos p'ixeles m'as correspondiente a los bordes que no se procesan. \subsection{Eleccion de im'agenes} Como primera medida, realizamos mediciones con una im'agen de 800x600, para poder establecer un punto de comparaci'on para las otras im'agenes de entrada. Luego, teniendo en cuenta lo descripto en la secci'on anterior, elegimos tama'nos de im'agenes que provoquen casos favorables y casos desfavorables, para poder compararlos. Para el segundo grupo de mediciones elegimos para los algoritmos en blanco y negro im'agenes de 16 y 17 p'ixeles de ancho para los casos favorable y desfavorable respectivamente. Estos valores son los anchos m'as peque'nos que producen los casos que buscamos. Por el contrario, para los algoritmos a color elegimos anchos de 10 y 11 p'ixeles. Para el filtro suavizar elegimos los anchos 17 y 18 p'ixeles. Es de esperar que en este conjunto de mediciones la penalizaci'on del \ass \ se vea exagerada. Luego realizamos otro conjunto de mediciones con imagenes mas anchas. Intentando, a priori, diluir las penalizaciones cuando las haya. En este punto encontramos un imprevisto. La librer'ia openCV genera un error al intentar abrir im'agenes mas anchas que 1453 p'ixeles. Es por eso que elegimos un ancho lo mas cercano a ese valor y que fuera m'ultiplo de 16 y de 5, de esta manera nos servir'ia como caso favorable tanto para los algoritmos a color como los de blanco y negro. El ancho elegido fue 1440, ya que cumple las condiciones anteriores. Por otra parte elegimos como ancho para los casos desfavorables el valor 1441. Para el filtro suavizar elegimos los anchos 1442 y 1443 p'ixeles. \subsection{Experimentos} \subsubsection{Caso base} En este experimento se miden todos los filtros en ambas implementaciones en una imagen de 800x600 p'ixeles. En el cuadro \ref{tab:base} podemos observar los siguientes 'indices: \begin{itemize} \item \textbf{ciclos}: ciclos de reloj consumidos por cada implementaci'on. \item \textbf{diferencia de ciclos}: modulo de la diferencia entre ciclos de reloj en \C \ y en \ass. \item \textbf{porcentaje de mejora}: porcentaje de eficiencia de un implementaci'on con respecto a la otra. \end{itemize} En el cuadro podemos ver que en todos los filtros la implementaci'on en \ass \ consume menos ciclos de reloj, un resultado que esta dentro de lo esperado, sin embargo llama la atenci'on lo significativa que es esta diferencia. Por ejemplo en el filtro invertir, que es el que menos instrucciones realiza, obtuvimos un porcentaje de mejora superior al 96$\%$. El caso del filtro que menos porcentaje de mejora tuvo fue monocromatizar\_uno, que no obstante, obtuvo una mejora superior al 50$\%$. Si bien suponiamos que podia haber una diferencia en la eficiencia no sabiamos que seria tan marcada, lo cual es muy positivo, ya que significa que dio r'editos implementar en un lenguaje de m'as bajo nivel y mayor dificultad a cambio de un mejor rendimiento, siempre utilizando la tecnolog'ia \textit{SSE}. \begin{table}[h!] \begin{center} \begin{tabular}{|c|c|c|c|c|c|} \hline \sc{funci'on} & \sc{\# pixels }& \sc{ciclos C }& \sc{ciclos ASM }& \sc{$\Delta$ ciclos }& \sc{\% mejora}\\ \hline invertir & 800x600 & 7.317.170 & 287.367 & 7.029.803 & 96,07\%\\ normalizar & 800x600 & 23.331.351 & 1.539.564 & 21.791.786 & 93,40\%\\ umbralizar & 800x600 & 13.538.943 & 540.008 & 12.998.935 & 96,01\%\\ suavizar & 800x600 & 32.483.342 & 3.968.673 & 28.514.669 & 87,78\%\\ monocromatizar\_uno & 800x600 & 17.332.554 & 5.513.335 & 11.819.219 & 68,19\%\\ monocromatizar\_inf & 800x600 & 18.555.484 & 4.468.378 & 14.087.106 & 75,92\%\\ separar\_canales & 800x600 & 20.421.239 & 6.219.616 & 14.201.623 & 69,54\%\\ \hline \end{tabular} \caption{Resultados caso base} \label{tab:base} \end{center} \end{table} \subsubsection{Imagenes altas} En este experimento comparamos todos los filtros para im'agenes mas altas que anchas. Utilizando medidas especiales para cada caso, como explicamos anteriormente. En este experimento introdujimos un nuevo 'indice denominado \textbf{penalizaci'on}. El mismo compara la implementaci'on en \ass, para un \textit{input} favorable y un desfavorable. B'asicamente se calcula como la diferencia de ciclos de esto dos casos expresada en porcentaje, tomando como base la cantidad de ciclos del caso favorable. En el cuadro \ref{tab:base} podemos observar los resultados para los filtros que toman im'agenes en escala de grises. En ella podemos ver una gran mejora de \ass \ con respecto a \C \ tanto en la imagen de 16x30000 como en la de 17x28234. Con esto concluimos que a'un en un caso no favorable este sigue siendo m'as eficiente. Sin embargo, podemos ver tambien que en los casos no favorables, la implementaci'on en \ass \ demora mucho mas que en los favorables. Es notable tambi'en el monstruoso porcentaje de penalizaci'on (340\%, 165\% y 234\%, para invertir, normalizar y umbralizar respectivamente), confirmando nuestras conjeturas sobre los casos favorables y desfavorables. Puntualmente esperabamos una penalizaci'on de alrededor del doble, pero en la mayor'ia de casos fue m'as. Creemos que se debe, de alguna manera, a la complejidad del filtro, es decir a la cantidad de ciclos que toma el procesamiento de una iteraci'on. Por ejemplo, invertir que es por lejos la funcion mas simple de todas, el incremento es de casi tres veces y media, mientras que en normalizar, donde recorremos dos veces la imagen, tenemos un porcentaje mas bajo pero igualmente superior al doble. El porcentaje de penalizaci'on para el filtro suavizar tambi'en nos result'o llamativo. Primero porque fue el 'unico que dio exactamente lo que esperamos. pero tambi'en porque dicho porcentaje es bajo en comparaci'on a los otros filtros. Lo cual nos hace inferir que tal vez podriamos implementarlo un poco mas eficientemente, o que tal vez se debe a la complejidad misma del algoritmo. En este punto hemos realizado una revisi'on de la implementaci'on del c'odigo de suavizar y vimos que tambien seria posible desarrollar una version que procese de a menos bytes, de esta manera disminuiriamos en un tercio los accesos a memoria\footnote{esto es porque actualmente se leen 18 bytes por iteraci'on - tres lecturas corridas de a un byte}. Ser'ia interesante ver si realmente procesar de menos p'ixeles pero con menos accesos a memoria presenta una mejora en la \textit{performance}. Es una pena que hemos tenido el tiempo suficiente para realizar dicha comprobaci'on. Sin embargo queda como un trabajo a futuro. \begin{table}[ht!] \begin{center} \begin{tabular}{|c|c|c|c|c|c|c|} \hline \sc{funci'on} & \sc{\# pixels} & \sc{ciclos C }& \sc{ciclos ASM }& \sc{$\Delta$ ciclos }& \sc{\% mejora }& \sc{penalizaci'on}\\ \hline invertir & 16x30000 & 7.706.474 & 408.430 & 7.298.044 & 94,70\% & \\ & 17x28234 & 7.642.414 & 1.799.789 & 5.842.625 & 76,45\% & 340,66\%\\ \hline normalizar & 16x30000 & 24.321.128 & 1.821.235 & 22.499.894 & 92,51\% & \\ & 17x28234 & 23.895.976 & 4.829.856 & 19.066.120 & 79,79\% & 165,20\%\\ \hline umbralizar & 16x30000 & 14.287.793 & 680.832 & 13.606.961 & 95,23\% & \\ & 17x28234 & 14.253.437 & 2.275.706 & 11.977.731 & 84,03\% & 234,25\%\\ \hline suavizar & 17x28234 & 29.283.006 & 3.773.630 & 25.509.376 & 87,11\% & \\ & 18x26666 & 29.320.184 & 7.404.941 & 21.915.243 & 74,74\% & 96,23\%\\ \hline \end{tabular} \caption{Resultados Im'agenes altas blanco y negro} \label{tab:abyn} \end{center} \end{table} Por otra parte el cuadro \ref{tab:acolor} muestra los resultados para los filtros que toman im'agenes a color. Aqui tambi'en podemos apreciar la gran diferencia de ciclos en \C \ y \ass \ con su porcentaje de mejora en todos los casos mayor que un 50\%. Sin embargo la penalizaci'on para los casos desfavorables no son tan grandes (entre 17\% y 32\%). Creemos que esto se debe a que no estamos en la misma situaci'on de caso favorable/desfavorable de las im'agenes en escala de grises. Para estarlo deberiamos haber procesado ima'agenes de 5 y 6 p'ixeles respectivamente. De esta manera, la primera imagen necesitar'ia solo un ciclo para procesar la fila y y el caso desfavorable necesitaria dos. Aqui el caso favorable necesita dos iteraciones, mientras que el desfavorable necesita 3. Esta diferencia expresada en porcentaje es menor. Cabe aclarar que no elegimos las imagenes reci'en descriptas pues nuestro algoritmo procesa imagenes color de como m'inimo 6 p'ixeles de ancho. Como una observaci'on general de estas mediciones de im'agenes altas, en contraste con el caso base podemos apreciar c'omo la distribuci'on de p'ixeles no influencia significativamente en la cantidad de ciclos de reloj de las implementaciones en \C \ mientras que en \ass \ este factor puede llegar tener mucha relevancia. \begin{table}[ht!] \begin{center} \begin{tabular}{|c|c|c|c|c|c|c|} \hline \sc{\footnotesize funci'on} & \sc{\footnotesize\# pixels} & \sc{\footnotesize ciclos C }& \sc{\footnotesize ciclos ASM }& \sc{\footnotesize$\Delta$ ciclos }& \sc{\footnotesize\% mejora }& \sc{\footnotesize penalizaci'on}\\ \hline mono\_uno& 10x48000 & 18.232.058 & 6.168.852 & 12.063.205 & 66,16\% & \\ & 11x43636 & 18.059.469 & 8.144.680 & 9.914.789 & 54,90\% & 32,03\%\\ \hline mono\_inf & 10x48000 & 18.978.920 & 5.410.115 & 13.568.806 & 71,49\% & \\ & 11x43636 & 18.967.671 & 6.368.449 & 12.599.222 & 66,42\% & 17,71\%\\ \hline separar\_c & 10x48000 & 20.874.906 & 7.176.690 & 13.698.216 & 65,62\% & \\ & 11x43636 & 20.800.016 & 9.195.779 & 11.604.237 & 55,79\% & 28,13\%\\ \hline \end{tabular} \caption{Resultados Im'agenes altas color} \label{tab:acolor} \end{center} \end{table} \subsubsection{Imagenes anchas} En este experimento comparamos todos los filtros para im'agenes mas anchas que altas, utilizando las medidas explicadas al inicio de esta secci'on. La tabla \ref{tab:anchas} nos muestra los resultados de este experimento. Primero podemos observar que el porcentaje de mejora entre las implentaciones es casi tan alto como el de el caso base en todos los filtros. Sin embargo en este experimento las penalizaciones sufridas por el \ass \ al procesar casos desfavorables no son tan grandes como en el experimento anterior. Esto vuelve a confirmar nuestras conjeturas sobre los casos favorables/desfavorables. Que la penalizaci'on sea menor que en el experimento anterior muestra que efectivamente a im'agenes mas anchas el costo de tener que reprocesar algunos pocos p'ixeles se diluye. Podemos pensar al costo de reprocesamiento total como la cantidad de filas por el costo de una iteraci'on. Con las im'agenes altas, las matrices tenian muchas m'as filas con lo cual el costo era alto. Aqui, para la misma cantidad de p'ixeles totales, al tener menos filas, tenemos un costo menor. Tambi'en es interesante notar c'omo en los filtros que procesan blanco y negro(excepto suavizar) la penalizaci'on todavia es considerable, mientras que en los otros la diferencia es casi imperceptible. Creemos que esto se debe a que en los filtros a color, como cada p'ixel son en realidad tres bytes, la penalizaci'on se diluye mucho mas, pues la informaci'on que se esta procesando es tres veces mas grande que en los casos blanco y negro. Asi que es de esperar la diferencia fuera como m'inimo una tercera parte. Sin embargo, no todo es color de rosa en la vida, y nos preguntamos porqu'e suavizar se parece mas a las funciones color que a las de su clase. Nuevamente creemos que tal vez se deba ya sea a la complejidad de la implentaci'on que realizamos(que tiene muchos accesos a memoria) o a la complejidad propia del algoritmo. Tambien es cierto que suavizar no fue el filtro que peor mejora tuvo en el caso base con respecto a la implementaci'on en \C. Y aunque no podamos justificar totalmente el porqu'e, las evidencias muestran que este filtro es el mas estable de todos, pues a pesar de las variaciones que estamos realizando los resultados no cambian tanto como en los otros filtros y son siempre similares al caso base. Otra observaci'on general que notamos fue que aqui tambi'en la cantidad de ciclos consumidos por la implementaci'on en \C \ es similar al de los casos base, por el contrario la implementaci'on en \ass \ en todos los casos los filtros consumen m'as ciclos que en su caso base (salvo normalizar que la cantidad de ciclos es comparable). \begin{table}[H] \begin{center} \begin{tabular}{|c|c|c|c|c|c|c|} \hline \sc{\footnotesize funci'on} & \sc{\footnotesize\# pixels} & \sc{\footnotesize ciclos C }& \sc{\footnotesize ciclos ASM }& \sc{\footnotesize$\Delta$ ciclos }& \sc{\footnotesize\% mejora }& \sc{\footnotesize penalizaci'on}\\ \hline invertir & 1440x333 & 7.277.945 & 313.567 & 6.964.378 & 95,69\% & \\ & 1441x333 & 7.274.547 & 459.617 & 6.814.930 & 93,68\% & 46,58\%\\ \hline normalizar & 1440x333 & 23.352.742 & 1.557.537 & 21.795.205 & 93,33\% & \\ & 1441x333 & 23.326.450 & 1.793.687 & 21.532.763 & 92,31\% & 15,16\%\\ \hline umbralizar & 1440x333 & 13.004.767 & 543.850 & 12.460.917 & 95,82\% & \\ & 1441x333 & 13.013.609 & 715.497 & 12.298.113 & 94,50\% & 31,56\%\\ \hline suavizar & 1442x333 & 32.468.271 & 3.905.847 & 28.562.424 & 87,97\% & \\ & 1443x333 & 32.483.078 & 3.945.091 & 28.537.988 & 87,85\% & 1,00\%\\ \hline mono\_uno & 1440x333 & 17.292.896 & 5.499.913 & 11.792.983 & 68,20\% & \\ & 1441x333 & 17.337.919 & 5.529.326 & 11.808.594 & 68,11\% & 0,53\%\\ \hline mono\_inf & 1440x333 & 18.526.267 & 4.450.636 & 14.075.631 & 75,98\% & \\ & 1441x333 & 18.521.016 & 4.483.062 & 14.037.954 & 75,79\% & 0,73\%\\ \hline separar\_c& 1440x333 & 20.427.885 & 6.163.018 & 14.264.867 & 69,83\% & \\ & 1441x333 & 20.457.241 & 6.214.148 & 14.243.092 & 69,62\% & 0,83\%\\ \hline \end{tabular} \caption{Resultados Im'agenes anchas} \label{tab:anchas} \end{center} \end{table}
022011-tp-o2
trunk/tp2-entregable/informe/src/mediciones.tex
TeX
gpl3
18,927
\section{Algoritmos} \label{sec:algoritmos} A la hora de implementar los algoritmos en \ass\ decidimos utilizar la tecnolog'ia SSE version 2. Si bien versiones mas actuales proveen instrucciones que en ciertos casos hubiesen sido m'as efectivas para el procesamiento de bytes empaquetados, nos era dif'icil desarrollar en nuestras casas, donde la version SSE de los procesadores no era tan avanzada. \subsection{Iterarando im'agenes} \label{sec:ciclos} La primer decisi'on a tomar a la hora de implementar los algoritmos fue como recorreremos las im'agenes. En \C\ optamos por la manera convencional, recorriendo secuencialmente la matriz, leyendo de a p'ixeles y cuando llegamos al final de cada fila salteamos el padding. Es claro que hay maneras m'as eficientes pero nos pareci'o apropiado tener esta implementaci'on como base de comparaci'on para todas las mejoras que implementaremos. Por otro lado, la implementaci'on en \ass\ fu'e mas ingeniosa ya que al utilizar la tecnolog'ia SSE debiamos, en principio, aprovechar al m'aximo lectura de a 16 bytes. Los problemas se presentan cuando quiero asegurarme de que estoy procesando todos los p'ixeles y que estoy evitando correctamente el \textit{padding}. En este trabajo pr'actico procesamos im'agenes a color y en escala de grises. Aunque la estrategia fue la misma, se presentaron sutiles diferencias para estos dos casos. \subsubsection{Im'agenes escala de grises} En este caso cada p'ixel es representado por un byte. La iteraci'on en \C\ es bastante simple (Algoritmo \ref{alg:iteracionC-BN}). En cambio en \ass, cada vez que accedemos a memoria con un registro SSE estamos cargando 16 p'ixeles. Por lo tanto la estrategia ser'a recorrer cada fila realizando sucesivas lecturas hasta que queden menos de 16 p'ixeles para que termine la fila. Para procesar los 'ultimos datos, reposicionamos el 'indice para cargar los 'ultimos p'ixeles y volvemos a iterar. Es claro que algunos p'ixeles ser'an recalculados, pero de esta manera podemos reutilizar el c'odigo de las iteraciones normales. Cuando inicio el proceso de la nueva fila, avanzo el 'indice teniendo en cuenta el \textit{padding}. Podemos observar el pseudoc'odigo en el Algoritmo \ref{alg:iteracionASM-BN}. Cabe aclarar que los pseudoc'odigos presentados en el informe son de caracter ilustrativo, con el objetivo de explicar las estrategias utilizadas. Para un pseudoc'odigo mas detallado remitirse a los comentarios del c'odigo \ass. \begin{algorithm}[h!] \caption{\sc{iteraci'on en c - escala de grises}}\label{alg:iteracionC-BN} \begin{algorithmic}[1] \FOR{$i=0$ to $n$} \STATE fila $\leftarrow$ i $\times$ row\_size \FOR{$pos=0$ to $m$} \STATE dst[fila + pos] $\leftarrow$ \textit{procesar}(src[fila + pos]) \ENDFOR \ENDFOR \end{algorithmic} \end{algorithm} \begin{algorithm}[h!] \caption{\sc{iteraci'on en assembler - escala de grises}}\label{alg:iteracionASM-BN} \begin{algorithmic}[1] \FOR{$i=0$ to $n$} \STATE fila $\leftarrow$ i $\times$ row\_size \FOR{$pos=0$ to $m$} \STATE dst[fila + pos] $\leftarrow$ \textit{procesar_{16}}(src[fila + pos]) \STATE pos $\leftarrow$ pos + 16 \IF{pos $=$ m} \STATE \textit{procesar\_siguiente\_fila} \ELSIF{pos $>$ m} \STATE pos $\leftarrow$ w - 16 \ENDIF \ENDFOR \ENDFOR \end{algorithmic} \end{algorithm} \subsubsection{Im'agenes a color} \label{sec:ciclos-color} En este caso cada p'ixel de las im'agenes de entrada esta representado por tres bytes(BGR). La 'unica modificacion que sufre la implementacion en \C\ es que a la hora de acceder a la matriz de entrada multiplicamos el iterador de la columna por tres. Adem'as podemos acceder a los distintos colores RGB desplazandonos cero, una o dos posiciones a partir de esa posici'on (Algoritmo \ref{alg:iteracionC-RGB}). \begin{algorithm}[h!] \caption{\sc{iteraci'on en c - color}}\label{alg:iteracionC-RGB} \begin{algorithmic}[1] \FOR{$i=0$ to $n$} \STATE fila_s $\leftarrow$ i $\times$ src\_row\_size \STATE fila_d $\leftarrow$ i $\times$ dst\_row\_size \FOR{$pos=0$ to $m$} \STATE dst[fila_d + pos] $\leftarrow$ \textit{procesar}(src[fila_s + 3 $*$ pos]) \ENDFOR \ENDFOR \end{algorithmic} \end{algorithm} En \ass (Algoritmo \ref{alg:iteracionASM-RGB}), las lecturas de a 16 bytes nos dejan en los registros 5 p'ixeles completos mas el primer byte del siguiente. Aqu'i decidimos descartar ese 'ultimo byte, procesar los datos y escribir en la imagen de salida solamente los resultados obtenidos. Es decir que mientras la imagen de entrada es recorrida de a 15 bytes(5 p'ixeles), la imagen de salida es recorrida de a 5 bytes. Por este motivo resulta imperioso llevar dos iteradores de posici'on. Tambi'en es necesario ajustar la ultima iteraci'on de cada fila. Cuando la lectura de los 'ultimos 16 bytes, estos no quedan cargados como queremos. Para poder procesar los 'ultimos 5 p'ixeles con las mismas instrucciones que tenemos en el ciclo debemos realizar un desplazamiento a derecha de un byte (figura \ref{est:ciclo}). \begin{figure}[h!] \xmmW{src[15$*$i]}{\textbf{X}R_4 & G_4B_4 & R_3G_3 & B_3R_2 & G_2B_2 & R_1G_1 & B_1R_0 & G_0B_0} \xmmW{src[3*w-16]}{R_4G_4 & B_4R_3 & G_3B_3 & R_2G_2 & B_2R_1 & G_1B_1 & R_0G_0 & B_0\textbf{R_{-1}}} \caption{diferencia en la carga en la 'ultima iteraci'on de im'agenes a color} \label{est:ciclo} \end{figure} Por otro lado, una vez que realizamos la ultima iteraci'on, debemos ajustar la condici'on de corte(linea \ref{alg:iteracionASM-RGB:corte}). Como estamos avanzando de a 15 bytes, vamos a haber finalizado la columna cuando la diferencia entre el iterador y el ancho total en bytes de la imagen de entrada sea igual a uno. Es f'acil de ver que esto solo sucede cuando se reajusta el 'indice(linea \ref{alg:iteracionASM-RGB:reajuste}), ya que no existe un caso donde falte procesar un solo byte si vengo iterando de a multiplos de 3. \begin{algorithm}[h!] \caption{\sc{iteraci'on en assembler - color}}\label{alg:iteracionASM-RGB} \begin{algorithmic}[1] \FOR{$i=0$ to $n$} \STATE fila_s $\leftarrow$ i $\times$ src\_row\_size \STATE fila_d $\leftarrow$ i $\times$ dst\_row\_size \FOR{$pos=0$ to $m$} \STATE dato_{$16$} $\leftarrow$ src[fila + pos] \STATE dst[fila + pos] $\leftarrow$ \textit{procesar_{16}}(dato) \label{alg:iteracionASM-RGB:entry} \STATE pos $\leftarrow$ pos + 15 \IF{pos + 1 $=$ m} \label{alg:iteracionASM-RGB:corte} \STATE \textit{procesar\_siguiente\_fila} \ELSIF{pos $>$ m} \STATE pos $\leftarrow$ w - 16 \label{alg:iteracionASM-RGB:reajuste} \STATE dato_{$16$} $\leftarrow$ desplazar\_der_{1b}(src[fila + pos]) \STATE \textbf{goto} linea \ref{alg:iteracionASM-RGB:entry} \ENDIF \ENDFOR \ENDFOR \end{algorithmic} \end{algorithm}
022011-tp-o2
trunk/tp2-entregable/informe/src/ciclo.tex
TeX
gpl3
6,715
% ************************************************************************** % % Package 'caratula', version 0.3 (para componer caratulas de TPs del DC). % % En caso de dudas, problemas o sugerencias sobre este package escribir a % Nico Rosner (nrosner arroba dc.uba.ar). % % ************************************************************************** % ----- Informacion sobre el package para el sistema ----------------------- \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{caratula}[2005/08/09 v0.4 Para componer caratulas de TPs del DC] \RequirePackage{ifthen} \usepackage{graphicx} % ----- Imprimir un mensajito al procesar un .tex que use este package ----- \typeout{Cargando package 'caratula' v0.4 (2006/09/29)} % ----- Algunas variables -------------------------------------------------- \let\Materia\relax \let\Submateria\relax \let\Titulo\relax \let\Subtitulo\relax \let\Grupo\relax \let\Fecha\relax \let\Logoimagefile\relax \newcommand{\LabelIntegrantes}{} \newboolean{showLU} \newboolean{showDirectores} % ----- Comandos para que el usuario defina las variables ------------------ \def\materia#1{\def\Materia{#1}} \def\submateria#1{\def\Submateria{#1}} \def\titulo#1{\def\Titulo{#1}} \def\subtitulo#1{\def\Subtitulo{#1}} \def\grupo#1{\def\Grupo{#1}} \def\fecha#1{\def\Fecha{#1}} \def\logoimagefile#1{\def\Logoimagefile{#1}} % ----- Token list para los integrantes ------------------------------------ \newtoks\intlist\intlist={} \newtoks\intlistSinLU\intlistSinLU={} \newcounter{integrantesCount} \setcounter{integrantesCount}{0} \newtoks\intTabNombre\intTabNombre={} \newtoks\intTabLU\intTabLU={} \newtoks\intTabEmail\intTabEmail={} \newcounter{directoresCount} \setcounter{directoresCount}{0} \newtoks\direcTabNombre\direcTabNombre={} \newtoks\direcTabEmail\direcTabEmail={} % ----- Comando para que el usuario agregue integrantes -------------------- \def\integrante#1#2#3{% \intlist=\expandafter{\the\intlist\rule{0pt}{1.2em}#1&#2&\tt #3\\[0.2em]}% \intlistSinLU=\expandafter{\the\intlistSinLU\rule{0pt}{1.2em}#1 & \tt #3\\[0.2em]}% % \ifthenelse{\value{integrantesCount} > 0}{% \intTabNombre=\expandafter{\the\intTabNombre & #1}% \intTabLU=\expandafter{\the\intTabLU & #2}% \intTabEmail=\expandafter{\the\intTabEmail & \tt #3}% }{ \intTabNombre=\expandafter{\the\intTabNombre #1}% \intTabLU=\expandafter{\the\intTabLU #2}% \intTabEmail=\expandafter{\the\intTabEmail \tt #3}% }% \addtocounter{integrantesCount}{1}% } \def\director#1#2{% \ifthenelse{\value{directoresCount} > 0}{% \direcTabNombre=\expandafter{\the\direcTabNombre & #1}% \direcTabEmail=\expandafter{\the\direcTabEmail & \tt #2}% }{ \direcTabNombre=\expandafter{\the\direcTabNombre #1}% \direcTabEmail=\expandafter{\the\direcTabEmail \tt #2}% }% \addtocounter{directoresCount}{1}% } % ----- Macro para generar la tabla de integrantes ------------------------- \newcommand{\tablaIntegrantes}{\ } \newcommand{\tablaIntegrantesVertical}{% \ifthenelse{\boolean{showLU}}{% \begin{tabular}[t]{| l @{\hspace{4ex}} c @{\hspace{4ex}} l|} \hline \multicolumn{1}{|c}{\rule{0pt}{1.2em} \LabelIntegrantes} & LU & \multicolumn{1}{c|}{Correo electr\'onico} \\[0.2em] \hline \hline \the\intlist \hline \end{tabular} }{ \begin{tabular}[t]{| l @{\hspace{4ex}} @{\hspace{4ex}} l|} \hline \multicolumn{1}{|c}{\rule{0pt}{1.2em} \LabelIntegrantes} & \multicolumn{1}{c|}{Correo electr\'onico} \\[0.2em] \hline \hline \the\intlistSinLU \hline \end{tabular} }% } \newcommand{\tablaIntegrantesHorizontal}{% \begin{tabular}[t]{ *{\value{integrantesCount}}{c} } \the\intTabNombre \\% \ifthenelse{\boolean{showLU}}{ \the\intTabLU \\% }{} \the\intTabEmail % \end{tabular}% } \newcommand{\tablaDirectores}{% \ifthenelse{\boolean{showDirectores}}{% \bigskip Directores \smallskip \begin{tabular}[t]{ *{\value{directoresCount}}{c} } \the\direcTabNombre \\% \the\direcTabEmail % \end{tabular}% }{}% } % ----- Codigo para manejo de errores -------------------------------------- \def\se{\let\ifsetuperror\iftrue} \def\ifsetuperror{% \let\ifsetuperror\iffalse \ifx\Materia\relax\se\errhelp={Te olvidaste de proveer una \materia{}.}\fi \ifx\Titulo\relax\se\errhelp={Te olvidaste de proveer un \titulo{}.}\fi \edef\mlist{\the\intlist}\ifx\mlist\empty\se% \errhelp={Tenes que proveer al menos un \integrante{nombre}{lu}{email}.}\fi \expandafter\ifsetuperror} % ----- \maketitletxt correspondiente a la versión v0.2.1 (texto v0.2 + fecha ) --------- \def\maketitletxt{% \ifsetuperror\errmessage{Faltan datos de la caratula! Ingresar 'h' para mas informacion.}\fi \thispagestyle{empty} \begin{center} \vspace*{\stretch{2}} {\LARGE\textbf{\Materia}}\\[1em] \ifx\Submateria\relax\else{\Large \Submateria}\\[0.5em]\fi \ifx\Fecha\relax\else{\Large \Fecha}\\[0.5em]\fi \par\vspace{\stretch{1}} {\large Departamento de Computaci\'on}\\[0.5em] {\large Facultad de Ciencias Exactas y Naturales}\\[0.5em] {\large Universidad de Buenos Aires} \par\vspace{\stretch{3}} {\Large \textbf{\Titulo}}\\[0.8em] {\Large \Subtitulo} \par\vspace{\stretch{3}} \ifx\Grupo\relax\else\textbf{\Grupo}\par\bigskip\fi \tablaIntegrantes \end{center} \vspace*{\stretch{3}} \newpage} % ----- \maketitletxtlogo correspondiente v0.2.1 (texto con fecha y logo) --------- \def\maketitletxtlogo{% \ifsetuperror\errmessage{Faltan datos de la caratula! Ingresar 'h' para mas informacion.}\fi \thispagestyle{empty} \begin{center} \ifx\Logoimagefile\relax\else\includegraphics{\Logoimagefile}\fi \hfill \includegraphics{imagenes/logo-dc.jpg}\\[1em] \vspace*{\stretch{2}} {\LARGE\textbf{\Materia}}\\[1em] \ifx\Submateria\relax\else{\Large \Submateria}\\[0.5em]\fi \ifx\Fecha\relax\else{\large \Fecha}\\[0.5em]\fi \par\vspace{\stretch{1}} {\large Departamento de Computaci\'on}\\[0.5em] {\large Facultad de Ciencias Exactas y Naturales}\\[0.5em] {\large Universidad de Buenos Aires} \par\vspace{\stretch{3}} {\Large \textbf{\Titulo}}\\[0.8em] {\Large \Subtitulo} \par\vspace{\stretch{3}} \ifx\Grupo\relax\else\textbf{\Grupo}\par\bigskip\fi \tablaIntegrantes \end{center} \vspace*{\stretch{4}} \newpage} % ----- \maketitlegraf correspondiente a la versión v0.3 (gráfica) ------------- \def\maketitlegraf{% \ifsetuperror\errmessage{Faltan datos de la caratula! Ingresar 'h' para mas informacion.}\fi % \thispagestyle{empty} \ifx\Logoimagefile\relax\else\includegraphics{\Logoimagefile}\fi \hfill \includegraphics{imagenes/logo-dc.jpg} \vspace*{.12 \textheight} \noindent \textbf{\huge \Titulo} \medskip \\ \ifx\Subtitulo\relax\else\noindent\textbf{\large \Subtitulo} \\ \fi% \noindent \rule{\textwidth}{1 pt} {\noindent\large\Fecha \hspace*\fill \Materia} \\ \ifx\Submateria\relax\else{\noindent \hspace*\fill \Submateria}\fi% \medskip% \begin{center} \ifx\Grupo\relax\else\textbf{\Grupo}\par\bigskip\fi \tablaIntegrantes \tablaDirectores \end{center}% \vfill% % \begin{minipage}[t]{\textwidth} \begin{minipage}[t]{.55 \textwidth} \includegraphics{imagenes/logo-uba.jpg} \end{minipage}%% \begin{minipage}[b]{.45 \textwidth} \textbf{\textsf{Facultad de Ciencias Exactas y Naturales}} \\ \textsf{Universidad de Buenos Aires} \\ {\scriptsize % Ciudad Universitaria - (Pabell\'on I/Planta Baja) \\ Intendente G\"uiraldes 2160 - C1428EGA \\ Ciudad Aut\'onoma de Buenos Aires - Rep. Argentina \\ Tel/Fax: (54 11) 4576-3359 \\ http://www.fcen.uba.ar \\ } \end{minipage} \end{minipage}% % \newpage} % ----- Reemplazamos el comando \maketitle de LaTeX con el nuestro --------- \renewcommand{\maketitle}{\maketitlegraf} % ----- Dependiendo de las opciones --------- % % opciones: % txt : caratula solo texto. % txtlogo : caratula txt con logo del DC y del grupo (opcional). % graf : (default) caratula grafica con logo del DC, UBA y del grupo (opcional). % \@makeother\*% some package redefined it as a letter (as color.sty) % % Layout general de la caratula % \DeclareOption{txt}{\renewcommand{\maketitle}{\maketitletxt}} \DeclareOption{txtlogo}{\renewcommand{\maketitle}{\maketitletxtlogo}} \DeclareOption{graf}{\renewcommand{\maketitle}{\maketitlegraf}} % % Etiqueta Autores o Integrantes % \DeclareOption{integrante}{\renewcommand{\LabelIntegrantes}{Integrante}} \DeclareOption{autor}{\renewcommand{\LabelIntegrantes}{Autor}} % % Formato tabla de integrantes % \DeclareOption{intVert}{\renewcommand{\tablaIntegrantes}{\tablaIntegrantesVertical}} \DeclareOption{intHoriz}{\renewcommand{\tablaIntegrantes}{\tablaIntegrantesHorizontal}} \DeclareOption{conLU}{\setboolean{showLU}{true}} \DeclareOption{sinLU}{\setboolean{showLU}{false}} \DeclareOption{showDirectores}{\setboolean{showDirectores}{true}} \DeclareOption{hideDirectores}{\setboolean{showDirectores}{false}} % % Opciones predeterminadas % \ExecuteOptions{intVert}% \ExecuteOptions{graf}% \ExecuteOptions{integrante}% \ExecuteOptions{conLU}% \ExecuteOptions{hideDirectores}% % \ProcessOptions\relax
022011-tp-o2
trunk/tp2-entregable/informe/src/caratula.sty
TeX
gpl3
9,506
\section{Introducci'on} El objetivo de este informe es describir el proceso de como la aplicacion algoritmica de filtros sobre imagenes puede ser optimizada notablemente(en comparaci'on con ANSI \C) si se aprovecha el modelo de instrucciones SIMD. Para ello implementamos siete algoritmos en \C\ y en \ass. Los mismos recorren las im'agenes aplicando diferentes c'alculos. Las implementaciones de alto nivel son bastantes triviales y directas gracias a la posibilidad que nos brinda el lenguaje para acceder a las distintas posiciones de memoria. Sin embargo la gran desventaja que tenemos aqu'i es que accedemos y procesamos los datos de a uno. En cambio, en la implementaci'on de bajo nivel, si bien podemos acceder a una gran cantidad de datos por vez, el acceso a ellos hace que los algortimos a veces se vuelvan ingeniosos. En la siguiente secci'on explicaremos como encaramos la implementaci'on de los filtros pedidos. Primero describiremos la estrategia que elegimos para iterar las im'agenes junto con sus variaciones. Luego nos abocaremos a describir la mec'anica que utilizamos en cada algoritmo para procesar los datos. Como dijimos antes, las implementaciones en alto nivel son bastantes directas, por lo que no nos detendremos mucho explic'andolas. El lector puede remitirse driectamente al c'odigo para un mayor detalle de los mismos. En la secci'on \ref{sec:mediciones} realizaremos mediciones de las distintas implementaciones sobre un conjunto de imagenes dado, comparando y analizando los resultados obtenidos. Es claro imaginar que deber'ia haber una gran diferencia en cuanto \textit{performance} y esperamos a lo largo de este informe verificar dicha conjetura. Sin embargo tambien veremos que existen casos menos favorables que otros donde si bien la mejora es grande, comparada con otros casos, no lo es tanto. Por 'ultimo en la secci'on \ref{sec:conclusiones} recapitularemos los resultados obtenidos, analizando la relaci'on costo-beneficio de las distintas implementaciones. Ademas comentaremos las principales dificultades encontradas y otras experiencias que obtuvimos durante la realizaci'on de este trabajo pr'actico.
022011-tp-o2
trunk/tp2-entregable/informe/src/intro.tex
TeX
gpl3
2,156
\begin{thebibliography}{9} \bibitem{i1} Intel^{\copyright} 64 and IA-32 Architectures Optimization Reference Manual \bibitem{i2} Intel^{\copyright} 64 and IA-32 Architectures Software Developer's Manual,Volume 1: Basic Architecture \bibitem{i3} Intel^{\copyright} 64 and IA-32 Architectures Software Developer's Manual,Volume 2A: Instruction Set Reference, A-M \bibitem{i4} Intel^{\copyright} 64 and IA-32 Architectures Software Developer's Manual,Volume 2B: Instruction Set Reference, N-Z \bibitem{i5} Enunciado del tp \bibitem{i6} http://orga2.com.ar, diapositivas de las clases \end{thebibliography}
022011-tp-o2
trunk/tp2-entregable/informe/src/referencias.tex
TeX
gpl3
615
%% %% This is file `algorithm.sty', %% generated with the docstrip utility. %% %% The original source files were: %% %% algorithms.dtx (with options: `algorithm') %% This is a generated file. %% %% Copyright (C) 1994-2004 Peter Williams <pwil3058@bigpond.net.au> %% Copyright (C) 2005-2009 Rog�rio Brito <rbrito@ime.usp.br> %% %% This document file is free software; you can redistribute it and/or %% modify it under the terms of the GNU Lesser General Public License as %% published by the Free Software Foundation; either version 2 of the %% License, or (at your option) any later version. %% %% This document file is distributed in the hope that it will be useful, but %% WITHOUT ANY WARRANTY; without even the implied warranty of %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser %% General Public License for more details. %% %% You should have received a copy of the GNU Lesser General Public License %% along with this document file; if not, write to the Free Software %% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, %% USA. %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{algorithm} [2009/08/24 v0.1 Document Style `algorithm' - floating environment] \RequirePackage{float} \RequirePackage{ifthen} \newcommand{\ALG@within}{nothing} \newboolean{ALG@within} \setboolean{ALG@within}{false} \newcommand{\ALG@floatstyle}{ruled} \newcommand{\ALG@name}{Algorithm} \newcommand{\listalgorithmname}{List of \ALG@name s} % Declare Options: % * first: appearance \DeclareOption{plain}{ \renewcommand{\ALG@floatstyle}{plain} } \DeclareOption{ruled}{ \renewcommand{\ALG@floatstyle}{ruled} } \DeclareOption{boxed}{ \renewcommand{\ALG@floatstyle}{boxed} } % * then: numbering convention \DeclareOption{part}{ \renewcommand{\ALG@within}{part} \setboolean{ALG@within}{true} } \DeclareOption{chapter}{ \renewcommand{\ALG@within}{chapter} \setboolean{ALG@within}{true} } \DeclareOption{section}{ \renewcommand{\ALG@within}{section} \setboolean{ALG@within}{true} } \DeclareOption{subsection}{ \renewcommand{\ALG@within}{subsection} \setboolean{ALG@within}{true} } \DeclareOption{subsubsection}{ \renewcommand{\ALG@within}{subsubsection} \setboolean{ALG@within}{true} } \DeclareOption{nothing}{ \renewcommand{\ALG@within}{nothing} \setboolean{ALG@within}{true} } \DeclareOption*{\edef\ALG@name{\CurrentOption}} % ALGORITHM % \ProcessOptions \floatstyle{\ALG@floatstyle} \ifthenelse{\boolean{ALG@within}}{ \ifthenelse{\equal{\ALG@within}{part}} {\newfloat{algorithm}{htbp}{loa}[part]}{} \ifthenelse{\equal{\ALG@within}{chapter}} {\newfloat{algorithm}{htbp}{loa}[chapter]}{} \ifthenelse{\equal{\ALG@within}{section}} {\newfloat{algorithm}{htbp}{loa}[section]}{} \ifthenelse{\equal{\ALG@within}{subsection}} {\newfloat{algorithm}{htbp}{loa}[subsection]}{} \ifthenelse{\equal{\ALG@within}{subsubsection}} {\newfloat{algorithm}{htbp}{loa}[subsubsection]}{} \ifthenelse{\equal{\ALG@within}{nothing}} {\newfloat{algorithm}{htbp}{loa}}{} }{ \newfloat{algorithm}{htbp}{loa} } \floatname{algorithm}{\ALG@name} \newcommand{\listofalgorithms}{\listof{algorithm}{\listalgorithmname}} \endinput %% %% End of file `algorithm.sty'.
022011-tp-o2
trunk/tp2-entregable/informe/src/algorithm.sty
TeX
gpl3
3,251
\documentclass[10pt,a4paper]{article} \usepackage{a4wide} %\usepackage[top=2.5cm, bottom=2cm, left=1.5cm, right=1.5cm, a4paper]{geometry} \usepackage[latin1]{inputenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{array} \usepackage{tabularx} \usepackage[spanish, activeacute]{babel} \usepackage[small]{caption} \usepackage{newclude} % Carátula \usepackage[txt]{caratula} \materia{Organizaci\'on del Computador II} \submateria{Segundo Cuatrimestre del 2011} \titulo{Trabajo Pr\'actico N\'umero 2} \subtitulo{Filtros de imagen} \integrante{Celave, Martin}{530/08}{tolacelave@gmail.com} \integrante{Colombo, Ricardo Gaston}{156/08}{ricardogcolombo@gmail.com} \integrante{Lores, Fernando}{718/01}{ferlores@gmail.com} \grupo{Lider espiritual: Angiulino "El chino" Cubrepileta} %Macro para subscript fuera de modo matematico \makeatletter \newcommand\textsubscript[1]{\@textsubscript{\selectfont#1}} \def\@textsubscript#1{{\m@th\ensuremath{_{\mbox{\fontsize\sf@size\z@#1}}}}} \newcommand\textbothscript[2]{% \@textbothscript{\selectfont#1}{\selectfont#2}} \def\@textbothscript#1#2{% {\m@th\ensuremath{% ^{\mbox{\fontsize\sf@size\z@#1}}% _{\mbox{\fontsize\sf@size\z@#2}}}}} \def\@super{^}\def\@sub{_} \catcode`^\active\catcode`_\active \def\@super@sub#1_#2{\textbothscript{#1}{#2}} \def\@sub@super#1^#2{\textbothscript{#2}{#1}} \def\@@super#1{\@ifnextchar_{\@super@sub{#1}}{\textsuperscript{#1}}} \def\@@sub#1{\@ifnextchar^{\@sub@super{#1}}{\textsubscript{#1}}} \def^{\let\@next\relax\ifmmode\@super\else\let\@next\@@super\fi\@next} \def_{\let\@next\relax\ifmmode\@sub\else\let\@next\@@sub\fi\@next} \makeatother % Macros para XMM %\newcolumntype{C}{>{\footnotesize\centering\arraybackslash}X} \newcolumntype{C}{>{\footnotesize\centering}p{18pt}} \newcolumntype{D}{>{\footnotesize\centering}p{48.5pt}} \newcommand{\xmmW}[2]{ \fontfamily{pcr}\selectfont \begin{center} \begin{tabularx}{400pt}{@{}p{120pt}|C|C|C|C|C|C|C|C|@{}p{5pt}@{}} \cline{2-9} \footnotesize{#1} & #2 &\\ \cline{2-9} \multicolumn{1}{r@{}}{^{\emph{\tiny 128}}} & \multicolumn{8}{c}{\textit{\scriptsize(word packed)}} & \multicolumn{1}{@{}l}{^{\emph{\tiny 0}}}\\ \end{tabularx} \end{center} } \newcommand{\xmmD}[2]{ \fontfamily{pcr}\selectfont \begin{center} \begin{tabularx}{400pt}{@{}p{120pt}|D|D|D|D|@{}p{5pt}@{}} \cline{2-5} \footnotesize{#1} & #2 &\\ \cline{2-5} \multicolumn{1}{r@{}}{^{\emph{\tiny128}}} & \multicolumn{4}{c}{\textit{\scriptsize(double-word packed)}} & \multicolumn{1}{@{}l}{^{\emph{\tiny0}}}\\ \end{tabularx} \end{center} } \newcommand{\ass}{\textit{assembler}} \newcommand{\C}{\textbf{C}} % Fancy Header \usepackage{fancyhdr} \fancyhf{} \fancyfoot{} \fancyhead{} \lhead{\slshape \footnotesize{\leftmark}} % texto izquierda de la cabecera \rhead{\Titulo} % número de página a la derecha \rfoot{\thepage} \pagestyle{fancy} % Algoritmos \usepackage[section]{algorithm} \usepackage{algorithmic} \floatname{algorithm}{Algoritmo} \algsetup{indent=2em} \makeindex \begin{document} \maketitle \tableofcontents \clearpage \include*{intro} \include*{ciclo} \include*{separarcanales} \include*{monocromatizar} \include*{umbralizar} \include*{invertir} \include*{normalizar} \include*{suavizar} \include*{mediciones} \include*{conclusiones} \include*{referencias} \end{document}
022011-tp-o2
trunk/tp2-entregable/informe/src/tp2.tex
TeX
gpl3
3,315
%% %% This is file `algorithmic.sty', %% generated with the docstrip utility. %% %% The original source files were: %% %% algorithms.dtx (with options: `algorithmic') %% This is a generated file. %% %% Copyright (C) 1994-2004 Peter Williams <pwil3058@bigpond.net.au> %% Copyright (C) 2005-2009 Rog�rio Brito <rbrito@ime.usp.br> %% %% This document file is free software; you can redistribute it and/or %% modify it under the terms of the GNU Lesser General Public License as %% published by the Free Software Foundation; either version 2 of the %% License, or (at your option) any later version. %% %% This document file is distributed in the hope that it will be useful, but %% WITHOUT ANY WARRANTY; without even the implied warranty of %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser %% General Public License for more details. %% %% You should have received a copy of the GNU Lesser General Public License %% along with this document file; if not, write to the Free Software %% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, %% USA. %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{algorithmic} [2009/08/24 v0.1 Document Style `algorithmic'] % The algorithmic.sty package: \RequirePackage{ifthen} \RequirePackage{keyval} \newboolean{ALC@noend} \setboolean{ALC@noend}{false} \newcounter{ALC@unique} % new counter to make lines numbers be internally \setcounter{ALC@unique}{0} % different in different algorithms \newcounter{ALC@line} % counter for current line \newcounter{ALC@rem} % counter for lines not printed \newcounter{ALC@depth} \newlength{\ALC@tlm} % \DeclareOption{noend}{\setboolean{ALC@noend}{true}} % \ProcessOptions % % For keyval-style options \def\algsetup{\setkeys{ALG}} % % For indentation of algorithms \newlength{\algorithmicindent} \setlength{\algorithmicindent}{0pt} \define@key{ALG}{indent}{\setlength{\algorithmicindent}{#1}} \ifthenelse{\lengthtest{\algorithmicindent=0pt}}% {\setlength{\algorithmicindent}{1em}}{} % % For line numbers' delimiters \newcommand{\ALC@linenodelimiter}{:} \define@key{ALG}{linenodelimiter}{\renewcommand{\ALC@linenodelimiter}{#1}} % % For line numbers' size \newcommand{\ALC@linenosize}{\footnotesize} \define@key{ALG}{linenosize}{\renewcommand{\ALC@linenosize}{#1}} % % ALGORITHMIC \newcommand{\algorithmicrequire}{\textbf{Require:}} \newcommand{\algorithmicensure}{\textbf{Ensure:}} \newcommand{\algorithmiccomment}[1]{\{#1\}} \newcommand{\algorithmicend}{\textbf{end}} \newcommand{\algorithmicif}{\textbf{if}} \newcommand{\algorithmicthen}{\textbf{then}} \newcommand{\algorithmicelse}{\textbf{else}} \newcommand{\algorithmicelsif}{\algorithmicelse\ \algorithmicif} \newcommand{\algorithmicendif}{\algorithmicend\ \algorithmicif} \newcommand{\algorithmicfor}{\textbf{for}} \newcommand{\algorithmicforall}{\textbf{for all}} \newcommand{\algorithmicdo}{\textbf{do}} \newcommand{\algorithmicendfor}{\algorithmicend\ \algorithmicfor} \newcommand{\algorithmicwhile}{\textbf{while}} \newcommand{\algorithmicendwhile}{\algorithmicend\ \algorithmicwhile} \newcommand{\algorithmicloop}{\textbf{loop}} \newcommand{\algorithmicendloop}{\algorithmicend\ \algorithmicloop} \newcommand{\algorithmicrepeat}{\textbf{repeat}} \newcommand{\algorithmicuntil}{\textbf{until}} \newcommand{\algorithmicprint}{\textbf{print}} \newcommand{\algorithmicreturn}{\textbf{return}} \newcommand{\algorithmicand}{\textbf{and}} \newcommand{\algorithmicor}{\textbf{or}} \newcommand{\algorithmicxor}{\textbf{xor}} \newcommand{\algorithmicnot}{\textbf{not}} \newcommand{\algorithmicto}{\textbf{to}} \newcommand{\algorithmicinputs}{\textbf{inputs}} \newcommand{\algorithmicoutputs}{\textbf{outputs}} \newcommand{\algorithmicglobals}{\textbf{globals}} \newcommand{\algorithmicbody}{\textbf{do}} \newcommand{\algorithmictrue}{\textbf{true}} \newcommand{\algorithmicfalse}{\textbf{false}} \def\ALC@item[#1]{% \if@noparitem \@donoparitem \else \if@inlabel \indent \par \fi \ifhmode \unskip\unskip \par \fi \if@newlist \if@nobreak \@nbitem \else \addpenalty\@beginparpenalty \addvspace\@topsep \addvspace{-\parskip}\fi \else \addpenalty\@itempenalty \addvspace\itemsep \fi \global\@inlabeltrue \fi \everypar{\global\@minipagefalse\global\@newlistfalse \if@inlabel\global\@inlabelfalse \hskip -\parindent \box\@labels \penalty\z@ \fi \everypar{}}\global\@nobreakfalse \if@noitemarg \@noitemargfalse \if@nmbrlist \refstepcounter{\@listctr}\fi \fi \sbox\@tempboxa{\makelabel{#1}}% \global\setbox\@labels \hbox{\unhbox\@labels \hskip \itemindent \hskip -\labelwidth \hskip -\ALC@tlm \ifdim \wd\@tempboxa >\labelwidth \box\@tempboxa \else \hbox to\labelwidth {\unhbox\@tempboxa}\fi \hskip \ALC@tlm}\ignorespaces} % \newenvironment{algorithmic}[1][0]{ \setcounter{ALC@depth}{\@listdepth}% \let\@listdepth\c@ALC@depth% \let\@item\ALC@item% \newcommand{\ALC@lno}{% \ifthenelse{\equal{\arabic{ALC@rem}}{0}} {{\ALC@linenosize \arabic{ALC@line}\ALC@linenodelimiter}}{}% } \let\@listii\@listi \let\@listiii\@listi \let\@listiv\@listi \let\@listv\@listi \let\@listvi\@listi \let\@listvii\@listi \newenvironment{ALC@g}{ \begin{list}{\ALC@lno}{ \itemsep\z@ \itemindent\z@ \listparindent\z@ \rightmargin\z@ \topsep\z@ \partopsep\z@ \parskip\z@\parsep\z@ \leftmargin \algorithmicindent%1em \addtolength{\ALC@tlm}{\leftmargin} } } {\end{list}} \newcommand{\ALC@it}{% \stepcounter{ALC@rem}% \ifthenelse{\equal{\arabic{ALC@rem}}{#1}}{\setcounter{ALC@rem}{0}}{}% \stepcounter{ALC@line}% \refstepcounter{ALC@unique}% \item\def\@currentlabel{\theALC@line}% } \newcommand{\ALC@com}[1]{\ifthenelse{\equal{##1}{default}}% {}{\ \algorithmiccomment{##1}}} \newcommand{\REQUIRE}{\item[\algorithmicrequire]} \newcommand{\ENSURE}{\item[\algorithmicensure]} \newcommand{\PRINT}{\ALC@it\algorithmicprint{} \ } \newcommand{\RETURN}{\ALC@it\algorithmicreturn{} \ } \newcommand{\TRUE}{\algorithmictrue{}} \newcommand{\FALSE}{\algorithmicfalse{}} \newcommand{\AND}{\algorithmicand{} } \newcommand{\OR}{\algorithmicor{} } \newcommand{\XOR}{\algorithmicxor{} } \newcommand{\NOT}{\algorithmicnot{} } \newcommand{\TO}{\algorithmicto{} } \newcommand{\STATE}{\ALC@it} \newcommand{\STMT}{\ALC@it} \newcommand{\COMMENT}[1]{\algorithmiccomment{##1}} \newenvironment{ALC@inputs}{\begin{ALC@g}}{\end{ALC@g}} \newenvironment{ALC@outputs}{\begin{ALC@g}}{\end{ALC@g}} \newenvironment{ALC@globals}{\begin{ALC@g}}{\end{ALC@g}} \newenvironment{ALC@body}{\begin{ALC@g}}{\end{ALC@g}} \newenvironment{ALC@if}{\begin{ALC@g}}{\end{ALC@g}} \newenvironment{ALC@for}{\begin{ALC@g}}{\end{ALC@g}} \newenvironment{ALC@whl}{\begin{ALC@g}}{\end{ALC@g}} \newenvironment{ALC@loop}{\begin{ALC@g}}{\end{ALC@g}} \newenvironment{ALC@rpt}{\begin{ALC@g}}{\end{ALC@g}} \renewcommand{\\}{\@centercr} \newcommand{\INPUTS}[1][default]{\ALC@it\algorithmicinputs\ \ALC@com{##1}\begin{ALC@inputs}} \newcommand{\ENDINPUTS}{\end{ALC@inputs}} \newcommand{\OUTPUTS}[1][default]{\ALC@it\algorithmicoutputs\ \ALC@com{##1}\begin{ALC@outputs}} \newcommand{\ENDOUTPUTS}{\end{ALC@outputs}} \newcommand{\GLOBALS}{\ALC@it\algorithmicglobals\ } \newcommand{\BODY}[1][default]{\ALC@it\algorithmicbody\ \ALC@com{##1}\begin{ALC@body}} \newcommand{\ENDBODY}{\end{ALC@body}} \newcommand{\IF}[2][default]{\ALC@it\algorithmicif\ ##2\ \algorithmicthen% \ALC@com{##1}\begin{ALC@if}} \newcommand{\ELSE}[1][default]{\end{ALC@if}\ALC@it\algorithmicelse% \ALC@com{##1}\begin{ALC@if}} \newcommand{\ELSIF}[2][default]% {\end{ALC@if}\ALC@it\algorithmicelsif\ ##2\ \algorithmicthen% \ALC@com{##1}\begin{ALC@if}} \newcommand{\FOR}[2][default]{\ALC@it\algorithmicfor\ ##2\ \algorithmicdo% \ALC@com{##1}\begin{ALC@for}} \newcommand{\FORALL}[2][default]{\ALC@it\algorithmicforall\ ##2\ % \algorithmicdo% \ALC@com{##1}\begin{ALC@for}} \newcommand{\WHILE}[2][default]{\ALC@it\algorithmicwhile\ ##2\ % \algorithmicdo% \ALC@com{##1}\begin{ALC@whl}} \newcommand{\LOOP}[1][default]{\ALC@it\algorithmicloop% \ALC@com{##1}\begin{ALC@loop}} \newcommand{\REPEAT}[1][default]{\ALC@it\algorithmicrepeat% \ALC@com{##1}\begin{ALC@rpt}} \newcommand{\UNTIL}[1]{\end{ALC@rpt}\ALC@it\algorithmicuntil\ ##1} \ifthenelse{\boolean{ALC@noend}}{ \newcommand{\ENDIF}{\end{ALC@if}} \newcommand{\ENDFOR}{\end{ALC@for}} \newcommand{\ENDWHILE}{\end{ALC@whl}} \newcommand{\ENDLOOP}{\end{ALC@loop}} }{ \newcommand{\ENDIF}{\end{ALC@if}\ALC@it\algorithmicendif} \newcommand{\ENDFOR}{\end{ALC@for}\ALC@it\algorithmicendfor} \newcommand{\ENDWHILE}{\end{ALC@whl}\ALC@it\algorithmicendwhile} \newcommand{\ENDLOOP}{\end{ALC@loop}\ALC@it\algorithmicendloop} } \renewcommand{\@toodeep}{} \begin{list}{\ALC@lno}{\setcounter{ALC@rem}{0}\setcounter{ALC@line}{0}% \itemsep\z@ \itemindent\z@ \listparindent\z@% \partopsep\z@ \parskip\z@ \parsep\z@% \labelsep 0.5em \topsep 0.2em% \ifthenelse{\equal{#1}{0}} {\labelwidth 0.5em } {\labelwidth 1.2em } \leftmargin\labelwidth \addtolength{\leftmargin}{\labelsep} \ALC@tlm\labelsep } } {\end{list}} \endinput %% %% End of file `algorithmic.sty'.
022011-tp-o2
trunk/tp2-entregable/informe/src/algorithmic.sty
TeX
gpl3
9,320
\subsection{Normalizar} El objetivo de este algoritmo es modificar cada pixel para ampliar el rango de valores de toda la imagen. Para esto utilizamos la f'ormula general (ecuaci'on \ref{eq:normalizar}), estableciendo los valores m'aximos y m'inimos posibles para el caso de las imagenes en escala de grises (255 y 0 respectivamente). Luego realizamos algunas operaciones 'algebraicas a fin de poder establecer una constante de multiplicaci'on que procesar'a cada pixel. Entonces el algoritmo queda divido en tres partes: la primera busca el m'aximo y m'inimo de la imagen, la segunda calcula la constante $K$ mientras que la segunda procesa los valores aplicando la ecuaci'on ya descripta. \begin{equation} \begin{array}{rl} I_{out}(i,j) &= (I_{in}(i,j) - max) \times \left( \dfrac{a-b}{max-min} \right) + a \\ \\ I_{out}(i,j) &= (I_{in}(i,j) - max) \times \left( \dfrac{255-0}{max-min} \right) + 255 \\ \\ I_{out}(i,j) &= \dfrac{255 \times (I_{in}(i,j) - min)}{max-min} $\hspace{10pt} \textit{\scriptsize factor comun (max - min)}$ \\ \\ $Sea $ K &\leftarrow \dfrac{255}{max-min} \\ \\ I_{out}(i,j) &= K \times (I_{in}(i,j) - min) \\ \\ \\ $Ecuaci'on \theequation:$&$Desarrollo de la f'ormula de normalizado$ \end{array} \label{eq:normalizar} \end{equation} \subsubsection*{B'usqueda de m'aximo y m'inimo} Para encontrar los valores m'aximos y m'inimos nos valemos de las instrucciones \textit{pmaxub} y \textit{pminub}. Las mismas comparan los valores byte a byte quedandose con los correspondientes a cada funci'on. Entonces, despues de recorrer la matriz obtenemos dos registros, uno con los candidatos a m'aximo y otro con los candidatos a m'inimo (paso 0). Lo que queda por hacer entonces es comparar los bytes dentro de cada registro para identificar al mayor y menor. Para ello duplicamos el registro y realizamos sucesivos intercambios para comparar todos con todos. Iniciamos invirtiendo la parte alta por la parte baja de registro y volviendo a utilizar las instruciones de m'aximo y m'inimo para comparar (paso 1). Entonces ahora tenemos ocho candidatos en la parte alta del registro. Repetimos el proceso utilizando intercambiando los dos double-words mas significativos (paso 2). Ahora tenemos cuatro candidatos, una vez mas repetimos la operacion intercambiando ahora los words mas significativos (paso 3). En este punto tenemos dos candidatos en el word mas significativo del registro. Para compararlos, duplicamos el registro y hacemos un desplazamiento a izquierda de un byte (paso 4). De esta manera, al comparar queda en el byte mas significativo el valor buscado. Una vez obtenidos estos dos valores, hacemos un desplazamiento a izquierda de tres bytes, y en el \textit{double word} mas significativo nos queda el valor deseado. Ahora hacemos un \textit{broadcast} a todos los \textit{double word} y el registro nos queda con los valores deseados empaquetados a \textit{double word}. La Figura \ref{est:normalizar-1} muestra como se van reduciendo los candidatos aplicando las operaciones antes descriptas. \begin{figure}[ht] \xmmW{paso 0.}{cc & cc & cc & cc & cc & cc & cc & cc} \xmmW{paso 1.}{cc & cc & cc & cc & xx & xx & xx & xx} \xmmW{paso 2.}{cc & cc & xx & xx & xx & xx & xx & xx} \xmmW{paso 3.}{cc & xx & xx & xx & xx & xx & xx & xx} \xmmW{paso 4.}{mx & xx & xx & xx & xx & xx & xx & xx} \xmmD{paso 5.}{00 0m & 00 0m & 00 0m & 00 0m} \caption{\textit{busqueda de m'aximo y m'inimo}} \label{est:normalizar-1} \end{figure} \subsubsection*{C'alculo de la constante $K$} Para calcular la constante $K$ a partir de el valor m'aximo y m'inimo obtenidos en el paso anterior, es importante tener en cuenta que dicho valor es un n'umero decimal. Es por esto que para no perder realizamos las cuentas utilizando como tipo de dato empaquetado al decimal con punto flotante de precisi'on simple. Entonces lo primero que realizamos fue una conversion de los registros que contenian el m'aximo y m'inimo empaquetados en \textit{double words} a un formato empaquetado \textit{float single presicion}, luego, realizando las operaciones descriptas en la ecuaci'on \ref{eq:normalizar} obtenemos un registro con la constante empaquetada como \textit{float}. Lo mismo hacemos con el registro que contiene el m'inimo, pues lo necesitamos en los c'alculos. \subsubsection*{Procesamiento de los p'ixeles} En esta etapa recorremos la matriz de a 16 p'ixeles, la desempaquetamos a \textit{words} separando y parte alta y baja. Cada parte es a su vez desempaquetada a \textit{double words} y convertida a empaquetados de punto flotante. Entonces, por cada lectura nos quedan cuatro registros con cada uno cuatro valores listos para ser procesados sin perder precisi'on. A los mismos se les resta el valor m'inimo con la resta de punto flotante (\textit{subps}) y se multiplica por la constante $K$ (\textit{mulps}). Una vez calculado cada p'ixel se realiza el camino inverso al descripto empaquetando el resultado. Primero se convierte el resultado de empaquetado de punto flotante a \textit{double word}, luego a \textit{word} y por 'ultimo a byte. Es importante resaltar que los empaquetamientos que realizamos son con saturaci'on signada. Es decir que si el valor esta fuera del rango permitido se satura al m'aximo o al m'inimo seg'un corresponda. Una vez que el resultado es empaquetado, 'este se baja a memoria y se continua con la siguiente iteraci'on.
022011-tp-o2
trunk/tp2-entregable/informe/src/normalizar.tex
TeX
gpl3
5,394
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package wcb; import java.util.Date; /** * * @author Michelangelo */ public class Solicitud { private Integer idSolicitud; private Integer email_Usuario;//foranea de entidad usuario private String status; private String informacion; private Date fecha_Solicitud; public Solicitud() { idSolicitud = email_Usuario = 0; status = informacion = ""; fecha_Solicitud = new Date(); } public Integer getEmail_Usuario() { return email_Usuario; } public void setEmail_Usuario(Integer email_Usuario) { this.email_Usuario = email_Usuario; } public Date getFecha_Solicitud() { return fecha_Solicitud; } public void setFecha_Solicitud(Date fecha_Solicitud) { this.fecha_Solicitud = fecha_Solicitud; } public Integer getIdSolicitud() { return idSolicitud; } public void setIdSolicitud(Integer idSolicitud) { this.idSolicitud = idSolicitud; } public String getInformacion() { return informacion; } public void setInformacion(String informacion) { this.informacion = informacion; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/wcb/Solicitud.java
Java
gpl2
1,407
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package wcb; import java.util.Date; /** * * @author Michelangelo */ public class Pais_has_Usuario1 { private Integer id_Pais; private String email_Usuario; private Date fecha_Inicio; private Date fecha_Fin; public Pais_has_Usuario1() { id_Pais = 0; email_Usuario = ""; fecha_Inicio = new Date(); fecha_Fin = new Date(); } public String getEmail_Usuario() { return email_Usuario; } public void setEmail_Usuario(String email_Usuario) { this.email_Usuario = email_Usuario; } public Integer getId_Pais() { return id_Pais; } public void setId_Pais(Integer id_Pais) { this.id_Pais = id_Pais; } public Date getFecha_Fin() { return fecha_Fin; } public void setFecha_Fin(Date fecha_Fin) { this.fecha_Fin = fecha_Fin; } public Date getFecha_Inicio() { return fecha_Inicio; } public void setFecha_Inicio(Date fecha_Inicio) { this.fecha_Inicio = fecha_Inicio; } }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/wcb/Pais_has_Usuario1.java
Java
gpl2
1,156
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package wcb; /** * * @author Michelangelo */ public class Descuento { private Integer id_Descuento; private Float monto; private Integer porcentaje; public Descuento() { id_Descuento = porcentaje = 0; monto = 0.0f; } public Integer getId_Descuento() { return id_Descuento; } public void setId_Descuento(Integer id_Descuento) { this.id_Descuento = id_Descuento; } public Float getMonto() { return monto; } public void setMonto(Float monto) { this.monto = monto; } public Integer getPorcentaje() { return porcentaje; } public void setPorcentaje(Integer porcentaje) { this.porcentaje = porcentaje; } }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/wcb/Descuento.java
Java
gpl2
847
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package wcb; import java.util.Date; /** * * @author Angiita */ public class Usuario_has_Estadio { private String USUARIO_email; private Integer ESTADIO_idESTADIO; //Constructor public Usuario_has_Estadio(String uE, Integer iE) { USUARIO_email=uE; ESTADIO_idESTADIO=iE; } Usuario_has_Estadio() { } public Usuario_has_Estadio llenarUsuarioEstadio(String uE, Integer iE) { Usuario_has_Estadio UsuarioEstadio = new Usuario_has_Estadio(uE, iE); return UsuarioEstadio; } public String getUSUARIO_email() { return USUARIO_email; } public void setUSUARIO_email(String USUARIO_email) { this.USUARIO_email = USUARIO_email; } public Integer getESTADIO_idESTADIO() { return ESTADIO_idESTADIO; } public void setESTADIO_idESTADIO(Integer ESTADIO_idESTADIO) { this.ESTADIO_idESTADIO = ESTADIO_idESTADIO; } }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/wcb/Usuario_has_Estadio.java
Java
gpl2
1,014
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package wcb; /** * * @author Michelangelo */ public class Descuento_has_Pais { }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/wcb/Descuento_has_Pais.java
Java
gpl2
189
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package wcb; import java.sql.Date; import java.sql.Time; /** * * @author Karla Ruiz */ public class Partido { //Atributos private Integer idpartido; private Date fecha; private Time hora; private String pais1; private String pais2; private Integer idestadio; //Constructor public Partido (Integer idp, Date fp, Time hp, String p1,String p2,Integer ide){ idpartido= idp; fecha= fp; hora= hp; pais1= p1; pais2= p2; idestadio= ide; } public Integer getIdpartido() { return idpartido; } public void setIdpartido(Integer idpartido) { this.idpartido = idpartido; } public Date getFecha() { return fecha; } public void setFecha(Date fecha) { this.fecha = fecha; } public Time getHora() { return hora; } public void setHora(Time hora) { this.hora = hora; } public String getPais1() { return pais1; } public void setPais1(String pais1) { this.pais1 = pais1; } public String getPais2() { return pais2; } public void setPais2(String pais2) { this.pais2 = pais2; } public Integer getIdestadio() { return idestadio; } public void setIdestadio(Integer idestadio) { this.idestadio = idestadio; } }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/wcb/Partido.java
Java
gpl2
1,443
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package wcb; import java.util.Date; /** * * @author Angiita */ public class Partido_has_Usuario { private Integer PARTIDO_idPARTIDO; private String USUARIO_email; //Constructor public Partido_has_Usuario(Integer iP, String uE) { PARTIDO_idPARTIDO=iP; USUARIO_email=uE; } Partido_has_Usuario() { } public Partido_has_Usuario llenarPartidoUsuario(Integer iP, String uE) { Partido_has_Usuario PartidoUsuario = new Partido_has_Usuario(iP, uE); return PartidoUsuario; } public Integer getPARTIDO_idPARTIDO() { return PARTIDO_idPARTIDO; } public void setPARTIDO_idPARTIDO(Integer PARTIDO_idPARTIDO) { this.PARTIDO_idPARTIDO = PARTIDO_idPARTIDO; } public String getUSUARIO_email() { return USUARIO_email; } public void setUSUARIO_email(String USUARIO_email) { this.USUARIO_email = USUARIO_email; } }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/wcb/Partido_has_Usuario.java
Java
gpl2
1,014
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package wcb; /** * * @author Michelangelo */ public class Pais { private Integer id_Pais; private String nombre; private String directorTecnico; private String grupo; public Pais() { id_Pais = 0; nombre = ""; directorTecnico = ""; grupo = ""; } public String getDirectorTecnico() { return directorTecnico; } public void setDirectorTecnico(String directorTecnico) { this.directorTecnico = directorTecnico; } public String getGrupo() { return grupo; } public void setGrupo(String grupo) { this.grupo = grupo; } public Integer getId_Pais() { return id_Pais; } public void setId_Pais(Integer id_Pais) { this.id_Pais = id_Pais; } public String getNombre() { return nombre; } public void setNombre(String nombre) { this.nombre = nombre; } }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/wcb/Pais.java
Java
gpl2
1,037
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package wcb; /** * * @author Karla Ruiz */ public class Usuario_has_Usuario { private int email_usuario1; private int email_usuario2; private String statu; public Usuario_has_Usuario (int email1, int email2, String s) { email_usuario1= email1; email_usuario2= email2; statu= s; } public int getEmail_usuario1() { return email_usuario1; } public void setEmail_usuario1(int email_usuario1) { this.email_usuario1 = email_usuario1; } public int getEmail_usuario2() { return email_usuario2; } public void setEmail_usuario2(int email_usuario2) { this.email_usuario2 = email_usuario2; } public String getStatu() { return statu; } public void setStatu(String statu) { this.statu = statu; } }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/wcb/Usuario_has_Usuario.java
Java
gpl2
940
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package wcb; import java.util.Date; /** * * @author Angiita */ public class Jugador_has_Usuario { private Integer JUGADOR_idJUGADOR; private String USUARIO_email; //Constructor public Jugador_has_Usuario(Integer iJ, String uE) { JUGADOR_idJUGADOR=iJ; USUARIO_email=uE; } Jugador_has_Usuario() { } public Jugador_has_Usuario llenarJugadorUsuario(Integer iJ, String uE) { Jugador_has_Usuario JugadorUsuario = new Jugador_has_Usuario(iJ, uE); return JugadorUsuario; } public Integer getJUGADOR_idJUGADOR() { return JUGADOR_idJUGADOR; } public void setJUGADOR_idJUGADOR(Integer JUGADOR_idJUGADOR) { this.JUGADOR_idJUGADOR = JUGADOR_idJUGADOR; } public String getUSUARIO_email() { return USUARIO_email; } public void setUSUARIO_email(String USUARIO_email) { this.USUARIO_email = USUARIO_email; } }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/wcb/Jugador_has_Usuario.java
Java
gpl2
1,014
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package wcb; /** * * @author Michelangelo */ public class Usuario_has_Entrada { private String email_Usuario; private Integer id_Entrada; public Usuario_has_Entrada() { email_Usuario=""; id_Entrada = 0; } public String getEmail_Usuario() { return email_Usuario; } public void setEmail_Usuario(String email_Usuario) { this.email_Usuario = email_Usuario; } public Integer getId_Entrada() { return id_Entrada; } public void setId_Entrada(Integer id_Entrada) { this.id_Entrada = id_Entrada; } }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/wcb/Usuario_has_Entrada.java
Java
gpl2
701
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package wcb; import java.util.Date; /** * * @author Angiita */ public class Factura { private Integer idFACTURA; private String USUARIO_email; //Constructor public Factura(Integer iF, String uE) { idFACTURA=iF; USUARIO_email=uE; } Factura() { } public Factura llenarFactura(Integer iF, String uE) { Factura factura = new Factura(iF, uE); return factura; } public Integer getIdFACTURA() { return idFACTURA; } public void setIdFACTURA(Integer idFACTURA) { this.idFACTURA = idFACTURA; } public String getUSUARIO_email() { return USUARIO_email; } public void setUSUARIO_email(String USUARIO_email) { this.USUARIO_email = USUARIO_email; } }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/wcb/Factura.java
Java
gpl2
857
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package wcb; import java.util.Date; /** * * @author Michelangelo */ public class Jugador { private Integer id_Jugador; private Integer id_Pais;//foranea private String ciudad_Nac; private String tipo;//cargo private Date fecha_Nac; public Jugador() { id_Jugador = 0; id_Pais=0; ciudad_Nac = ""; tipo = ""; fecha_Nac = new Date(); } public String getCiudad_Nac() { return ciudad_Nac; } public void setCiudad_Nac(String ciudad_Nac) { this.ciudad_Nac = ciudad_Nac; } public Date getFecha_Nac() { return fecha_Nac; } public void setFecha_Nac(Date fecha_Nac) { this.fecha_Nac = fecha_Nac; } public Integer getId_Jugador() { return id_Jugador; } public void setId_Jugador(Integer id_Jugador) { this.id_Jugador = id_Jugador; } public Integer getId_Pais() { return id_Pais; } public void setId_Pais(Integer id_Pais) { this.id_Pais = id_Pais; } public String getTipo() { return tipo; } public void setTipo(String tipo) { this.tipo = tipo; } }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/wcb/Jugador.java
Java
gpl2
1,285
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package wcb; /** * * @author Michelangelo */ public class Pais_has_Usuario { private Integer id_Pais; private String email_Usuario; public Pais_has_Usuario() { id_Pais = 0; email_Usuario = ""; } public String getEmail_Usuario() { return email_Usuario; } public void setEmail_Usuario(String email_Usuario) { this.email_Usuario = email_Usuario; } public Integer getId_Pais() { return id_Pais; } public void setId_Pais(Integer id_Pais) { this.id_Pais = id_Pais; } }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/wcb/Pais_has_Usuario.java
Java
gpl2
674
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package wcb; import java.sql.*; import java.util.logging.Level; import java.util.logging.Logger; public class BD { static Connection con; public void conectar() throws SQLException { try { Class.forName("com.mysql.jdbc.Driver"); String conec = "jdbc:mysql://localhost/mydb?" + "user=root&password=12345678"; con = DriverManager.getConnection(conec); Statement st = con.createStatement(); ResultSet rs = st.executeQuery("Select * from Copa"); int i = 0; int x; int y; String z; String w; while (rs.next()) { i++; x = rs.getInt(i); y = rs.getInt(i+1); z = rs.getString(i+2); w = rs.getString(i+3); System.out.print(x+" "); System.out.print(y+" "); System.out.print(z+" "); System.out.println(w); i=0; } } catch (ClassNotFoundException ex) { Logger.getLogger(BD.class.getName()).log(Level.SEVERE, null, ex); } } }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/wcb/BD.java
Java
gpl2
1,273
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package wcb; /** * * @author Karla Ruiz */ public class Objeto { //Atributos private Integer idobjeto; private String descripcion; private float precio; private Integer cantidad; private Integer idfactura; //Constructor public Objeto (Integer ido, String dob, float po, Integer co, Integer idfo){ idobjeto= ido; descripcion= dob; precio= po; cantidad= co; idfactura= idfo; } public Integer getIdobjeto() { return idobjeto; } public void setIdobjeto(Integer idobjeto) { this.idobjeto = idobjeto; } public String getDescripcion() { return descripcion; } public void setDescripcion(String descripcion) { this.descripcion = descripcion; } public float getPrecio() { return precio; } public void setPrecio(float precio) { this.precio = precio; } public Integer getCantidad() { return cantidad; } public void setCantidad(Integer cantidad) { this.cantidad = cantidad; } public Integer getIdfactura() { return idfactura; } public void setIdfactura(Integer idfactura) { this.idfactura = idfactura; } }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/wcb/Objeto.java
Java
gpl2
1,312
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package wcb; /** * * @author Michelangelo */ public class Usuario_has_Descuento { private String email_Usuario; private Integer id_Descuento; public Usuario_has_Descuento() { email_Usuario = ""; id_Descuento = 0; } public String getEmail_Usuario() { return email_Usuario; } public void setEmail_Usuario(String email_Usuario) { this.email_Usuario = email_Usuario; } public Integer getId_Descuento() { return id_Descuento; } public void setId_Descuento(Integer id_Descuento) { this.id_Descuento = id_Descuento; } }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/wcb/Usuario_has_Descuento.java
Java
gpl2
727
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package wcb; import java.util.Date; /** * * @author Angiita */ public class Evento { private Integer idEVENTO; private Date fecha; private String lugar; private String informacion; private String USUARIO_email; //Constructor public Evento(Integer iE, Date fec, String lug, String inf, String uE) { idEVENTO=iE; fecha=fec; lugar=lug; informacion=inf; USUARIO_email=uE; } Evento() { } public Evento llenarEvento(Integer iE, Date fec, String lug, String inf, String uE) { Evento evento = new Evento(iE, fec, lug, inf, uE); return evento; } public Integer getIdEVENTO() { return idEVENTO; } public void setIdEVENTO(Integer idEVENTO) { this.idEVENTO = idEVENTO; } public Date getFecha() { return fecha; } public void setFecha(Date fecha) { this.fecha = fecha; } public String getLugar() { return lugar; } public void setLugar(String lugar) { this.lugar = lugar; } public String getInformacion() { return informacion; } public void setInformacion(String informacion) { this.informacion = informacion; } public String getUSUARIO_email() { return USUARIO_email; } public void setUSUARIO_email(String USUARIO_email) { this.USUARIO_email = USUARIO_email; } }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/wcb/Evento.java
Java
gpl2
1,472
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package wcb; import java.util.Date; /** * * @author Angiita */ public class Partido_has_Pais { private Integer PARTIDO_idPARTIDO; private Integer PAIS_idPAIS; //Constructor public Partido_has_Pais(Integer iPartido, Integer iPais) { PARTIDO_idPARTIDO=iPartido; PAIS_idPAIS=iPais; } Partido_has_Pais() { } public Partido_has_Pais llenarPartidoPais(Integer iPartido, Integer iPais) { Partido_has_Pais PartidoPais = new Partido_has_Pais(iPartido, iPais); return PartidoPais; } public Integer getPARTIDO_idPARTIDO() { return PARTIDO_idPARTIDO; } public void setPARTIDO_idPARTIDO(Integer PARTIDO_idPARTIDO) { this.PARTIDO_idPARTIDO = PARTIDO_idPARTIDO; } public Integer getPAIS_idPAIS() { return PAIS_idPAIS; } public void setPAIS_idPAIS(Integer PAIS_idPAIS) { this.PAIS_idPAIS = PAIS_idPAIS; } }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/wcb/Partido_has_Pais.java
Java
gpl2
1,012
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package wcb; import Interfaces.Wellcome; import java.sql.SQLException; /** * * @author Angiita */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) throws SQLException { BD miBD = new BD(); miBD.conectar(); } }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/wcb/Main.java
Java
gpl2
426
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package wcb; /** * * @author Michelangelo */ public class Copa { private Integer id; private Integer id_Pais;//foranea con el pais q la gano private Integer anio; private String pais; private String tipo;//este tipo es de jugada o ganada, consultar si se puede cambiar de string a boolean o tipo de dato dual public Copa() { id=0; anio = 0; pais = ""; tipo = ""; } public Integer getAnio() { return anio; } public void setAnio(Integer anio) { this.anio = anio; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getPais() { return pais; } public void setPais(String pais) { this.pais = pais; } public String getTipo() { return tipo; } public void setTipo(String tipo) { this.tipo = tipo; } public Integer getId_Pais() { return id_Pais; } public void setId_Pais(Integer id_Pais) { this.id_Pais = id_Pais; } }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/wcb/Copa.java
Java
gpl2
1,201
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package wcb; import java.util.Date; /** * * @author Angiita */ public class Entrada { private Integer idENTRADA; private String tipo; private Float precio; //cambiar a float private Integer total_entrada; private String nombre_vendedor; private String USUARIO_email2; private String USUARIO_email; private String USUARIO_email1; private Integer FACTURA_idFACTURA; private Integer PARTIDO_idPARTIDO; private String USUARIO_email3; //Constructor public Entrada(Integer idE, String tipo1, Float precio1, Integer tE, String nV, String uE2, String uE, String uE1, Integer iF, Integer iP, String uE3) { idENTRADA=idE; tipo=tipo1; precio=precio1; //cambiar a float total_entrada=tE; nombre_vendedor=nV; USUARIO_email2=uE2; USUARIO_email=uE; USUARIO_email1=uE1; FACTURA_idFACTURA=iF; PARTIDO_idPARTIDO=iP; USUARIO_email3=uE3; } Entrada() { } public Entrada llenarEntrada(Integer idE, String tipo1, Float precio1, Integer tE, String nV, String uE2, String uE, String uE1, Integer iF, Integer iP, String uE3) { Entrada entrada = new Entrada(idE, tipo1, precio1, tE, nV, uE2, uE, uE1, iF, iP, uE3); return entrada; } public Integer getIdENTRADA() { return idENTRADA; } public void setIdENTRADA(Integer idENTRADA) { this.idENTRADA = idENTRADA; } public String getTipo() { return tipo; } public void setTipo(String tipo) { this.tipo = tipo; } public Float getPrecio() { return precio; } public void setPrecio(Float precio) { this.precio = precio; } public Integer getTotal_entrada() { return total_entrada; } public void setTotal_entrada(Integer total_entrada) { this.total_entrada = total_entrada; } public String getNombre_vendedor() { return nombre_vendedor; } public void setNombre_vendedor(String nombre_vendedor) { this.nombre_vendedor = nombre_vendedor; } public String getUSUARIO_email2() { return USUARIO_email2; } public void setUSUARIO_email2(String USUARIO_email2) { this.USUARIO_email2 = USUARIO_email2; } public String getUSUARIO_email() { return USUARIO_email; } public void setUSUARIO_email(String USUARIO_email) { this.USUARIO_email = USUARIO_email; } public String getUSUARIO_email1() { return USUARIO_email1; } public void setUSUARIO_email1(String USUARIO_email1) { this.USUARIO_email1 = USUARIO_email1; } public Integer getFACTURA_idFACTURA() { return FACTURA_idFACTURA; } public void setFACTURA_idFACTURA(Integer FACTURA_idFACTURA) { this.FACTURA_idFACTURA = FACTURA_idFACTURA; } public Integer getPARTIDO_idPARTIDO() { return PARTIDO_idPARTIDO; } public void setPARTIDO_idPARTIDO(Integer PARTIDO_idPARTIDO) { this.PARTIDO_idPARTIDO = PARTIDO_idPARTIDO; } public String getUSUARIO_email3() { return USUARIO_email3; } public void setUSUARIO_email3(String USUARIO_email3) { this.USUARIO_email3 = USUARIO_email3; } }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/wcb/Entrada.java
Java
gpl2
3,274
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package wcb; /** * * @author Michelangelo */ public class Usuario_has_Factura { private String email_Usuario; private Integer id_Factura; public Usuario_has_Factura() { email_Usuario = ""; id_Factura=0; } public String getEmail_Usuario() { return email_Usuario; } public void setEmail_Usuario(String email_Usuario) { this.email_Usuario = email_Usuario; } public Integer getId_Factura() { return id_Factura; } public void setId_Factura(Integer id_Factura) { this.id_Factura = id_Factura; } }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/wcb/Usuario_has_Factura.java
Java
gpl2
702
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package wcb; import java.sql.Date; /** * * @author Karla Ruiz */ public class Usuario { //Atributos private String email; private String nombre; private String apellido; private Date fecha_nac; private String sexo; private String nacionalidad; private String telefono; private String profesion; private String tipo_usuario; private float descuento; private float monto_acum; public Usuario (String eu, String nu, String au, Date fnu, String su, String nacu, String tu, String pu,String tuu, float du, float mau){ email = eu; nombre = nu; apellido = au; fecha_nac = fnu; sexo = su; nacionalidad = nacu; telefono = tu; profesion = pu; tipo_usuario = tuu; descuento = du; monto_acum = mau; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getNombre() { return nombre; } public void setNombre(String nombre) { this.nombre = nombre; } public String getApellido() { return apellido; } public void setApellido(String apellido) { this.apellido = apellido; } public Date getFecha_nac() { return fecha_nac; } public void setFecha_nac(Date fecha_nac) { this.fecha_nac = fecha_nac; } public String getSexo() { return sexo; } public void setSexo(String sexo) { this.sexo = sexo; } public String getNacionalidad() { return nacionalidad; } public void setNacionalidad(String nacionalidad) { this.nacionalidad = nacionalidad; } public String getTelefono() { return telefono; } public void setTelefono(String telefono) { this.telefono = telefono; } public String getProfesion() { return profesion; } public void setProfesion(String profesion) { this.profesion = profesion; } public String getTipo_usuario() { return tipo_usuario; } public void setTipo_usuario(String tipo_usuario) { this.tipo_usuario = tipo_usuario; } public float getDescuento() { return descuento; } public void setDescuento(float descuento) { this.descuento = descuento; } public float getMonto_acum() { return monto_acum; } public void setMonto_acum(float monto_acum) { this.monto_acum = monto_acum; } }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/wcb/Usuario.java
Java
gpl2
2,654
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package wcb; import java.util.Date; /** * * @author Angiita */ public class Estadio { private Integer idESTADIO; private String nombre; private String ciudad; private Integer aforo; private Date fecha_construccion; //Constructor public Estadio(Integer iE, String nomb, String ciud, Integer af, Date fC) { idESTADIO=iE; nombre=nomb; ciudad=ciud; aforo=af; fecha_construccion=fC; } Estadio() { } public Estadio llenarEstadio(Integer iE, String nomb, String ciud, Integer af, Date fC) { Estadio estadio = new Estadio(iE, nomb, ciud, af, fC); return estadio; } public Integer getIdESTADIO() { return idESTADIO; } public void setIdESTADIO(Integer idESTADIO) { this.idESTADIO = idESTADIO; } public String getNombre() { return nombre; } public void setNombre(String nombre) { this.nombre = nombre; } public String getCiudad() { return ciudad; } public void setCiudad(String ciudad) { this.ciudad = ciudad; } public Integer getAforo() { return aforo; } public void setAforo(Integer aforo) { this.aforo = aforo; } public Date getFecha_construccion() { return fecha_construccion; } public void setFecha_construccion(Date fecha_construccion) { this.fecha_construccion = fecha_construccion; } }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/wcb/Estadio.java
Java
gpl2
1,506
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * AgregarPais.java * * Created on 19-may-2010, 21:28:32 */ package Interfaces; /** * * @author Angiita */ public class AgregarPais extends javax.swing.JFrame { /** Creates new form AgregarPais */ public AgregarPais() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); LPais = new javax.swing.JLabel(); jAtras = new javax.swing.JButton(); jAgregar = new javax.swing.JButton(); LNombre = new javax.swing.JLabel(); LDirectorT = new javax.swing.JLabel(); LGrupo = new javax.swing.JLabel(); jDirectorT = new javax.swing.JTextField(); jGrupo = new javax.swing.JTextField(); jNombre = new javax.swing.JTextField(); fondo = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); LPais.setFont(new java.awt.Font("Tahoma", 1, 18)); LPais.setForeground(new java.awt.Color(255, 255, 255)); LPais.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); LPais.setText("Pais"); LPais.setBounds(210, 20, 70, 30); jLayeredPane1.add(LPais, javax.swing.JLayeredPane.DEFAULT_LAYER); jAtras.setText("Atras"); jAtras.setBounds(60, 330, 90, 23); jLayeredPane1.add(jAtras, javax.swing.JLayeredPane.DEFAULT_LAYER); jAgregar.setText("Agregar"); jAgregar.setBounds(350, 330, 90, 23); jLayeredPane1.add(jAgregar, javax.swing.JLayeredPane.DEFAULT_LAYER); LNombre.setForeground(new java.awt.Color(255, 255, 255)); LNombre.setText("Nombre:"); LNombre.setBounds(110, 110, 70, 14); jLayeredPane1.add(LNombre, javax.swing.JLayeredPane.DEFAULT_LAYER); LDirectorT.setForeground(new java.awt.Color(255, 255, 255)); LDirectorT.setText("Director tecnico:"); LDirectorT.setBounds(110, 150, 100, 14); jLayeredPane1.add(LDirectorT, javax.swing.JLayeredPane.DEFAULT_LAYER); LGrupo.setForeground(new java.awt.Color(255, 255, 255)); LGrupo.setText("Grupo:"); LGrupo.setBounds(110, 190, 60, 14); jLayeredPane1.add(LGrupo, javax.swing.JLayeredPane.DEFAULT_LAYER); jDirectorT.setBounds(250, 150, 130, 20); jLayeredPane1.add(jDirectorT, javax.swing.JLayeredPane.DEFAULT_LAYER); jGrupo.setBounds(250, 190, 130, 20); jLayeredPane1.add(jGrupo, javax.swing.JLayeredPane.DEFAULT_LAYER); jNombre.setBounds(250, 110, 130, 20); jLayeredPane1.add(jNombre, javax.swing.JLayeredPane.DEFAULT_LAYER); fondo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Sudafrica_2010_2.png"))); // NOI18N fondo.setText("jLabel1"); fondo.setBounds(0, 0, 500, 400); jLayeredPane1.add(fondo, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 500, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new AgregarPais().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel LDirectorT; private javax.swing.JLabel LGrupo; private javax.swing.JLabel LNombre; private javax.swing.JLabel LPais; private javax.swing.JLabel fondo; private javax.swing.JButton jAgregar; private javax.swing.JButton jAtras; private javax.swing.JTextField jDirectorT; private javax.swing.JTextField jGrupo; private javax.swing.JLayeredPane jLayeredPane1; private javax.swing.JTextField jNombre; // End of variables declaration//GEN-END:variables }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/Interfaces/AgregarPais.java
Java
gpl2
4,850
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * Usuario_Administrador.java * * Created on 18-may-2010, 21:02:46 */ package Interfaces; /** * * @author Michelangelo */ public class Usuario_Administrador extends javax.swing.JFrame { /** Creates new form Usuario_Administrador */ public Usuario_Administrador() { initComponents(); this.setTitle("Bienvenido"); this.setSize(600,450); this.atras.setLocation(40, 320); this.atras.setSize(125, 30); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); cerrarSeccion = new javax.swing.JLabel(); verPerfil = new javax.swing.JLabel(); icono = new javax.swing.JLabel(); titulo = new javax.swing.JLabel(); atras = new javax.swing.JButton(); fondo = new javax.swing.JLabel(); jMenuBar1 = new javax.swing.JMenuBar(); m_Amigos = new javax.swing.JMenu(); m_Amigos_Agregar = new javax.swing.JMenuItem(); m_Amigos_Consultar = new javax.swing.JMenuItem(); m_Amigos_Bloquear = new javax.swing.JMenuItem(); m_Pais = new javax.swing.JMenu(); m_Pais_Agregar = new javax.swing.JMenuItem(); m_Pais_Consultar = new javax.swing.JMenuItem(); m_Pais_Modificar = new javax.swing.JMenuItem(); m_Pais_BecomeAFan = new javax.swing.JMenuItem(); m_Evento = new javax.swing.JMenu(); m_Evento_Agregar = new javax.swing.JMenuItem(); m_Evento_Modificar = new javax.swing.JMenuItem(); m_Evento_Consultar = new javax.swing.JMenuItem(); m_Evento_Eliminar = new javax.swing.JMenuItem(); m_Factura = new javax.swing.JMenu(); m_Factura_VerDescuento = new javax.swing.JMenuItem(); m_Factura_AgregarDescuento = new javax.swing.JMenuItem(); m_Factura_ModificarDescuento = new javax.swing.JMenuItem(); m_Factura_EliminarDescuento = new javax.swing.JMenuItem(); m_Factura_VerFactura = new javax.swing.JMenuItem(); m_Solicitud = new javax.swing.JMenu(); m_Solicitud_Amigos = new javax.swing.JMenuItem(); m_Solicitud_Miembros = new javax.swing.JMenuItem(); m_Producto = new javax.swing.JMenu(); m_Producto_Agregar = new javax.swing.JMenuItem(); m_Producto_Modificar = new javax.swing.JMenuItem(); m_Producto_Consultar = new javax.swing.JMenuItem(); m_Producto_Eliminar = new javax.swing.JMenuItem(); m_Producto_Comprar = new javax.swing.JMenuItem(); m_Entrada = new javax.swing.JMenu(); m_Entrada_Vender = new javax.swing.JMenuItem(); m_Entrada_Modificar = new javax.swing.JMenuItem(); m_Entrada_Comprar = new javax.swing.JMenuItem(); m_Jugador = new javax.swing.JMenu(); m_Jugador_Agregar = new javax.swing.JMenuItem(); m_Jugador_Modificar = new javax.swing.JMenuItem(); m_Jugador_Consultar = new javax.swing.JMenuItem(); m_Partido = new javax.swing.JMenu(); m_Partido_Agregar = new javax.swing.JMenuItem(); m_Partido_Modificar = new javax.swing.JMenuItem(); m_Partido_Consultar = new javax.swing.JMenuItem(); m_Estadio = new javax.swing.JMenu(); m_Estadio_Agregar = new javax.swing.JMenuItem(); m_Estadio_Modificar = new javax.swing.JMenuItem(); m_Estadio_Consultar = new javax.swing.JMenuItem(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); cerrarSeccion.setForeground(new java.awt.Color(255, 255, 255)); cerrarSeccion.setText("Cerrar Secion"); cerrarSeccion.setBounds(10, 130, 100, 14); jLayeredPane1.add(cerrarSeccion, javax.swing.JLayeredPane.DEFAULT_LAYER); verPerfil.setForeground(new java.awt.Color(255, 255, 255)); verPerfil.setText("Ver Perfil"); verPerfil.setBounds(10, 100, 80, 14); jLayeredPane1.add(verPerfil, javax.swing.JLayeredPane.DEFAULT_LAYER); icono.setForeground(new java.awt.Color(255, 255, 255)); icono.setText("(- _ -)"); icono.setBounds(20, 10, 70, 80); jLayeredPane1.add(icono, javax.swing.JLayeredPane.DEFAULT_LAYER); titulo.setFont(new java.awt.Font("Tahoma", 1, 24)); titulo.setForeground(new java.awt.Color(255, 255, 255)); titulo.setText("Bienvenido "); titulo.setBounds(210, 10, 180, 30); jLayeredPane1.add(titulo, javax.swing.JLayeredPane.DEFAULT_LAYER); atras.setText("atras"); atras.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { atrasActionPerformed(evt); } }); atras.setBounds(70, 330, 73, 23); jLayeredPane1.add(atras, javax.swing.JLayeredPane.DEFAULT_LAYER); fondo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Hamburg.jpg"))); // NOI18N fondo.setText("jLabel3"); fondo.setBounds(0, 0, 610, 410); jLayeredPane1.add(fondo, javax.swing.JLayeredPane.DEFAULT_LAYER); m_Amigos.setText("Amigos"); m_Amigos_Agregar.setText("Agregar"); m_Amigos.add(m_Amigos_Agregar); m_Amigos_Consultar.setText("Consultar"); m_Amigos.add(m_Amigos_Consultar); m_Amigos_Bloquear.setText("Bloquear"); m_Amigos.add(m_Amigos_Bloquear); jMenuBar1.add(m_Amigos); m_Pais.setText("Pais"); m_Pais_Agregar.setText("Agregar"); m_Pais.add(m_Pais_Agregar); m_Pais_Consultar.setText("Consultar"); m_Pais.add(m_Pais_Consultar); m_Pais_Modificar.setText("Modificar"); m_Pais.add(m_Pais_Modificar); m_Pais_BecomeAFan.setText("Volverse Fan"); m_Pais.add(m_Pais_BecomeAFan); jMenuBar1.add(m_Pais); m_Evento.setText("Evento"); m_Evento_Agregar.setText("Agregar"); m_Evento.add(m_Evento_Agregar); m_Evento_Modificar.setText("Modificar"); m_Evento.add(m_Evento_Modificar); m_Evento_Consultar.setText("Consultar"); m_Evento.add(m_Evento_Consultar); m_Evento_Eliminar.setText("Eliminar"); m_Evento.add(m_Evento_Eliminar); jMenuBar1.add(m_Evento); m_Factura.setText("Factura"); m_Factura_VerDescuento.setText("Ver Descuento"); m_Factura.add(m_Factura_VerDescuento); m_Factura_AgregarDescuento.setText("Agregar Descuento"); m_Factura.add(m_Factura_AgregarDescuento); m_Factura_ModificarDescuento.setText("Modificar Descuento"); m_Factura.add(m_Factura_ModificarDescuento); m_Factura_EliminarDescuento.setText("Eliminar Descuentos"); m_Factura.add(m_Factura_EliminarDescuento); m_Factura_VerFactura.setText("Ver Factura"); m_Factura.add(m_Factura_VerFactura); jMenuBar1.add(m_Factura); m_Solicitud.setText("Solicitud"); m_Solicitud_Amigos.setText("Amigos"); m_Solicitud.add(m_Solicitud_Amigos); m_Solicitud_Miembros.setText("Miembro"); m_Solicitud.add(m_Solicitud_Miembros); jMenuBar1.add(m_Solicitud); m_Producto.setText("Producto"); m_Producto_Agregar.setText("Agregar"); m_Producto.add(m_Producto_Agregar); m_Producto_Modificar.setText("Modificar"); m_Producto.add(m_Producto_Modificar); m_Producto_Consultar.setText("Consultar"); m_Producto.add(m_Producto_Consultar); m_Producto_Eliminar.setText("Eliminar"); m_Producto.add(m_Producto_Eliminar); m_Producto_Comprar.setText("Comprar"); m_Producto.add(m_Producto_Comprar); jMenuBar1.add(m_Producto); m_Entrada.setText("Entradas"); m_Entrada_Vender.setText("Vender"); m_Entrada.add(m_Entrada_Vender); m_Entrada_Modificar.setText("Modificar"); m_Entrada.add(m_Entrada_Modificar); m_Entrada_Comprar.setText("Comprar"); m_Entrada.add(m_Entrada_Comprar); jMenuBar1.add(m_Entrada); m_Jugador.setText("Jugador"); m_Jugador_Agregar.setText("Agregar"); m_Jugador.add(m_Jugador_Agregar); m_Jugador_Modificar.setText("Modificar"); m_Jugador.add(m_Jugador_Modificar); m_Jugador_Consultar.setText("Consultar"); m_Jugador.add(m_Jugador_Consultar); jMenuBar1.add(m_Jugador); m_Partido.setText("Partido"); m_Partido_Agregar.setText("Agregar"); m_Partido.add(m_Partido_Agregar); m_Partido_Modificar.setText("Modificar"); m_Partido.add(m_Partido_Modificar); m_Partido_Consultar.setText("Consultar"); m_Partido.add(m_Partido_Consultar); jMenuBar1.add(m_Partido); m_Estadio.setText("Estadio"); m_Estadio_Agregar.setText("Agregar"); m_Estadio.add(m_Estadio_Agregar); m_Estadio_Modificar.setText("Modificar"); m_Estadio.add(m_Estadio_Modificar); m_Estadio_Consultar.setText("Consultar"); m_Estadio.add(m_Estadio_Consultar); jMenuBar1.add(m_Estadio); setJMenuBar(jMenuBar1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jLayeredPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 603, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 412, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents private void atrasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_atrasActionPerformed // TODO add your handling code here: }//GEN-LAST:event_atrasActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Usuario_Administrador().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton atras; private javax.swing.JLabel cerrarSeccion; private javax.swing.JLabel fondo; private javax.swing.JLabel icono; private javax.swing.JLayeredPane jLayeredPane1; private javax.swing.JMenuBar jMenuBar1; private javax.swing.JMenu m_Amigos; private javax.swing.JMenuItem m_Amigos_Agregar; private javax.swing.JMenuItem m_Amigos_Bloquear; private javax.swing.JMenuItem m_Amigos_Consultar; private javax.swing.JMenu m_Entrada; private javax.swing.JMenuItem m_Entrada_Comprar; private javax.swing.JMenuItem m_Entrada_Modificar; private javax.swing.JMenuItem m_Entrada_Vender; private javax.swing.JMenu m_Estadio; private javax.swing.JMenuItem m_Estadio_Agregar; private javax.swing.JMenuItem m_Estadio_Consultar; private javax.swing.JMenuItem m_Estadio_Modificar; private javax.swing.JMenu m_Evento; private javax.swing.JMenuItem m_Evento_Agregar; private javax.swing.JMenuItem m_Evento_Consultar; private javax.swing.JMenuItem m_Evento_Eliminar; private javax.swing.JMenuItem m_Evento_Modificar; private javax.swing.JMenu m_Factura; private javax.swing.JMenuItem m_Factura_AgregarDescuento; private javax.swing.JMenuItem m_Factura_EliminarDescuento; private javax.swing.JMenuItem m_Factura_ModificarDescuento; private javax.swing.JMenuItem m_Factura_VerDescuento; private javax.swing.JMenuItem m_Factura_VerFactura; private javax.swing.JMenu m_Jugador; private javax.swing.JMenuItem m_Jugador_Agregar; private javax.swing.JMenuItem m_Jugador_Consultar; private javax.swing.JMenuItem m_Jugador_Modificar; private javax.swing.JMenu m_Pais; private javax.swing.JMenuItem m_Pais_Agregar; private javax.swing.JMenuItem m_Pais_BecomeAFan; private javax.swing.JMenuItem m_Pais_Consultar; private javax.swing.JMenuItem m_Pais_Modificar; private javax.swing.JMenu m_Partido; private javax.swing.JMenuItem m_Partido_Agregar; private javax.swing.JMenuItem m_Partido_Consultar; private javax.swing.JMenuItem m_Partido_Modificar; private javax.swing.JMenu m_Producto; private javax.swing.JMenuItem m_Producto_Agregar; private javax.swing.JMenuItem m_Producto_Comprar; private javax.swing.JMenuItem m_Producto_Consultar; private javax.swing.JMenuItem m_Producto_Eliminar; private javax.swing.JMenuItem m_Producto_Modificar; private javax.swing.JMenu m_Solicitud; private javax.swing.JMenuItem m_Solicitud_Amigos; private javax.swing.JMenuItem m_Solicitud_Miembros; private javax.swing.JLabel titulo; private javax.swing.JLabel verPerfil; // End of variables declaration//GEN-END:variables }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/Interfaces/Usuario_Administrador.java
Java
gpl2
13,687
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * Agregar_Amigo.java * * Created on 19-may-2010, 19:49:03 */ package Interfaces; /** * * @author Michelangelo */ public class Agregar_Amigo extends javax.swing.JFrame { /** Creates new form Agregar_Amigo */ public Agregar_Amigo() { initComponents(); this.setTitle("Amigos"); this.setSize(500, 400); this.cb_ListaAmigos.setLocation(140,120); this.l_ListaAmigos.setLocation(this.cb_ListaAmigos.getX(),this.cb_ListaAmigos.getY()-25); this.l_ListaAmigos.setText("Lista de Amigos"); this.atras.setLocation(50, 280); this.atras.setSize(125, 30); this.agregar.setLocation(320, 280); this.agregar.setSize(125, 30); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); l_ListaAmigos = new javax.swing.JLabel(); cb_ListaAmigos = new javax.swing.JComboBox(); atras = new javax.swing.JButton(); agregar = new javax.swing.JButton(); titulo = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); l_ListaAmigos.setBackground(new java.awt.Color(204, 255, 51)); l_ListaAmigos.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N l_ListaAmigos.setForeground(new java.awt.Color(255, 255, 255)); l_ListaAmigos.setText("Lista Amigos"); l_ListaAmigos.setBounds(130, 120, 120, 20); jLayeredPane1.add(l_ListaAmigos, javax.swing.JLayeredPane.DEFAULT_LAYER); cb_ListaAmigos.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); cb_ListaAmigos.setBounds(130, 140, 210, 20); jLayeredPane1.add(cb_ListaAmigos, javax.swing.JLayeredPane.DEFAULT_LAYER); atras.setText("Atras"); atras.setBounds(60, 280, 100, 23); jLayeredPane1.add(atras, javax.swing.JLayeredPane.DEFAULT_LAYER); agregar.setText("Agregar"); agregar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { agregarActionPerformed(evt); } }); agregar.setBounds(310, 277, 100, 23); jLayeredPane1.add(agregar, javax.swing.JLayeredPane.DEFAULT_LAYER); titulo.setBackground(new java.awt.Color(204, 255, 51)); titulo.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N titulo.setText(" Amigos"); titulo.setBounds(150, 10, 210, 22); jLayeredPane1.add(titulo, javax.swing.JLayeredPane.DEFAULT_LAYER); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Homero_2.png"))); // NOI18N jLabel1.setText("jLabel1"); jLabel1.setBounds(0, 0, 480, 410); jLayeredPane1.add(jLabel1, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 482, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 340, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents private void agregarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_agregarActionPerformed // TODO add your handling code here: }//GEN-LAST:event_agregarActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Agregar_Amigo().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton agregar; private javax.swing.JButton atras; private javax.swing.JComboBox cb_ListaAmigos; private javax.swing.JLabel jLabel1; private javax.swing.JLayeredPane jLayeredPane1; private javax.swing.JLabel l_ListaAmigos; private javax.swing.JLabel titulo; // End of variables declaration//GEN-END:variables }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/Interfaces/Agregar_Amigo.java
Java
gpl2
4,939
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * Agregar_Descuento.java * * Created on 23/05/2010, 09:26:06 AM */ package Interfaces; /** * * @author Karla Ruiz */ public class Agregar_Descuento extends javax.swing.JFrame { /** Creates new form Agregar_Descuento */ public Agregar_Descuento() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); titulo = new javax.swing.JLabel(); lmonto = new javax.swing.JLabel(); lporcentaje = new javax.swing.JLabel(); monto = new javax.swing.JTextField(); porcentaje = new javax.swing.JTextField(); atras = new javax.swing.JButton(); agregar = new javax.swing.JButton(); jButton1 = new javax.swing.JButton(); imagen = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Descuento"); setMinimumSize(new java.awt.Dimension(500, 400)); titulo.setFont(new java.awt.Font("Tahoma", 1, 18)); titulo.setForeground(new java.awt.Color(255, 255, 255)); titulo.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); titulo.setText("Descuento"); titulo.setBounds(170, 30, 140, -1); jLayeredPane1.add(titulo, javax.swing.JLayeredPane.DEFAULT_LAYER); lmonto.setForeground(new java.awt.Color(255, 255, 255)); lmonto.setText("Monto"); lmonto.setBounds(140, 130, 50, -1); jLayeredPane1.add(lmonto, javax.swing.JLayeredPane.DEFAULT_LAYER); lporcentaje.setForeground(new java.awt.Color(255, 255, 255)); lporcentaje.setText("Porcentaje"); lporcentaje.setBounds(140, 170, 70, -1); jLayeredPane1.add(lporcentaje, javax.swing.JLayeredPane.DEFAULT_LAYER); monto.setBounds(250, 130, 120, -1); jLayeredPane1.add(monto, javax.swing.JLayeredPane.DEFAULT_LAYER); porcentaje.setBounds(250, 170, 120, -1); jLayeredPane1.add(porcentaje, javax.swing.JLayeredPane.DEFAULT_LAYER); atras.setText("Atrás"); atras.setBounds(30, 350, 90, -1); jLayeredPane1.add(atras, javax.swing.JLayeredPane.DEFAULT_LAYER); agregar.setText("Agregar"); agregar.setBounds(370, 350, 90, -1); jLayeredPane1.add(agregar, javax.swing.JLayeredPane.DEFAULT_LAYER); jButton1.setText("Modificar"); jButton1.setBounds(370, 310, 90, -1); jLayeredPane1.add(jButton1, javax.swing.JLayeredPane.DEFAULT_LAYER); imagen.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Sudafrica_2010_2.png"))); // NOI18N imagen.setBounds(0, 0, 500, 400); jLayeredPane1.add(imagen, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 500, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Agregar_Descuento().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton agregar; private javax.swing.JButton atras; private javax.swing.JLabel imagen; private javax.swing.JButton jButton1; private javax.swing.JLayeredPane jLayeredPane1; private javax.swing.JLabel lmonto; private javax.swing.JLabel lporcentaje; private javax.swing.JTextField monto; private javax.swing.JTextField porcentaje; private javax.swing.JLabel titulo; // End of variables declaration//GEN-END:variables }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/Interfaces/Agregar_Descuento.java
Java
gpl2
4,672
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * Agregar_Jugador.java * * Created on 23/05/2010, 09:06:35 AM */ package Interfaces; /** * * @author Karla Ruiz */ public class Agregar_Jugador extends javax.swing.JFrame { /** Creates new form Agregar_Jugador */ public Agregar_Jugador() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); titulo = new javax.swing.JLabel(); lnombre = new javax.swing.JLabel(); lfechanac = new javax.swing.JLabel(); lciudadnac = new javax.swing.JLabel(); ltipo = new javax.swing.JLabel(); lequipo = new javax.swing.JLabel(); nombre = new javax.swing.JTextField(); fechanac = new com.toedter.calendar.JDateChooser(); ciudadnac = new javax.swing.JTextField(); tipo = new javax.swing.JComboBox(); equipo = new javax.swing.JComboBox(); atras = new javax.swing.JButton(); agregar = new javax.swing.JButton(); imagen = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Agregar Jugador"); setMinimumSize(new java.awt.Dimension(500, 400)); titulo.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N titulo.setForeground(new java.awt.Color(0, 0, 255)); titulo.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); titulo.setText("Jugador"); titulo.setBounds(190, 20, 110, 22); jLayeredPane1.add(titulo, javax.swing.JLayeredPane.DEFAULT_LAYER); lnombre.setForeground(new java.awt.Color(0, 0, 255)); lnombre.setText("Nombre"); lnombre.setBounds(90, 90, 70, 14); jLayeredPane1.add(lnombre, javax.swing.JLayeredPane.DEFAULT_LAYER); lfechanac.setForeground(new java.awt.Color(0, 0, 255)); lfechanac.setText("Fecha de Nacimiento"); lfechanac.setBounds(90, 130, 130, 14); jLayeredPane1.add(lfechanac, javax.swing.JLayeredPane.DEFAULT_LAYER); lciudadnac.setForeground(new java.awt.Color(0, 0, 255)); lciudadnac.setText("Ciudad de Nacimiento"); lciudadnac.setBounds(90, 170, 140, 14); jLayeredPane1.add(lciudadnac, javax.swing.JLayeredPane.DEFAULT_LAYER); ltipo.setForeground(new java.awt.Color(0, 0, 255)); ltipo.setText("Tipo de Jugador"); ltipo.setBounds(90, 210, 110, 14); jLayeredPane1.add(ltipo, javax.swing.JLayeredPane.DEFAULT_LAYER); lequipo.setForeground(new java.awt.Color(0, 0, 255)); lequipo.setText("Equipo"); lequipo.setBounds(90, 250, 60, 14); jLayeredPane1.add(lequipo, javax.swing.JLayeredPane.DEFAULT_LAYER); nombre.setBounds(230, 90, 130, 20); jLayeredPane1.add(nombre, javax.swing.JLayeredPane.DEFAULT_LAYER); fechanac.setBounds(230, 130, 130, 20); jLayeredPane1.add(fechanac, javax.swing.JLayeredPane.DEFAULT_LAYER); ciudadnac.setBounds(230, 170, 130, 20); jLayeredPane1.add(ciudadnac, javax.swing.JLayeredPane.DEFAULT_LAYER); tipo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Capitan", "Jugador" })); tipo.setBounds(230, 210, 130, 20); jLayeredPane1.add(tipo, javax.swing.JLayeredPane.DEFAULT_LAYER); equipo.setBounds(230, 250, 130, 20); jLayeredPane1.add(equipo, javax.swing.JLayeredPane.DEFAULT_LAYER); atras.setText("Atrás"); atras.setBounds(20, 360, 90, 23); jLayeredPane1.add(atras, javax.swing.JLayeredPane.DEFAULT_LAYER); agregar.setText("Agregar"); agregar.setBounds(390, 360, 90, 23); jLayeredPane1.add(agregar, javax.swing.JLayeredPane.DEFAULT_LAYER); imagen.setForeground(new java.awt.Color(0, 0, 255)); imagen.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/football_194359.jpg"))); // NOI18N imagen.setBounds(0, 0, 500, 400); jLayeredPane1.add(imagen, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 500, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Agregar_Jugador().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton agregar; private javax.swing.JButton atras; private javax.swing.JTextField ciudadnac; private javax.swing.JComboBox equipo; private com.toedter.calendar.JDateChooser fechanac; private javax.swing.JLabel imagen; private javax.swing.JLayeredPane jLayeredPane1; private javax.swing.JLabel lciudadnac; private javax.swing.JLabel lequipo; private javax.swing.JLabel lfechanac; private javax.swing.JLabel lnombre; private javax.swing.JLabel ltipo; private javax.swing.JTextField nombre; private javax.swing.JComboBox tipo; private javax.swing.JLabel titulo; // End of variables declaration//GEN-END:variables }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/Interfaces/Agregar_Jugador.java
Java
gpl2
6,161
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * ConsultarPartido.java * * Created on 19-may-2010, 20:22:29 */ package Interfaces; /** * * @author Angiita */ public class ConsultarPartido extends javax.swing.JFrame { /** Creates new form ConsultarPartido */ public ConsultarPartido() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); LFecha = new javax.swing.JLabel(); jFecha = new javax.swing.JComboBox(); jPartido = new javax.swing.JScrollPane(); jTPartido = new javax.swing.JTable(); jAtras = new javax.swing.JButton(); jConsultar = new javax.swing.JButton(); LPartido = new javax.swing.JLabel(); jModificr = new javax.swing.JButton(); imagen = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jLayeredPane1.setPreferredSize(new java.awt.Dimension(520, 300)); LFecha.setForeground(new java.awt.Color(255, 255, 255)); LFecha.setText("Fecha"); LFecha.setBounds(40, 70, 29, 14); jLayeredPane1.add(LFecha, javax.swing.JLayeredPane.DEFAULT_LAYER); jFecha.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jFechaActionPerformed(evt); } }); jFecha.setBounds(40, 90, 110, 20); jLayeredPane1.add(jFecha, javax.swing.JLayeredPane.DEFAULT_LAYER); jTPartido.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null} }, new String [] { "Hora", "Pais", "Pais", "Estadio" } )); jPartido.setViewportView(jTPartido); jPartido.setBounds(50, 140, 370, 90); jLayeredPane1.add(jPartido, javax.swing.JLayeredPane.DEFAULT_LAYER); jAtras.setText("Atras"); jAtras.setBounds(50, 320, 100, 23); jLayeredPane1.add(jAtras, javax.swing.JLayeredPane.DEFAULT_LAYER); jConsultar.setText("Consultar"); jConsultar.setBounds(200, 320, 100, 23); jLayeredPane1.add(jConsultar, javax.swing.JLayeredPane.DEFAULT_LAYER); LPartido.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N LPartido.setForeground(new java.awt.Color(255, 255, 255)); LPartido.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); LPartido.setText("Partido"); LPartido.setBounds(200, 20, 120, 30); jLayeredPane1.add(LPartido, javax.swing.JLayeredPane.DEFAULT_LAYER); jModificr.setText("Modificar"); jModificr.setBounds(340, 320, 90, 23); jLayeredPane1.add(jModificr, javax.swing.JLayeredPane.DEFAULT_LAYER); imagen.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Hamburg.jpg"))); // NOI18N imagen.setText("jLabel1"); imagen.setBounds(0, 0, 500, 400); jLayeredPane1.add(imagen, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 500, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents private void jFechaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jFechaActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jFechaActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new ConsultarPartido().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel LFecha; private javax.swing.JLabel LPartido; private javax.swing.JLabel imagen; private javax.swing.JButton jAtras; private javax.swing.JButton jConsultar; private javax.swing.JComboBox jFecha; private javax.swing.JLayeredPane jLayeredPane1; private javax.swing.JButton jModificr; private javax.swing.JScrollPane jPartido; private javax.swing.JTable jTPartido; // End of variables declaration//GEN-END:variables }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/Interfaces/ConsultarPartido.java
Java
gpl2
5,319
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * VentaEntradaObjetos.java * * Created on 19-may-2010, 20:01:05 */ package Interfaces; /** * * @author Angiita */ public class VentaEntradaObjetos extends javax.swing.JFrame { /** Creates new form VentaEntradaObjetos */ public VentaEntradaObjetos() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); LEntrada = new javax.swing.JLabel(); LPartidos = new javax.swing.JLabel(); jPartidos = new javax.swing.JComboBox(); LVIP = new javax.swing.JLabel(); LPreferencial = new javax.swing.JLabel(); LGeneral = new javax.swing.JLabel(); jVIP = new javax.swing.JComboBox(); jPreferencial = new javax.swing.JComboBox(); jGeneral = new javax.swing.JComboBox(); LMonto = new javax.swing.JLabel(); JMonto = new javax.swing.JTextField(); LObjetos = new javax.swing.JLabel(); jObjetos = new javax.swing.JComboBox(); jCantidad = new javax.swing.JComboBox(); LCantidad = new javax.swing.JLabel(); LMonto2 = new javax.swing.JLabel(); jMonto2 = new javax.swing.JTextField(); jAtras = new javax.swing.JButton(); LArticulos = new javax.swing.JLabel(); jGenerar = new javax.swing.JButton(); jAgregar = new javax.swing.JButton(); LPrincipal = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); LEntrada.setFont(new java.awt.Font("Tahoma", 1, 18)); LEntrada.setForeground(new java.awt.Color(255, 255, 51)); LEntrada.setText("Entrada"); LEntrada.setBounds(190, 20, 90, 30); jLayeredPane1.add(LEntrada, javax.swing.JLayeredPane.DEFAULT_LAYER); LPartidos.setFont(new java.awt.Font("Tahoma", 1, 11)); LPartidos.setForeground(new java.awt.Color(255, 255, 51)); LPartidos.setText("Partido"); LPartidos.setBounds(20, 80, 70, 20); jLayeredPane1.add(LPartidos, javax.swing.JLayeredPane.DEFAULT_LAYER); jPartidos.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Partidos" })); jPartidos.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jPartidosActionPerformed(evt); } }); jPartidos.setBounds(80, 80, 90, -1); jLayeredPane1.add(jPartidos, javax.swing.JLayeredPane.DEFAULT_LAYER); LVIP.setFont(new java.awt.Font("Tahoma", 1, 11)); LVIP.setForeground(new java.awt.Color(255, 255, 51)); LVIP.setText("VIP:"); LVIP.setBounds(210, 70, 40, 20); jLayeredPane1.add(LVIP, javax.swing.JLayeredPane.DEFAULT_LAYER); LPreferencial.setFont(new java.awt.Font("Tahoma", 1, 11)); LPreferencial.setForeground(new java.awt.Color(255, 255, 51)); LPreferencial.setText("Preferencial:"); LPreferencial.setBounds(210, 100, 80, -1); jLayeredPane1.add(LPreferencial, javax.swing.JLayeredPane.DEFAULT_LAYER); LGeneral.setFont(new java.awt.Font("Tahoma", 1, 11)); LGeneral.setForeground(new java.awt.Color(255, 255, 51)); LGeneral.setText("General:"); LGeneral.setBounds(210, 130, 60, -1); jLayeredPane1.add(LGeneral, javax.swing.JLayeredPane.DEFAULT_LAYER); jVIP.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); jVIP.setBounds(300, 70, -1, 20); jLayeredPane1.add(jVIP, javax.swing.JLayeredPane.DEFAULT_LAYER); jPreferencial.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); jPreferencial.setBounds(300, 100, -1, 20); jLayeredPane1.add(jPreferencial, javax.swing.JLayeredPane.DEFAULT_LAYER); jGeneral.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); jGeneral.setBounds(300, 130, -1, -1); jLayeredPane1.add(jGeneral, javax.swing.JLayeredPane.DEFAULT_LAYER); LMonto.setFont(new java.awt.Font("Tahoma", 1, 11)); LMonto.setForeground(new java.awt.Color(255, 255, 51)); LMonto.setText("Monto"); LMonto.setBounds(380, 90, 50, -1); jLayeredPane1.add(LMonto, javax.swing.JLayeredPane.DEFAULT_LAYER); JMonto.setBounds(430, 90, 60, -1); jLayeredPane1.add(JMonto, javax.swing.JLayeredPane.DEFAULT_LAYER); LObjetos.setFont(new java.awt.Font("Tahoma", 1, 18)); LObjetos.setForeground(new java.awt.Color(255, 255, 51)); LObjetos.setText("OBJETOS"); LObjetos.setBounds(200, 200, 120, 20); jLayeredPane1.add(LObjetos, javax.swing.JLayeredPane.DEFAULT_LAYER); jObjetos.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Objetos" })); jObjetos.setBounds(80, 250, 90, -1); jLayeredPane1.add(jObjetos, javax.swing.JLayeredPane.DEFAULT_LAYER); jCantidad.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); jCantidad.setBounds(290, 250, -1, -1); jLayeredPane1.add(jCantidad, javax.swing.JLayeredPane.DEFAULT_LAYER); LCantidad.setFont(new java.awt.Font("Tahoma", 1, 11)); LCantidad.setForeground(new java.awt.Color(255, 255, 51)); LCantidad.setText("Cantidad:"); LCantidad.setBounds(210, 250, 70, -1); jLayeredPane1.add(LCantidad, javax.swing.JLayeredPane.DEFAULT_LAYER); LMonto2.setFont(new java.awt.Font("Tahoma", 1, 11)); LMonto2.setForeground(new java.awt.Color(255, 255, 51)); LMonto2.setText("Monto:"); LMonto2.setBounds(370, 250, -1, -1); jLayeredPane1.add(LMonto2, javax.swing.JLayeredPane.DEFAULT_LAYER); jMonto2.setBounds(430, 250, 60, -1); jLayeredPane1.add(jMonto2, javax.swing.JLayeredPane.DEFAULT_LAYER); jAtras.setText("Atras"); jAtras.setBounds(40, 340, 100, -1); jLayeredPane1.add(jAtras, javax.swing.JLayeredPane.DEFAULT_LAYER); LArticulos.setFont(new java.awt.Font("Tahoma", 1, 11)); LArticulos.setForeground(new java.awt.Color(255, 255, 51)); LArticulos.setText("Articulo"); LArticulos.setBounds(20, 250, -1, -1); jLayeredPane1.add(LArticulos, javax.swing.JLayeredPane.DEFAULT_LAYER); jGenerar.setText("Generar Factura"); jGenerar.setBounds(200, 340, 120, -1); jLayeredPane1.add(jGenerar, javax.swing.JLayeredPane.DEFAULT_LAYER); jAgregar.setText("Agregar"); jAgregar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jAgregarActionPerformed(evt); } }); jAgregar.setBounds(370, 340, 100, -1); jLayeredPane1.add(jAgregar, javax.swing.JLayeredPane.DEFAULT_LAYER); LPrincipal.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/football_194359.jpg"))); // NOI18N LPrincipal.setBounds(0, 0, -1, 400); jLayeredPane1.add(LPrincipal, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 496, javax.swing.GroupLayout.PREFERRED_SIZE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents private void jPartidosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jPartidosActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jPartidosActionPerformed private void jAgregarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jAgregarActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jAgregarActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new VentaEntradaObjetos().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JTextField JMonto; private javax.swing.JLabel LArticulos; private javax.swing.JLabel LCantidad; private javax.swing.JLabel LEntrada; private javax.swing.JLabel LGeneral; private javax.swing.JLabel LMonto; private javax.swing.JLabel LMonto2; private javax.swing.JLabel LObjetos; private javax.swing.JLabel LPartidos; private javax.swing.JLabel LPreferencial; private javax.swing.JLabel LPrincipal; private javax.swing.JLabel LVIP; private javax.swing.JButton jAgregar; private javax.swing.JButton jAtras; private javax.swing.JComboBox jCantidad; private javax.swing.JComboBox jGeneral; private javax.swing.JButton jGenerar; private javax.swing.JLayeredPane jLayeredPane1; private javax.swing.JTextField jMonto2; private javax.swing.JComboBox jObjetos; private javax.swing.JComboBox jPartidos; private javax.swing.JComboBox jPreferencial; private javax.swing.JComboBox jVIP; // End of variables declaration//GEN-END:variables }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/Interfaces/VentaEntradaObjetos.java
Java
gpl2
10,165
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * Objeto_Consultar.java * * Created on 23/05/2010, 11:24:57 AM */ package Interfaces; /** * * @author Karla Ruiz */ public class Objeto_Consultar extends javax.swing.JFrame { /** Creates new form Objeto_Consultar */ public Objeto_Consultar() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); titulo = new javax.swing.JLabel(); objetos = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); atras = new javax.swing.JButton(); eliminar = new javax.swing.JButton(); modificar = new javax.swing.JButton(); imagen = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setMinimumSize(new java.awt.Dimension(500, 400)); titulo.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N titulo.setForeground(new java.awt.Color(255, 255, 255)); titulo.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); titulo.setText("Objetos"); titulo.setBounds(180, 20, 120, 29); jLayeredPane1.add(titulo, javax.swing.JLayeredPane.DEFAULT_LAYER); jTable1.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null} }, new String [] { "Nº", "Descripcion", "Precio", "Cantidad" } )); objetos.setViewportView(jTable1); objetos.setBounds(20, 70, 450, 190); jLayeredPane1.add(objetos, javax.swing.JLayeredPane.DEFAULT_LAYER); atras.setText("Atrás"); atras.setBounds(60, 350, 100, 23); jLayeredPane1.add(atras, javax.swing.JLayeredPane.DEFAULT_LAYER); eliminar.setText("Eliminar"); eliminar.setBounds(340, 310, 100, 23); jLayeredPane1.add(eliminar, javax.swing.JLayeredPane.DEFAULT_LAYER); modificar.setText("Modificar"); modificar.setBounds(340, 350, 100, 23); jLayeredPane1.add(modificar, javax.swing.JLayeredPane.DEFAULT_LAYER); imagen.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/fonfofifa2.png"))); // NOI18N imagen.setBounds(0, 0, 500, 400); jLayeredPane1.add(imagen, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 500, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Objeto_Consultar().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton atras; private javax.swing.JButton eliminar; private javax.swing.JLabel imagen; private javax.swing.JLayeredPane jLayeredPane1; private javax.swing.JTable jTable1; private javax.swing.JButton modificar; private javax.swing.JScrollPane objetos; private javax.swing.JLabel titulo; // End of variables declaration//GEN-END:variables }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/Interfaces/Objeto_Consultar.java
Java
gpl2
4,571
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * SolicitudAmigoMiembro.java * * Created on 21-may-2010, 19:02:39 */ package Interfaces; /** * * @author Angiita */ public class SolicitudAmigoMiembro extends javax.swing.JFrame { /** Creates new form SolicitudAmigoMiembro */ public SolicitudAmigoMiembro() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); jNombreSolicitantes = new javax.swing.JComboBox(); LSolicitudes = new javax.swing.JLabel(); jAtras = new javax.swing.JButton(); jSolicitudes = new javax.swing.JScrollPane(); jTSolicitudes = new javax.swing.JTable(); jRechazar = new javax.swing.JButton(); jAceptar = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jNombreSolicitantes.setBounds(80, 110, 360, -1); jLayeredPane1.add(jNombreSolicitantes, javax.swing.JLayeredPane.DEFAULT_LAYER); LSolicitudes.setFont(new java.awt.Font("Tahoma", 1, 18)); LSolicitudes.setForeground(new java.awt.Color(255, 255, 255)); LSolicitudes.setText("Solicitudes"); LSolicitudes.setBounds(190, 30, 110, 30); jLayeredPane1.add(LSolicitudes, javax.swing.JLayeredPane.DEFAULT_LAYER); jAtras.setText("Atras"); jAtras.setBounds(70, 340, 90, -1); jLayeredPane1.add(jAtras, javax.swing.JLayeredPane.DEFAULT_LAYER); jTSolicitudes.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null} }, new String [] { "Nacionalidad", "Sexo", "Fecha Solicitud" } )); jSolicitudes.setViewportView(jTSolicitudes); jSolicitudes.setBounds(80, 170, 360, 90); jLayeredPane1.add(jSolicitudes, javax.swing.JLayeredPane.DEFAULT_LAYER); jRechazar.setText("Rechazar"); jRechazar.setBounds(210, 340, 90, -1); jLayeredPane1.add(jRechazar, javax.swing.JLayeredPane.DEFAULT_LAYER); jAceptar.setText("Aceptar"); jAceptar.setBounds(350, 340, 90, -1); jLayeredPane1.add(jAceptar, javax.swing.JLayeredPane.DEFAULT_LAYER); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Sudafrica_2010_2.png"))); // NOI18N jLabel1.setText("jLabel1"); jLabel1.setBounds(0, 0, 500, 400); jLayeredPane1.add(jLabel1, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 500, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new SolicitudAmigoMiembro().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel LSolicitudes; private javax.swing.JButton jAceptar; private javax.swing.JButton jAtras; private javax.swing.JLabel jLabel1; private javax.swing.JLayeredPane jLayeredPane1; private javax.swing.JComboBox jNombreSolicitantes; private javax.swing.JButton jRechazar; private javax.swing.JScrollPane jSolicitudes; private javax.swing.JTable jTSolicitudes; // End of variables declaration//GEN-END:variables }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/Interfaces/SolicitudAmigoMiembro.java
Java
gpl2
4,573
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * Consultar_Amigo.java * * Created on 19-may-2010, 19:52:22 */ package Interfaces; /** * * @author Michelangelo */ public class Consultar_Amigo extends javax.swing.JFrame { /** Creates new form Consultar_Amigo */ public Consultar_Amigo() { initComponents(); this.setTitle("Amigos"); this.setSize(600,450); this.atras.setLocation(40, 320); this.atras.setSize(125, 30); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); jScrollPane1 = new javax.swing.JScrollPane(); amigos = new javax.swing.JTextArea(); jScrollPane2 = new javax.swing.JScrollPane(); bloqueadoPor = new javax.swing.JTextArea(); jScrollPane3 = new javax.swing.JScrollPane(); bloqueadosPorMi = new javax.swing.JTextArea(); lAmigos = new javax.swing.JLabel(); lBloquadosPor = new javax.swing.JLabel(); lBloqueadosPorMi = new javax.swing.JLabel(); titulo = new javax.swing.JLabel(); atras = new javax.swing.JButton(); imagen = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); amigos.setColumns(20); amigos.setRows(5); jScrollPane1.setViewportView(amigos); jScrollPane1.setBounds(20, 100, 130, 230); jLayeredPane1.add(jScrollPane1, javax.swing.JLayeredPane.DEFAULT_LAYER); bloqueadoPor.setColumns(20); bloqueadoPor.setRows(5); jScrollPane2.setViewportView(bloqueadoPor); jScrollPane2.setBounds(180, 100, 130, 230); jLayeredPane1.add(jScrollPane2, javax.swing.JLayeredPane.DEFAULT_LAYER); bloqueadosPorMi.setColumns(20); bloqueadosPorMi.setRows(5); jScrollPane3.setViewportView(bloqueadosPorMi); jScrollPane3.setBounds(350, 100, 130, 230); jLayeredPane1.add(jScrollPane3, javax.swing.JLayeredPane.DEFAULT_LAYER); lAmigos.setText("Amigos"); lAmigos.setBounds(50, 80, 110, -1); jLayeredPane1.add(lAmigos, javax.swing.JLayeredPane.DEFAULT_LAYER); lBloquadosPor.setText("Bloqueado Por"); lBloquadosPor.setBounds(200, 80, 130, -1); jLayeredPane1.add(lBloquadosPor, javax.swing.JLayeredPane.DEFAULT_LAYER); lBloqueadosPorMi.setText("Bloqueados Por Mi"); lBloqueadosPorMi.setBounds(360, 80, 140, -1); jLayeredPane1.add(lBloqueadosPorMi, javax.swing.JLayeredPane.DEFAULT_LAYER); titulo.setFont(new java.awt.Font("Tahoma", 1, 18)); titulo.setText(" Amigo"); titulo.setBounds(190, 10, 160, 30); jLayeredPane1.add(titulo, javax.swing.JLayeredPane.DEFAULT_LAYER); atras.setText("Atras"); atras.setBounds(30, 360, 100, -1); jLayeredPane1.add(atras, javax.swing.JLayeredPane.DEFAULT_LAYER); imagen.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/evento2.png"))); // NOI18N imagen.setText("jLabel1"); imagen.setBounds(0, 0, 500, 400); jLayeredPane1.add(imagen, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 500, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Consultar_Amigo().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JTextArea amigos; private javax.swing.JButton atras; private javax.swing.JTextArea bloqueadoPor; private javax.swing.JTextArea bloqueadosPorMi; private javax.swing.JLabel imagen; private javax.swing.JLayeredPane jLayeredPane1; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane2; private javax.swing.JScrollPane jScrollPane3; private javax.swing.JLabel lAmigos; private javax.swing.JLabel lBloquadosPor; private javax.swing.JLabel lBloqueadosPorMi; private javax.swing.JLabel titulo; // End of variables declaration//GEN-END:variables }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/Interfaces/Consultar_Amigo.java
Java
gpl2
5,233
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * Descuento_Modificar_Eliminar_Consultar.java * * Created on 21-may-2010, 15:24:49 */ package Interfaces; /** * * @author Michelangelo */ public class Descuento_Modificar_Eliminar_Consultar extends javax.swing.JFrame { /** Creates new form Descuento_Modificar_Eliminar_Consultar */ public Descuento_Modificar_Eliminar_Consultar() { initComponents(); this.setTitle("Descuento"); this.setSize(600,450); this.atras.setLocation(40, 320); this.atras.setSize(125, 30); //dependiendo de la manera en que se llame a esta ventna, //si es eliminar o sea modificar un campo, uno de los botones estara //invisible y el otro no, por eso se encuentran en la misma posicion //ya que solo se utilizara un boton dependiendo del caso de uso //(si deseo eliminar se muestra eliminar y se deseo modificar //se mostrara modificar), para ello habra que manerjar los .setVisible(true); de los botones this.modificar.setLocation(400, 320); this.modificar.setSize(125, 30); this.eliminar.setLocation(400, 320); this.eliminar.setSize(125, 30); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); atras = new javax.swing.JButton(); eliminar = new javax.swing.JButton(); modificar = new javax.swing.JButton(); jScrollPane1 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); titulo = new javax.swing.JLabel(); imagen = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); atras.setText("Atras"); atras.setBounds(40, 350, 100, 23); jLayeredPane1.add(atras, javax.swing.JLayeredPane.DEFAULT_LAYER); eliminar.setText("Eliminar"); eliminar.setBounds(370, 320, 100, 23); jLayeredPane1.add(eliminar, javax.swing.JLayeredPane.DEFAULT_LAYER); modificar.setText("Modificar"); modificar.setBounds(370, 350, 100, 23); jLayeredPane1.add(modificar, javax.swing.JLayeredPane.DEFAULT_LAYER); jTable1.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null} }, new String [] { "Nº", "Monto", "Porcentaje(%)" } )); jScrollPane1.setViewportView(jTable1); jScrollPane1.setBounds(30, 60, 520, 230); jLayeredPane1.add(jScrollPane1, javax.swing.JLayeredPane.DEFAULT_LAYER); titulo.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N titulo.setForeground(new java.awt.Color(255, 255, 255)); titulo.setText("Descuento"); titulo.setBounds(220, 10, 190, 30); jLayeredPane1.add(titulo, javax.swing.JLayeredPane.DEFAULT_LAYER); imagen.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/fonfofifa2.png"))); // NOI18N imagen.setText("jLabel1"); imagen.setBounds(0, 0, 600, 440); jLayeredPane1.add(imagen, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 599, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 431, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Descuento_Modificar_Eliminar_Consultar().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton atras; private javax.swing.JButton eliminar; private javax.swing.JLabel imagen; private javax.swing.JLayeredPane jLayeredPane1; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTable jTable1; private javax.swing.JButton modificar; private javax.swing.JLabel titulo; // End of variables declaration//GEN-END:variables }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/Interfaces/Descuento_Modificar_Eliminar_Consultar.java
Java
gpl2
5,104
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * ConsultarObjetos.java * * Created on 19-may-2010, 21:04:44 */ package Interfaces; /** * * @author Angiita */ public class ConsultarObjetos extends javax.swing.JFrame { /** Creates new form ConsultarObjetos */ public ConsultarObjetos() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); LObjeto = new javax.swing.JLabel(); LDescripcion = new javax.swing.JLabel(); LPrecio = new javax.swing.JLabel(); LCantidad = new javax.swing.JLabel(); jDescripcion = new javax.swing.JTextField(); jPrecio = new javax.swing.JTextField(); jCantidad = new javax.swing.JTextField(); jAtras = new javax.swing.JButton(); jAgregad = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); LObjeto.setFont(new java.awt.Font("Tahoma", 1, 18)); LObjeto.setForeground(new java.awt.Color(255, 255, 255)); LObjeto.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); LObjeto.setText("Objeto"); LObjeto.setBounds(190, 20, 110, 30); jLayeredPane1.add(LObjeto, javax.swing.JLayeredPane.DEFAULT_LAYER); LDescripcion.setForeground(new java.awt.Color(255, 255, 255)); LDescripcion.setText("Descripcion:"); LDescripcion.setBounds(70, 120, 80, 14); jLayeredPane1.add(LDescripcion, javax.swing.JLayeredPane.DEFAULT_LAYER); LPrecio.setForeground(new java.awt.Color(255, 255, 255)); LPrecio.setText("Precio:"); LPrecio.setBounds(70, 160, 60, 14); jLayeredPane1.add(LPrecio, javax.swing.JLayeredPane.DEFAULT_LAYER); LCantidad.setForeground(new java.awt.Color(255, 255, 255)); LCantidad.setText("Cantidad:"); LCantidad.setBounds(70, 200, 70, 14); jLayeredPane1.add(LCantidad, javax.swing.JLayeredPane.DEFAULT_LAYER); jDescripcion.setBounds(180, 120, 140, 20); jLayeredPane1.add(jDescripcion, javax.swing.JLayeredPane.DEFAULT_LAYER); jPrecio.setBounds(180, 160, 140, 20); jLayeredPane1.add(jPrecio, javax.swing.JLayeredPane.DEFAULT_LAYER); jCantidad.setBounds(180, 200, 140, 20); jLayeredPane1.add(jCantidad, javax.swing.JLayeredPane.DEFAULT_LAYER); jAtras.setText("Atras"); jAtras.setBounds(80, 330, 90, 23); jLayeredPane1.add(jAtras, javax.swing.JLayeredPane.DEFAULT_LAYER); jAgregad.setText("Agregar"); jAgregad.setBounds(330, 330, 90, 23); jLayeredPane1.add(jAgregad, javax.swing.JLayeredPane.DEFAULT_LAYER); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/balon_de_futbol_275.jpg"))); // NOI18N jLabel1.setText("jLabel1"); jLabel1.setBounds(0, 0, 500, 400); jLayeredPane1.add(jLabel1, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 500, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new ConsultarObjetos().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel LCantidad; private javax.swing.JLabel LDescripcion; private javax.swing.JLabel LObjeto; private javax.swing.JLabel LPrecio; private javax.swing.JButton jAgregad; private javax.swing.JButton jAtras; private javax.swing.JTextField jCantidad; private javax.swing.JTextField jDescripcion; private javax.swing.JLabel jLabel1; private javax.swing.JLayeredPane jLayeredPane1; private javax.swing.JTextField jPrecio; // End of variables declaration//GEN-END:variables }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/Interfaces/ConsultarObjetos.java
Java
gpl2
4,953
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * rEGISTRO.java * * Created on 19-may-2010, 22:01:26 */ package Interfaces; /** * * @author Angiita */ public class Registro extends javax.swing.JFrame { /** Creates new form rEGISTRO */ public Registro() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); LRegistro = new javax.swing.JLabel(); jAgregar = new javax.swing.JButton(); jSalir = new javax.swing.JButton(); jAtras = new javax.swing.JButton(); LNombre = new javax.swing.JLabel(); LApellido = new javax.swing.JLabel(); LFechaNac = new javax.swing.JLabel(); LSexo = new javax.swing.JLabel(); LNacionalidad = new javax.swing.JLabel(); LTelefono = new javax.swing.JLabel(); LProfesion = new javax.swing.JLabel(); jNombre = new javax.swing.JTextField(); jApellido = new javax.swing.JTextField(); jFechaNac = new javax.swing.JTextField(); jSexo = new javax.swing.JTextField(); jNacionalidad = new javax.swing.JTextField(); jTelefono = new javax.swing.JTextField(); jProfesion = new javax.swing.JTextField(); jLabel1 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); LRegistro.setFont(new java.awt.Font("Tahoma", 1, 18)); LRegistro.setForeground(new java.awt.Color(255, 255, 255)); LRegistro.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); LRegistro.setText("Registro"); LRegistro.setBounds(160, 20, 170, 30); jLayeredPane1.add(LRegistro, javax.swing.JLayeredPane.DEFAULT_LAYER); jAgregar.setText("Agregar"); jAgregar.setBounds(190, 340, 100, -1); jLayeredPane1.add(jAgregar, javax.swing.JLayeredPane.DEFAULT_LAYER); jSalir.setText("Salir"); jSalir.setBounds(350, 340, 100, -1); jLayeredPane1.add(jSalir, javax.swing.JLayeredPane.DEFAULT_LAYER); jAtras.setText("Atras"); jAtras.setBounds(30, 340, 100, -1); jLayeredPane1.add(jAtras, javax.swing.JLayeredPane.DEFAULT_LAYER); LNombre.setForeground(new java.awt.Color(255, 255, 255)); LNombre.setText("Nombre:"); LNombre.setBounds(60, 90, 60, -1); jLayeredPane1.add(LNombre, javax.swing.JLayeredPane.DEFAULT_LAYER); LApellido.setForeground(new java.awt.Color(255, 255, 255)); LApellido.setText("Apellido:"); LApellido.setBounds(60, 120, 60, -1); jLayeredPane1.add(LApellido, javax.swing.JLayeredPane.DEFAULT_LAYER); LFechaNac.setForeground(new java.awt.Color(255, 255, 255)); LFechaNac.setText("Fecha de Nacimiento:"); LFechaNac.setBounds(60, 150, 110, -1); jLayeredPane1.add(LFechaNac, javax.swing.JLayeredPane.DEFAULT_LAYER); LSexo.setForeground(new java.awt.Color(255, 255, 255)); LSexo.setText("Sexo:"); LSexo.setBounds(60, 180, 70, -1); jLayeredPane1.add(LSexo, javax.swing.JLayeredPane.DEFAULT_LAYER); LNacionalidad.setForeground(new java.awt.Color(255, 255, 255)); LNacionalidad.setText("Nacionalidad:"); LNacionalidad.setBounds(60, 210, 70, -1); jLayeredPane1.add(LNacionalidad, javax.swing.JLayeredPane.DEFAULT_LAYER); LTelefono.setForeground(new java.awt.Color(255, 255, 255)); LTelefono.setText("Telefono:"); LTelefono.setBounds(60, 240, 60, -1); jLayeredPane1.add(LTelefono, javax.swing.JLayeredPane.DEFAULT_LAYER); LProfesion.setForeground(new java.awt.Color(255, 255, 255)); LProfesion.setText("Profesion:"); LProfesion.setBounds(60, 270, 80, -1); jLayeredPane1.add(LProfesion, javax.swing.JLayeredPane.DEFAULT_LAYER); jNombre.setBounds(180, 90, 210, -1); jLayeredPane1.add(jNombre, javax.swing.JLayeredPane.DEFAULT_LAYER); jApellido.setBounds(180, 120, 210, -1); jLayeredPane1.add(jApellido, javax.swing.JLayeredPane.DEFAULT_LAYER); jFechaNac.setBounds(180, 150, 210, -1); jLayeredPane1.add(jFechaNac, javax.swing.JLayeredPane.DEFAULT_LAYER); jSexo.setBounds(180, 180, 210, -1); jLayeredPane1.add(jSexo, javax.swing.JLayeredPane.DEFAULT_LAYER); jNacionalidad.setBounds(180, 210, 210, -1); jLayeredPane1.add(jNacionalidad, javax.swing.JLayeredPane.DEFAULT_LAYER); jTelefono.setBounds(180, 240, 210, -1); jLayeredPane1.add(jTelefono, javax.swing.JLayeredPane.DEFAULT_LAYER); jProfesion.setBounds(180, 270, 210, -1); jLayeredPane1.add(jProfesion, javax.swing.JLayeredPane.DEFAULT_LAYER); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Sudafrica_2010_2.png"))); // NOI18N jLabel1.setText("jLabel1"); jLabel1.setBounds(0, 0, 500, 400); jLayeredPane1.add(jLabel1, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 500, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Registro().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel LApellido; private javax.swing.JLabel LFechaNac; private javax.swing.JLabel LNacionalidad; private javax.swing.JLabel LNombre; private javax.swing.JLabel LProfesion; private javax.swing.JLabel LRegistro; private javax.swing.JLabel LSexo; private javax.swing.JLabel LTelefono; private javax.swing.JButton jAgregar; private javax.swing.JTextField jApellido; private javax.swing.JButton jAtras; private javax.swing.JTextField jFechaNac; private javax.swing.JLabel jLabel1; private javax.swing.JLayeredPane jLayeredPane1; private javax.swing.JTextField jNacionalidad; private javax.swing.JTextField jNombre; private javax.swing.JTextField jProfesion; private javax.swing.JButton jSalir; private javax.swing.JTextField jSexo; private javax.swing.JTextField jTelefono; // End of variables declaration//GEN-END:variables }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/Interfaces/Registro.java
Java
gpl2
7,328
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * Bloquear_Amigo.java * * Created on 22/05/2010, 07:33:38 PM */ package Interfaces; /** * * @author Karla Ruiz */ public class Bloquear_Amigo extends javax.swing.JFrame { /** Creates new form Bloquear_Amigo */ public Bloquear_Amigo() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); titulo = new javax.swing.JLabel(); amigos = new javax.swing.JComboBox(); bloqueado = new javax.swing.JScrollPane(); jTextArea1 = new javax.swing.JTextArea(); lamigo = new javax.swing.JLabel(); lbloqueado = new javax.swing.JLabel(); atras = new javax.swing.JButton(); bloquear = new javax.swing.JButton(); imagen = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("BLOQUEAR AMIGO"); setMinimumSize(new java.awt.Dimension(500, 400)); titulo.setFont(new java.awt.Font("Tahoma", 1, 18)); titulo.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); titulo.setText("Bloquear Amigo"); titulo.setBounds(150, 20, 210, 29); jLayeredPane1.add(titulo, javax.swing.JLayeredPane.DEFAULT_LAYER); amigos.setBounds(10, 100, 210, 20); jLayeredPane1.add(amigos, javax.swing.JLayeredPane.DEFAULT_LAYER); jTextArea1.setColumns(20); jTextArea1.setRows(5); bloqueado.setViewportView(jTextArea1); bloqueado.setBounds(330, 100, 160, 230); jLayeredPane1.add(bloqueado, javax.swing.JLayeredPane.DEFAULT_LAYER); lamigo.setText("Amigos"); lamigo.setBounds(20, 80, 70, 14); jLayeredPane1.add(lamigo, javax.swing.JLayeredPane.DEFAULT_LAYER); lbloqueado.setText("Bloqueados"); lbloqueado.setBounds(340, 80, 80, 14); jLayeredPane1.add(lbloqueado, javax.swing.JLayeredPane.DEFAULT_LAYER); atras.setText("Atrás"); atras.setBounds(40, 350, 90, 23); jLayeredPane1.add(atras, javax.swing.JLayeredPane.DEFAULT_LAYER); bloquear.setText("Bloquear"); bloquear.setBounds(360, 350, 90, 23); jLayeredPane1.add(bloquear, javax.swing.JLayeredPane.DEFAULT_LAYER); imagen.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); imagen.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Homero_2.png"))); // NOI18N imagen.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); imagen.setPreferredSize(new java.awt.Dimension(34, 14)); imagen.setBounds(0, 0, 500, 400); jLayeredPane1.add(imagen, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 500, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Bloquear_Amigo().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JComboBox amigos; private javax.swing.JButton atras; private javax.swing.JScrollPane bloqueado; private javax.swing.JButton bloquear; private javax.swing.JLabel imagen; private javax.swing.JLayeredPane jLayeredPane1; private javax.swing.JTextArea jTextArea1; private javax.swing.JLabel lamigo; private javax.swing.JLabel lbloqueado; private javax.swing.JLabel titulo; // End of variables declaration//GEN-END:variables }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/Interfaces/Bloquear_Amigo.java
Java
gpl2
4,635
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * Modificar_Entrada.java * * Created on 23/05/2010, 11:32:34 AM */ package Interfaces; /** * * @author Karla Ruiz */ public class Modificar_Entrada extends javax.swing.JFrame { /** Creates new form Modificar_Entrada */ public Modificar_Entrada() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); titulo = new javax.swing.JLabel(); lpartido = new javax.swing.JLabel(); lvip = new javax.swing.JLabel(); lpreferencial = new javax.swing.JLabel(); lgeneral = new javax.swing.JLabel(); partido = new javax.swing.JComboBox(); jVIP = new javax.swing.JComboBox(); jPreferencial = new javax.swing.JComboBox(); jGeneral = new javax.swing.JComboBox(); atras = new javax.swing.JButton(); modificar = new javax.swing.JButton(); imagen = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Modificar Entrada"); setMinimumSize(new java.awt.Dimension(500, 400)); titulo.setFont(new java.awt.Font("Tahoma", 1, 18)); titulo.setForeground(new java.awt.Color(255, 255, 255)); titulo.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); titulo.setText("Entrada"); titulo.setBounds(180, 30, 110, -1); jLayeredPane1.add(titulo, javax.swing.JLayeredPane.DEFAULT_LAYER); lpartido.setForeground(new java.awt.Color(255, 255, 255)); lpartido.setText("Partido"); lpartido.setBounds(110, 120, 80, -1); jLayeredPane1.add(lpartido, javax.swing.JLayeredPane.DEFAULT_LAYER); lvip.setForeground(new java.awt.Color(255, 255, 255)); lvip.setText("VIP"); lvip.setBounds(110, 160, 80, -1); jLayeredPane1.add(lvip, javax.swing.JLayeredPane.DEFAULT_LAYER); lpreferencial.setForeground(new java.awt.Color(255, 255, 255)); lpreferencial.setText("Preferencial"); lpreferencial.setBounds(110, 200, 80, -1); jLayeredPane1.add(lpreferencial, javax.swing.JLayeredPane.DEFAULT_LAYER); lgeneral.setForeground(new java.awt.Color(255, 255, 255)); lgeneral.setText("General"); lgeneral.setBounds(110, 240, 80, -1); jLayeredPane1.add(lgeneral, javax.swing.JLayeredPane.DEFAULT_LAYER); partido.setBounds(210, 120, 160, -1); jLayeredPane1.add(partido, javax.swing.JLayeredPane.DEFAULT_LAYER); jVIP.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "1", "2", "3", "4", "5" })); jVIP.setBounds(210, 160, 60, -1); jLayeredPane1.add(jVIP, javax.swing.JLayeredPane.DEFAULT_LAYER); jPreferencial.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" })); jPreferencial.setBounds(210, 200, 60, -1); jLayeredPane1.add(jPreferencial, javax.swing.JLayeredPane.DEFAULT_LAYER); jGeneral.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "1", "2", "3", "4", "5" })); jGeneral.setBounds(210, 240, 60, -1); jLayeredPane1.add(jGeneral, javax.swing.JLayeredPane.DEFAULT_LAYER); atras.setText("Atrás"); atras.setBounds(70, 340, 90, -1); jLayeredPane1.add(atras, javax.swing.JLayeredPane.DEFAULT_LAYER); modificar.setText("Modificar"); modificar.setBounds(350, 340, 90, -1); jLayeredPane1.add(modificar, javax.swing.JLayeredPane.DEFAULT_LAYER); imagen.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Sudafrica_2010_2.png"))); // NOI18N imagen.setBounds(0, 0, 500, 400); jLayeredPane1.add(imagen, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 500, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Modificar_Entrada().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton atras; private javax.swing.JLabel imagen; private javax.swing.JComboBox jGeneral; private javax.swing.JLayeredPane jLayeredPane1; private javax.swing.JComboBox jPreferencial; private javax.swing.JComboBox jVIP; private javax.swing.JLabel lgeneral; private javax.swing.JLabel lpartido; private javax.swing.JLabel lpreferencial; private javax.swing.JLabel lvip; private javax.swing.JButton modificar; private javax.swing.JComboBox partido; private javax.swing.JLabel titulo; // End of variables declaration//GEN-END:variables }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/Interfaces/Modificar_Entrada.java
Java
gpl2
5,848
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * ModificarJugador.java * * Created on 19-may-2010, 21:42:19 */ package Interfaces; /** * * @author Angiita */ public class ModificarJugador extends javax.swing.JFrame { /** Creates new form ModificarJugador */ public ModificarJugador() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); jAtras = new javax.swing.JButton(); jModificar = new javax.swing.JButton(); LJugador = new javax.swing.JLabel(); LTipoJ = new javax.swing.JLabel(); jTipoJ = new javax.swing.JTextField(); jLabel1 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jAtras.setText("Atras"); jAtras.setBounds(90, 330, 90, -1); jLayeredPane1.add(jAtras, javax.swing.JLayeredPane.DEFAULT_LAYER); jModificar.setText("Modificar"); jModificar.setBounds(320, 330, 90, -1); jLayeredPane1.add(jModificar, javax.swing.JLayeredPane.DEFAULT_LAYER); LJugador.setFont(new java.awt.Font("Tahoma", 1, 18)); LJugador.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); LJugador.setText("Jugador"); LJugador.setBounds(190, 30, 130, 30); jLayeredPane1.add(LJugador, javax.swing.JLayeredPane.DEFAULT_LAYER); LTipoJ.setText("Tipo de Jugador:"); LTipoJ.setBounds(70, 144, 100, 30); jLayeredPane1.add(LTipoJ, javax.swing.JLayeredPane.DEFAULT_LAYER); jTipoJ.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTipoJActionPerformed(evt); } }); jTipoJ.setBounds(180, 150, 150, -1); jLayeredPane1.add(jTipoJ, javax.swing.JLayeredPane.DEFAULT_LAYER); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/football_194359.jpg"))); // NOI18N jLabel1.setText("jLabel1"); jLabel1.setBounds(0, 0, 500, 400); jLayeredPane1.add(jLabel1, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 500, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents private void jTipoJActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTipoJActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jTipoJActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new ModificarJugador().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel LJugador; private javax.swing.JLabel LTipoJ; private javax.swing.JButton jAtras; private javax.swing.JLabel jLabel1; private javax.swing.JLayeredPane jLayeredPane1; private javax.swing.JButton jModificar; private javax.swing.JTextField jTipoJ; // End of variables declaration//GEN-END:variables }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/Interfaces/ModificarJugador.java
Java
gpl2
4,137
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * Vender_Revender.java * * Created on 21-may-2010, 12:11:26 */ package Interfaces; /** * * @author Michelangelo */ public class Vender_Revender extends javax.swing.JFrame { /** Creates new form Vender_Revender */ public Vender_Revender() { initComponents(); this.setTitle("Entradas"); this.setSize(500,400); this.atras.setLocation(50, 280); this.atras.setSize(125, 30); this.vender.setLocation(320, 280); this.vender.setSize(125, 30); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); atras = new javax.swing.JButton(); vender = new javax.swing.JButton(); cod_Entrada = new javax.swing.JTextField(); tipo = new javax.swing.JTextField(); precio = new javax.swing.JTextField(); n_Entradas = new javax.swing.JTextField(); lEntrada = new javax.swing.JLabel(); lTipo = new javax.swing.JLabel(); lPrecio = new javax.swing.JLabel(); lNEntradas = new javax.swing.JLabel(); titulo = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); atras.setText("Atras"); atras.setBounds(60, 310, 90, -1); jLayeredPane1.add(atras, javax.swing.JLayeredPane.DEFAULT_LAYER); vender.setText("Vender"); vender.setBounds(340, 310, 100, -1); jLayeredPane1.add(vender, javax.swing.JLayeredPane.DEFAULT_LAYER); cod_Entrada.setBounds(210, 110, 150, -1); jLayeredPane1.add(cod_Entrada, javax.swing.JLayeredPane.DEFAULT_LAYER); tipo.setBounds(210, 140, 150, -1); jLayeredPane1.add(tipo, javax.swing.JLayeredPane.DEFAULT_LAYER); precio.setBounds(210, 170, 150, -1); jLayeredPane1.add(precio, javax.swing.JLayeredPane.DEFAULT_LAYER); n_Entradas.setBounds(210, 200, 150, -1); jLayeredPane1.add(n_Entradas, javax.swing.JLayeredPane.DEFAULT_LAYER); lEntrada.setForeground(new java.awt.Color(255, 255, 255)); lEntrada.setText("Codigo Entrada:"); lEntrada.setBounds(90, 110, 180, -1); jLayeredPane1.add(lEntrada, javax.swing.JLayeredPane.DEFAULT_LAYER); lTipo.setForeground(new java.awt.Color(255, 255, 255)); lTipo.setText("Tipo:"); lTipo.setBounds(90, 140, 180, -1); jLayeredPane1.add(lTipo, javax.swing.JLayeredPane.DEFAULT_LAYER); lPrecio.setForeground(new java.awt.Color(255, 255, 255)); lPrecio.setText("Precio:"); lPrecio.setBounds(90, 170, 180, -1); jLayeredPane1.add(lPrecio, javax.swing.JLayeredPane.DEFAULT_LAYER); lNEntradas.setForeground(new java.awt.Color(255, 255, 255)); lNEntradas.setText("Nº de entradas:"); lNEntradas.setBounds(90, 200, 180, -1); jLayeredPane1.add(lNEntradas, javax.swing.JLayeredPane.DEFAULT_LAYER); titulo.setFont(new java.awt.Font("Tahoma", 1, 18)); titulo.setForeground(new java.awt.Color(255, 255, 255)); titulo.setText("Entrada"); titulo.setBounds(220, 30, 150, 20); jLayeredPane1.add(titulo, javax.swing.JLayeredPane.DEFAULT_LAYER); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/fonfofifa2.png"))); // NOI18N jLabel1.setText("jLabel1"); jLabel1.setBounds(0, 0, 530, 400); jLayeredPane1.add(jLabel1, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 533, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 399, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Vender_Revender().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton atras; private javax.swing.JTextField cod_Entrada; private javax.swing.JLabel jLabel1; private javax.swing.JLayeredPane jLayeredPane1; private javax.swing.JLabel lEntrada; private javax.swing.JLabel lNEntradas; private javax.swing.JLabel lPrecio; private javax.swing.JLabel lTipo; private javax.swing.JTextField n_Entradas; private javax.swing.JTextField precio; private javax.swing.JTextField tipo; private javax.swing.JLabel titulo; private javax.swing.JButton vender; // End of variables declaration//GEN-END:variables }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/Interfaces/Vender_Revender.java
Java
gpl2
5,561
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * ConsultarAceptar.java * * Created on 19-may-2010, 21:46:08 */ package Interfaces; /** * * @author Angiita */ public class ConsultarAceptar extends javax.swing.JFrame { /** Creates new form ConsultarAceptar */ public ConsultarAceptar() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); LAceptados = new javax.swing.JLabel(); LRechazados = new javax.swing.JLabel(); LOrganizados = new javax.swing.JLabel(); LInvitados = new javax.swing.JLabel(); jInvitados = new javax.swing.JScrollPane(); jTInvitados = new javax.swing.JTextArea(); jAceptados = new javax.swing.JScrollPane(); jTAceptados = new javax.swing.JTextArea(); jRechazados = new javax.swing.JScrollPane(); jTREchazados = new javax.swing.JTextArea(); jOrganizados = new javax.swing.JScrollPane(); jTOrganizados = new javax.swing.JTextArea(); jAceptar = new javax.swing.JButton(); jRechazar = new javax.swing.JButton(); jConsultar = new javax.swing.JButton(); jAtras = new javax.swing.JButton(); LEvento = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); LAceptados.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N LAceptados.setText("Aceptados"); LAceptados.setBounds(40, 80, 80, 14); jLayeredPane1.add(LAceptados, javax.swing.JLayeredPane.DEFAULT_LAYER); LRechazados.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N LRechazados.setText("Rechazados"); LRechazados.setBounds(150, 80, 100, 14); jLayeredPane1.add(LRechazados, javax.swing.JLayeredPane.DEFAULT_LAYER); LOrganizados.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N LOrganizados.setText("Organizados"); LOrganizados.setBounds(260, 80, 90, 14); jLayeredPane1.add(LOrganizados, javax.swing.JLayeredPane.DEFAULT_LAYER); LInvitados.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N LInvitados.setText("Invitados"); LInvitados.setBounds(380, 80, 90, 14); jLayeredPane1.add(LInvitados, javax.swing.JLayeredPane.DEFAULT_LAYER); jTInvitados.setColumns(20); jTInvitados.setRows(5); jInvitados.setViewportView(jTInvitados); jInvitados.setBounds(360, 100, 100, 230); jLayeredPane1.add(jInvitados, javax.swing.JLayeredPane.DEFAULT_LAYER); jTAceptados.setColumns(20); jTAceptados.setRows(5); jAceptados.setViewportView(jTAceptados); jAceptados.setBounds(30, 100, 100, 230); jLayeredPane1.add(jAceptados, javax.swing.JLayeredPane.DEFAULT_LAYER); jTREchazados.setColumns(20); jTREchazados.setRows(5); jRechazados.setViewportView(jTREchazados); jRechazados.setBounds(140, 100, 100, 230); jLayeredPane1.add(jRechazados, javax.swing.JLayeredPane.DEFAULT_LAYER); jTOrganizados.setColumns(20); jTOrganizados.setRows(5); jOrganizados.setViewportView(jTOrganizados); jOrganizados.setBounds(250, 100, 100, 230); jLayeredPane1.add(jOrganizados, javax.swing.JLayeredPane.DEFAULT_LAYER); jAceptar.setText("Aceptar"); jAceptar.setBounds(130, 360, 100, 23); jLayeredPane1.add(jAceptar, javax.swing.JLayeredPane.DEFAULT_LAYER); jRechazar.setText("Rechazar"); jRechazar.setBounds(240, 360, 100, 23); jLayeredPane1.add(jRechazar, javax.swing.JLayeredPane.DEFAULT_LAYER); jConsultar.setText("Consultar"); jConsultar.setBounds(360, 360, 100, 23); jLayeredPane1.add(jConsultar, javax.swing.JLayeredPane.DEFAULT_LAYER); jAtras.setText("Atras"); jAtras.setBounds(20, 360, 100, 23); jLayeredPane1.add(jAtras, javax.swing.JLayeredPane.DEFAULT_LAYER); LEvento.setFont(new java.awt.Font("Tahoma", 1, 18)); LEvento.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); LEvento.setText("Evento"); LEvento.setBounds(190, 10, 110, 22); jLayeredPane1.add(LEvento, javax.swing.JLayeredPane.DEFAULT_LAYER); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/evento2.png"))); // NOI18N jLabel1.setText("jLabel1"); jLabel1.setBounds(0, 0, 500, 400); jLayeredPane1.add(jLabel1, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 500, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new ConsultarAceptar().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel LAceptados; private javax.swing.JLabel LEvento; private javax.swing.JLabel LInvitados; private javax.swing.JLabel LOrganizados; private javax.swing.JLabel LRechazados; private javax.swing.JScrollPane jAceptados; private javax.swing.JButton jAceptar; private javax.swing.JButton jAtras; private javax.swing.JButton jConsultar; private javax.swing.JScrollPane jInvitados; private javax.swing.JLabel jLabel1; private javax.swing.JLayeredPane jLayeredPane1; private javax.swing.JScrollPane jOrganizados; private javax.swing.JScrollPane jRechazados; private javax.swing.JButton jRechazar; private javax.swing.JTextArea jTAceptados; private javax.swing.JTextArea jTInvitados; private javax.swing.JTextArea jTOrganizados; private javax.swing.JTextArea jTREchazados; // End of variables declaration//GEN-END:variables }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/Interfaces/ConsultarAceptar.java
Java
gpl2
6,917
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * Modificar_Evento.java * * Created on 21-may-2010, 15:30:45 */ package Interfaces; /** * * @author Michelangelo */ public class Modificar_Evento extends javax.swing.JFrame { /** Creates new form Modificar_Evento */ public Modificar_Evento() { initComponents(); this.setTitle("Eventos"); this.setSize(500, 400); this.atras.setLocation(50, 280); this.atras.setSize(125, 30); this.modificar.setLocation(320, 280); this.modificar.setSize(125, 30); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); jScrollPane1 = new javax.swing.JScrollPane(); descripcion = new javax.swing.JTextArea(); lugar = new javax.swing.JTextField(); fecha = new com.toedter.calendar.JDateChooser(); lFecha = new javax.swing.JLabel(); lLugar = new javax.swing.JLabel(); lDescripcion = new javax.swing.JLabel(); atras = new javax.swing.JButton(); modificar = new javax.swing.JButton(); titulo = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); descripcion.setColumns(20); descripcion.setRows(5); jScrollPane1.setViewportView(descripcion); jScrollPane1.setBounds(150, 160, 270, 90); jLayeredPane1.add(jScrollPane1, javax.swing.JLayeredPane.DEFAULT_LAYER); lugar.setBounds(150, 80, 230, -1); jLayeredPane1.add(lugar, javax.swing.JLayeredPane.DEFAULT_LAYER); fecha.setBounds(150, 120, 230, -1); jLayeredPane1.add(fecha, javax.swing.JLayeredPane.DEFAULT_LAYER); lFecha.setFont(new java.awt.Font("Tahoma", 1, 11)); lFecha.setForeground(new java.awt.Color(255, 255, 0)); lFecha.setText("Fecha: "); lFecha.setBounds(90, 120, 70, 20); jLayeredPane1.add(lFecha, javax.swing.JLayeredPane.DEFAULT_LAYER); lLugar.setFont(new java.awt.Font("Tahoma", 1, 11)); lLugar.setForeground(new java.awt.Color(255, 255, 0)); lLugar.setText("Lugar:"); lLugar.setBounds(90, 80, 60, 30); jLayeredPane1.add(lLugar, javax.swing.JLayeredPane.DEFAULT_LAYER); lDescripcion.setFont(new java.awt.Font("Tahoma", 1, 11)); lDescripcion.setForeground(new java.awt.Color(255, 255, 0)); lDescripcion.setText("Descripcion:"); lDescripcion.setBounds(60, 150, 80, 30); jLayeredPane1.add(lDescripcion, javax.swing.JLayeredPane.DEFAULT_LAYER); atras.setText("Atras"); atras.setBounds(90, 340, 90, 20); jLayeredPane1.add(atras, javax.swing.JLayeredPane.DEFAULT_LAYER); modificar.setText("Modificar"); modificar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { modificarActionPerformed(evt); } }); modificar.setBounds(410, 337, 120, -1); jLayeredPane1.add(modificar, javax.swing.JLayeredPane.DEFAULT_LAYER); titulo.setFont(new java.awt.Font("Tahoma", 1, 24)); titulo.setForeground(new java.awt.Color(255, 255, 0)); titulo.setText("Evento"); titulo.setBounds(200, 24, 150, 20); jLayeredPane1.add(titulo, javax.swing.JLayeredPane.DEFAULT_LAYER); jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/estadio.png"))); // NOI18N jLabel1.setText("jLabel1"); jLabel1.setBounds(0, 0, 580, 400); jLayeredPane1.add(jLabel1, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 580, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 396, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents private void modificarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_modificarActionPerformed // TODO add your handling code here: }//GEN-LAST:event_modificarActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Modificar_Evento().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton atras; private javax.swing.JTextArea descripcion; private com.toedter.calendar.JDateChooser fecha; private javax.swing.JLabel jLabel1; private javax.swing.JLayeredPane jLayeredPane1; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JLabel lDescripcion; private javax.swing.JLabel lFecha; private javax.swing.JLabel lLugar; private javax.swing.JTextField lugar; private javax.swing.JButton modificar; private javax.swing.JLabel titulo; // End of variables declaration//GEN-END:variables }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/Interfaces/Modificar_Evento.java
Java
gpl2
5,969
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * Ver_Factura.java * * Created on 23/05/2010, 11:11:13 AM */ package Interfaces; /** * * @author Karla Ruiz */ public class Ver_Factura extends javax.swing.JFrame { /** Creates new form Ver_Factura */ public Ver_Factura() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); titulo = new javax.swing.JLabel(); usuario = new javax.swing.JComboBox(); lcodigo = new javax.swing.JLabel(); lusuario = new javax.swing.JLabel(); codigo = new javax.swing.JComboBox(); factura = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); atras = new javax.swing.JButton(); consultar = new javax.swing.JButton(); imagen = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Consultar Factura"); setMinimumSize(new java.awt.Dimension(500, 400)); titulo.setFont(new java.awt.Font("Tahoma", 1, 18)); titulo.setForeground(new java.awt.Color(255, 255, 255)); titulo.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); titulo.setText("Factura"); titulo.setBounds(190, 10, 110, 29); jLayeredPane1.add(titulo, javax.swing.JLayeredPane.DEFAULT_LAYER); usuario.setBounds(50, 90, 120, -1); jLayeredPane1.add(usuario, javax.swing.JLayeredPane.DEFAULT_LAYER); lcodigo.setForeground(new java.awt.Color(255, 255, 255)); lcodigo.setText("Codigo de factura"); lcodigo.setBounds(340, 70, 120, -1); jLayeredPane1.add(lcodigo, javax.swing.JLayeredPane.DEFAULT_LAYER); lusuario.setForeground(new java.awt.Color(255, 255, 255)); lusuario.setText("Usuario"); lusuario.setBounds(50, 70, 60, -1); jLayeredPane1.add(lusuario, javax.swing.JLayeredPane.DEFAULT_LAYER); codigo.setBounds(340, 90, 120, -1); jLayeredPane1.add(codigo, javax.swing.JLayeredPane.DEFAULT_LAYER); jTable1.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null}, {null, null}, {null, null}, {null, null}, {null, null}, {null, null}, {null, null}, {null, null}, {null, null}, {null, null} }, new String [] { "Objeto / Entrada", "Precio" } )); jTable1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); factura.setViewportView(jTable1); factura.setBounds(30, 140, -1, 180); jLayeredPane1.add(factura, javax.swing.JLayeredPane.DEFAULT_LAYER); atras.setText("Atrás"); atras.setBounds(70, 350, 100, -1); jLayeredPane1.add(atras, javax.swing.JLayeredPane.DEFAULT_LAYER); consultar.setText("Consultar"); consultar.setBounds(340, 350, 90, -1); jLayeredPane1.add(consultar, javax.swing.JLayeredPane.DEFAULT_LAYER); imagen.setForeground(new java.awt.Color(255, 255, 255)); imagen.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Sudafrica_2010_2.png"))); // NOI18N imagen.setBounds(0, 0, 500, 400); jLayeredPane1.add(imagen, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 500, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Ver_Factura().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton atras; private javax.swing.JComboBox codigo; private javax.swing.JButton consultar; private javax.swing.JScrollPane factura; private javax.swing.JLabel imagen; private javax.swing.JLayeredPane jLayeredPane1; private javax.swing.JTable jTable1; private javax.swing.JLabel lcodigo; private javax.swing.JLabel lusuario; private javax.swing.JLabel titulo; private javax.swing.JComboBox usuario; // End of variables declaration//GEN-END:variables }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/Interfaces/Ver_Factura.java
Java
gpl2
5,389
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * Modificar_Pais.java * * Created on 21-may-2010, 15:00:00 */ package Interfaces; /** * * @author Michelangelo */ public class Modificar_Pais extends javax.swing.JFrame { /** Creates new form Modificar_Pais */ public Modificar_Pais() { initComponents(); this.setSize(500, 400); this.setTitle("Paises"); //this.cb_listaPais.setLocation(150,70); this.lPais.setLocation(this.cb_listaPais.getX(),this.cb_listaPais.getY()-25); this.atras.setLocation(50, 280); this.atras.setSize(125, 30); this.modificar.setLocation(320, 280); this.modificar.setSize(125, 30); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); atras = new javax.swing.JButton(); modificar = new javax.swing.JButton(); cb_listaPais = new javax.swing.JComboBox(); lPais = new javax.swing.JLabel(); directorTecnico = new javax.swing.JTextField(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jComboBox1 = new javax.swing.JComboBox(); titulo = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); atras.setText("Atras"); atras.setBounds(60, 330, 100, -1); jLayeredPane1.add(atras, javax.swing.JLayeredPane.DEFAULT_LAYER); modificar.setText("Modificar"); modificar.setBounds(370, 330, 100, -1); jLayeredPane1.add(modificar, javax.swing.JLayeredPane.DEFAULT_LAYER); cb_listaPais.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); cb_listaPais.setBounds(170, 110, 180, -1); jLayeredPane1.add(cb_listaPais, javax.swing.JLayeredPane.DEFAULT_LAYER); lPais.setForeground(new java.awt.Color(255, 255, 255)); lPais.setText("Seleccione el Pais"); lPais.setBounds(60, 110, 130, -1); jLayeredPane1.add(lPais, javax.swing.JLayeredPane.DEFAULT_LAYER); directorTecnico.setBounds(170, 160, 140, -1); jLayeredPane1.add(directorTecnico, javax.swing.JLayeredPane.DEFAULT_LAYER); jLabel1.setForeground(new java.awt.Color(255, 255, 255)); jLabel1.setText("Director Tecnico:"); jLabel1.setBounds(60, 160, 100, 20); jLayeredPane1.add(jLabel1, javax.swing.JLayeredPane.DEFAULT_LAYER); jLabel2.setForeground(new java.awt.Color(255, 255, 255)); jLabel2.setText("Grupo: "); jLabel2.setBounds(60, 210, 60, 20); jLayeredPane1.add(jLabel2, javax.swing.JLayeredPane.DEFAULT_LAYER); jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); jComboBox1.setBounds(170, 210, 140, -1); jLayeredPane1.add(jComboBox1, javax.swing.JLayeredPane.DEFAULT_LAYER); titulo.setFont(new java.awt.Font("Tahoma", 1, 18)); titulo.setForeground(new java.awt.Color(255, 255, 255)); titulo.setText("Paises"); titulo.setBounds(250, 10, 170, 30); jLayeredPane1.add(titulo, javax.swing.JLayeredPane.DEFAULT_LAYER); jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/ciudad.png"))); // NOI18N jLabel3.setText("jLabel3"); jLabel3.setBounds(0, 0, 540, 390); jLayeredPane1.add(jLabel3, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 544, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jLayeredPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 383, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Modificar_Pais().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton atras; private javax.swing.JComboBox cb_listaPais; private javax.swing.JTextField directorTecnico; private javax.swing.JComboBox jComboBox1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLayeredPane jLayeredPane1; private javax.swing.JLabel lPais; private javax.swing.JButton modificar; private javax.swing.JLabel titulo; // End of variables declaration//GEN-END:variables }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/Interfaces/Modificar_Pais.java
Java
gpl2
5,639
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * Login.java * * Created on 22/05/2010, 06:04:08 PM */ package Interfaces; /** * * @author Karla Ruiz */ public class Login extends javax.swing.JFrame { /** Creates new form Login */ public Login() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); titulo = new javax.swing.JLabel(); atras = new javax.swing.JButton(); salir = new javax.swing.JButton(); registrarse = new javax.swing.JButton(); iniciarsesion = new javax.swing.JButton(); lemail = new javax.swing.JLabel(); lpassword = new javax.swing.JLabel(); email = new javax.swing.JTextField(); password = new javax.swing.JTextField(); error = new javax.swing.JLabel(); imagen = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("LOGIN"); setMinimumSize(new java.awt.Dimension(500, 400)); setResizable(false); titulo.setFont(new java.awt.Font("Tahoma", 1, 18)); titulo.setForeground(new java.awt.Color(255, 255, 255)); titulo.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); titulo.setText("WorldCupBook"); titulo.setBounds(140, 20, 210, 40); jLayeredPane1.add(titulo, javax.swing.JLayeredPane.DEFAULT_LAYER); atras.setText("Atrás"); atras.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { atrasActionPerformed(evt); } }); atras.setBounds(40, 350, 120, -1); jLayeredPane1.add(atras, javax.swing.JLayeredPane.DEFAULT_LAYER); salir.setText("Salir"); salir.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { salirActionPerformed(evt); } }); salir.setBounds(360, 350, 120, -1); jLayeredPane1.add(salir, javax.swing.JLayeredPane.DEFAULT_LAYER); registrarse.setText("Registrarse"); registrarse.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { registrarseActionPerformed(evt); } }); registrarse.setBounds(200, 350, 120, -1); jLayeredPane1.add(registrarse, javax.swing.JLayeredPane.DEFAULT_LAYER); iniciarsesion.setText("Iniciar Sesion"); iniciarsesion.setBounds(190, 230, 120, -1); jLayeredPane1.add(iniciarsesion, javax.swing.JLayeredPane.DEFAULT_LAYER); lemail.setForeground(new java.awt.Color(255, 255, 255)); lemail.setText("Email"); lemail.setBounds(90, 140, 60, -1); jLayeredPane1.add(lemail, javax.swing.JLayeredPane.DEFAULT_LAYER); lpassword.setForeground(new java.awt.Color(255, 255, 255)); lpassword.setText("Password"); lpassword.setBounds(90, 180, 70, -1); jLayeredPane1.add(lpassword, javax.swing.JLayeredPane.DEFAULT_LAYER); email.setBounds(190, 140, 130, -1); jLayeredPane1.add(email, javax.swing.JLayeredPane.DEFAULT_LAYER); password.setBounds(190, 180, 130, -1); jLayeredPane1.add(password, javax.swing.JLayeredPane.DEFAULT_LAYER); error.setBounds(130, 270, 240, 20); jLayeredPane1.add(error, javax.swing.JLayeredPane.DEFAULT_LAYER); imagen.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Sudafrica_2010_2.png"))); // NOI18N imagen.setBounds(0, 0, 500, 400); jLayeredPane1.add(imagen, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 500, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents private void atrasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_atrasActionPerformed // TODO add your handling code here: this.dispose(); }//GEN-LAST:event_atrasActionPerformed private void registrarseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_registrarseActionPerformed // TODO add your handling code here: Registro registro = new Registro(); registro.setVisible(true); }//GEN-LAST:event_registrarseActionPerformed private void salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_salirActionPerformed // TODO add your handling code here: this.dispose(); }//GEN-LAST:event_salirActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Login().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton atras; private javax.swing.JTextField email; private javax.swing.JLabel error; private javax.swing.JLabel imagen; private javax.swing.JButton iniciarsesion; private javax.swing.JLayeredPane jLayeredPane1; private javax.swing.JLabel lemail; private javax.swing.JLabel lpassword; private javax.swing.JTextField password; private javax.swing.JButton registrarse; private javax.swing.JButton salir; private javax.swing.JLabel titulo; // End of variables declaration//GEN-END:variables }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/Interfaces/Login.java
Java
gpl2
6,499
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * Agregar_Partido.java * * Created on 19-may-2010, 20:17:37 */ package Interfaces; /** * * @author Michelangelo */ public class Agregar_Partido extends javax.swing.JFrame { /** Creates new form Agregar_Partido */ public Agregar_Partido() { initComponents(); this.setSize(500, 400); this.setTitle("Partidos"); this.atras.setLocation(50, 280); this.atras.setSize(125, 30); this.agregar.setLocation(320, 280); this.agregar.setSize(125, 30); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); atras = new javax.swing.JButton(); agregar = new javax.swing.JButton(); lFecha = new javax.swing.JLabel(); lHora = new javax.swing.JLabel(); lPais1 = new javax.swing.JLabel(); lPais2 = new javax.swing.JLabel(); cb_pais1 = new javax.swing.JComboBox(); cb_pais2 = new javax.swing.JComboBox(); hora = new javax.swing.JComboBox(); jDateChooser1 = new com.toedter.calendar.JDateChooser(); titulo = new javax.swing.JLabel(); modificar = new javax.swing.JButton(); fondo = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); atras.setText("Atras"); atras.setBounds(30, 300, 110, 23); jLayeredPane1.add(atras, javax.swing.JLayeredPane.DEFAULT_LAYER); agregar.setText("Agregar"); agregar.setBounds(190, 300, 110, 23); jLayeredPane1.add(agregar, javax.swing.JLayeredPane.DEFAULT_LAYER); lFecha.setBackground(new java.awt.Color(0, 0, 0)); lFecha.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N lFecha.setText("Fecha:"); lFecha.setBounds(120, 180, 70, 20); jLayeredPane1.add(lFecha, javax.swing.JLayeredPane.DEFAULT_LAYER); lHora.setBackground(new java.awt.Color(0, 0, 0)); lHora.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N lHora.setText("Hora:"); lHora.setBounds(120, 220, 70, 20); jLayeredPane1.add(lHora, javax.swing.JLayeredPane.DEFAULT_LAYER); lPais1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N lPais1.setText("Pais 1"); lPais1.setBounds(110, 70, 70, 20); jLayeredPane1.add(lPais1, javax.swing.JLayeredPane.DEFAULT_LAYER); lPais2.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N lPais2.setText("Pais 2"); lPais2.setBounds(340, 70, 70, 20); jLayeredPane1.add(lPais2, javax.swing.JLayeredPane.DEFAULT_LAYER); cb_pais1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); cb_pais1.setBounds(50, 90, 160, 20); jLayeredPane1.add(cb_pais1, javax.swing.JLayeredPane.DEFAULT_LAYER); cb_pais2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); cb_pais2.setBounds(270, 90, 160, 20); jLayeredPane1.add(cb_pais2, javax.swing.JLayeredPane.DEFAULT_LAYER); hora.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); hora.setBounds(190, 220, 170, 20); jLayeredPane1.add(hora, javax.swing.JLayeredPane.DEFAULT_LAYER); jDateChooser1.setBounds(190, 180, 170, 20); jLayeredPane1.add(jDateChooser1, javax.swing.JLayeredPane.DEFAULT_LAYER); titulo.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N titulo.setText("Partido"); titulo.setBounds(210, 20, 90, 20); jLayeredPane1.add(titulo, javax.swing.JLayeredPane.DEFAULT_LAYER); modificar.setText("Modificar"); modificar.setBounds(350, 300, 100, 23); jLayeredPane1.add(modificar, javax.swing.JLayeredPane.DEFAULT_LAYER); fondo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/PeterMokaba.png"))); // NOI18N fondo.setText("jLabel1"); fondo.setBounds(0, 0, 500, 380); jLayeredPane1.add(fondo, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 499, javax.swing.GroupLayout.PREFERRED_SIZE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 379, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Agregar_Partido().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton agregar; private javax.swing.JButton atras; private javax.swing.JComboBox cb_pais1; private javax.swing.JComboBox cb_pais2; private javax.swing.JLabel fondo; private javax.swing.JComboBox hora; private com.toedter.calendar.JDateChooser jDateChooser1; private javax.swing.JLayeredPane jLayeredPane1; private javax.swing.JLabel lFecha; private javax.swing.JLabel lHora; private javax.swing.JLabel lPais1; private javax.swing.JLabel lPais2; private javax.swing.JButton modificar; private javax.swing.JLabel titulo; // End of variables declaration//GEN-END:variables }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/Interfaces/Agregar_Partido.java
Java
gpl2
6,245
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * FanaticoPais.java * * Created on 22/05/2010, 07:47:57 PM */ package Interfaces; /** * * @author Karla Ruiz */ public class Fanatico_Pais extends javax.swing.JFrame { /** Creates new form FanaticoPais */ public Fanatico_Pais() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); titulo = new javax.swing.JLabel(); pais = new javax.swing.JComboBox(); lpais = new javax.swing.JLabel(); seguir = new javax.swing.JButton(); noseguir = new javax.swing.JButton(); atras = new javax.swing.JButton(); fanatico = new javax.swing.JScrollPane(); jTextArea1 = new javax.swing.JTextArea(); lfanatico = new javax.swing.JLabel(); imagen = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("PAIS - FANATICO"); setMinimumSize(new java.awt.Dimension(500, 400)); titulo.setFont(new java.awt.Font("Tahoma", 1, 18)); titulo.setForeground(new java.awt.Color(255, 255, 255)); titulo.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); titulo.setText("Pais"); titulo.setBounds(180, 20, 110, 29); jLayeredPane1.add(titulo, javax.swing.JLayeredPane.DEFAULT_LAYER); pais.setOpaque(false); pais.setBounds(40, 130, 210, -1); jLayeredPane1.add(pais, javax.swing.JLayeredPane.DEFAULT_LAYER); lpais.setForeground(new java.awt.Color(255, 255, 255)); lpais.setText("Pais:"); lpais.setBounds(40, 100, 40, -1); jLayeredPane1.add(lpais, javax.swing.JLayeredPane.DEFAULT_LAYER); seguir.setText("Seguir"); seguir.setBounds(30, 190, 90, -1); jLayeredPane1.add(seguir, javax.swing.JLayeredPane.DEFAULT_LAYER); noseguir.setText("No Seguir"); noseguir.setBounds(160, 190, 90, -1); jLayeredPane1.add(noseguir, javax.swing.JLayeredPane.DEFAULT_LAYER); atras.setText("Atrás"); atras.setBounds(30, 360, 100, -1); jLayeredPane1.add(atras, javax.swing.JLayeredPane.DEFAULT_LAYER); jTextArea1.setColumns(20); jTextArea1.setRows(5); fanatico.setViewportView(jTextArea1); fanatico.setBounds(310, 130, -1, 120); jLayeredPane1.add(fanatico, javax.swing.JLayeredPane.DEFAULT_LAYER); lfanatico.setForeground(new java.awt.Color(255, 255, 255)); lfanatico.setText("Fanatico de:"); lfanatico.setBounds(310, 100, 70, -1); jLayeredPane1.add(lfanatico, javax.swing.JLayeredPane.DEFAULT_LAYER); imagen.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/ciudad.png"))); // NOI18N imagen.setBounds(0, 0, 500, 400); jLayeredPane1.add(imagen, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 500, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Fanatico_Pais().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton atras; private javax.swing.JScrollPane fanatico; private javax.swing.JLabel imagen; private javax.swing.JLayeredPane jLayeredPane1; private javax.swing.JTextArea jTextArea1; private javax.swing.JLabel lfanatico; private javax.swing.JLabel lpais; private javax.swing.JButton noseguir; private javax.swing.JComboBox pais; private javax.swing.JButton seguir; private javax.swing.JLabel titulo; // End of variables declaration//GEN-END:variables }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/Interfaces/Fanatico_Pais.java
Java
gpl2
4,847
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * AgregarEstadio.java * * Created on 19-may-2010, 20:44:38 */ package Interfaces; import java.sql.SQLException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JOptionPane; import wcb.BD; import wcb.Estadio; /** * * @author Angiita */ public class AgregarEstadio extends javax.swing.JFrame { BD bd = new BD(); /** Creates new form AgregarEstadio */ public AgregarEstadio() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); jAtras = new javax.swing.JButton(); jAgregar = new javax.swing.JButton(); LNombre = new javax.swing.JLabel(); LEstadio = new javax.swing.JLabel(); LCiudad = new javax.swing.JLabel(); LAforo = new javax.swing.JLabel(); LFecha = new javax.swing.JLabel(); lFechaC = new javax.swing.JLabel(); jNombre = new javax.swing.JTextField(); jCiudad = new javax.swing.JTextField(); jAforo = new javax.swing.JTextField(); jFechaC = new com.toedter.calendar.JDateChooser(); jLabel1 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jAtras.setText("Atras"); jAtras.setPreferredSize(new java.awt.Dimension(73, 23)); jAtras.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jAtrasActionPerformed(evt); } }); jAtras.setBounds(70, 330, 100, 23); jLayeredPane1.add(jAtras, javax.swing.JLayeredPane.DEFAULT_LAYER); jAgregar.setText("Agregar"); jAgregar.setMaximumSize(new java.awt.Dimension(59, 23)); jAgregar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jAgregarActionPerformed(evt); } }); jAgregar.setBounds(310, 330, 100, 23); jLayeredPane1.add(jAgregar, javax.swing.JLayeredPane.DEFAULT_LAYER); LNombre.setForeground(new java.awt.Color(255, 255, 0)); LNombre.setText("Nombre:"); LNombre.setBounds(60, 100, 70, 14); jLayeredPane1.add(LNombre, javax.swing.JLayeredPane.DEFAULT_LAYER); LEstadio.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N LEstadio.setForeground(new java.awt.Color(255, 255, 0)); LEstadio.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); LEstadio.setText("Estadio"); LEstadio.setBounds(190, 20, 130, 22); jLayeredPane1.add(LEstadio, javax.swing.JLayeredPane.DEFAULT_LAYER); LCiudad.setForeground(new java.awt.Color(255, 255, 0)); LCiudad.setText("Ciudad:"); LCiudad.setBounds(60, 140, 50, 14); jLayeredPane1.add(LCiudad, javax.swing.JLayeredPane.DEFAULT_LAYER); LAforo.setForeground(new java.awt.Color(255, 255, 0)); LAforo.setText("Aforo:"); LAforo.setBounds(60, 180, 50, 14); jLayeredPane1.add(LAforo, javax.swing.JLayeredPane.DEFAULT_LAYER); LFecha.setForeground(new java.awt.Color(255, 255, 0)); LFecha.setText("Fecha de"); LFecha.setBounds(60, 210, 50, 20); jLayeredPane1.add(LFecha, javax.swing.JLayeredPane.DEFAULT_LAYER); lFechaC.setForeground(new java.awt.Color(255, 255, 0)); lFechaC.setText("Construccion:"); lFechaC.setBounds(60, 230, 80, 14); jLayeredPane1.add(lFechaC, javax.swing.JLayeredPane.DEFAULT_LAYER); jNombre.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jNombreActionPerformed(evt); } }); jNombre.setBounds(180, 100, 180, 20); jLayeredPane1.add(jNombre, javax.swing.JLayeredPane.DEFAULT_LAYER); jCiudad.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jCiudadActionPerformed(evt); } }); jCiudad.setBounds(180, 140, 180, 20); jLayeredPane1.add(jCiudad, javax.swing.JLayeredPane.DEFAULT_LAYER); jAforo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jAforoActionPerformed(evt); } }); jAforo.setBounds(180, 180, 180, 20); jLayeredPane1.add(jAforo, javax.swing.JLayeredPane.DEFAULT_LAYER); jFechaC.setBounds(180, 220, 180, 20); jLayeredPane1.add(jFechaC, javax.swing.JLayeredPane.DEFAULT_LAYER); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/estadio.png"))); // NOI18N jLabel1.setText("jLabel1"); jLabel1.setBounds(0, 0, 500, 400); jLayeredPane1.add(jLabel1, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 500, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents private void jAtrasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jAtrasActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jAtrasActionPerformed private void jAgregarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jAgregarActionPerformed // TODO add your handling code here: // String aforo, nombre, ciudad; // Integer c; // aforo= jAforo.getText().toString(); // nombre= jNombre.getText().toString(); // ciudad= jCiudad.getText().toString(); // c= Integer.parseInt(aforo); // // Calendar cal1 = jFechaC.getCalendar(); // int dia1 = cal1.get(Calendar.DATE); // int mes1 = cal1.get(Calendar.MONTH); // int año1 = cal1.get(Calendar.YEAR)- 1900; // java.sql.Date Date1=new java.sql.Date(año1,mes1,dia1); //Date Sistema // // if((jAforo.getText().equals("")) || (nombre.equals("")) || (ciudad.equals("")) || (aforo.equals(""))) // { // JOptionPane.showMessageDialog(null,"ERROR, Debe llenar todos los campos"); // } // else // { // Estadio nuevo_estadio = new Estadio(null,nombre,ciudad,c,Date1); //// Calendar cal = Calendar.getInstance(); //// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); //// String now = sdf.format(cal.getTime()); // // int x = 0; // try { // x = bd.insertarEstadio(nuevo_estadio); // } catch (SQLException ex) { // Logger.getLogger(AgregarEstadio.class.getName()).log(Level.SEVERE, null, ex); // } // if (x==1) // JOptionPane.showMessageDialog(null,"Error, el Estadio ya existe"); // else // JOptionPane.showMessageDialog(null,"Estadio agregado Exitosamente"); // // } }//GEN-LAST:event_jAgregarActionPerformed private void jCiudadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCiudadActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jCiudadActionPerformed private void jAforoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jAforoActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jAforoActionPerformed private void jNombreActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jNombreActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jNombreActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new AgregarEstadio().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel LAforo; private javax.swing.JLabel LCiudad; private javax.swing.JLabel LEstadio; private javax.swing.JLabel LFecha; private javax.swing.JLabel LNombre; private javax.swing.JTextField jAforo; private javax.swing.JButton jAgregar; private javax.swing.JButton jAtras; private javax.swing.JTextField jCiudad; private com.toedter.calendar.JDateChooser jFechaC; private javax.swing.JLabel jLabel1; private javax.swing.JLayeredPane jLayeredPane1; private javax.swing.JTextField jNombre; private javax.swing.JLabel lFechaC; // End of variables declaration//GEN-END:variables }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/Interfaces/AgregarEstadio.java
Java
gpl2
9,693
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * Evento.java * * Created on 23/05/2010, 08:55:06 AM */ package Interfaces; /** * * @author Karla Ruiz */ public class Evento extends javax.swing.JFrame { /** Creates new form Evento */ public Evento() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); titulo = new javax.swing.JLabel(); atras = new javax.swing.JButton(); agregar = new javax.swing.JButton(); lfecha = new javax.swing.JLabel(); llugar = new javax.swing.JLabel(); ldescripcion = new javax.swing.JLabel(); fecha = new com.toedter.calendar.JDateChooser(); lugar = new javax.swing.JTextField(); descripcion = new javax.swing.JScrollPane(); jTextArea1 = new javax.swing.JTextArea(); imagen = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("EVENTO"); setMinimumSize(new java.awt.Dimension(500, 400)); titulo.setFont(new java.awt.Font("Tahoma", 1, 18)); titulo.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); titulo.setText("Evento"); titulo.setBounds(190, 20, 120, -1); jLayeredPane1.add(titulo, javax.swing.JLayeredPane.DEFAULT_LAYER); atras.setText("Atrás"); atras.setBounds(70, 350, 100, -1); jLayeredPane1.add(atras, javax.swing.JLayeredPane.DEFAULT_LAYER); agregar.setText("Agregar"); agregar.setBounds(360, 350, 90, -1); jLayeredPane1.add(agregar, javax.swing.JLayeredPane.DEFAULT_LAYER); lfecha.setFont(new java.awt.Font("Tahoma", 1, 11)); lfecha.setText("Fecha"); lfecha.setBounds(50, 110, 40, -1); jLayeredPane1.add(lfecha, javax.swing.JLayeredPane.DEFAULT_LAYER); llugar.setFont(new java.awt.Font("Tahoma", 1, 11)); llugar.setText("Lugar"); llugar.setBounds(50, 160, 50, -1); jLayeredPane1.add(llugar, javax.swing.JLayeredPane.DEFAULT_LAYER); ldescripcion.setFont(new java.awt.Font("Tahoma", 1, 11)); ldescripcion.setText("Descripcion"); ldescripcion.setBounds(40, 210, 70, -1); jLayeredPane1.add(ldescripcion, javax.swing.JLayeredPane.DEFAULT_LAYER); fecha.setBounds(140, 110, 170, -1); jLayeredPane1.add(fecha, javax.swing.JLayeredPane.DEFAULT_LAYER); lugar.setBounds(140, 160, 170, -1); jLayeredPane1.add(lugar, javax.swing.JLayeredPane.DEFAULT_LAYER); jTextArea1.setColumns(20); jTextArea1.setRows(5); descripcion.setViewportView(jTextArea1); descripcion.setBounds(130, 210, 250, -1); jLayeredPane1.add(descripcion, javax.swing.JLayeredPane.DEFAULT_LAYER); imagen.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/evento.png"))); // NOI18N imagen.setBounds(0, 0, 500, 400); jLayeredPane1.add(imagen, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 500, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Evento().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton agregar; private javax.swing.JButton atras; private javax.swing.JScrollPane descripcion; private com.toedter.calendar.JDateChooser fecha; private javax.swing.JLabel imagen; private javax.swing.JLayeredPane jLayeredPane1; private javax.swing.JTextArea jTextArea1; private javax.swing.JLabel ldescripcion; private javax.swing.JLabel lfecha; private javax.swing.JLabel llugar; private javax.swing.JTextField lugar; private javax.swing.JLabel titulo; // End of variables declaration//GEN-END:variables }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/Interfaces/Evento.java
Java
gpl2
5,022
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * Consultar_Jugador.java * * Created on 19-may-2010, 20:10:59 */ package Interfaces; /** * * @author Michelangelo */ public class Consultar_Jugador extends javax.swing.JFrame { /** Creates new form Consultar_Jugador */ public Consultar_Jugador() { initComponents(); this.setTitle("Jugadores"); this.setSize(600,450); this.atras.setLocation(40, 320); this.atras.setSize(125, 30); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); jScrollPane1 = new javax.swing.JScrollPane(); Tabla = new javax.swing.JTable(); jComboBox1 = new javax.swing.JComboBox(); jLabel1 = new javax.swing.JLabel(); atras = new javax.swing.JButton(); titulo = new javax.swing.JLabel(); imagen = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); Tabla.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null} }, new String [] { "Nombre", "Fecha de Nacimiento", "Ciudad de nacimiento", "Tipo" } )); jScrollPane1.setViewportView(Tabla); jScrollPane1.setBounds(50, 110, 520, 170); jLayeredPane1.add(jScrollPane1, javax.swing.JLayeredPane.DEFAULT_LAYER); jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); jComboBox1.setBounds(60, 60, 150, 20); jLayeredPane1.add(jComboBox1, javax.swing.JLayeredPane.DEFAULT_LAYER); jLabel1.setForeground(new java.awt.Color(255, 255, 255)); jLabel1.setText("Pais"); jLabel1.setBounds(70, 40, 50, 14); jLayeredPane1.add(jLabel1, javax.swing.JLayeredPane.DEFAULT_LAYER); atras.setText("Atras"); atras.setBounds(40, 360, 100, 23); jLayeredPane1.add(atras, javax.swing.JLayeredPane.DEFAULT_LAYER); titulo.setFont(new java.awt.Font("Tahoma", 1, 18)); titulo.setForeground(new java.awt.Color(255, 255, 255)); titulo.setText("Jugadores"); titulo.setBounds(250, 20, 190, 30); jLayeredPane1.add(titulo, javax.swing.JLayeredPane.DEFAULT_LAYER); imagen.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Sudafrica_2010_3.png"))); // NOI18N imagen.setText("jLabel2"); imagen.setBounds(0, 0, 600, 450); jLayeredPane1.add(imagen, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 600, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 451, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Consultar_Jugador().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JTable Tabla; private javax.swing.JButton atras; private javax.swing.JLabel imagen; private javax.swing.JComboBox jComboBox1; private javax.swing.JLabel jLabel1; private javax.swing.JLayeredPane jLayeredPane1; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JLabel titulo; // End of variables declaration//GEN-END:variables }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/Interfaces/Consultar_Jugador.java
Java
gpl2
4,552
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * Modificar_Estadio.java * * Created on 21-may-2010, 15:40:26 */ package Interfaces; /** * * @author Michelangelo */ public class Modificar_Estadio extends javax.swing.JFrame { /** Creates new form Modificar_Estadio */ public Modificar_Estadio() { initComponents(); this.setTitle("Estadios"); this.setSize(500, 400); this.atras.setLocation(50, 280); this.atras.setSize(125, 30); this.modificar.setLocation(320, 280); this.modificar.setSize(125, 30); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); lnombre = new javax.swing.JLabel(); nombre = new javax.swing.JTextField(); atras = new javax.swing.JButton(); modificar = new javax.swing.JButton(); titulo = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); lnombre.setFont(new java.awt.Font("Tahoma", 1, 11)); lnombre.setText("nombre: "); lnombre.setBounds(90, 80, 80, 20); jLayeredPane1.add(lnombre, javax.swing.JLayeredPane.DEFAULT_LAYER); nombre.setBounds(160, 80, 200, 20); jLayeredPane1.add(nombre, javax.swing.JLayeredPane.DEFAULT_LAYER); atras.setText("Atras"); atras.setBounds(20, 263, 100, 30); jLayeredPane1.add(atras, javax.swing.JLayeredPane.DEFAULT_LAYER); modificar.setText("Modificar"); modificar.setBounds(360, 260, 110, -1); jLayeredPane1.add(modificar, javax.swing.JLayeredPane.DEFAULT_LAYER); titulo.setFont(new java.awt.Font("Tahoma", 1, 24)); titulo.setText("Estadios"); titulo.setBounds(190, 20, 140, 20); jLayeredPane1.add(titulo, javax.swing.JLayeredPane.DEFAULT_LAYER); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/PeterMokaba.png"))); // NOI18N jLabel1.setText("jLabel1"); jLabel1.setBounds(0, 0, 500, 320); jLayeredPane1.add(jLabel1, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 497, javax.swing.GroupLayout.PREFERRED_SIZE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 323, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Modificar_Estadio().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton atras; private javax.swing.JLabel jLabel1; private javax.swing.JLayeredPane jLayeredPane1; private javax.swing.JLabel lnombre; private javax.swing.JButton modificar; private javax.swing.JTextField nombre; private javax.swing.JLabel titulo; // End of variables declaration//GEN-END:variables }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/Interfaces/Modificar_Estadio.java
Java
gpl2
3,942
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * Consultar.java * * Created on 19-may-2010, 20:10:59 */ package Interfaces; /** * * @author Michelangelo */ public class Consultar_Estadio extends javax.swing.JFrame { /** Creates new form Consultar */ public Consultar_Estadio() { initComponents(); this.setTitle("Estadios"); this.setSize(600,450); this.atras.setLocation(40, 320); this.atras.setSize(125, 30); //dependiendo de la manera en que se llame a esta ventna, //si es eliminar o sea modificar un campo, uno de los botones estara //invisible y el otro no, por eso se encuentran en la misma posicion //ya que solo se utilizara un boton dependiendo del caso de uso //(si deseo eliminar se muestra eliminar y se deseo modificar //se mostrara modificar), para ello habra que manerjar los .setVisible(true); de los botones this.modificar.setLocation(400, 320); this.modificar.setSize(125, 30); this.eliminar.setLocation(400, 320); this.eliminar.setSize(125, 30); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); jScrollPane1 = new javax.swing.JScrollPane(); Tabla = new javax.swing.JTable(); atras = new javax.swing.JButton(); modificar = new javax.swing.JButton(); eliminar = new javax.swing.JButton(); titulo = new javax.swing.JLabel(); imagen = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); Tabla.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null} }, new String [] { "Nombre", "Ciudad", "Aforo", "Fecha" } )); jScrollPane1.setViewportView(Tabla); jScrollPane1.setBounds(20, 100, 540, 90); jLayeredPane1.add(jScrollPane1, javax.swing.JLayeredPane.DEFAULT_LAYER); atras.setText("Atras"); atras.setBounds(50, 307, 100, -1); jLayeredPane1.add(atras, javax.swing.JLayeredPane.DEFAULT_LAYER); modificar.setText("Modificar"); modificar.setBounds(420, 307, 100, -1); jLayeredPane1.add(modificar, javax.swing.JLayeredPane.DEFAULT_LAYER); eliminar.setText("Eliminar"); eliminar.setBounds(420, 260, 100, -1); jLayeredPane1.add(eliminar, javax.swing.JLayeredPane.DEFAULT_LAYER); titulo.setFont(new java.awt.Font("Tahoma", 1, 18)); titulo.setText("Estadios"); titulo.setBounds(280, 30, 170, 20); jLayeredPane1.add(titulo, javax.swing.JLayeredPane.DEFAULT_LAYER); imagen.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/estadio.png"))); // NOI18N imagen.setText("jLabel1"); imagen.setBounds(0, 0, 600, 450); jLayeredPane1.add(imagen, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 600, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 450, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Consultar_Estadio().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JTable Tabla; private javax.swing.JButton atras; private javax.swing.JButton eliminar; private javax.swing.JLabel imagen; private javax.swing.JLayeredPane jLayeredPane1; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JButton modificar; private javax.swing.JLabel titulo; // End of variables declaration//GEN-END:variables }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/Interfaces/Consultar_Estadio.java
Java
gpl2
4,926
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * Wellcome.java * * Created on 21-may-2010, 19:18:57 */ package Interfaces; /** * * @author Angiita */ public class Wellcome extends javax.swing.JFrame { /** Creates new form Wellcome */ public Wellcome() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); jEntrar = new javax.swing.JButton(); LabelImagenes = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jEntrar.setText("Entrar"); jEntrar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jEntrarActionPerformed(evt); } }); jEntrar.setBounds(200, 220, 90, 23); jLayeredPane1.add(jEntrar, javax.swing.JLayeredPane.DEFAULT_LAYER); LabelImagenes.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Inicio2.png"))); // NOI18N LabelImagenes.setBounds(0, 0, 500, 400); jLayeredPane1.add(LabelImagenes, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 500, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents private void jEntrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jEntrarActionPerformed // TODO add your handling code here: Login log = new Login(); log.setVisible(true); }//GEN-LAST:event_jEntrarActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Wellcome().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel LabelImagenes; private javax.swing.JButton jEntrar; private javax.swing.JLayeredPane jLayeredPane1; // End of variables declaration//GEN-END:variables }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/Interfaces/Wellcome.java
Java
gpl2
3,057
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * Administrador_Usuario.java * * Created on 18-may-2010, 21:02:46 */ package Interfaces; /** * * @author Michelangelo */ public class Usuario extends javax.swing.JFrame { /** Creates new form Administrador_Usuario */ public Usuario() { initComponents(); this.setTitle("Bienvenido"); this.setSize(600,400); this.setSize(600,450); this.atras.setLocation(40, 320); this.atras.setSize(125, 30); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); cerrarSecion = new javax.swing.JLabel(); icono = new javax.swing.JLabel(); verPerfil = new javax.swing.JLabel(); atras = new javax.swing.JButton(); titulo = new javax.swing.JLabel(); fondo = new javax.swing.JLabel(); jMenuBar1 = new javax.swing.JMenuBar(); m_Amigos = new javax.swing.JMenu(); m_Amigos_Agregar = new javax.swing.JMenuItem(); m_Amigos_Consultar = new javax.swing.JMenuItem(); m_Amigos_Bloquear = new javax.swing.JMenuItem(); m_Pais = new javax.swing.JMenu(); m_Pais_Consultar = new javax.swing.JMenuItem(); m_Pais_BecomeAFan = new javax.swing.JMenuItem(); m_Evento = new javax.swing.JMenu(); m_Evento_Agregar = new javax.swing.JMenuItem(); m_Evento_Modificar = new javax.swing.JMenuItem(); m_Evento_Consultar = new javax.swing.JMenuItem(); m_Evento_Eliminar = new javax.swing.JMenuItem(); m_Factura = new javax.swing.JMenu(); m_Factura_VerDescuento = new javax.swing.JMenuItem(); m_Factura_VerFactura = new javax.swing.JMenuItem(); m_Solicitud = new javax.swing.JMenu(); m_Solicitud_Amigos = new javax.swing.JMenuItem(); m_Solicitud_Miembros = new javax.swing.JMenuItem(); m_Producto = new javax.swing.JMenu(); m_Producto_Consultar = new javax.swing.JMenuItem(); m_Producto_Eliminar = new javax.swing.JMenuItem(); m_Producto_Comprar = new javax.swing.JMenuItem(); m_Entrada = new javax.swing.JMenu(); m_Entrada_Vender = new javax.swing.JMenuItem(); m_Entrada_Modificar = new javax.swing.JMenuItem(); m_Entrada_Comprar = new javax.swing.JMenuItem(); m_Jugador = new javax.swing.JMenu(); m_Jugador_Consultar = new javax.swing.JMenuItem(); m_Partido = new javax.swing.JMenu(); m_Partido_Consultar = new javax.swing.JMenuItem(); m_Estadio = new javax.swing.JMenu(); m_Estadio_Consultar = new javax.swing.JMenuItem(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); cerrarSecion.setText("Cerrar Secion"); cerrarSecion.setBounds(10, 130, 100, 14); jLayeredPane1.add(cerrarSecion, javax.swing.JLayeredPane.DEFAULT_LAYER); icono.setText(" (- _ -)"); icono.setBounds(10, 10, 60, 80); jLayeredPane1.add(icono, javax.swing.JLayeredPane.DEFAULT_LAYER); verPerfil.setText("Ver Perfil"); verPerfil.setBounds(10, 100, 80, 14); jLayeredPane1.add(verPerfil, javax.swing.JLayeredPane.DEFAULT_LAYER); atras.setText("atras"); atras.setBounds(50, 330, 90, 30); jLayeredPane1.add(atras, javax.swing.JLayeredPane.DEFAULT_LAYER); titulo.setFont(new java.awt.Font("Tahoma", 1, 18)); titulo.setText("Bienvenido"); titulo.setBounds(190, 20, 160, 30); jLayeredPane1.add(titulo, javax.swing.JLayeredPane.DEFAULT_LAYER); fondo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/usuario imagen 4.png"))); // NOI18N fondo.setText("jLabel1"); fondo.setBounds(0, 0, 610, 410); jLayeredPane1.add(fondo, javax.swing.JLayeredPane.DEFAULT_LAYER); m_Amigos.setText("Amigos"); m_Amigos_Agregar.setText("Agregar"); m_Amigos.add(m_Amigos_Agregar); m_Amigos_Consultar.setText("Consultar"); m_Amigos.add(m_Amigos_Consultar); m_Amigos_Bloquear.setText("Bloquear"); m_Amigos.add(m_Amigos_Bloquear); jMenuBar1.add(m_Amigos); m_Pais.setText("Pais"); m_Pais_Consultar.setText("Consultar"); m_Pais.add(m_Pais_Consultar); m_Pais_BecomeAFan.setText("Volverse Fan"); m_Pais.add(m_Pais_BecomeAFan); jMenuBar1.add(m_Pais); m_Evento.setText("Evento"); m_Evento_Agregar.setText("Agregar"); m_Evento.add(m_Evento_Agregar); m_Evento_Modificar.setText("Modificar"); m_Evento.add(m_Evento_Modificar); m_Evento_Consultar.setText("Consultar"); m_Evento.add(m_Evento_Consultar); m_Evento_Eliminar.setText("Eliminar"); m_Evento.add(m_Evento_Eliminar); jMenuBar1.add(m_Evento); m_Factura.setText("Factura"); m_Factura_VerDescuento.setText("Ver Descuento"); m_Factura.add(m_Factura_VerDescuento); m_Factura_VerFactura.setText("Ver Factura"); m_Factura.add(m_Factura_VerFactura); jMenuBar1.add(m_Factura); m_Solicitud.setText("Solicitud"); m_Solicitud_Amigos.setText("Amigos"); m_Solicitud.add(m_Solicitud_Amigos); m_Solicitud_Miembros.setText("Miembro"); m_Solicitud.add(m_Solicitud_Miembros); jMenuBar1.add(m_Solicitud); m_Producto.setText("Producto"); m_Producto_Consultar.setText("Consultar"); m_Producto.add(m_Producto_Consultar); m_Producto_Eliminar.setText("Eliminar"); m_Producto.add(m_Producto_Eliminar); m_Producto_Comprar.setText("Comprar"); m_Producto.add(m_Producto_Comprar); jMenuBar1.add(m_Producto); m_Entrada.setText("Entradas"); m_Entrada_Vender.setText("Vender"); m_Entrada.add(m_Entrada_Vender); m_Entrada_Modificar.setText("Modificar"); m_Entrada.add(m_Entrada_Modificar); m_Entrada_Comprar.setText("Comprar"); m_Entrada.add(m_Entrada_Comprar); jMenuBar1.add(m_Entrada); m_Jugador.setText("Jugador"); m_Jugador_Consultar.setText("Consultar"); m_Jugador.add(m_Jugador_Consultar); jMenuBar1.add(m_Jugador); m_Partido.setText("Partido"); m_Partido_Consultar.setText("Consultar"); m_Partido.add(m_Partido_Consultar); jMenuBar1.add(m_Partido); m_Estadio.setText("Estadio"); m_Estadio_Consultar.setText("Consultar"); m_Estadio.add(m_Estadio_Consultar); jMenuBar1.add(m_Estadio); setJMenuBar(jMenuBar1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 609, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 408, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Usuario().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton atras; private javax.swing.JLabel cerrarSecion; private javax.swing.JLabel fondo; private javax.swing.JLabel icono; private javax.swing.JLayeredPane jLayeredPane1; private javax.swing.JMenuBar jMenuBar1; private javax.swing.JMenu m_Amigos; private javax.swing.JMenuItem m_Amigos_Agregar; private javax.swing.JMenuItem m_Amigos_Bloquear; private javax.swing.JMenuItem m_Amigos_Consultar; private javax.swing.JMenu m_Entrada; private javax.swing.JMenuItem m_Entrada_Comprar; private javax.swing.JMenuItem m_Entrada_Modificar; private javax.swing.JMenuItem m_Entrada_Vender; private javax.swing.JMenu m_Estadio; private javax.swing.JMenuItem m_Estadio_Consultar; private javax.swing.JMenu m_Evento; private javax.swing.JMenuItem m_Evento_Agregar; private javax.swing.JMenuItem m_Evento_Consultar; private javax.swing.JMenuItem m_Evento_Eliminar; private javax.swing.JMenuItem m_Evento_Modificar; private javax.swing.JMenu m_Factura; private javax.swing.JMenuItem m_Factura_VerDescuento; private javax.swing.JMenuItem m_Factura_VerFactura; private javax.swing.JMenu m_Jugador; private javax.swing.JMenuItem m_Jugador_Consultar; private javax.swing.JMenu m_Pais; private javax.swing.JMenuItem m_Pais_BecomeAFan; private javax.swing.JMenuItem m_Pais_Consultar; private javax.swing.JMenu m_Partido; private javax.swing.JMenuItem m_Partido_Consultar; private javax.swing.JMenu m_Producto; private javax.swing.JMenuItem m_Producto_Comprar; private javax.swing.JMenuItem m_Producto_Consultar; private javax.swing.JMenuItem m_Producto_Eliminar; private javax.swing.JMenu m_Solicitud; private javax.swing.JMenuItem m_Solicitud_Amigos; private javax.swing.JMenuItem m_Solicitud_Miembros; private javax.swing.JLabel titulo; private javax.swing.JLabel verPerfil; // End of variables declaration//GEN-END:variables }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/Interfaces/Usuario.java
Java
gpl2
10,050
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * ConsultarPais.java * * Created on 21-may-2010, 18:55:39 */ package Interfaces; /** * * @author Angiita */ public class ConsultarPais extends javax.swing.JFrame { /** Creates new form ConsultarPais */ public ConsultarPais() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); LPais = new javax.swing.JLabel(); LPaises = new javax.swing.JLabel(); jPaises = new javax.swing.JComboBox(); jPaise = new javax.swing.JScrollPane(); jTPais = new javax.swing.JTextArea(); jAtras = new javax.swing.JButton(); LSeguidores = new javax.swing.JLabel(); jSeguidores = new javax.swing.JScrollPane(); jTSeguidores = new javax.swing.JTable(); jLabel1 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); LPais.setFont(new java.awt.Font("Tahoma", 1, 18)); LPais.setForeground(new java.awt.Color(255, 255, 255)); LPais.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); LPais.setText("Pais"); LPais.setBounds(210, 20, 90, 20); jLayeredPane1.add(LPais, javax.swing.JLayeredPane.DEFAULT_LAYER); LPaises.setForeground(new java.awt.Color(255, 255, 255)); LPaises.setText("Paises"); LPaises.setBounds(30, 60, 30, 14); jLayeredPane1.add(LPaises, javax.swing.JLayeredPane.DEFAULT_LAYER); jPaises.setBounds(30, 80, 150, 20); jLayeredPane1.add(jPaises, javax.swing.JLayeredPane.DEFAULT_LAYER); jTPais.setColumns(20); jTPais.setRows(5); jPaise.setViewportView(jTPais); jPaise.setBounds(30, 120, 150, 200); jLayeredPane1.add(jPaise, javax.swing.JLayeredPane.DEFAULT_LAYER); jAtras.setText("Atras"); jAtras.setBounds(30, 350, 100, 23); jLayeredPane1.add(jAtras, javax.swing.JLayeredPane.DEFAULT_LAYER); LSeguidores.setForeground(new java.awt.Color(255, 255, 255)); LSeguidores.setText("Seguidores"); LSeguidores.setBounds(310, 50, 70, 14); jLayeredPane1.add(LSeguidores, javax.swing.JLayeredPane.DEFAULT_LAYER); jTSeguidores.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null} }, new String [] { "Nombre", "Fecha Inicio", "Fecha Fin" } )); jSeguidores.setViewportView(jTSeguidores); jSeguidores.setBounds(210, 80, 260, 240); jLayeredPane1.add(jSeguidores, javax.swing.JLayeredPane.DEFAULT_LAYER); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/ciudad.png"))); // NOI18N jLabel1.setText("jLabel1"); jLabel1.setBounds(0, 0, 500, 410); jLayeredPane1.add(jLabel1, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 500, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new ConsultarPais().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel LPais; private javax.swing.JLabel LPaises; private javax.swing.JLabel LSeguidores; private javax.swing.JButton jAtras; private javax.swing.JLabel jLabel1; private javax.swing.JLayeredPane jLayeredPane1; private javax.swing.JScrollPane jPaise; private javax.swing.JComboBox jPaises; private javax.swing.JScrollPane jSeguidores; private javax.swing.JTextArea jTPais; private javax.swing.JTable jTSeguidores; // End of variables declaration//GEN-END:variables }
0karrita123michey456angiita7891
trunk/WorldCupBook/src/Interfaces/ConsultarPais.java
Java
gpl2
5,266
/* * 12306 Auto Query => A javascript snippet to help you book tickets online. * 12306 Booking Assistant * Copyright (C) 2011 Hidden * * 12306 Auto Query => A javascript snippet to help you book tickets online. * Copyright (C) 2011 Jingqin Lynn * * 12306 Auto Login => A javascript snippet to help you auto login 12306.com. * Copyright (C) 2011 Kevintop * * Includes jQuery * Copyright 2011, John Resig * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ // ==UserScript== // @name 12306 Booking Assistant // @version 1.3.8.2 // @author zzdhidden@gmail.com // @namespace https://github.com/zzdhidden // @description 12306 订票助手之(自动登录,自动查票,自动订单) // @include *://dynamic.12306.cn/otsweb/* // @require https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js // ==/UserScript== function withjQuery(callback, safe){ if(typeof(jQuery) == "undefined") { var script = document.createElement("script"); script.type = "text/javascript"; script.src = "https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"; if(safe) { var cb = document.createElement("script"); cb.type = "text/javascript"; cb.textContent = "jQuery.noConflict();(" + callback.toString() + ")(jQuery, window);"; script.addEventListener('load', function() { document.head.appendChild(cb); }); } else { var dollar = undefined; if(typeof($) != "undefined") dollar = $; script.addEventListener('load', function() { jQuery.noConflict(); $ = dollar; callback(jQuery, window); }); } document.head.appendChild(script); } else { setTimeout(function() { //Firefox supports callback(jQuery, typeof unsafeWindow === "undefined" ? window : unsafeWindow); }, 30); } } withjQuery(function($, window){ $(document).click(function() { if( window.webkitNotifications && window.webkitNotifications.checkPermission() != 0 ) { window.webkitNotifications.requestPermission(); } }); function notify(str, timeout, skipAlert) { if( window.webkitNotifications && window.webkitNotifications.checkPermission() == 0 ) { var notification = webkitNotifications.createNotification( "http://www.12306.cn/mormhweb/images/favicon.ico", // icon url - can be relative '订票', // notification title str ); notification.show(); if ( timeout ) { setTimeout(function() { notification.cancel(); }, timeout); } return true; } else { if( !skipAlert ) { alert( str ); } return false; } } function route(match, fn) { if( window.location.href.indexOf(match) != -1 ) { fn(); }; } function query() { //query var isTicketAvailable = false; var firstRemove = false; window.$ && window.$(".obj:first").ajaxComplete(function() { $(this).find("tr").each(function(n, e) { if(checkTickets(e)){ isTicketAvailable = true; highLightRow(e); } }); if(firstRemove) { firstRemove = false; if (isTicketAvailable) { if (isAutoQueryEnabled) document.getElementById("refreshButton").click(); onticketAvailable(); //report } else { //wait for the button to become valid } } }).ajaxError(function() { if(isAutoQueryEnabled) doQuery(); }); //hack into the validQueryButton function to detect query var _delayButton = window.delayButton; window.delayButton = function() { _delayButton(); if(isAutoQueryEnabled) doQuery(); } //Trigger the button var doQuery = function() { displayQueryTimes(queryTimes++); firstRemove = true; document.getElementById(isStudentTicket ? "stu_submitQuery" : "submitQuery").click(); } var $special = $("<input type='text' />") var checkTickets = function(row) { var hasTicket = false; var v1 = $special.val(); if( v1 ) { var v2 = $.trim( $(row).find(".base_txtdiv").text() ); if( v1.indexOf( v2 ) == -1 ) { return false; } } if( $(row).find("td input.yuding_x[type=button]").length ) { return false; } $("td", row).each(function(i, e) { if(ticketType[i-1]) { var info = $.trim($(e).text()); if(info != "--" && info != "无") { hasTicket = true; highLightCell(e); } } }); return hasTicket; } var queryTimes = 0; //counter var isAutoQueryEnabled = false; //enable flag //please DIY: var audio = null; var onticketAvailable = function() { if(window.Audio) { if(!audio) { audio = new Audio("http://www.w3school.com.cn/i/song.ogg"); audio.loop = true; } audio.play(); notify("可以订票了!", null, true); } else { notify("可以订票了!"); } } var highLightRow = function(row) { $(row).css("background-color", "#D1E1F1"); } var highLightCell = function(cell) { $(cell).css("background-color", "#2CC03E"); } var displayQueryTimes = function(n) { document.getElementById("refreshTimes").innerHTML = n; }; var isStudentTicket = false; //Control panel UI var ui = $("<div>请先选择好出发地,目的地,和出发时间。&nbsp;&nbsp;&nbsp;</div>") .append( $("<input id='isStudentTicket' type='checkbox' />").change(function(){ isStudentTicket = this.checked; }) ) .append( $("<label for='isStudentTicket'></label>").html("学生票&nbsp;&nbsp;") ) .append( $("<button style='padding: 5px 10px; background: #2CC03E;border-color: #259A33;border-right-color: #2CC03E;border-bottom-color:#2CC03E;color: white;border-radius: 5px;text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.2);'/>").attr("id", "refreshButton").html("开始刷票").click(function() { if(!isAutoQueryEnabled) { isTicketAvailable = false; if(audio && !audio.paused) audio.pause(); isAutoQueryEnabled = true; doQuery(); this.innerHTML="停止刷票"; } else { isAutoQueryEnabled = false; this.innerHTML="开始刷票"; } }) ) .append( $("<span>").html("&nbsp;&nbsp;尝试次数:").append( $("<span/>").attr("id", "refreshTimes").text("0") ) ) .append( //Custom ticket type $("<div>如果只需要刷特定的票种,请在余票信息下面勾选。</div>") .append($("<a href='#' style='color: blue;'>只勾选坐票&nbsp;&nbsp;</a>").click(function() { $(".hdr tr:eq(2) td").each(function(i,e) { var val = this.innerHTML.indexOf("座") != -1; var el = $(this).find("input").attr("checked", val); el && el[0] && ( ticketType[el[0].ticketTypeId] = val ); }); return false; })) .append($("<a href='#' style='color: blue;'>只勾选卧铺&nbsp;&nbsp;</a>").click(function() { $(".hdr tr:eq(2) td").each(function(i,e) { var val = this.innerHTML.indexOf("卧") != -1; var el = $(this).find("input").attr("checked", val); el && el[0] && ( ticketType[el[0].ticketTypeId] = val ); }); return false; })) ) .append( $("<div>限定出发车次:</div>") .append( $special ) .append( "不限制不填写,限定多次用逗号分割,例如: G32,G34" ) ); var container = $(".cx_title_w:first"); container.length ? ui.insertBefore(container) : ui.appendTo(document.body); //Ticket type selector & UI var ticketType = new Array(); $(".hdr tr:eq(2) td").each(function(i,e) { ticketType.push(false); if(i<3) return; ticketType[i] = true; var c = $("<input/>").attr("type", "checkBox").attr("checked", true); c[0].ticketTypeId = i; c.change(function() { ticketType[this.ticketTypeId] = this.checked; }).appendTo(e); }); } route("querySingleAction.do", query); route("myOrderAction.do?method=resign", query); route("confirmPassengerResignAction.do?method=cancelOrderToQuery", query); route("loginAction.do?method=init", function() { if( !window.location.href.match( /init$/i ) ) { return; } //login var url = "https://dynamic.12306.cn/otsweb/loginAction.do?method=login"; var queryurl = "https://dynamic.12306.cn/otsweb/order/querySingleAction.do?method=init"; //Check had login, redirect to query url if( window.parent && window.parent.$ ) { var str = window.parent.$("#username_ a").attr("href"); if( str && str.indexOf("sysuser/user_info") != -1 ){ window.location.href = queryurl; return; } } function submitForm(){ var submitUrl = url; $.ajax({ type: "POST", url: submitUrl, data: { "loginUser.user_name": $("#UserName").val() , "user.password": $("#password").val() , "randCode": $("#randCode").val() }, beforeSend: function( xhr ) { try{ xhr.setRequestHeader('X-Requested-With', {toString: function(){ return ''; }}); xhr.setRequestHeader('Cache-Control', 'max-age=0'); xhr.setRequestHeader('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'); }catch(e){}; }, timeout: 30000, //cache: false, //async: false, success: function(msg){ //密码输入错误 //您的用户已经被锁定 if ( msg.indexOf('请输入正确的验证码') > -1 ) { alert('请输入正确的验证码!'); } else if ( msg.indexOf('当前访问用户过多') > -1 ){ reLogin(); } else if( msg.match(/var\s+isLogin\s*=\s*true/i) ) { notify('登录成功,开始查询车票吧!'); window.location.replace( queryurl ); } else if( msg.indexOf('var message = ""') > -1 ){ reLogin(); } else { msg = msg.match(/var\s+message\s*=\s*"([^"]*)/); alert( msg && msg[1] || "未知错误" ); } }, error: function(msg){ reLogin(); } }); } var count = 1; function reLogin(){ count ++; $('#refreshButton').html("("+count+")次登录中..."); setTimeout(submitForm, 50); } //初始化 $("#subLink").after($("<a href='#' style='padding: 5px 10px; background: #2CC03E;border-color: #259A33;border-right-color: #2CC03E;border-bottom-color:#2CC03E;color: white;border-radius: 5px;text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.2);'/>").attr("id", "refreshButton").html("自动登录").click(function() { count = 1; $(this).html("(1)次登录中..."); //notify('开始尝试登录,请耐心等待!', 4000); submitForm(); return false; })); alert('如果使用自动登录功能,请输入用户名、密码及验证码后,点击自动登录,系统会尝试登录,直至成功!'); }); route("confirmPassengerAction.do", function() { /** * Auto Submit Order * From: https://gist.github.com/1577671 * Author: kevintop@gmail.com */ //Auto select the first user when not selected if( !$("input._checkbox_class:checked").length ) { try{ //Will failed in IE $("input._checkbox_class:first").click(); }catch(e){}; } //passengerTickets var userInfoUrl = 'https://dynamic.12306.cn/otsweb/order/myOrderAction.do?method=queryMyOrderNotComplete&leftmenu=Y'; var count = 1, freq = 1000, doing = false, timer, $msg = $("<div style='padding-left:470px;'></div>"); function submitForm(){ timer = null; //更改提交列车日期参数 //var wantDate = $("#startdatepicker").val(); //$("#start_date").val(wantDate); //$("#_train_date_str").val(wantDate); jQuery.ajax({ url: $("#confirmPassenger").attr('action'), data: $('#confirmPassenger').serialize(), beforeSend: function( xhr ) { try{ xhr.setRequestHeader('X-Requested-With', {toString: function(){ return ''; }}); xhr.setRequestHeader('Cache-Control', 'max-age=0'); xhr.setRequestHeader('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'); }catch(e){}; }, type: "POST", timeout: 30000, success: function( msg ) { //Refresh token var match = msg && msg.match(/org\.apache\.struts\.taglib\.html\.TOKEN['"]?\s*value=['"]?([^'">]+)/i); var newToken = match && match[1]; if(newToken) { $("input[name='org.apache.struts.taglib.html.TOKEN']").val(newToken); } if( msg.indexOf('payButton') > -1 ) { //Success! var audio; if( window.Audio ) { audio = new Audio("http://www.w3school.com.cn/i/song.ogg"); audio.loop = true; audio.play(); } notify("恭喜,车票预订成!", null, true); setTimeout(function() { if( confirm("车票预订成,去付款?") ){ window.location.replace(userInfoUrl); } else { if(audio && !audio.paused) audio.pause(); } }, 100); return; }else if(msg.indexOf('未处理的订单') > -1){ notify("有未处理的订单!"); window.location.replace(userInfoUrl); return; } var reTryMessage = [ '用户过多' , '确认客票的状态后再尝试后续操作' , '请不要重复提交' , '没有足够的票!' ]; for (var i = reTryMessage.length - 1; i >= 0; i--) { if( msg.indexOf( reTryMessage[i] ) > -1 ) { reSubmitForm( reTryMessage[i] ); return; } }; //Parse error message msg = msg.match(/var\s+message\s*=\s*"([^"]*)/); stop(msg && msg[1] || '出错了。。。。 啥错? 我也不知道。。。。。'); }, error: function(msg){ reSubmitForm("网络错误"); } }); }; function reSubmitForm(msg){ if( !doing )return; count ++; $msg.html("("+count+")次自动提交中... " + (msg || "")); timer = setTimeout( submitForm, freq || 50 ); } function stop ( msg ) { doing = false; $msg.html("("+count+")次 已停止"); $('#refreshButton').html("自动提交订单"); timer && clearTimeout( timer ); msg && alert( msg ); } function reloadSeat(){ $("select[name$='_seat']").html('<option value="M" selected="">一等座</option><option value="O" selected="">二等座</option><option value="1">硬座</option><option value="3">硬卧</option><option value="4">软卧</option>'); } //初始化 if($("#refreshButton").size()<1){ // //重置后加载所有席别 // $("select[name$='_seat']").each(function(){this.blur(function(){ // alert(this.attr("id") + "blur"); // })}); ////初始化所有席别 //$(".qr_box :checkbox[name^='checkbox']").each(function(){$(this).click(reloadSeat)}); //reloadSeat(); //日期可选 //$("td.bluetext:first").html('<input type="text" name="orderRequest.train_date" value="' +$("td.bluetext:first").html()+'" id="startdatepicker" style="width: 150px;" class="input_20txt" onfocus="WdatePicker({firstDayOfWeek:1})" />'); $(".tj_btn").append($("<a style='padding: 5px 10px; background: #2CC03E;border-color: #259A33;border-right-color: #2CC03E;border-bottom-color:#2CC03E;color: white;border-radius: 5px;text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.2);'></a>").attr("id", "refreshButton").html("自动提交订单").click(function() { //alert('开始自动提交订单,请点确定后耐心等待!'); if( this.innerHTML.indexOf("自动提交订单") == -1 ){ //doing stop(); } else { if( window.submit_form_check && !window.submit_form_check("confirmPassenger") ) { return; } count = 0; doing = true; this.innerHTML = "停止自动提交"; reSubmitForm(); } return false; })); $(".tj_btn").append("自动提交频率:") .append($("<select id='freq'><option value='50' >频繁</option><option value='500' selected='' >正常</option><option value='2000' >缓慢</option></select>").change(function() { freq = parseInt( $(this).val() ); })) .append($msg); //alert('如果使用自动提交订单功能,请在确认订单正确无误后,再点击自动提交按钮!'); } }); }, true);
12306-assistant
trunk/12306BookingAssistant.user.js
JavaScript
asf20
17,029
<!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Test Analytics</title> <script type="text/javascript" language="javascript" src="com.google.testing.testify.risk.frontend.clientmodule.nocache.js"></script> <link rel="stylesheet" type="text/css" href="test-analytics.css" /> </head> <body> <!-- No script check --> <noscript> <div class="tty-NoJavaScriptError"> Your web browser must have JavaScript enabled in order for this application to display correctly. </div> </noscript> <!-- Enable GWT to use browser history --> <iframe src="javascript:''" id="__gwt_historyFrame" style="width:0;height:0;border:0"></iframe> <script type="text/javascript"> // Install Google Feedback (function() { // Protect global namespace var prefix = ('https:' == document.location.protocol) ? 'https://ssl' : 'http://www'; var script = document.createElement('script'); script.type = 'text/javascript'; script.src = prefix + '.gstatic.com/feedback/api.js'; document.body.appendChild(script); })(); </script> </body> </html>
11shubhanjali-test
testanalytics_frontend/src/main/webapp/index.html
HTML
asf20
1,184
/** * Copyright 2010 Google Inc. All Rights Reseved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. * * @author chrsmith@google.com (Chris Smith) * @author jimr@google.com (Jim Reardon) */ * { font-family: Arial; margin: 0; padding: 0; } /** * Test Analytics header. */ .tty-Header { width: 100%; height: 35px; margin: 5px 10px 10px 0; vertical-align: bottom; position: relative; } /** * User Bar on top. */ .tty-UserBar { float: right; height: 100%; } .tty-UserBarDivider { margin: 0 3px; cursor: default; padding-bottom: 4px; } .tty-UserBarItem { margin: 0 3px; cursor: pointer; text-decoration: underline; padding-bottom: 4px; display: block; } .tty-UserBarTextEmail { font-weight: bold; cursor: default; padding-bottom: 4px; } .tty-UserBarBottom { border-top: 1px solid #c9d7f1; position: absolute; width: 100% } .tty-Logo { position: absolute; top: 6px; left: 0; } /** * Toolbar on top of the Test Analytics Application. */ .tty-Toolbar { background: #bcf; height: 32px; width: 100%; } .tty-ToolbarItem { margin: 3px 5px; } .tty-ToolbarProjectsList { width: 9em; } .tty-ToolbarProjectStar { margin-left: 0.7em; } .tty-ToolbarProjectName { font-size: 130%; font-weight: bold; } /** * Left navigation bar. */ .tty-LeftNav { border-right: 6px solid #bcf; display: block; } .tty-LeftNav * { width: 100%; } .tty-LeftNavItem, .tty-LeftNavItemSelected, .tty-LeftNavItemDisabled { height: 20px; vertical-align: middle; padding-left: 8px; } .tty-LeftNavItem { cursor: pointer; } .tty-LeftNavItem:hover { background: #e3e9ff; } .tty-LeftNavItem a, .tty-LeftNavItemSelected a { text-decoration: none; vertical-align: middle; } .tty-LeftNavItem:hover a { text-decoration: underline; } .tty-LeftNavItemSelected { background: #bcf; cursor: default; } .tty-LeftNavItemSelected a { cursor: default; } .tty-LeftNavItemDisabled { color: #666; cursor: default; } .tty-LeftNavItemDisabled div div { color: #666; cursor: default; padding-top: 1px; } /** * Navigation Section Panels. */ .tty-NavSectionPanel { border-top: 1px solid #ddd; height: 1px; width: 100%; } .tty-NavSectionPanelHeader { padding-left: 4px; } .tty-NavSectionPanelHeaderText { display: inline; font-weight: bold; } /** * Styles for general page flow. */ .tty-Page, .tty-CapabilitiesPage { width: 95%; } .tty-PageIntroText { margin-bottom: 0.6em; } .tty-InlineAnchor { color: #78c; display: inline; padding-left: 0.6em; } .tty-PageSectionVerticalPanel { margin: 1.0em 1.0em; width: 100%; } .tty-PageSectionVerticalPanelHeader { background: #e3e9ff; display: block; font-size: 1.3em; font-weight: bolder; margin-bottom: 0.5em; padding: 0.2em 0.4em; } .tty-PageSectionVerticalPanelItem { margin-left: 0.5em; margin-right: 0.5em; padding: 2px 0; } /** * Test Analytics footer. */ .tty-Footer { border-top: 1px solid #bcf; padding-top: 0.7em; width: 100%; } .tty-FooterText { text-align: center; } /** * General widgets created for Test Analytics. */ .tty-RemovableLabel { background: #F0F0F0; border-radius: 0.6em; border: 1px solid #aaa; display: inline-block; cursor: pointer; margin: 1px 5px 1px 0; } .tty-RemovableLabel div { padding: 2px 2px; } .tty-RemovableLabel .gwt-Label, .tty-RemovableLabel .gwt-TextBox { font-size: small; } .tty-RemovableLabelDeleteImage { float: right; margin: 1px 5px 1px 1px; } .tty-RemovableLabelAddImage { float: right; height: 12px; margin: 1px 1px 1px 3px; width: 12px; } .tty-SuggestBoxPopup { background-color: lightgray; border: 2px gray solid; padding-left: 2px; padding-right: 2px; margin-left: 10px; } .tty-SuggestBoxPopup .item { padding-left: 2px; padding-right: 6px; cursor: default; } .tty-SuggestBoxPopup .item-selected { background-color: #EEE; } .gwt-DisclosurePanel .content { border-left: 0; } .tty-DisclosurePanel { width: 100%; } /** Necessary for Firefox to not show a border around the + box **/ .tty-DisclosurePanel img { border: none; } .tty-DisclosurePanelHeader { width: 100%; } .tty-DisclosurePanelHeader td { padding-right: 5px; } .tty-DisclosureHeader { font-color: #FFF; font-weight: bolder; padding-left: 5px; } .tty-StandardDialogBox { height: 400px; width: 600px; } .tty-DataGrid > tbody > tr:nth-child(odd) { background-color: #eee; } .tty-DataGrid > tbody > tr:nth-child(even) { background-color: #fff; } .tty-DataGridHeaderCell { background-color: #ccc; font-weight: bold; padding: 4px 12px; } .tty-DataGridCell { font-size: small; padding: 3px 5px; } .tty-DataGridCell div { font-size: smaller; padding: 0 10px; } .tty-DataGridImageCell { margin: auto; display: block; } .tty-DataGrid > tbody > tr > td:nth-of-type(1) { width: 100%; } /** * Project Details page. */ .tty-ProjectDetailsPage .gwt-Label { font-weight: bold; } .tty-ProjectDetailsPage .gwt-TextBox, .tty-ProjectDetailsPage .gwt-TextArea { width: 600px; } .tty-DetailsInputItem { padding-left: 5px; margin-bottom: 10px; } .tty-DetailsCheckbox label { padding-left: 5px; } /** * Different color intensities to visualize risk. */ /* Positive values: transition from white to green. */ .tty-RiskIntensity_-100 { background: #008B00; } .tty-RiskIntensity_-90 { background: #00CD00; } .tty-RiskIntensity_-80 { background: #00EE00; } .tty-RiskIntensity_-70 { background: #4DFF4D; } .tty-RiskIntensity_-60 { background: #33FF33; } .tty-RiskIntensity_-50 { background: #6FFF6F; } .tty-RiskIntensity_-40 { background: #66FF66; } .tty-RiskIntensity_-30 { background: #9Aff9A; } .tty-RiskIntensity_-20 { background: #DDFFDD; } .tty-RiskIntensity_-10 { background: #F0FFF0; } /* Positive values: transition from orange to red. */ .tty-RiskIntensity_0 { background: #FFFFFF; } .tty-RiskIntensity_10 { background: #FFFFDD; } .tty-RiskIntensity_20 { background: #FFFFCC; } .tty-RiskIntensity_30 { background: #FFFFAA; } .tty-RiskIntensity_40 { background: #FFEE00; } .tty-RiskIntensity_50 { background: #FFCC00; } .tty-RiskIntensity_60 { background: #FFAA00; } .tty-RiskIntensity_70 { background: #FF8800; } .tty-RiskIntensity_80 { background: #FF6666; } .tty-RiskIntensity_90 { background: #FF3300; } .tty-RiskIntensity_100 { background: #FF2200; } /** * HomePage Styling */ .tty-HomePageOptions { width: 600px; margin-left: auto; margin-right: auto; padding-bottom: 5px; } .tty-HomePageOptions table { padding-bottom: 5px; } .tty-HomePageOptionsBottom { border-top: 1px solid #c9d7f1; font-size: 1px; width: 100% } .tty-HomePageLogo { display: block; margin-left: auto; margin-right: auto; padding: 25px 0 10px 0; } .tty-HomePageContent { width: 700px; margin-left: auto; margin-right: auto; } .tty-HomePageTagline { font-size: 150%; margin-bottom: 1.5em; margin-top: 3em; text-align: center; } .tty-HomePageProjectsFilter { display: block; text-align: right; margin-top: 1.0em; } .tty-HomePageProjectsFilter label { padding-left: 0.5em; } .tty-HomePageProjectsGrid { font-size: 150%; margin-left: auto; margin-right: auto; width: 600px; } /* Size the cells housing project widgets. */ .tty-HomePageProjectsGrid > tbody > tr > td { width: 32%; } /* Size the controls of the project widgets inside the table. */ .tty-HomePageProjectsGrid > tbody > tr > td > td:nth-of-type(1) { width: 20px; } .tty-HomePageProjectsGrid > tbody > tr > td > td:nth-of-type(2) { width: 100%; } .tty-HomePageNewProject { margin-left: auto; margin-right: auto; width: auto; padding-top: 10px; } .tty-HomePageNewProjectName, .tty-HomePageNewProjectName tbody { text-align: center; margin-left: auto; margin-right: auto; background-color: #CCC; padding: 15px 10px; border-radius: 1em; } .tty-HomePageNewProjectName td:nth-of-type(2) { padding: 0 15px; } /** * Common styling for Attributes, Components, Capabilties. */ .tty-ItemDivider { width: 80%; color: #ebebeb; height: 1px; margin: 15px auto; text-align: middle; border: 0; border-top: 2px solid #dbdbdb; } .tty-ItemContainer { border: 0; margin: 4px 5px; padding: 3px 3px; width: 550px; height: 100% } .tty-ItemContainer > tbody > tr > td > .gwt-TextBox { height: 20px; width: 480px; } .tty-ItemContainer .gwt-Button { height: 27px; width: 60px; } .tty-ItemContent { width: 100%; padding-left: 20px; } .tty-NoPadding { padding-left: 0px; } .tty-ItemContent a { cursor: pointer; } .tty-ItemContent .gwt-TextArea { height: 3.0em; width: 95%; } .tty-ItemContent > tbody > tr > td, .tty-EditCapabilityTable > tbody > tr > td { padding: 3px 0; } .tty-ItemNameContainer { width: 95%; } .tty-ItemName, .tty-ItemName input, .tty-DisclosurePanelHeader tbody tr td div { color: #353535; font-size: large; font-weight: bold; style: inline-block; } .tty-DetailsLink { cursor: pointer; color: #00A; text-decoration: underline; } .tty-DetailsContent td { padding: 3px; } .tty-ItemSignoffCheckbox input, .tty-ItemSignoffCheckbox label { cursor: pointer; padding-left: 5px; } .tty-ItemContainer:hover .tty-ItemGripper { visibility: visible; } .tty-ItemGripper { background-image:url('images/grippy.png'); height: 100%; width: 12px; background-repeat: repeat-y; background-position: center; visibility: hidden; } .tty-ItemDeleteImage { display: inline; cursor: pointer; margin-top: 9px; } /** * Styling for capabilities related items. */ .tty-CapabilityRiskHeader { width: 100%; } .tty-CapabilityRiskValueHeader { font-weight: bold; text-align: right; width: 100%; } .tty-EditCapabilityTable { width: 100%; } .tty-EditCapabilityTable .gwt-TextBox { padding-right: 10px; width: 95%; } .tty-EditCapabilitySelectPanel { padding: 4px 0 6px 10px; width: 100%; } .tty-EditCapabilitySelectPanel td:nth-of-type(1) { width: 10%; } .tty-EditCapabilitySelectPanel td:nth-of-type(2), .tty-EditCapabilitySelectPanel td:nth-of-type(3), .tty-EditCapabilitySelectPanel td:nth-of-type(5) { width: 20%; } .tty-EditCapabilitySelectPanel td:nth-of-type(4) { width: 30%; } .tty-EditCapabilitySelectPanel label { padding-left: 3px; } .tty-EditCapabilityButtonPanel { align: right; padding-top: 5px; } .tty-RiskSourcesPanel { padding-bottom: 10px; } .tty-RiskSourcesPanel .gwt-CheckBox label { padding: 0 25px 0 5px; } .tty-CapabilitiesPageItem, .tty-RiskPageItem { padding-top: 10px; padding-bottom: 10px; } /** * DataRequest and Filter Parameter Styling */ .tty-DataRequestParameter, .tty-FilterParameter { margin: 5px 5px; width: 98%; } .tty-FilterParameterAnyAll .gwt-ListBox { margin: 0 5px; padding: 0 3px; } .tty-DataRequestParameter .gwt-TextBox, .tty-FilterParameter .gwt-TextBox, .tty-FilterParameter .gwt-ListBox { width: 98%; } .tty-DataRequestParameter td, .tty-FilterParameter td { padding-right: 10px; } .tty-DataRequestParameter td:nth-of-type(2), .tty-FilterParameter td:nth-of-type(2) { width: 100%; } /** * Grid Styles */ .tty-ComponentAttributeGrid { border: 0 none; border-collapse: collapse; text-align: center; } .tty-GridXHeaderCell { border: none; padding: 10px 5px 10px 30px; background: #FFF; } .tty-GridXHeaderCell div { font-weight: bolder; text-align: right; } .tty-GridYHeaderCell { border: none; padding: 5px 15px 0 15px; background: #FFF; } .tty-GridYHeaderCell div { font-weight: bolder; } .tty-GridCell { font-size: large; border: 1px solid #B3B3B3; padding: 0; } .tty-GridCell div, .tty-GridCell td { text-decoration: none; width: 100%; height: 100%; min-height: 100%; min-width: 100%; color: blue; cursor: pointer; } .tty-GridCellHighlighted, .tty-GridCellSelected { background: #CCC; } .tty-GridColumnHighlighted { background: #EEE; } .tty-GridRowHighlighted { background: #EEE; } .tty-RiskCellSelected { border-color: #777; border-width: 2px; } /** * General error page. */ .tty-ErrorPage { margin: 2em 2em; } .tty-ErrorPageErrorType { font-size: 250%; font-weight: bold; margin: 10px 10px; } .tty-ErrorPageErrorText { margin-top: 1em; }
11shubhanjali-test
testanalytics_frontend/src/main/webapp/test-analytics.css
CSS
asf20
12,840
// Copyright 2010 Google Inc. All Rights Reserved package com.google.testing.testify.risk.frontend.client.presenter; /** * Base Presenter for all application pages. * * @author jimr@google.com (Jim Reardon) */ public abstract class BasePagePresenter implements TaPagePresenter { /** * Refresh the view, including page data. * * By default, pages won't care about passed in page data and thus short circuit over to the * no-parameter refreshView unless explicitly implemented by the page presenter. * * @param pageData the parameter data for this page. * */ @Override public void refreshView(String pageData) { refreshView(); } }
11shubhanjali-test
testanalytics_frontend/src/main/java/com/google/testing/testify/risk/frontend/client/presenter/BasePagePresenter.java
Java
asf20
669
// Copyright 2010 Google Inc. All Rights Reseved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.testing.testify.risk.frontend.client.presenter; import com.google.gwt.event.shared.EventBus; import com.google.gwt.user.client.ui.Widget; import com.google.testing.testify.risk.frontend.client.TaCallback; import com.google.testing.testify.risk.frontend.client.event.ProjectChangedEvent; import com.google.testing.testify.risk.frontend.client.view.ProjectSettingsView; import com.google.testing.testify.risk.frontend.model.Project; import com.google.testing.testify.risk.frontend.shared.rpc.ProjectRpcAsync; import com.google.testing.testify.risk.frontend.shared.rpc.UserRpc.ProjectAccess; import com.google.testing.testify.risk.frontend.shared.rpc.UserRpcAsync; import java.util.List; /** * Presenter for the ProjectSettings widget. * * @author chrsmith@google.com (Chris Smith) */ public class ProjectSettingsPresenter extends BasePagePresenter implements ProjectSettingsView.Presenter, TaPagePresenter { private final Project project; private final ProjectRpcAsync projectService; private final UserRpcAsync userService; private final ProjectSettingsView view; private final EventBus eventBus; /** * Constructs the presenter. */ public ProjectSettingsPresenter(Project project, ProjectRpcAsync projectService, UserRpcAsync userService, ProjectSettingsView view, EventBus eventBus) { this.project = project; this.projectService = projectService; this.userService = userService; this.view = view; this.eventBus = eventBus; refreshView(); } /** * Query the database for project information and populate UI fields. */ @Override public void refreshView() { view.setPresenter(this); view.setProjectSettings(project); userService.getAccessLevel(project.getProjectId(), new TaCallback<ProjectAccess>("Checking User Access") { @Override public void onSuccess(ProjectAccess result) { view.enableProjectEditing(result); } }); } /** Returns the underlying view. */ @Override public Widget getView() { return view.asWidget(); } @Override public ProjectRpcAsync getProjectService() { return projectService; } @Override public long getProjectId() { return project.getProjectId(); } /** * To be called by the View when the user performs the updateProjectInfo action. */ @Override public void onUpdateProjectInfoClicked( String name, String description, List<String> projectOwners, List<String> projectEditors, List<String> projectViewers, boolean isPublicalyVisible) { project.setName(name); project.setDescription(description); project.setIsPubliclyVisible(isPublicalyVisible); project.setProjectOwners(projectOwners); project.setProjectEditors(projectEditors); project.setProjectViewers(projectViewers); projectService.updateProject(project, new TaCallback<Void>("Updating Project") { @Override public void onSuccess(Void result) { view.showSaved(); eventBus.fireEvent(new ProjectChangedEvent(project)); } }); } @Override public void removeProject() { projectService.removeProject(project, TaCallback.getNoopCallback()); } }
11shubhanjali-test
testanalytics_frontend/src/main/java/com/google/testing/testify/risk/frontend/client/presenter/ProjectSettingsPresenter.java
Java
asf20
3,878
// Copyright 2010 Google Inc. All Rights Reseved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.testing.testify.risk.frontend.client.presenter; import com.google.testing.testify.risk.frontend.client.view.ComponentView; import com.google.testing.testify.risk.frontend.client.view.ComponentsView; import com.google.testing.testify.risk.frontend.model.AccLabel; import com.google.testing.testify.risk.frontend.model.Component; /** * Presenter for a single Component. * * @author chrsmith@google.com (Chris Smith) */ public class ComponentPresenter implements ComponentView.Presenter { private Component targetComponent; private final ComponentView view; private final ComponentsView.Presenter parentPresenter; public ComponentPresenter(Component component, ComponentView view, ComponentsView.Presenter parentPresenter) { this.targetComponent = component; this.view = view; this.parentPresenter = parentPresenter; view.setPresenter(this); refreshView(); } /** * Refreshes UI elements of the View. */ @Override public void refreshView() { view.setComponentName(targetComponent.getName()); view.setDescription(targetComponent.getDescription()); if (targetComponent.getComponentId() != null) { view.setComponentId(targetComponent.getComponentId()); } view.setComponentLabels(targetComponent.getAccLabels()); } @Override public void refreshView(Component component) { this.targetComponent = component; refreshView(); } @Override public long getComponentId() { return targetComponent.getComponentId(); } @Override public long getProjectId() { return targetComponent.getParentProjectId(); } @Override public void updateSignoff(boolean newValue) { parentPresenter.updateSignoff(targetComponent, newValue); } @Override public void onDescriptionEdited(String description) { targetComponent.setDescription(description); parentPresenter.updateComponent(targetComponent); } @Override public void onRename(String newComponentName) { targetComponent.setName(newComponentName); parentPresenter.updateComponent(targetComponent); } @Override public void onRemove() { view.hide(); parentPresenter.removeComponent(targetComponent); } @Override public void onAddLabel(String label) { targetComponent.addLabel(label); parentPresenter.updateComponent(targetComponent); } @Override public void onUpdateLabel(AccLabel label, String newText) { label = targetComponent.getAccLabel(label.getId()); label.setLabelText(newText); parentPresenter.updateComponent(targetComponent); } @Override public void onRemoveLabel(AccLabel label) { targetComponent.removeLabel(label); parentPresenter.updateComponent(targetComponent); } }
11shubhanjali-test
testanalytics_frontend/src/main/java/com/google/testing/testify/risk/frontend/client/presenter/ComponentPresenter.java
Java
asf20
3,360
// Copyright 2010 Google Inc. All Rights Reseved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.testing.testify.risk.frontend.client.presenter; import com.google.testing.testify.risk.frontend.client.view.ConfigureDataView; import com.google.testing.testify.risk.frontend.client.view.DataRequestView; import com.google.testing.testify.risk.frontend.model.DataRequest; import com.google.testing.testify.risk.frontend.model.DataRequestOption; import com.google.testing.testify.risk.frontend.model.DataSource; import java.util.List; /** * Presenter for an individual DataRequest view. * * @author chrsmith@google.com (Chris Smith) */ public class DataRequestPresenter implements DataRequestView.Presenter { private final DataRequest targetRequest; private final DataSource dataSource; private final DataRequestView view; private final ConfigureDataView.Presenter parentPresenter; public DataRequestPresenter(DataRequest request, DataSource dataSource, DataRequestView view, ConfigureDataView.Presenter parentPresenter) { this.dataSource = dataSource; this.targetRequest = request; this.view = view; this.parentPresenter = parentPresenter; refreshView(); } /** * Refreshes UI elements of the View. */ @Override public void refreshView() { view.setPresenter(this); String dataSourceName = targetRequest.getDataSourceName(); view.setDataSourceName(dataSourceName); view.setDataSourceParameters(dataSource.getParameters(), targetRequest.getDataRequestOptions()); } @Override public void onUpdate(List<DataRequestOption> newParameters) { targetRequest.setDataRequestOptions(newParameters); parentPresenter.updateDataRequest(targetRequest); } @Override public void onRemove() { view.hide(); parentPresenter.deleteDataRequest(targetRequest); } }
11shubhanjali-test
testanalytics_frontend/src/main/java/com/google/testing/testify/risk/frontend/client/presenter/DataRequestPresenter.java
Java
asf20
2,380
// Copyright 2010 Google Inc. All Rights Reseved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.testing.testify.risk.frontend.client.presenter; import com.google.common.collect.Lists; import com.google.gwt.event.shared.EventBus; import com.google.gwt.user.client.ui.Widget; import com.google.testing.testify.risk.frontend.client.TaCallback; import com.google.testing.testify.risk.frontend.client.event.ProjectElementAddedEvent; import com.google.testing.testify.risk.frontend.client.event.ProjectHasNoElementsEvent; import com.google.testing.testify.risk.frontend.client.view.ComponentsView; import com.google.testing.testify.risk.frontend.model.AccElementType; import com.google.testing.testify.risk.frontend.model.AccLabel; import com.google.testing.testify.risk.frontend.model.Component; import com.google.testing.testify.risk.frontend.model.Project; import com.google.testing.testify.risk.frontend.model.Signoff; import com.google.testing.testify.risk.frontend.shared.rpc.DataRpcAsync; import com.google.testing.testify.risk.frontend.shared.rpc.ProjectRpcAsync; import com.google.testing.testify.risk.frontend.shared.rpc.UserRpcAsync; import java.util.Collection; import java.util.List; /** * Presenter for the Components page. * * @author chrsmith@google.com (Chris Smith) */ public class ComponentsPresenter extends BasePagePresenter implements TaPagePresenter, ComponentsView.Presenter { private final Project project; private final ProjectRpcAsync projectService; private final UserRpcAsync userService; private final DataRpcAsync dataService; private final ComponentsView view; private final EventBus eventBus; private final Collection<String> projectLabels = Lists.newArrayList(); /** * Constructs the presenter. */ public ComponentsPresenter( Project project, ProjectRpcAsync projectService, UserRpcAsync userService, DataRpcAsync dataService, ComponentsView view, EventBus eventBus) { this.project = project; this.projectService = projectService; this.userService = userService; this.dataService = dataService; this.view = view; this.eventBus = eventBus; refreshView(); } /** * Query the database for project information and populate UI fields. */ @Override public void refreshView() { view.setPresenter(this); userService.hasEditAccess(project.getProjectId(), new TaCallback<Boolean>("Checking User Access") { @Override public void onSuccess(Boolean result) { // Assume the user already has VIEW access, otherwise the RPC service wouldn't have // served the Project object in the first place. if (result) { view.enableEditing(); } } }); projectService.getProjectComponents(project.getProjectId(), new TaCallback<List<Component>>("Querying Components") { @Override public void onSuccess(List<Component> result) { if (result.size() == 0) { eventBus.fireEvent( new ProjectHasNoElementsEvent(project, AccElementType.COMPONENT)); } view.setProjectComponents(result); } }); dataService.getSignoffsByType(project.getProjectId(), AccElementType.COMPONENT, new TaCallback<List<Signoff>>("Retrieving signoff data") { @Override public void onSuccess(List<Signoff> results) { view.setSignoffs(results); } }); projectService.getLabels(project.getProjectId(), new TaCallback<List<AccLabel>>("Loading labels") { @Override public void onSuccess(List<AccLabel> result) { for (AccLabel l : result) { projectLabels.add(l.getLabelText()); } view.setProjectLabels(projectLabels); } }); } /** Returns the underlying view. */ @Override public Widget getView() { return view.asWidget(); } @Override public long getProjectId() { return project.getProjectId(); } @Override public void createComponent(final Component component) { projectService.createComponent(component, new TaCallback<Long>("Creating Component") { @Override public void onSuccess(Long result) { component.setComponentId(result); refreshView(); eventBus.fireEvent(new ProjectElementAddedEvent(component)); } }); } /** * Updates the given component in the database. */ @Override public void updateComponent(Component componentToUpdate) { projectService.updateComponent(componentToUpdate, new TaCallback<Component>("updating component") { @Override public void onSuccess(Component result) { view.refreshComponent(result); } }); } @Override public void updateSignoff(Component component, boolean newSignoff) { dataService.setSignedOff(component.getParentProjectId(), AccElementType.COMPONENT, component.getComponentId(), newSignoff, TaCallback.getNoopCallback()); } /** * Removes the given component from the Project. */ @Override public void removeComponent(Component componentToRemove) { projectService.removeComponent(componentToRemove, new TaCallback<Void>("Removing Component") { @Override public void onSuccess(Void result) { refreshView(); } }); } @Override public ProjectRpcAsync getProjectService() { return projectService; } @Override public void reorderComponents(List<Long> newOrder) { projectService.reorderComponents( project.getProjectId(), newOrder, new TaCallback<Void>("Reordering Comonents") { @Override public void onSuccess(Void result) { refreshView(); } }); } }
11shubhanjali-test
testanalytics_frontend/src/main/java/com/google/testing/testify/risk/frontend/client/presenter/ComponentsPresenter.java
Java
asf20
6,429
// Copyright 2010 Google Inc. All Rights Reseved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.testing.testify.risk.frontend.client.presenter; import com.google.testing.testify.risk.frontend.client.TaCallback; import com.google.testing.testify.risk.frontend.client.view.RiskView; import com.google.testing.testify.risk.frontend.model.Attribute; import com.google.testing.testify.risk.frontend.model.Capability; import com.google.testing.testify.risk.frontend.model.Component; import com.google.testing.testify.risk.frontend.model.Project; import com.google.testing.testify.risk.frontend.shared.rpc.ProjectRpcAsync; import java.util.List; /** * Base class for Presenters surfacing views on top of Risk and/or Risk Mitigations. * * @author chrsmith@google.com (Chris) */ public abstract class RiskPresenter extends BasePagePresenter { protected final ProjectRpcAsync projectService; protected final RiskView view; protected final Project project; public RiskPresenter(Project project, ProjectRpcAsync projectService, RiskView view) { this.project = project; this.projectService = projectService; this.view = view; } /** * Refreshes the view based on data obtained from the Project Service. */ public void refreshBaseView() { final long projectId = project.getProjectId(); projectService.getProjectAttributes(projectId, new TaCallback<List<Attribute>>("Querying Attributes") { @Override public void onSuccess(List<Attribute> result) { view.setAttributes(result); } }); projectService.getProjectComponents(projectId, new TaCallback<List<Component>>("Querying Components") { @Override public void onSuccess(List<Component> result) { view.setComponents(result); } }); projectService.getProjectCapabilities(projectId, new TaCallback<List<Capability>>("Querying Capabilities") { @Override public void onSuccess(List<Capability> result) { view.setCapabilities(result); } }); } }
11shubhanjali-test
testanalytics_frontend/src/main/java/com/google/testing/testify/risk/frontend/client/presenter/RiskPresenter.java
Java
asf20
2,641
// Copyright 2011 Google Inc. All Rights Reseved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.testing.testify.risk.frontend.client.presenter; import com.google.testing.testify.risk.frontend.client.view.ConfigureFiltersView; import com.google.testing.testify.risk.frontend.client.view.FilterView; import com.google.testing.testify.risk.frontend.model.Filter; import com.google.testing.testify.risk.frontend.model.FilterOption; import java.util.List; import java.util.Map; /** * Presenter for an individual Filter. * * @author jimr@google.com (Jim Reardon) */ public class FilterPresenter implements FilterView.Presenter { private final Filter filter; private final FilterView view; private final ConfigureFiltersView.Presenter presenter; public FilterPresenter(Filter filter, Map<String, Long> attributes, Map<String, Long> components, Map<String, Long> capabilities, FilterView view, ConfigureFiltersView.Presenter presenter) { this.filter = filter; this.view = view; this.presenter = presenter; view.setPresenter(this); view.setAttributes(attributes); view.setComponents(components); view.setCapabilities(capabilities); refreshView(); } @Override public void refreshView() { view.setFilterTitle(filter.getTitle()); view.setFilterOptionChoices(filter.getFilterType().getFilterTypes()); view.setFilterSettings(filter.getFilterOptions(), filter.getFilterConjunction(), filter.getTargetAttributeId(), filter.getTargetComponentId(), filter.getTargetCapabilityId()); } @Override public void onUpdate(List<FilterOption> newOptions, String conjunction, Long attribute, Long component, Long capability) { filter.setFilterOptions(newOptions); filter.setFilterConjunction(conjunction); filter.setTargetAttributeId(attribute); filter.setTargetCapabilityId(capability); filter.setTargetComponentId(component); presenter.updateFilter(filter); } @Override public void onRemove() { view.hide(); presenter.deleteFilter(filter); } }
11shubhanjali-test
testanalytics_frontend/src/main/java/com/google/testing/testify/risk/frontend/client/presenter/FilterPresenter.java
Java
asf20
2,600
// Copyright 2010 Google Inc. package com.google.testing.testify.risk.frontend.client.presenter; import com.google.gwt.user.client.ui.Widget; /** * Base interface for all Presenters for Test Analytics pages. * * @author chrsmith@google.com (Chris) */ public interface TaPagePresenter { /** Refreshes the current view. Typically by querying the datastore and updating UI elements. */ public void refreshView(); /** Allows data to be passed in while refreshing the view. */ public void refreshView(String pageData); /** Returns the underlying View. */ public Widget getView(); }
11shubhanjali-test
testanalytics_frontend/src/main/java/com/google/testing/testify/risk/frontend/client/presenter/TaPagePresenter.java
Java
asf20
598
// Copyright 2010 Google Inc. All Rights Reseved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.testing.testify.risk.frontend.client.presenter; import com.google.common.collect.Lists; import com.google.gwt.event.shared.EventBus; import com.google.gwt.user.client.ui.Widget; import com.google.testing.testify.risk.frontend.client.TaCallback; import com.google.testing.testify.risk.frontend.client.event.ProjectElementAddedEvent; import com.google.testing.testify.risk.frontend.client.view.CapabilitiesView; import com.google.testing.testify.risk.frontend.model.AccLabel; import com.google.testing.testify.risk.frontend.model.Attribute; import com.google.testing.testify.risk.frontend.model.Capability; import com.google.testing.testify.risk.frontend.model.Component; import com.google.testing.testify.risk.frontend.model.Project; import com.google.testing.testify.risk.frontend.shared.rpc.ProjectRpcAsync; import com.google.testing.testify.risk.frontend.shared.rpc.UserRpcAsync; import java.util.Collection; import java.util.List; /** * Presenter for the CapabilitiesGrid widget. * {@See com.google.testing.testify.risk.frontend.client.view.CapabilitiesGridView} * * @author jimr@google.com (Jim Reardon) */ public class CapabilitiesPresenter extends BasePagePresenter implements CapabilitiesView.Presenter, TaPagePresenter { private final Project project; private final ProjectRpcAsync projectService; private final UserRpcAsync userService; private final CapabilitiesView view; private final EventBus eventBus; public CapabilitiesPresenter( Project project, ProjectRpcAsync projectService, UserRpcAsync userService, CapabilitiesView view, EventBus eventBus) { this.project = project; this.projectService = projectService; this.userService = userService; this.view = view; this.eventBus = eventBus; refreshView(); } /** * Refreshes the view based on data obtained from the Project Service. */ @Override public void refreshView() { view.setPresenter(this); userService.hasEditAccess(project.getProjectId(), new TaCallback<Boolean>("checking user access") { @Override public void onSuccess(Boolean result) { // Assume the user already has VIEW access, otherwise the RPC service wouldn't have // served the Project object in the first place. view.setEditable(result); } }); projectService.getProjectAttributes(project.getProjectId(), new TaCallback<List<Attribute>>("querying attributes") { @Override public void onSuccess(List<Attribute> result) { view.setAttributes(result); } }); projectService.getProjectComponents(project.getProjectId(), new TaCallback<List<Component>>("querying components") { @Override public void onSuccess(List<Component> result) { view.setComponents(result); } }); projectService.getProjectCapabilities(project.getProjectId(), new TaCallback<List<Capability>>("querying capabilities") { @Override public void onSuccess(List<Capability> result) { view.setCapabilities(result); } }); projectService.getLabels(project.getProjectId(), new TaCallback<List<AccLabel>>("querying components") { @Override public void onSuccess(List<AccLabel> result) { Collection<String> labels = Lists.newArrayList(); for (AccLabel l : result) { labels.add(l.getLabelText()); } view.setProjectLabels(labels); } }); } @Override public void onAddCapability(final Capability capabilityToAdd) { projectService.createCapability(capabilityToAdd, new TaCallback<Capability>("creating capability") { @Override public void onSuccess(Capability result) { eventBus.fireEvent( new ProjectElementAddedEvent(result)); view.addCapability(result); } }); } @Override public void onUpdateCapability(Capability capabilityToUpdate) { projectService.updateCapability(capabilityToUpdate, TaCallback.getNoopCallback()); } @Override public void onRemoveCapability(Capability capabilityToRemove) { projectService.removeCapability(capabilityToRemove, TaCallback.getNoopCallback()); } @Override public void reorderCapabilities(List<Long> ids) { projectService.reorderCapabilities(project.getProjectId(), ids, TaCallback.getNoopCallback()); } /** Returns the underlying view. */ @Override public Widget getView() { return view.asWidget(); } }
11shubhanjali-test
testanalytics_frontend/src/main/java/com/google/testing/testify/risk/frontend/client/presenter/CapabilitiesPresenter.java
Java
asf20
5,257
// Copyright 2010 Google Inc. All Rights Reseved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.testing.testify.risk.frontend.client.presenter; import com.google.testing.testify.risk.frontend.client.view.AttributeView; import com.google.testing.testify.risk.frontend.client.view.AttributesView; import com.google.testing.testify.risk.frontend.model.AccLabel; import com.google.testing.testify.risk.frontend.model.Attribute; /** * Presenter for a single Attribute. * * @author jimr@google.com (Jim Reardon) */ public class AttributePresenter implements AttributeView.Presenter { private Attribute targetAttribute; private final AttributeView view; private final AttributesView.Presenter parentPresenter; public AttributePresenter(Attribute targetAttribute, AttributeView view, AttributesView.Presenter parentPresenter) { this.targetAttribute = targetAttribute; this.view = view; this.parentPresenter = parentPresenter; view.setPresenter(this); refreshView(); } /** * Refreshes UI elements of the View. */ @Override public void refreshView() { view.setAttributeName(targetAttribute.getName()); view.setDescription(targetAttribute.getDescription()); if (targetAttribute.getAttributeId() != null) { view.setAttributeId(targetAttribute.getAttributeId()); } view.setLabels(targetAttribute.getAccLabels()); } @Override public void refreshView(Attribute attribute) { this.targetAttribute = attribute; refreshView(); } @Override public long getAttributeId() { return targetAttribute.getAttributeId(); } @Override public long getProjectId() { return targetAttribute.getParentProjectId(); } @Override public void updateSignoff(boolean newValue) { parentPresenter.updateSignoff(targetAttribute, newValue); } @Override public void onDescriptionEdited(String description) { targetAttribute.setDescription(description); parentPresenter.updateAttribute(targetAttribute); } @Override public void onRename(String newAttributeName) { targetAttribute.setName(newAttributeName); parentPresenter.updateAttribute(targetAttribute); } @Override public void onRemove() { view.hide(); parentPresenter.removeAttribute(targetAttribute); } @Override public void onAddLabel(String label) { targetAttribute.addLabel(label); parentPresenter.updateAttribute(targetAttribute); } @Override public void onUpdateLabel(AccLabel label, String newText) { label = targetAttribute.getAccLabel(label.getId()); label.setLabelText(newText); parentPresenter.updateAttribute(targetAttribute); } @Override public void onRemoveLabel(AccLabel label) { targetAttribute.removeLabel(label); parentPresenter.updateAttribute(targetAttribute); } }
11shubhanjali-test
testanalytics_frontend/src/main/java/com/google/testing/testify/risk/frontend/client/presenter/AttributePresenter.java
Java
asf20
3,355