code stringlengths 3 1.18M | language stringclasses 1 value |
|---|---|
package com.anores.persistence.domain;
import javax.persistence.AssociationOverride;
import javax.persistence.AssociationOverrides;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.Table;
import javax.persistence.Transient;
@Entity
@Table(name="user_role")
@AssociationOverrides({
@AssociationOverride(name="pk.user", joinColumns=@JoinColumn(name="user_id")),
@AssociationOverride(name="pk.role", joinColumns=@JoinColumn(name="role_id"))})
public class UserRole {
@EmbeddedId
private UserRoleId pk = new UserRoleId();
public UserRoleId getPk() {
return this.pk;
}
public void setPk(UserRoleId userRoleId) {
this.pk = userRoleId;
}
@Transient
public User getUser() {
return this.getPk().getUser();
}
public void setUser(User user) {
this.getPk().setUser(user);
}
@Transient
public Role getRole() {
return this.getPk().getRole();
}
public void setRole(Role role) {
this.getPk().setRole(role);
}
}
| Java |
package com.anores.persistence.domain;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.Table;
@Entity
@Table(name = "user")
public class User extends BaseEntityAudit {
@OneToMany(cascade=CascadeType.ALL, mappedBy="pk.user", fetch=FetchType.LAZY)
private Set<UserRole> userRoles = new HashSet<UserRole>();
public Set<UserRole> getUserRoles() {
return userRoles;
}
public void setUserRoles(Set<UserRole> userRoles) {
this.userRoles = userRoles;
}
}
| Java |
package com.anores.persistence.domain;
import javax.persistence.Entity;
import javax.persistence.Table;
@Entity
@Table(name = "permission")
public class Permission extends BaseEntityAudit {
}
| Java |
package com.anores.persistence.domain;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
@MappedSuperclass
public abstract class BaseEntityAudit extends BaseEntity {
@Column(name = "created_at")
@Temporal(TemporalType.TIMESTAMP)
private Date createdAt;
@Size(max = 20)
@Column(name = "created_by", length = 20)
private String createdBy;
@Column(name = "updated_at")
@Temporal(TemporalType.TIMESTAMP)
private Date updatedAt;
@Size(max = 20)
@Column(name = "updated_by", length = 20)
private String updatedBy;
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public String getUpdatedBy() {
return updatedBy;
}
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* Sets createdAt before insert
*/
@PrePersist
public void setCreationDate() {
this.createdAt = new Date();
}
/**
* Sets updatedAt before update
*/
@PreUpdate
public void setChangeDate() {
this.updatedAt = new Date();
}
}
| Java |
package com.anores.persistence.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import com.anores.persistence.domain.User;
public interface UserRepository extends JpaRepository<User, Long>{
}
| Java |
package com.anores.persistence.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import com.anores.persistence.domain.Role;
public interface RoleRepository extends JpaRepository<Role, Long>{
}
| Java |
package com.anores.security;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.stereotype.Component;
import com.anores.core.services.UserService;
import com.anores.events.user.FindUserByUsernameEvent;
import com.anores.events.user.UserEvent;
@Component
public class ApplicationAuthenticationProvider implements
AuthenticationProvider {
@Autowired
public UserService userService;
@Override
public Authentication authenticate(Authentication authentication)
throws AuthenticationException {
UserEvent event = userService.loadUserByUsername(new FindUserByUsernameEvent("Liep Nguyen"));
return null;
}
@Override
public boolean supports(Class<?> authentication) {
return authentication.equals(UsernamePasswordAuthenticationToken.class);
}
}
| Java |
/*
* 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;
}
}
| Java |
/*
* 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;
}
}
| Java |
/*
* 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;
}
}
| Java |
/*
* 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;
}
}
| Java |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package wcb;
/**
*
* @author Michelangelo
*/
public class Descuento_has_Pais {
}
| Java |
/*
* 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;
}
}
| Java |
/*
* 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;
}
}
| Java |
/*
* 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;
}
}
| Java |
/*
* 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;
}
}
| Java |
/*
* 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;
}
}
| Java |
/*
* 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;
}
}
| Java |
/*
* 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;
}
}
| Java |
/*
* 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;
}
}
| Java |
/*
* 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;
}
}
| Java |
/*
* 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);
}
}
}
| Java |
/*
* 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;
}
}
| Java |
/*
* 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;
}
}
| Java |
/*
* 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;
}
}
| Java |
/*
* 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;
}
}
| Java |
/*
* 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();
}
}
| Java |
/*
* 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;
}
}
| Java |
/*
* 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;
}
}
| Java |
/*
* 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;
}
}
| Java |
/*
* 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;
}
}
| Java |
/*
* 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;
}
}
| Java |
/*
* 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
}
| Java |
/*
* 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
}
| Java |
/*
* 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
}
| Java |
/*
* 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
}
| Java |
/*
* 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
}
| Java |
/*
* 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
}
| Java |
/*
* 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
}
| Java |
/*
* 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
}
| Java |
/*
* 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
}
| Java |
/*
* 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
}
| Java |
/*
* 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
}
| Java |
/*
* 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
}
| Java |
/*
* 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
}
| Java |
/*
* 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
}
| Java |
/*
* 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
}
| Java |
/*
* 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
}
| Java |
/*
* 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
}
| Java |
/*
* 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
}
| Java |
/*
* 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
}
| Java |
/*
* 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
}
| Java |
/*
* 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
}
| Java |
/*
* 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
}
| Java |
/*
* 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
}
| Java |
/*
* 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
}
| Java |
/*
* 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
}
| Java |
/*
* 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
}
| Java |
/*
* 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
}
| Java |
/*
* 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
}
| Java |
/*
* 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
}
| Java |
/*
* 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
}
| Java |
/*
* 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
}
| Java |
/*
* 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
}
| Java |
// 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();
}
}
| Java |
// 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());
}
}
| Java |
// 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);
}
}
| Java |
// 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);
}
}
| Java |
// 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();
}
});
}
}
| Java |
// 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);
}
});
}
}
| Java |
// 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);
}
}
| Java |
// 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();
}
| Java |
// 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();
}
}
| Java |
// 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);
}
}
| Java |
// 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.common.collect.Lists;
import com.google.gwt.user.client.Window;
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.view.CapabilityDetailsView;
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.Attribute;
import com.google.testing.testify.risk.frontend.model.Bug;
import com.google.testing.testify.risk.frontend.model.Capability;
import com.google.testing.testify.risk.frontend.model.Checkin;
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.TestCase;
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 details of a single capability.
*
* @author jimr@google.com (Jim Reardon)
*/
public class CapabilityDetailsPresenter extends BasePagePresenter
implements CapabilityDetailsView.Presenter {
protected final Project project;
protected final ProjectRpcAsync projectService;
protected final UserRpcAsync userService;
protected final DataRpcAsync dataService;
protected final CapabilityDetailsView view;
protected String pageData;
private Long capabilityId;
public CapabilityDetailsPresenter(Project project, ProjectRpcAsync projectService,
DataRpcAsync dataService, UserRpcAsync userService,
CapabilityDetailsView view) {
this.project = project;
this.projectService = projectService;
this.dataService = dataService;
this.userService = userService;
this.view = view;
view.setPresenter(this);
}
@Override
public void refreshView() {
final long projectId = project.getProjectId();
// Tell view to expect an entire reload of data.
view.reset();
userService.hasEditAccess(projectId,
new TaCallback<Boolean>("Querying user permissions") {
@Override
public void onSuccess(Boolean result) {
if (result == true) {
view.makeEditable();
}
}
});
projectService.getProjectAttributes(projectId,
new TaCallback<List<Attribute>>("Querying Attributes") {
@Override
public void onSuccess(List<Attribute> result) {
view.setAttributes(result);
}
});
projectService.getLabels(projectId,
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);
}
});
projectService.getProjectComponents(projectId,
new TaCallback<List<Component>>("Querying Components") {
@Override
public void onSuccess(List<Component> result) {
view.setComponents(result);
}
});
projectService.getCapabilityById(projectId, capabilityId,
new TaCallback<Capability>("Querying capability") {
@Override
public void onSuccess(Capability result) {
view.setCapability(result);
}
});
dataService.isSignedOff(AccElementType.CAPABILITY, capabilityId,
new TaCallback<Boolean>("Getting signoff status") {
@Override
public void onSuccess(Boolean result) {
view.setSignoff(result == null ? false : result);
}
});
dataService.getProjectBugsById(projectId,
new TaCallback<List<Bug>>("Querying Bugs") {
@Override
public void onSuccess(List<Bug> result) {
view.setBugs(result);
}
});
dataService.getProjectTestCasesById(projectId,
new TaCallback<List<TestCase>>("Querying Tests") {
@Override
public void onSuccess(List<TestCase> result) {
view.setTests(result);
}
});
dataService.getProjectCheckinsById(projectId,
new TaCallback<List<Checkin>>("Querying Checkins") {
@Override
public void onSuccess(List<Checkin> result) {
view.setCheckins(result);
}
});
}
@Override
public void assignBugToCapability(long capabilityId, long bugId) {
dataService.updateBugAssociations(bugId, -1, -1, capabilityId,
new TaCallback<Void>("assigning bug to capability"));
}
@Override
public void assignCheckinToCapability(long capabilityId, long checkinId) {
dataService.updateCheckinAssociations(checkinId, -1, -1, capabilityId,
new TaCallback<Void>("assigning checkin to capability"));
}
@Override
public void assignTestCaseToCapability(long capabilityId, long testId) {
dataService.updateTestAssociations(testId, -1, -1, capabilityId,
new TaCallback<Void>("assigning test to capability"));
}
@Override
public void refreshView(String pageData) {
try {
capabilityId = Long.parseLong(pageData);
} catch (NumberFormatException e) {
Window.alert("Cannot refresh capability details page, invalid capbility ID.");
}
refreshView();
}
@Override
public Widget getView() {
return view.asWidget();
}
@Override
public void updateCapability(Capability capability) {
projectService.updateCapability(capability, new TaCallback<Void>("updating capability"));
}
@Override
public void setSignoff(long capabilityId, boolean isSignedOff) {
dataService.setSignedOff(project.getProjectId(), AccElementType.CAPABILITY, capabilityId,
isSignedOff, new TaCallback<Void>("setting signoff status"));
}
}
| Java |
// 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.common.collect.Maps;
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.view.ConfigureFiltersView;
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.Filter;
import com.google.testing.testify.risk.frontend.model.Project;
import com.google.testing.testify.risk.frontend.shared.rpc.DataRpcAsync;
import com.google.testing.testify.risk.frontend.shared.rpc.ProjectRpcAsync;
import java.util.HashMap;
import java.util.List;
/**
* Presenter for Filter list and creating filters.
*
* @author jimr@google.com (Jim Reardon)
*/
public class ConfigureFiltersPresenter extends BasePagePresenter implements TaPagePresenter,
ConfigureFiltersView.Presenter {
private final Project project;
private final DataRpcAsync dataService;
private final ProjectRpcAsync projectService;
private final ConfigureFiltersView view;
public ConfigureFiltersPresenter(Project project, DataRpcAsync dataService,
ProjectRpcAsync projectService, ConfigureFiltersView view) {
this.project = project;
this.dataService = dataService;
this.projectService = projectService;
this.view = view;
refreshView();
}
@Override
public Widget getView() {
return view.asWidget();
}
@Override
public void refreshView() {
view.setPresenter(this);
dataService.getFilters(project.getProjectId(),
new TaCallback<List<Filter>>("Getting filters") {
@Override
public void onSuccess(List<Filter> result) {
view.setFilters(result);
}
});
projectService.getProjectAttributes(project.getProjectId(),
new TaCallback<List<Attribute>>("Getting attributes") {
@Override
public void onSuccess(List<Attribute> result) {
HashMap<String, Long> map = Maps.newHashMap();
for (Attribute attribute : result) {
map.put(attribute.getName(), attribute.getAttributeId());
}
view.setAttributes(map);
}
});
projectService.getProjectComponents(project.getProjectId(),
new TaCallback<List<Component>>("Getting components") {
@Override
public void onSuccess(List<Component> result) {
HashMap<String, Long> map = Maps.newHashMap();
for (Component component : result) {
map.put(component.getName(), component.getComponentId());
}
view.setComponents(map);
}
});
projectService.getProjectCapabilities(project.getProjectId(),
new TaCallback<List<Capability>>("Getting capabilities") {
@Override
public void onSuccess(List<Capability> result) {
HashMap<String, Long> map = Maps.newHashMap();
for (Capability capability : result) {
map.put(capability.getName(), capability.getCapabilityId());
}
view.setCapabilities(map);
}
});
}
@Override
public void addFilter(final Filter newFilter) {
newFilter.setParentProjectId(project.getProjectId());
dataService.addFilter(newFilter,
new TaCallback<Long>("Adding new filter") {
@Override
public void onSuccess(Long result) {
newFilter.setId(result);
refreshView();
}
});
}
@Override
public void deleteFilter(Filter filterToDelete) {
dataService.removeFilter(filterToDelete,
new TaCallback<Void>("Deleting filter") {
@Override
public void onSuccess(Void result) {
refreshView();
}
});
}
@Override
public void updateFilter(Filter filterToUpdate) {
dataService.updateFilter(filterToUpdate, TaCallback.getNoopCallback());
}
}
| Java |
// 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.user.client.ui.Widget;
import com.google.testing.testify.risk.frontend.client.TaCallback;
import com.google.testing.testify.risk.frontend.client.view.ConfigureDataView;
import com.google.testing.testify.risk.frontend.model.DataRequest;
import com.google.testing.testify.risk.frontend.model.DataSource;
import com.google.testing.testify.risk.frontend.model.Project;
import com.google.testing.testify.risk.frontend.shared.rpc.DataRpcAsync;
import java.util.List;
/**
* Presenter for the Configure Data page.
*
* @author chrsmith@google.com (Chris Smith)
*/
public class ConfigureDataPresenter extends BasePagePresenter
implements TaPagePresenter, ConfigureDataView.Presenter {
private final Project project;
private final DataRpcAsync dataService;
private final ConfigureDataView view;
public ConfigureDataPresenter(
Project project, DataRpcAsync rpcService,
ConfigureDataView view) {
this.project = project;
this.dataService = rpcService;
this.view = view;
refreshView();
}
@Override
public void refreshView() {
view.setPresenter(this);
dataService.getDataSources(
new TaCallback<List<DataSource>>("Getting data source options") {
@Override
public void onSuccess(List<DataSource> result) {
view.setDataSources(result);
}
});
dataService.getProjectRequests(project.getProjectId(),
new TaCallback<List<DataRequest>>("Getting data requests") {
@Override
public void onSuccess(List<DataRequest> result) {
view.setDataRequests(result);
}
});
}
@Override
public void addDataRequest(final DataRequest newRequest) {
newRequest.setParentProjectId(project.getProjectId());
dataService.addDataRequest(newRequest,
new TaCallback<Long>("Updating data request") {
@Override
public void onSuccess(Long result) {
newRequest.setRequestId(result);
refreshView();
}
});
}
@Override
public void updateDataRequest(DataRequest requestToUpdate) {
dataService.updateDataRequest(requestToUpdate, TaCallback.getNoopCallback());
}
@Override
public void deleteDataRequest(DataRequest requestToDelete) {
dataService.removeDataRequest(requestToDelete,
new TaCallback<Void>("Deleting data request") {
@Override
public void onSuccess(Void result) {
refreshView();
}
});
}
@Override
public Widget getView() {
return view.asWidget();
}
}
| Java |
// 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.user.client.ui.Widget;
import com.google.testing.testify.risk.frontend.client.view.RiskView;
import com.google.testing.testify.risk.frontend.model.Project;
import com.google.testing.testify.risk.frontend.shared.rpc.ProjectRpcAsync;
/**
* Presenter for viewing a project's known risk, that is outstanding risk minus mitigations.
*
* @author chrsmith@google.com (Chris Smith)
*/
public class KnownRiskPresenter extends RiskPresenter implements TaPagePresenter {
public KnownRiskPresenter(
Project project, ProjectRpcAsync projectService, RiskView view) {
super(project, projectService, view);
refreshView();
}
@Override
public void refreshView() {
refreshBaseView();
}
@Override
public Widget getView() {
return view.asWidget();
}
}
| Java |
// 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.AttributesView;
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.Attribute;
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 Attributes page.
*
* @author jimr@google.com (Jim Reardon)
*/
public class AttributesPresenter extends BasePagePresenter implements AttributesView.Presenter,
TaPagePresenter {
private final Project project;
private final ProjectRpcAsync projectService;
private final UserRpcAsync userService;
private final DataRpcAsync dataService;
private final AttributesView view;
private final EventBus eventBus;
private final Collection<String> projectLabels = Lists.newArrayList();
/**
* Constructs the Attributes page presenter.
*/
public AttributesPresenter(
Project project, ProjectRpcAsync projectService, UserRpcAsync userService,
DataRpcAsync dataService, AttributesView 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) {
if (result) {
view.enableEditing();
}
}
});
projectService.getProjectAttributes(project.getProjectId(),
new TaCallback<List<Attribute>>("loading attributes") {
@Override
public void onSuccess(List<Attribute> result) {
// If the project has no attributes, we need to broadcast it.
if (result.size() == 0) {
eventBus.fireEvent(
new ProjectHasNoElementsEvent(project, AccElementType.ATTRIBUTE));
}
view.setProjectAttributes(result);
}
});
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);
}
});
dataService.getSignoffsByType(project.getProjectId(), AccElementType.ATTRIBUTE,
new TaCallback<List<Signoff>>("loading signoff details") {
@Override
public void onSuccess(List<Signoff> results) {
view.setSignoffs(results);
}
});
}
/** Returns the underlying view. */
@Override
public Widget getView() {
return view.asWidget();
}
@Override
public long getProjectId() {
return project.getProjectId();
}
/**
* Adds a new Attribute to the data store.
*/
@Override
public void createAttribute(final Attribute attribute) {
projectService.createAttribute(attribute,
new TaCallback<Long>("creating attribute") {
@Override
public void onSuccess(Long result) {
attribute.setAttributeId(result);
eventBus.fireEvent(new ProjectElementAddedEvent(attribute));
refreshView();
}
});
}
/**
* Updates the given attribute in the database.
*/
@Override
public void updateAttribute(Attribute attributeToUpdate) {
projectService.updateAttribute(attributeToUpdate,
new TaCallback<Attribute>("updating attribute") {
@Override
public void onSuccess(Attribute result) {
view.refreshAttribute(result);
}
});
}
@Override
public void updateSignoff(Attribute attribute, boolean newSignoff) {
dataService.setSignedOff(attribute.getParentProjectId(), AccElementType.ATTRIBUTE,
attribute.getAttributeId(), newSignoff, TaCallback.getNoopCallback());
}
/**
* Removes the given attribute from the Project.
*/
@Override
public void removeAttribute(Attribute attributeToRemove) {
projectService.removeAttribute(attributeToRemove,
new TaCallback<Void>("deleting attribute") {
@Override
public void onSuccess(Void result) {
refreshView();
}
});
}
@Override
public void reorderAttributes(List<Long> newOrder) {
projectService.reorderAttributes(
project.getProjectId(), newOrder,
new TaCallback<Void>("reordering attributes") {
@Override
public void onSuccess(Void result) {
refreshView();
}
});
}
@Override
public ProjectRpcAsync getProjectService() {
return projectService;
}
}
| Java |
// 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.view;
import com.google.gwt.user.client.ui.Widget;
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 java.util.List;
/**
* View on top of any user interface for visualizing a project's Risk or Risk Mitigations.
*
* @author chrsmith@google.com (Chris Smith)
*/
public interface RiskView {
/**
* Initializes user interface elements with the given components.
*/
public void setComponents(List<Component> components);
/**
* Initializes user interface elements with the given attributes.
*/
public void setAttributes(List<Attribute> attributes);
/**
* Notifies the view of all Project Components.
*/
public void setCapabilities(List<Capability> capabilities);
/**
* Converts the view into a GWT widget.
*/
public Widget asWidget();
}
| Java |
// 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.view;
import com.google.gwt.user.client.ui.Widget;
import com.google.testing.testify.risk.frontend.client.presenter.TaPagePresenter;
import com.google.testing.testify.risk.frontend.model.Attribute;
import com.google.testing.testify.risk.frontend.model.Bug;
import com.google.testing.testify.risk.frontend.model.Capability;
import com.google.testing.testify.risk.frontend.model.Checkin;
import com.google.testing.testify.risk.frontend.model.Component;
import com.google.testing.testify.risk.frontend.model.TestCase;
import java.util.Collection;
import java.util.List;
/**
* View on top of the CapabilityDetails page.
*
* @author jimr@google.com (Jim Reardon)
*/
public interface CapabilityDetailsView {
/**
* Presenter interface for this view.
*/
public interface Presenter extends TaPagePresenter {
public void assignBugToCapability(long capabilityId, long bugId);
public void assignCheckinToCapability(long capabilityId, long checkinId);
public void assignTestCaseToCapability(long capabilityId, long testId);
public void updateCapability(Capability capability);
public void setSignoff(long capabilityId, boolean isSignedOff);
}
public void setAttributes(List<Attribute> attributes);
public void setBugs(List<Bug> bugs);
public void setComponents(List<Component> components);
public void setCapability(Capability capability);
public void setTests(List<TestCase> tests);
public void setCheckins(List<Checkin> checkins);
public void setSignoff(boolean signoff);
public void setProjectLabels(Collection<String> labels);
public void setPresenter(Presenter presenter);
/**
* Reset clears all stored data. Call before refresh, or setting new data,
* to avoid staggering updates. */
public void reset();
public void makeEditable();
public void refresh();
public Widget asWidget();
}
| Java |
// 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.view;
import com.google.gwt.user.client.ui.Widget;
import com.google.testing.testify.risk.frontend.model.Attribute;
import com.google.testing.testify.risk.frontend.model.Signoff;
import com.google.testing.testify.risk.frontend.shared.rpc.ProjectRpcAsync;
import java.util.Collection;
import java.util.List;
/**
* View on top of the ProjectAttributes page.
*
* @author chrsmith@google.com (Chris Smith)
*/
public interface AttributesView {
/**
* Interface for notifying the Presenter about events arising from the View.
*/
public interface Presenter {
/**
* @return the ProjectID for the project the View is displaying.
*/
long getProjectId();
/**
* Notifies the Presenter that a new Attribute has been created.
*/
public void createAttribute(Attribute attribute);
/**
* Updates the given Attribute in the database.
*/
public void updateAttribute(Attribute attributeToUpdate);
public void updateSignoff(Attribute attribute, boolean newSignoff);
/**
* Removes the given Attribute from the Project.
*/
public void removeAttribute(Attribute attributeToRemove);
/**
* Reorders the project's list of Attributes.
*/
public void reorderAttributes(List<Long> newOrder);
/** Get the ProjectService associated with the presenter. */
public ProjectRpcAsync getProjectService();
}
/**
* Bind the view and the underlying presenter it communicates with.
*/
public void setPresenter(Presenter presenter);
/**
* Initialize user interface elements with the given set of Attributes.
*/
public void setProjectAttributes(List<Attribute> attributes);
/** Update a single attribute */
public void refreshAttribute(Attribute attribute);
/** All of this project's labels. Used for autocomplete drop-down. */
public void setProjectLabels(Collection<String> projectLabels);
/**
* Data on which elements have been signed off.
*/
public void setSignoffs(List<Signoff> signoffs);
/**
* Updates the view to enable editing of attribute data.
*/
public void enableEditing();
/**
* Converts the view into a GWT widget.
*/
public Widget asWidget();
}
| Java |
// 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.view;
import com.google.gwt.user.client.ui.Widget;
import com.google.testing.testify.risk.frontend.model.AccLabel;
import com.google.testing.testify.risk.frontend.model.Component;
import java.util.List;
/**
* View for a Component widget.
* {@See com.google.testing.testify.risk.frontend.model.Component}
*
* @author chrsmith@google.com (Chris Smith)
*/
public interface ComponentView {
/**
* Interface for notifying the Presenter about events arising from the View.
*/
public interface Presenter {
/**
* Returns the project ID of the target Component.
*/
public long getProjectId();
/**
* Returns the Component ID of the target Component.
*/
public long getComponentId();
public void updateSignoff(boolean newSignoff);
public void onDescriptionEdited(String description);
/**
* Called when the user renames the given component.
*/
public void onRename(String newComponentName);
/**
* Called when the user deletes the given Component.
*/
public void onRemove();
/**
* Called when the user updates a label.
*/
public void onUpdateLabel(AccLabel label, String newText);
/**
* Called when the user adds a new Label.
*/
public void onAddLabel(String label);
/**
* Called when the user removes a label.
*/
public void onRemoveLabel(AccLabel label);
public void refreshView(Component component);
/** Requests the presenter refresh the view's controls. */
public void refreshView();
}
/**
* Bind the view and the underlying presenter it communicates with.
*/
public void setPresenter(Presenter presenter);
/**
* Set the UI to display the Component's name.
*/
public void setComponentName(String componentName);
public void setDescription(String description);
public void setSignedOff(boolean signedOff);
/**
* Set the UI to display the Component's ID.
*/
public void setComponentId(Long componentId);
/**
* Set the UI to display the given Component labels.
*/
public void setComponentLabels(List<AccLabel> componentLabels);
/**
* Updates the view to enable editing of attribute data.
*/
public void enableEditing();
/**
* Hides the Widget so it is no longer visible. (Typically after the Component has been deleted.)
*/
public void hide();
/**
* Converts the view into a GWT widget.
*/
public Widget asWidget();
}
| Java |
// 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.view;
import com.google.gwt.user.client.ui.Widget;
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 java.util.List;
/**
* View on top of the ProjectSettings Widget.
*
* @author chrsmith@google.com (Chris Smith)
*/
public interface ProjectSettingsView {
/**
* Interface for notifying the Presenter about events arising from the View.
*/
public interface Presenter {
/**
* @return the ProjectID for the project the View is displaying.
*/
long getProjectId();
/**
* @return a handle to the Presenter's ProjectService serverlet. Ideally this should be hidden.
*/
ProjectRpcAsync getProjectService();
/**
* Updates the project name, summary, and description get updated in one batch action.
*/
void onUpdateProjectInfoClicked(
String projectName, String projectDescription,
List<String> projectOwners, List<String> projectEditors, List<String> projectViewers,
boolean isPublicalyVisible);
/**
* Deletes the Project. Proceed with caution.
*/
public void removeProject();
}
/**
* Shows the "project saved" panel.
*/
public void showSaved();
/**
* Updates the view to enable editing of project data. (Security will still be checked in the
* backend servlet.)
*/
public void enableProjectEditing(ProjectAccess userAccessLevel);
/**
* Bind the view and the underlying presenter it communicates with.
*/
public void setPresenter(Presenter presenter);
/**
* Initialize user interface elements with the given project settings.
*/
public void setProjectSettings(Project projectSettings);
/**
* Converts the view into a GWT widget.
*/
public Widget asWidget();
}
| Java |
// 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.view;
import com.google.gwt.user.client.ui.Widget;
import com.google.testing.testify.risk.frontend.model.FilterOption;
import java.util.List;
import java.util.Map;
/**
* View for a Filter.
*
* @author jimr@google.com (Jim Reardon)
*/
public interface FilterView {
/** Interface for notifying the presenter about changes to this view. */
public interface Presenter {
/** Called when the options for this filter are updated. */
public void onUpdate(List<FilterOption> newOptions, String conjunction, Long attribute,
Long component, Long capability);
/** Called when this filter is deleted. */
public void onRemove();
/** Called to refresh the view. */
public void refreshView();
}
/** Binds the view to the presenter. */
public void setPresenter(Presenter presenter);
/** Set the title to display for this filter. */
public void setFilterTitle(String title);
/** Set the available options for this filter. */
public void setFilterOptionChoices(List<String> filterOptionChoices);
/** Set the list of current configuration of this filter: current options filtered on and
* to what things are filtered.. */
public void setFilterSettings(List<FilterOption> options, String conjunction, Long attribute,
Long component, Long capability);
/** Set current list of ACC parts. */
public void setAttributes(Map<String, Long> attributes);
public void setComponents(Map<String, Long> components);
public void setCapabilities(Map<String, Long> capabilities);
/** Makes the widget invisible. */
public void hide();
/** View as a GWT widget. */
public Widget asWidget();
}
| Java |
// 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.view;
import com.google.gwt.user.client.ui.Widget;
import com.google.testing.testify.risk.frontend.model.AccLabel;
import com.google.testing.testify.risk.frontend.model.Attribute;
import java.util.List;
/**
* View for an Attribute widget.
* {@See com.google.testing.testify.risk.frontend.model.Attribute}
*
* @author chrsmith@google.com (Chris Smith)
*/
public interface AttributeView {
/**
* Interface for notifying the Presenter about events arising from the View.
*/
public interface Presenter {
/**
* Returns the project ID of the target Component.
*/
public long getProjectId();
/**
* Returns the Attribute ID of the target Attribute.
*/
public long getAttributeId();
public void updateSignoff(boolean newSignoff);
public void onDescriptionEdited(String description);
/**
* Called when the user renames the given Attribute.
*/
public void onRename(String newAttributeName);
/**
* Called when the user deletes the given Attribute.
*/
public void onRemove();
/**
* Called when the user adds a new Label.
*/
public void onAddLabel(String label);
/**
* Called when the user updates a Label.
*/
public void onUpdateLabel(AccLabel label, String newText);
/**
* Called when the user removes a label.
*/
public void onRemoveLabel(AccLabel label);
/** Updates the view with new attribute data. */
public void refreshView(Attribute attribute);
/** Requests the presenter refresh the view's controls. */
public void refreshView();
}
/**
* Bind the view and the underlying presenter it communicates with.
*/
public void setPresenter(Presenter presenter);
public void setDescription(String description);
public void setSignedOff(boolean signedOff);
/**
* Set the UI displaying the Attribute's name.
*/
public void setAttributeName(String name);
/**
* Set the UI displaying the Attribute's ID.
*/
public void setAttributeId(Long id);
/**
* Set the UI to display the given labels.
*/
public void setLabels(List<AccLabel> labels);
/**
* Updates the view to enable editing of attribute data.
*/
public void enableEditing();
/**
* Hides the Widget so it is no longer visible. (Typically after the Attribute has been deleted.)
*/
public void hide();
/**
* Converts the view into a GWT widget.
*/
public Widget asWidget();
}
| Java |
// 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.view.widgets;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HasWidgets;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
import java.util.Iterator;
/**
* Customized VerticalPanel for a page. The following CSS classes are exposed by this
* widget:
*
* tty-PageSectionVerticalPanel - The entire panel.
* tty-PageSectionVerticalPanelHeader - The header text.
* tty-PageSectionVerticalPanelItem - Each item in the panel.
*
* @author chrsmith@google.com (Chris Smith)
*/
public class PageSectionVerticalPanel extends Composite implements HasWidgets {
private final Label header = new Label();
private final VerticalPanel content = new VerticalPanel();
public PageSectionVerticalPanel() {
header.addStyleName("tty-PageSectionVerticalPanelHeader");
content.addStyleName("tty-PageSectionVerticalPanel");
content.add(header);
this.initWidget(content);
}
public void setHeaderText(String newTitle) {
header.setText(newTitle);
}
@Override
public void add(Widget w) {
w.addStyleName("tty-PageSectionVerticalPanelItem");
content.add(w);
}
@Override
public void clear() {
content.clear();
content.add(header);
}
@Override
public Iterator<Widget> iterator() {
return content.iterator();
}
@Override
public boolean remove(Widget w) {
return content.remove(w);
}
}
| Java |
// 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.view.widgets;
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HasWidgets;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
import java.util.Iterator;
/**
* Organization unit for a navigation pane.
*
* @author chrsmith@google.com (Chris Smith)
*/
public class NavSectionPanel extends Composite implements HasWidgets {
/** Used to wire parent class to associated UI Binder. */
interface NavSectionPanelUiBinder extends UiBinder<Widget, NavSectionPanel> {}
private static final NavSectionPanelUiBinder uiBinder = GWT.create(NavSectionPanelUiBinder.class);
@UiField
public Label sectionTitle;
@UiField
public VerticalPanel content;
public NavSectionPanel() {
initWidget(uiBinder.createAndBindUi(this));
}
public String getSectionTitle() {
return sectionTitle.getText();
}
public void setSectionTitle(String newTitle) {
sectionTitle.setText(newTitle);
}
@Override
public void add(Widget w) {
content.add(w);
}
@Override
public void clear() {
content.clear();
}
@Override
public Iterator<Widget> iterator() {
return content.iterator();
}
@Override
public boolean remove(Widget w) {
return content.remove(w);
}
}
| Java |
// 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.view.widgets;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Multimap;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.MouseOutEvent;
import com.google.gwt.event.dom.client.MouseOutHandler;
import com.google.gwt.event.dom.client.MouseOverEvent;
import com.google.gwt.event.dom.client.MouseOverHandler;
import com.google.gwt.event.logical.shared.HasValueChangeHandlers;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Grid;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HTMLTable.CellFormatter;
import com.google.gwt.user.client.ui.Label;
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.Pair;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
* A widget for displaying a set of capabilities in a Grid.
*
* @author jimr@google.com (Jim Reardon)
*/
public class CapabilitiesGridWidget extends Composite
implements HasValueChangeHandlers<Pair<Component, Attribute>> {
private final List<Attribute> attributes = Lists.newArrayList();
private final List<Component> components = Lists.newArrayList();
// Map from intersection key to capability list.
private final Multimap<Integer, Capability> capabilityMap = HashMultimap.create();
// Map from intersection key to table cell.
private final Map<Integer, HTML> cellMap = Maps.newHashMap();
private final Grid grid = new Grid();
private int highlightedCellRow = -1;
private int highlightedCellColumn = -1;
public CapabilitiesGridWidget() {
grid.addStyleName("tty-ComponentAttributeGrid");
grid.addStyleName("tty-CapabilitiesGrid");
initWidget(grid);
}
/**
* Adds a single capability without clearing out prior capabilities.
*
* @param capability capability to add.
*/
public void addCapability(Capability capability) {
Integer key = capability.getCapabilityIntersectionKey();
// Add the capability.
addCapabilityWithoutUpdate(capability);
// Update relevant UI field.
updateGridCell(key);
}
public void deleteCapability(Capability capability) {
for (Integer key : capabilityMap.keySet()) {
Collection<Capability> c = capabilityMap.get(key);
if (c.contains(capability)) {
c.remove(capability);
updateGridCell(key);
}
}
}
public void updateCapability(Capability capability) {
deleteCapability(capability);
addCapability(capability);
}
public void setAttributes(List<Attribute> attributes) {
this.attributes.clear();
this.attributes.addAll(attributes);
redrawGrid();
}
public void setComponents(List<Component> components) {
this.components.clear();
this.components.addAll(components);
redrawGrid();
}
public void setCapabilities(List<Capability> capabilities) {
capabilityMap.clear();
for (Capability capability : capabilities) {
addCapabilityWithoutUpdate(capability);
}
updateGridCells();
}
private void addCapabilityWithoutUpdate(Capability capability) {
Integer key = capability.getCapabilityIntersectionKey();
capabilityMap.put(key, capability);
}
/**
* Completely recreates the grid then calls updateGridCells() to update contents of grid.
* This should be called if the list of components or attributes changes.
*/
private void redrawGrid() {
grid.clear();
cellMap.clear();
if (components.size() < 1 || attributes.size() < 1) {
return;
}
grid.resize(components.size() + 1, attributes.size() + 1);
grid.getCellFormatter().setStyleName(0, 0, "tty-GridXHeaderCell");
// Add component headers.
for (int i = 0; i < components.size(); i++) {
Label label = new Label(components.get(i).getName());
grid.getCellFormatter().setStyleName(i + 1, 0, "tty-GridXHeaderCell");
grid.setWidget(i + 1, 0, label);
}
// Add attribute headers.
for (int i = 0; i < attributes.size(); i++) {
Label label = new Label(attributes.get(i).getName());
grid.getCellFormatter().setStyleName(0, i + 1, "tty-GridYHeaderCell");
grid.setWidget(0, i + 1, label);
}
// Fill up the rest of the grid with labels.
for (int cIndex = 0; cIndex < components.size(); cIndex++) {
for (int aIndex = 0; aIndex < attributes.size(); aIndex++) {
int row = cIndex + 1;
int column = aIndex + 1;
Component component = components.get(cIndex);
Attribute attribute = attributes.get(aIndex);
Integer key = Capability.getCapabilityIntersectionKey(component, attribute);
grid.getCellFormatter().setStyleName(row, column, "tty-GridCell");
if (row == highlightedCellRow && column == highlightedCellColumn) {
grid.getCellFormatter().addStyleName(row, column, "tty-GridCellSelected");
}
HTML cell = new HTML();
cell.addClickHandler(cellClickHandler(row, column));
cell.addMouseOverHandler(createMouseOverHandler(row, column));
cell.addMouseOutHandler(createMouseOutHandler(row, column));
cellMap.put(key, cell);
grid.setWidget(row, column, cell);
}
}
updateGridCells();
}
/**
* Creates a mouse over handler for a specific row and column.
*
* @param row the row number.
* @param column the column number.
* @return the mouse over handler.
*/
private MouseOverHandler createMouseOverHandler(final int row, final int column) {
return new MouseOverHandler() {
@Override
public void onMouseOver(MouseOverEvent event) {
mouseOver(row, column);
}
};
}
/**
* Generates a mouse out handler for a specific row and column.
*
* @param row the row.
* @param column the column.
* @return a mouse out handler.
*/
private MouseOutHandler createMouseOutHandler(final int row, final int column) {
return new MouseOutHandler() {
@Override
public void onMouseOut(MouseOutEvent event) {
mouseOut(row, column);
}
};
}
/**
* Handles a mouse out event by removing the formatting on cells that were once highlighted due
* to a mouse over event.
*
* @param row the row that lost mouse over.
* @param column the column that lost mouse over.
*/
private void mouseOut(int row, int column) {
CellFormatter formatter = grid.getCellFormatter();
// Remove highlighting from cell.
formatter.removeStyleName(row, column, "tty-GridCellHighlighted");
// Remove column highlighting.
for (int i = 1; i < grid.getRowCount(); i++) {
formatter.removeStyleName(i, column, "tty-GridColumnHighlighted");
}
// Remove row highlighting.
for (int j = 1; j < grid.getColumnCount(); j++) {
formatter.removeStyleName(row, j, "tty-GridRowHighlighted");
}
}
/**
* Handles a mouse over event by highlighting the moused over cell and adding style to the
* row and column that is also to be highlighted.
*
* @param row the row that gained mouse over.
* @param column the column that gained mouse over.
*/
private void mouseOver(int row, int column) {
CellFormatter formatter = grid.getCellFormatter();
// Add highlighting to cell.
formatter.addStyleName(row, column, "tty-GridCellHighlighted");
// Add column highlighting.
for (int i = 1; i < grid.getRowCount(); i++) {
if (i != row) {
formatter.addStyleName(i, column, "tty-GridColumnHighlighted");
}
}
// Add row highlighting.
for (int j = 1; j < grid.getColumnCount(); j++) {
if (j != column) {
formatter.addStyleName(row, j, "tty-GridRowHighlighted");
}
}
}
/**
* This updates the contents of the grid based off the current capability data.
*/
private void updateGridCells() {
for (Integer key : cellMap.keySet()) {
updateGridCell(key);
}
}
private void updateGridCell(Integer key) {
int size = capabilityMap.get(key).size();
String text = " ";
if (size > 0) {
text = Integer.toString(size);
}
cellMap.get(key).setHTML(text);
}
private ClickHandler cellClickHandler(final int row, final int column) {
final HasValueChangeHandlers<Pair<Component, Attribute>> self = this;
return new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
cellClicked(row, column);
}
};
}
private void cellClicked(int row, int column) {
final Component component = components.get(row - 1);
final Attribute attribute = attributes.get(column - 1);
if (highlightedCellRow != -1 && highlightedCellColumn != -1) {
grid.getCellFormatter().removeStyleName(
highlightedCellRow, highlightedCellColumn, "tty-GridCellSelected");
}
grid.getCellFormatter().addStyleName(row, column, "tty-GridCellSelected");
highlightedCellRow = row;
highlightedCellColumn = column;
ValueChangeEvent.fire(this, new Pair<Component, Attribute>(component, attribute));
}
@Override
public HandlerRegistration addValueChangeHandler(
ValueChangeHandler<Pair<Component, Attribute>> handler) {
return addHandler(handler, ValueChangeEvent.getType());
}
}
| Java |
// 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.view.widgets;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Image;
import com.google.testing.testify.risk.frontend.client.TaCallback;
import com.google.testing.testify.risk.frontend.shared.rpc.UserRpc;
import com.google.testing.testify.risk.frontend.shared.rpc.UserRpcAsync;
/**
* Project favorite star. Used to track user favorites. Note that the project favorite star defines
* the CSS style tty-ProjectFavoriteStar.
*
* @author chrsmith@google.com (Chris Smith)
*/
public class ProjectFavoriteStar extends Composite {
private final UserRpcAsync userService;
private boolean isStarred = false;
private final Image starImage = new Image();
private static final String STAR_ON_URL = "images/star-on.png";
private static final String STAR_OFF_URL = "images/star-off.png";
public ProjectFavoriteStar() {
userService = GWT.create(UserRpc.class);
starImage.setUrl(STAR_OFF_URL);
starImage.addStyleName("tty-ProjectFavoriteStar");
initWidget(starImage);
}
/** Set's the widget's Starred status. */
public void setStarredStatus(boolean isStarred) {
this.isStarred = isStarred;
if (isStarred) {
starImage.setUrl(STAR_ON_URL);
} else {
starImage.setUrl(STAR_OFF_URL);
}
}
/**
* Attach the current favorite star to the given Project ID. When this widget is clicked, it will
* make an RPC call to add the project as a favorite of the user.
*/
public void attachToProject(final long projectId) {
// Add 'click status'.
starImage.addClickHandler(
new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
setStarredStatus(!isStarred);
if (isStarred) {
userService.starProject(projectId, TaCallback.getNoopCallback());
} else {
userService.unstarProject(projectId, TaCallback.getNoopCallback());
}
}
});
}
}
| Java |
// 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.view.widgets;
import com.google.gwt.uibinder.client.UiFactory;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;
import com.google.testing.testify.risk.frontend.model.Capability;
/**
* A widget that displays risk details to the user. No editing is done via this widget, just
* informational display.
*
* @author jimr@google.com (Jim Reardon)
*/
public class RiskCapabilityWidget extends BaseCapabilityWidget {
private final String risk;
private Label riskLabel;
public RiskCapabilityWidget(Capability capability, String risk) {
super(capability);
this.risk = risk;
updateRiskLabel();
}
@Override
public void makeEditable() {
// Always disable editing, no matter what. This is not a widget for editing, but for viewing.
}
private void updateRiskLabel() {
riskLabel.setText("Risk: " + risk);
}
@UiFactory @Override
public EasyDisclosurePanel createDisclosurePanel() {
HorizontalPanel header = new HorizontalPanel();
header.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
header.setStyleName("tty-CapabilityRiskHeader");
header.add(capabilityLabel);
riskLabel = new Label();
riskLabel.setStyleName("tty-CapabilityRiskValueHeader");
updateRiskLabel();
header.add(riskLabel);
EasyDisclosurePanel panel = new EasyDisclosurePanel(header);
panel.setOpen(false);
return panel;
}
public void setRiskContent(Widget content) {
disclosureContent.setWidget(content);
}
}
| Java |
// 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.view.widgets;
import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.event.dom.client.ChangeEvent;
import com.google.gwt.event.dom.client.ChangeHandler;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.TextBox;
/**
* Widget for a DataRequest parameter with an arbitrary parameter key.
*
* @author chrsmith@google.com (Chris Smith)
*/
public class CustomParameterWidget extends Composite implements DataRequestParameterWidget {
private final TextBox keyTextBox = new TextBox();
private final TextBox valueTextBox = new TextBox();
private boolean isDeleted = false;
private final Image removeParameterImage = new Image("/images/x.png");
public CustomParameterWidget(String key, String value) {
HorizontalPanel panel = new HorizontalPanel();
panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
panel.addStyleName("tty-DataRequestParameter");
panel.add(keyTextBox);
panel.add(valueTextBox);
panel.add(removeParameterImage);
removeParameterImage.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent arg0) {
isDeleted = true;
fireChangeEvent();
}
});
initWidget(panel);
}
private void fireChangeEvent() {
NativeEvent event = Document.get().createChangeEvent();
ChangeEvent.fireNativeEvent(event, this);
}
@Override
public String getParameterKey() {
if (isDeleted) {
return null;
}
return keyTextBox.getText();
}
@Override
public String getParameterValue() {
if (isDeleted) {
return null;
}
return valueTextBox.getText();
}
@Override
public HandlerRegistration addChangeHandler(ChangeHandler handler) {
return addHandler(handler, ChangeEvent.getType());
}
@Override
public boolean isDeleted() {
return isDeleted;
}
}
| Java |
// 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.view.widgets;
import com.google.gwt.event.dom.client.HasChangeHandlers;
import com.google.gwt.user.client.ui.Widget;
/**
* Base interface visualizing a parameter to a data request.
*
* @author chrsmith@google.com (Chris Smith)
*/
public interface DataRequestParameterWidget extends HasChangeHandlers {
public String getParameterKey();
public String getParameterValue();
public Widget asWidget();
public boolean isDeleted();
}
| Java |
// 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.view.widgets;
import com.google.common.collect.Lists;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiFactory;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HasValue;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.RadioButton;
import com.google.gwt.user.client.ui.TextArea;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.Widget;
import com.google.testing.testify.risk.frontend.client.util.NotificationUtil;
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.FailureRate;
import com.google.testing.testify.risk.frontend.model.UserImpact;
import java.util.Collection;
import java.util.List;
/**
* A capability widget that allows you to edit the details of the capability. Hook up
* an update and delete listener to be notified of edits on this widget.
*
* @author jimr@google.com (Jim Reardon)
*/
public class EditCapabilityWidget extends Composite implements HasValue<Capability> {
interface EditCapabilityWidgetUiBinder extends UiBinder<Widget, EditCapabilityWidget> {}
private static final EditCapabilityWidgetUiBinder uiBinder =
GWT.create(EditCapabilityWidgetUiBinder.class);
private Capability capability;
private final List<Attribute> attributes = Lists.newArrayList();
private final List<Component> components = Lists.newArrayList();
@UiField
protected FlowPanel labelsPanel;
@UiField
protected HorizontalPanel failurePanel;
@UiField
protected HorizontalPanel impactPanel;
@UiField
protected ListBox attributeBox;
@UiField
protected ListBox componentBox;
@UiField
protected TextBox capabilityName;
@UiField
protected TextArea description;
@UiField
protected Label capabilityGripper;
@UiField
protected HorizontalPanel buttonPanel;
@UiField
public HorizontalPanel savedPanel;
@UiField
protected EasyDisclosurePanel disclosurePanel;
@UiField
protected Button cancelButton;
@UiField
protected Button saveButton;
@UiField
protected Image deleteImage;
@UiField
protected Label capabilityId;
private final Label capabilityLabel = new Label();
private LabelWidget addNewLabel;
private Collection<String> labelSuggestions = Lists.newArrayList();
private boolean isEditable = false;
private boolean isDeletable = true;
/**
* Creates a widget which exposes the ability to edit the widget.
*
* @param capability the capability for this widget.
*/
public EditCapabilityWidget(Capability capability) {
this.capability = capability;
initWidget(uiBinder.createAndBindUi(this));
capabilityLabel.setText(capability.getName());
description.getElement().setAttribute("placeholder", "Enter description of this capability...");
refresh();
}
public Widget getCapabilityGripper() {
return capabilityGripper;
}
public void expand() {
disclosurePanel.setOpen(true);
}
public void setAttributes(List<Attribute> attributes) {
this.attributes.clear();
this.attributes.addAll(attributes);
refresh();
}
public void setComponents(List<Component> components) {
this.components.clear();
this.components.addAll(components);
refresh();
}
public long getCapabilityId() {
return capability.getCapabilityId();
}
public void disableDelete() {
isDeletable = false;
deleteImage.setVisible(false);
}
@UiFactory
public EasyDisclosurePanel createDisclosurePanel() {
EasyDisclosurePanel panel = new EasyDisclosurePanel(capabilityLabel);
panel.setOpen(false);
return panel;
}
@UiHandler("deleteImage")
protected void handleDelete(ClickEvent event) {
String promptText = "Are you sure you want to remove " + capability.getName() + "?";
if (Window.confirm(promptText)) {
setValue(null, true);
}
}
@UiHandler("cancelButton")
protected void handleCancel(ClickEvent event) {
refresh();
}
@UiHandler("saveButton")
public void handleSave(ClickEvent event) {
savedPanel.setVisible(false);
long selectedAttribute;
long selectedComponent;
try {
selectedAttribute =
Long.parseLong(attributeBox.getValue(attributeBox.getSelectedIndex()));
selectedComponent =
Long.parseLong(componentBox.getValue(componentBox.getSelectedIndex()));
} catch (NumberFormatException e) {
NotificationUtil.displayErrorMessage("Couldn't save capability. The attribute or"
+ " component ID was invalid.");
return;
}
// Handle updates.
capability.setName(capabilityName.getValue());
capability.setDescription(description.getValue());
capability.setFailureRate(
FailureRate.fromDescription(getSelectedOptionInPanel(failurePanel)));
capability.setUserImpact(
UserImpact.fromDescription(getSelectedOptionInPanel(impactPanel)));
capability.setAttributeId(selectedAttribute);
capability.setComponentId(selectedComponent);
if ((capability.getComponentId() != selectedComponent)
|| (capability.getAttributeId() != selectedAttribute)) {
Window.alert("The capability " + capability.getName() + " will disappear from the "
+ " currently visible list because you have changed its attribute or component.");
}
// Tell the world that we've updated this capability.
ValueChangeEvent.fire(this, capability);
}
public void showSaved() {
// Show saved message.
savedPanel.setVisible(true);
Timer timer = new Timer() {
@Override
public void run() {
savedPanel.setVisible(false);
}
};
// Make the saved text disappear after 10 seconds.
timer.schedule(5000);
}
/**
* Updates the label suggestions for all labels on this view.
*/
public void setLabelSuggestions(Collection<String> labelSuggestions) {
this.labelSuggestions.clear();
this.labelSuggestions.addAll(labelSuggestions);
for (Widget w : labelsPanel) {
if (w instanceof LabelWidget) {
LabelWidget l = (LabelWidget) w;
l.setLabelSuggestions(this.labelSuggestions);
}
}
}
private void refresh() {
capabilityLabel.setText(capability.getName());
capabilityName.setText(capability.getName());
createLabelsPanel();
description.setText(capability.getDescription());
createFailureBox();
createImpactBox();
createAttributeBox();
createComponentBox();
capabilityName.setEnabled(isEditable);
capabilityGripper.setVisible(isEditable);
description.setEnabled(isEditable);
enableOrDisableAllRadioButtons(failurePanel, isEditable);
enableOrDisableAllRadioButtons(impactPanel, isEditable);
attributeBox.setEnabled(isEditable);
componentBox.setEnabled(isEditable);
buttonPanel.setVisible(isEditable);
}
private void createLabelsPanel() {
labelsPanel.clear();
for (AccLabel label : capability.getAccLabels()) {
createLabel(label);
}
addBlankLabel();
}
private void createLabel(final AccLabel label) {
final LabelWidget widget = new LabelWidget(label.getLabelText());
widget.setLabelSuggestions(labelSuggestions);
widget.setEditable(isEditable);
widget.addValueChangeHandler(new ValueChangeHandler<String>() {
@Override
public void onValueChange(ValueChangeEvent<String> event) {
if (event.getValue() == null) {
labelsPanel.remove(widget);
capability.removeLabel(label);
} else {
label.setLabelText(event.getValue());
}
}
});
labelsPanel.add(widget);
}
private void addBlankLabel() {
final String newText = "new label";
addNewLabel = new LabelWidget(newText, true);
addNewLabel.setLabelSuggestions(labelSuggestions);
addNewLabel.setEditable(true);
addNewLabel.addValueChangeHandler(new ValueChangeHandler<String>() {
@Override
public void onValueChange(ValueChangeEvent<String> event) {
labelsPanel.remove(addNewLabel);
AccLabel label = capability.addLabel(event.getValue());
createLabel(label);
addBlankLabel();
}
});
addNewLabel.setVisible(isEditable);
labelsPanel.add(addNewLabel);
}
private void createFailureBox() {
failurePanel.clear();
RadioButton button;
for (FailureRate rate : FailureRate.values()) {
button = new RadioButton("failure" + capability.getCapabilityId().toString(),
rate.getDescription());
failurePanel.add(button);
if (rate.equals(capability.getFailureRate())) {
button.setValue(true);
}
}
}
private void createImpactBox() {
impactPanel.clear();
RadioButton button;
for (UserImpact impact : UserImpact.values()) {
button = new RadioButton("impact" + capability.getCapabilityId().toString(),
impact.getDescription());
impactPanel.add(button);
if (impact.equals(capability.getUserImpact())) {
button.setValue(true);
}
}
}
private void enableOrDisableAllRadioButtons(Panel panel, boolean enable) {
for (Widget w : panel) {
if (w instanceof RadioButton) {
RadioButton b = (RadioButton) w;
b.setEnabled(enable);
}
}
}
private String getSelectedOptionInPanel(Panel panel) {
for (Widget w : panel) {
if (w instanceof RadioButton) {
RadioButton b = (RadioButton) w;
if (b.getValue()) {
return b.getText();
}
}
}
return null;
}
private void createAttributeBox() {
attributeBox.clear();
int i = 0;
for (Attribute attribute : attributes) {
attributeBox.addItem(attribute.getName(), attribute.getAttributeId().toString());
if (attribute.getAttributeId() == capability.getAttributeId()) {
attributeBox.setSelectedIndex(i);
}
i++;
}
}
private void createComponentBox() {
componentBox.clear();
int i = 0;
for (Component component : components) {
componentBox.addItem(component.getName(), component.getComponentId().toString());
if (component.getComponentId() == capability.getComponentId()) {
componentBox.setSelectedIndex(i);
}
i++;
}
}
public void makeEditable() {
isEditable = true;
deleteImage.setVisible(isDeletable);
enableOrDisableAllRadioButtons(failurePanel, true);
enableOrDisableAllRadioButtons(impactPanel, true);
description.setEnabled(true);
attributeBox.setEnabled(true);
componentBox.setEnabled(true);
capabilityName.setEnabled(true);
capabilityGripper.setVisible(true);
buttonPanel.setVisible(true);
for (Widget widget : labelsPanel) {
LabelWidget label = (LabelWidget) widget;
label.setEditable(true);
}
addNewLabel.setVisible(true);
}
@Override
public Capability getValue() {
return capability;
}
@Override
public HandlerRegistration addValueChangeHandler(ValueChangeHandler<Capability> handler) {
return addHandler(handler, ValueChangeEvent.getType());
}
@Override
public void setValue(Capability capability) {
this.capability = capability;
}
@Override
public void setValue(Capability capability, boolean fireEvents) {
this.capability = capability;
if (fireEvents) {
ValueChangeEvent.fire(this, capability);
}
}
}
| Java |
// 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.view.widgets;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;
import com.google.testing.testify.risk.frontend.client.TaApplication;
import com.google.testing.testify.risk.frontend.model.Capability;
/**
* Displays a Capability which, upon click, takes a user to another page.
*
* @author jimr@google.com (Jim Reardon)
*/
public class LinkCapabilityWidget extends Composite {
interface CapabilityWidgetBinder extends UiBinder<Widget, LinkCapabilityWidget> { }
private static final CapabilityWidgetBinder uiBinder = GWT.create(CapabilityWidgetBinder.class);
@UiField
public Label capabilityId;
@UiField
public Label capabilityLabel;
private final Capability capability;
/**
* @param capability
*/
public LinkCapabilityWidget(Capability capability) {
initWidget(uiBinder.createAndBindUi(this));
this.capability = capability;
initializeWidget();
}
private void initializeWidget() {
capabilityLabel.setText(capability.getName());
capabilityId.setText(Long.toString(capability.getCapabilityId()));
capabilityLabel.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
History.newItem("/" + capability.getParentProjectId()
+ "/" + TaApplication.PAGE_HISTORY_TOKEN_CAPABILITY_DETAILS
+ "/" + capability.getCapabilityId());
}
});
}
} | Java |
// 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.view.widgets;
import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.event.dom.client.ChangeEvent;
import com.google.gwt.event.dom.client.ChangeHandler;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.event.shared.HasHandlers;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.TextBox;
import java.util.List;
/**
* Widget a constrained DataRequest parameter, where the key values are fixed.
*
* @author chrsmith@google.com (Chris Smith)
*/
public class ConstrainedParameterWidget extends Composite implements DataRequestParameterWidget {
private final ListBox keyListBox = new ListBox();
private final TextBox valueTextBox = new TextBox();
private boolean isDeleted = false;
private final Image removeParameterImage = new Image("/images/x.png");
public ConstrainedParameterWidget(List<String> keyValues, String key, String value) {
keyListBox.clear();
for (String keyValue : keyValues) {
keyListBox.addItem(keyValue);
}
int startingKeyIndex = -1;
if (keyValues.contains(key)) {
startingKeyIndex = keyValues.indexOf(key);
} else {
// Initialized with a key not in the key values? Likely a bug somewhere...
startingKeyIndex = 0;
}
keyListBox.setSelectedIndex(startingKeyIndex);
valueTextBox.setText(value);
final HasHandlers self = this;
removeParameterImage.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent arg0) {
isDeleted = true;
fireChangeEvent();
}
});
HorizontalPanel panel = new HorizontalPanel();
panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
panel.addStyleName("tty-DataRequestParameter");
panel.add(keyListBox);
panel.add(valueTextBox);
panel.add(removeParameterImage);
initWidget(panel);
}
private void fireChangeEvent() {
NativeEvent event = Document.get().createChangeEvent();
ChangeEvent.fireNativeEvent(event, this);
}
@Override
public String getParameterKey() {
if (isDeleted) {
return null;
}
int selectedIndex = keyListBox.getSelectedIndex();
return keyListBox.getItemText(selectedIndex);
}
@Override
public String getParameterValue() {
if (isDeleted) {
return null;
}
return valueTextBox.getText();
}
@Override
public boolean isDeleted() {
return isDeleted;
}
@Override
public HandlerRegistration addChangeHandler(ChangeHandler handler) {
return addHandler(handler, ChangeEvent.getType());
}
}
| Java |
// 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.view.widgets;
import com.google.common.base.Function;
import com.google.common.collect.Lists;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.testing.testify.risk.frontend.client.event.HasWidgetsReorderedHandler;
import com.google.testing.testify.risk.frontend.client.event.WidgetsReorderedEvent;
import com.google.testing.testify.risk.frontend.client.event.WidgetsReorderedHandler;
import com.allen_sauer.gwt.dnd.client.DragEndEvent;
import com.allen_sauer.gwt.dnd.client.DragHandler;
import com.allen_sauer.gwt.dnd.client.DragStartEvent;
import com.allen_sauer.gwt.dnd.client.PickupDragController;
import com.allen_sauer.gwt.dnd.client.drop.VerticalPanelDropController;
import java.util.Iterator;
import java.util.List;
/**
* A VerticalPanel which supports reordering via drag and drop.
*
* @param <T> Type of the widget to display on the panel.
* @author chrsmith@google.com (Chris Smith)
*/
public class SortableVerticalPanel<T extends Widget> extends Composite
implements HasWidgetsReorderedHandler, Iterable<Widget> {
private final SimplePanel content = new SimplePanel();
private VerticalPanel currentVerticalPanel = new VerticalPanel();
public SortableVerticalPanel() {
initWidget(content);
}
/**
* Clears the vertical panel and adds the list of widgets. The provided function will be used to
* get the widget's drag target (such as header text or a gripper image).
*
* @param widgets the list of widgets to display on the generated panel.
* @param getDragTarget function for getting the 'dragable area' of any given widget. (Such as
* a gripping area or header label.
*/
public void setWidgets(List<T> widgets, Function<T, Widget> getDragTarget) {
AbsolutePanel boundaryPanel = new AbsolutePanel();
boundaryPanel.setSize("100%", "100%");
boundaryPanel.clear();
content.clear();
content.add(boundaryPanel);
// The VerticalPanel which actually holds the list of widgets.
currentVerticalPanel = new VerticalPanel();
// The VerticalPanelDropController handles DOM manipulation.
final VerticalPanelDropController widgetDropController =
new VerticalPanelDropController(currentVerticalPanel);
boundaryPanel.add(currentVerticalPanel);
DragHandler dragHandler = createDragHandler(currentVerticalPanel);
PickupDragController widgetDragController = new PickupDragController(boundaryPanel, false);
widgetDragController.setBehaviorMultipleSelection(false);
widgetDragController.addDragHandler(dragHandler);
widgetDragController.registerDropController(widgetDropController);
// Add each widget to the VerticalPanel and enable dragging via its DragTarget.
for (T widget : widgets) {
currentVerticalPanel.add(widget);
widgetDragController.makeDraggable(widget, getDragTarget.apply(widget));
}
}
/**
* Returns the number of Widgets on the VerticalPanel.
*/
public int getWidgetCount() {
return currentVerticalPanel.getWidgetCount();
}
/**
* Returns the Widget at the specified index.
*/
public Widget getWidget(int index) {
return currentVerticalPanel.getWidget(index);
}
/**
* Returns a generic DragHandler for notification of drag events.
*/
private DragHandler createDragHandler(final VerticalPanel verticalPanel) {
// TODO(chrsmith): Provide a way to hook into events. (Required to preserve ordering.)
return new DragHandler() {
@Override
public void onDragEnd(DragEndEvent event) {
List<Widget> widgetList = Lists.newArrayList();
for (int index = 0; index < verticalPanel.getWidgetCount(); index++) {
widgetList.add(verticalPanel.getWidget(index));
}
fireEvent(new WidgetsReorderedEvent(widgetList));
}
@Override
public void onDragStart(DragStartEvent event) {}
@Override
public void onPreviewDragEnd(DragEndEvent event) {}
@Override
public void onPreviewDragStart(DragStartEvent event) {}
};
}
@Override
public HandlerRegistration addWidgetsReorderedHandler(WidgetsReorderedHandler handler) {
return super.addHandler(handler, WidgetsReorderedEvent.getType());
}
@Override
public Iterator<Widget> iterator() {
return currentVerticalPanel.iterator();
}
}
| Java |
// 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.view.widgets;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.logical.shared.HasValueChangeHandlers;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiFactory;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.testing.testify.risk.frontend.model.Capability;
/**
* Base display for a capability. This widget is intended to be extended to supply content
* in the disclosure panel depending on view (for example, on the Capabilities page, the ability
* to edit capability details would be contained there. On a risk page, details on the risk
* assessment would be contained there. And so on).
*
* @author jimr@google.com (Jim Reardon)
*/
public class BaseCapabilityWidget extends Composite implements HasValueChangeHandlers<Capability> {
interface CapabilityWidgetBinder extends UiBinder<Widget, BaseCapabilityWidget> { }
private static final CapabilityWidgetBinder uiBinder = GWT.create(CapabilityWidgetBinder.class);
@UiField
public Image capabilityGripper;
@UiField
public EasyDisclosurePanel disclosurePanel;
@UiField
public SimplePanel disclosureContent;
@UiField
public Label capabilityId;
@UiField
public Image deleteCapabilityImage;
protected final Label capabilityLabel = new Label();
protected final Capability capability;
// If this widget allows editing.
protected boolean isEditable = false;
public BaseCapabilityWidget(Capability capability) {
initWidget(uiBinder.createAndBindUi(this));
this.capability = capability;
initializeWidget();
}
@UiFactory
public EasyDisclosurePanel createDisclosurePanel() {
EasyDisclosurePanel panel = new EasyDisclosurePanel(capabilityLabel);
panel.setOpen(false);
return panel;
}
private void initializeWidget() {
capabilityLabel.setStyleName("tty-CapabilityName");
deleteCapabilityImage.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
ValueChangeEvent.fire(BaseCapabilityWidget.this, null);
}
});
capabilityLabel.setText(capability.getName());
capabilityId.setText(Long.toString(capability.getCapabilityId()));
}
public void makeEditable() {
isEditable = true;
capabilityGripper.setVisible(true);
deleteCapabilityImage.setVisible(true);
}
@Override
public HandlerRegistration addValueChangeHandler(ValueChangeHandler<Capability> handler) {
return addHandler(handler, ValueChangeEvent.getType());
}
}
| Java |
// 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.view.widgets;
import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.BlurHandler;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.event.dom.client.KeyDownEvent;
import com.google.gwt.event.dom.client.KeyDownHandler;
import com.google.gwt.event.logical.shared.HasValueChangeHandlers;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DeckPanel;
import com.google.gwt.user.client.ui.HasValue;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.MultiWordSuggestOracle;
import com.google.gwt.user.client.ui.SuggestBox;
import com.google.gwt.user.client.ui.SuggestBox.DefaultSuggestionDisplay;
import java.util.Collection;
/**
* Displays a label with a little delete X as well. You can click the X to delete the label.
*
* @author jimr@google.com (Jim Reardon)
*/
public class LabelWidget extends Composite implements HasValue<String>,
HasValueChangeHandlers<String> {
private HorizontalPanel contentPanel = new HorizontalPanel();
private Image image = new Image();
// The deck panel will have to entries -- the view mode, and the edit mode. DeckPanel will
// only make one visible at a time.
private DeckPanel deckPanel = new DeckPanel();
private MultiWordSuggestOracle oracle = new MultiWordSuggestOracle(" -");
private SuggestBox inputBox = new SuggestBox(oracle);
private Label label = new Label();
private static final int VIEW_MODE = 0;
private static final int EDIT_MODE = 1;
private boolean canEdit = false;
public LabelWidget(String text) {
this(text, false);
}
/**
* Constructs a label for a given object, allowing customized styling. The constructed
* label will use styles:
* tty-GenericLabel
* tty-GenericLabelRemoveLabelImage
* @param text the textual representation for this label.
* @param isAddWidget true if this is a "new label..." widget, false if not.
*/
public LabelWidget(String text, final boolean isAddWidget) {
DefaultSuggestionDisplay suggestionDisplay =
(DefaultSuggestionDisplay) inputBox.getSuggestionDisplay();
suggestionDisplay.setPopupStyleName("tty-SuggestBoxPopup");
contentPanel.addStyleName("tty-RemovableLabel");
if (isAddWidget) {
// Craft a little plus image.
image.setStyleName("tty-RemovableLabelAddImage");
image.setUrl("images/collapsed_12.png");
image.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
switchMode(EDIT_MODE);
}
});
contentPanel.add(image);
}
// Craft the view mode.
label.setText(text);
label.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent arg0) {
switchMode(EDIT_MODE);
}
});
deckPanel.add(label);
// Craft the edit mode.
if (!isAddWidget) {
inputBox.setText(text);
}
inputBox.getTextBox().addBlurHandler(new BlurHandler() {
@Override
public void onBlur(BlurEvent arg0) {
switchMode(VIEW_MODE);
}
});
inputBox.getTextBox().addKeyDownHandler(new KeyDownHandler() {
@Override
public void onKeyDown(KeyDownEvent event) {
if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
switchMode(VIEW_MODE);
} else if (event.getNativeKeyCode() == KeyCodes.KEY_ESCAPE) {
if (isAddWidget) {
inputBox.setText("");
} else {
inputBox.setText(label.getText());
}
switchMode(VIEW_MODE);
}
}
});
// Explicitly does not call switchMode to avoid logic inside that function that would think
// we have switched from edit mode to view mode.
deckPanel.showWidget(VIEW_MODE);
deckPanel.add(inputBox);
contentPanel.add(deckPanel);
if (!isAddWidget) {
// Craft the delete button.
image.setStyleName("tty-RemovableLabelDeleteImage");
image.setUrl("images/x.png");
image.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
setValue(null, true);
}
});
contentPanel.add(image);
}
// Set some alignments to make the widget pretty.
contentPanel.setCellVerticalAlignment(label, HasVerticalAlignment.ALIGN_MIDDLE);
contentPanel.setCellVerticalAlignment(image, HasVerticalAlignment.ALIGN_MIDDLE);
initWidget(contentPanel);
}
private void switchMode(int mode) {
// Just keep them in view mode if they can't edit this widget.
if (!canEdit) {
deckPanel.showWidget(VIEW_MODE);
return;
}
if (mode == VIEW_MODE) {
String text = inputBox.getText();
if (!text.equals(label.getText())) {
// Don't save an empty label.
if (!"".equals(text)) {
// We have updates to save.
setValue(inputBox.getText(), true);
}
}
}
int width = label.getOffsetWidth();
deckPanel.showWidget(mode);
if (mode == EDIT_MODE) {
inputBox.setWidth(String.valueOf(String.valueOf(width)) + "px");
inputBox.setFocus(true);
}
}
public void setEditable(boolean canEdit) {
this.canEdit = canEdit;
image.setVisible(canEdit);
}
/**
* Sets the list of suggestions for the autocomplete box.
* @param suggestions list of items to suggest off of.
*/
public void setLabelSuggestions(Collection<String> suggestions) {
oracle.clear();
oracle.addAll(suggestions);
}
@Override
public String getValue() {
return label.getText();
}
@Override
public void setValue(String value) {
setValue(value, false);
}
@Override
public void setValue(String value, boolean fireEvents) {
String old = label.getText();
label.setText(value);
inputBox.setText(value);
if (fireEvents) {
ValueChangeEvent.fireIfNotEqual(this, old, value);
}
}
/**
* Will fire when value of text changes or delete is clicked (the value will be null if deleted).
*/
@Override
public HandlerRegistration addValueChangeHandler(ValueChangeHandler<String> handler) {
return addHandler(handler, ValueChangeEvent.getType());
}
}
| Java |
// 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.view.widgets;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.testing.testify.risk.frontend.client.event.DialogClosedEvent;
import com.google.testing.testify.risk.frontend.client.event.DialogClosedEvent.DialogResult;
import com.google.testing.testify.risk.frontend.client.event.DialogClosedHandler;
import com.google.testing.testify.risk.frontend.client.event.HasDialogClosedHandler;
/**
* Standard dialog box with OK/Cancel buttons.
*
* @author chrsmith@google.com (Chris Smith)
*/
public class StandardDialogBox extends Composite implements HasDialogClosedHandler {
interface StandardDialogBoxUiBinder extends UiBinder<Widget, StandardDialogBox> {}
private static final StandardDialogBoxUiBinder uiBinder =
GWT.create(StandardDialogBoxUiBinder.class);
@UiField
protected VerticalPanel dialogContent;
@UiField
protected Button okButton;
@UiField
protected Button cancelButton;
/** If this is displayed, get a handle to the owning dialog box. */
private DialogBox dialogBox;
public StandardDialogBox() {
initWidget(uiBinder.createAndBindUi(this));
}
/**
* @return the dialog's content. Consumers will add any custom widgets to the returned Panel.
*/
public Panel getDialogContent() {
return dialogContent;
}
/**
* Displays the Dialog.
*/
public static void showAsDialog(StandardDialogBox dialogWidget) {
DialogBox dialogBox = new DialogBox();
dialogWidget.dialogBox = dialogBox;
dialogBox.addStyleName("tty-StandardDialogBox");
dialogBox.setText(dialogWidget.getTitle());
dialogBox.add(dialogWidget);
dialogBox.center();
dialogBox.show();
}
/**
* Gets called whenever the OK Button is clicked.
*/
@UiHandler("okButton")
public void handleOkButtonClicked(ClickEvent event) {
if (dialogBox != null) {
dialogBox.hide();
}
fireEvent(new DialogClosedEvent(DialogResult.OK));
}
/**
* Gets called whenever the Cancel Button is clicked.
*/
@UiHandler("cancelButton")
public void handleCancelButtonClicked(ClickEvent event) {
if (dialogBox != null) {
dialogBox.hide();
}
fireEvent(new DialogClosedEvent(DialogResult.Cancel));
}
@Override
public HandlerRegistration addDialogClosedHandler(DialogClosedHandler handler) {
return super.addHandler(handler, DialogClosedEvent.getType());
}
public void add(Widget w) {
dialogContent.add(w);
}
}
| Java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.