package com.vgo.movie.ecran;
import java.awt.Dimension;
import java.awt.Toolkit;
import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.SwingConstants;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableColumn;
import javax.swing.table.TableModel;
import com.vgo.movie.thread.DetailFilmThread;
import com.vgo.movie.util.Libelle;
/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class DetailFilm extends javax.swing.JDialog {
/**
*
*/
private static final long serialVersionUID = 1L;
private JLabel jLabelNom;
private JLabel jValeurRealisateur;
private JPanel jPanelImage1;
private JPanel jPanelImage2;
private JPanel jPanelImage3;
private JLabel jLabelInformationFournie;
private JLabel jValeurDateSortie;
private JLabel jLabelDateSortie;
private JLabel jValeurRecompenses;
private JLabel jLabelRecompenses;
private JLabel jValeurDuree;
private JLabel jValeurNomImdb;
private JPanel jPanelLogoImdb;
private JTable jTableActeurs;
private JScrollPane jScrollPane1;
private JLabel jValeurGenre;
private JLabel jLabelGenre;
private JLabel jLabelDuree;
private JLabel jValeurPays;
private JLabel jLabelPays;
private JProgressBar jProgressBar;
private JLabel jLabelRealisateur;
private JLabel jValeurNom;
private String nomFilm;
/**
* Auto-generated main method to display this JDialog
*/
public DetailFilm(JFrame frame, String tmpNomFilm) {
super(frame);
nomFilm = tmpNomFilm;
initGUI();
this.setTitle(nomFilm);
initFilm();
initLibelle();
}
private void initGUI() {
try {
{
getContentPane().setLayout(null);
this.setResizable(false);
}
{
jLabelNom = new JLabel();
getContentPane().add(jLabelNom);
jLabelNom.setText("Nom");
jLabelNom.setLayout(null);
jLabelNom.setBounds(7, 7, 42, 28);
jLabelNom.setFont(new java.awt.Font("Tahoma",1,12));
}
{
jValeurNom = new JLabel();
getContentPane().add(jValeurNom);
jValeurNom.setLayout(null);
jValeurNom.setFont(new java.awt.Font("Tahoma",2,12));
jValeurNom.setBounds(28, 154, 203, 28);
jValeurNom.setVisible(false);
}
{
jLabelRealisateur = new JLabel();
getContentPane().add(jLabelRealisateur);
jLabelRealisateur.setText("R�alisateur");
jLabelRealisateur.setFont(new java.awt.Font("Tahoma",1,12));
jLabelRealisateur.setLayout(null);
jLabelRealisateur.setBounds(7, 35, 84, 28);
}
{
jValeurRealisateur = new JLabel();
getContentPane().add(jValeurRealisateur);
jValeurRealisateur.setLayout(null);
jValeurRealisateur.setFont(new java.awt.Font("Tahoma",2,12));
jValeurRealisateur.setBounds(98, 35, 196, 28);
}
{
jProgressBar = new JProgressBar();
getContentPane().add(jProgressBar);
jProgressBar.setBounds(7, 581, 700, 14);
}
{
jLabelPays = new JLabel();
getContentPane().add(jLabelPays);
jLabelPays.setText("Pays");
jLabelPays.setFont(new java.awt.Font("Tahoma",1,12));
jLabelPays.setLayout(null);
jLabelPays.setBounds(7, 63, 84, 28);
}
{
jValeurPays = new JLabel();
getContentPane().add(jValeurPays);
jValeurPays.setLayout(null);
jValeurPays.setFont(new java.awt.Font("Tahoma",2,12));
jValeurPays.setBounds(98, 63, 203, 28);
}
{
jLabelDuree = new JLabel();
getContentPane().add(jLabelDuree);
jLabelDuree.setText("Dur�e");
jLabelDuree.setFont(new java.awt.Font("Tahoma",1,12));
jLabelDuree.setLayout(null);
jLabelDuree.setBounds(343, 35, 84, 28);
}
{
jValeurDuree = new JLabel();
getContentPane().add(jValeurDuree);
jValeurDuree.setLayout(null);
jValeurDuree.setFont(new java.awt.Font("Tahoma",2,12));
jValeurDuree.setBounds(455, 35, 238, 28);
}
{
jLabelGenre = new JLabel();
getContentPane().add(jLabelGenre);
jLabelGenre.setText("Genre");
jLabelGenre.setFont(new java.awt.Font("Tahoma",1,12));
jLabelGenre.setLayout(null);
jLabelGenre.setBounds(343, 63, 84, 28);
}
{
jValeurGenre = new JLabel();
getContentPane().add(jValeurGenre);
jValeurGenre.setLayout(null);
jValeurGenre.setFont(new java.awt.Font("Tahoma",2,12));
jValeurGenre.setBounds(434, 63, 273, 28);
}
{
jLabelRecompenses = new JLabel();
getContentPane().add(jLabelRecompenses);
jLabelRecompenses.setText("Recompenses");
jLabelRecompenses.setFont(new java.awt.Font("Tahoma",1,12));
jLabelRecompenses.setLayout(null);
jLabelRecompenses.setBounds(7, 91, 84, 28);
}
{
jValeurRecompenses = new JLabel();
getContentPane().add(jValeurRecompenses);
jValeurRecompenses.setLayout(null);
jValeurRecompenses.setFont(new java.awt.Font("Tahoma",2,12));
jValeurRecompenses.setBounds(98, 91, 483, 28);
}
{
jLabelDateSortie = new JLabel();
getContentPane().add(jLabelDateSortie);
jLabelDateSortie.setText("Date de sortie");
jLabelDateSortie.setFont(new java.awt.Font("Tahoma",1,12));
jLabelDateSortie.setLayout(null);
jLabelDateSortie.setBounds(343, 7, 105, 28);
}
{
jValeurDateSortie = new JLabel();
getContentPane().add(jValeurDateSortie);
jValeurDateSortie.setLayout(null);
jValeurDateSortie.setFont(new java.awt.Font("Tahoma",2,12));
jValeurDateSortie.setBounds(455, 7, 238, 28);
}
{
jPanelLogoImdb = new JPanel();
getContentPane().add(jPanelLogoImdb);
jPanelLogoImdb.setBounds(539, 483, 168, 91);
jPanelLogoImdb.setBorder(BorderFactory.createTitledBorder(""));
}
{
jLabelInformationFournie = new JLabel();
getContentPane().add(jLabelInformationFournie);
jLabelInformationFournie.setText("Informations fournie par : ");
jLabelInformationFournie.setBounds(539, 455, 168, 28);
jLabelInformationFournie.setFont(new java.awt.Font("Tahoma",2,11));
jLabelInformationFournie.setHorizontalTextPosition(SwingConstants.CENTER);
jLabelInformationFournie.setHorizontalAlignment(SwingConstants.RIGHT);
}
{
jPanelImage3 = new JPanel();
getContentPane().add(jPanelImage3);
jPanelImage3.setBorder(BorderFactory.createTitledBorder(""));
jPanelImage3.setBounds(364, 469, 168, 105);
}
{
jPanelImage2 = new JPanel();
getContentPane().add(jPanelImage2);
jPanelImage2.setBorder(BorderFactory.createTitledBorder(""));
jPanelImage2.setBounds(189, 469, 168, 105);
}
{
jPanelImage1 = new JPanel();
getContentPane().add(jPanelImage1);
jPanelImage1.setBorder(BorderFactory.createTitledBorder(""));
jPanelImage1.setBounds(14, 469, 168, 105);
}
{
jValeurNomImdb = new JLabel();
getContentPane().add(jValeurNomImdb);
jValeurNomImdb.setFont(new java.awt.Font("Tahoma",2,12));
jValeurNomImdb.setLayout(null);
jValeurNomImdb.setBounds(99, 7, 203, 28);
}
{
jScrollPane1 = new JScrollPane();
getContentPane().add(jScrollPane1);
jScrollPane1.setBounds(7, 126, 700, 329);
{
TableModel jTableActeursModel = new DefaultTableModel(
new String[][] {},
new String[] { "Photos", "Acteur", "Personnage" }){
private static final long serialVersionUID = 1L;
public boolean isCellEditable(int row, int col) {
return false; // toutes les cellules seront non editables
}
public Class<?> getColumnClass(int column){
Class returnValue;
if((column >= 0) && (column < getColumnCount())){
returnValue = getValueAt(0, column).getClass();
} else{
returnValue = Object.class;
}
return returnValue;
}
};
jTableActeurs = new JTable();
jTableActeurs.setAutoCreateRowSorter(true);
jScrollPane1.setViewportView(jTableActeurs);
jTableActeurs.setModel(jTableActeursModel);
jTableActeurs.setRowHeight(30);
TableColumn column = null;
column = getJTableActeurs().getColumn("Photos");
column.setPreferredWidth(30);
column = getJTableActeurs().getColumn("Acteur");
column.setPreferredWidth(150);
column = getJTableActeurs().getColumn("Personnage");
column.setPreferredWidth(149);
}
}
this.setSize(722, 636);
} catch (Exception e) {
e.printStackTrace();
}
}
private void initFilm() {
setValeurNom(nomFilm);
DetailFilmThread tmpThread = new DetailFilmThread(this);
tmpThread.start();
}
private void initLibelle() {
jLabelNom.setText(Libelle.getLibelle("titreColonneNom"));
jLabelDateSortie.setText(Libelle.getLibelle("dateSortie"));
jLabelRealisateur.setText(Libelle.getLibelle("realisateur"));
jLabelDuree.setText(Libelle.getLibelle("duree"));
jLabelPays.setText(Libelle.getLibelle("pays"));
jLabelGenre.setText(Libelle.getLibelle("genre"));
jLabelRecompenses.setText(Libelle.getLibelle("recompenses"));
jLabelInformationFournie.setText(Libelle.getLibelle("informationsFournies"));
}
public JLabel getJValeurNom() {
return jValeurNom;
}
public JProgressBar getJProgressBar() {
return jProgressBar;
}
public void setValeurNom(String tmpString) {
jValeurNom.setText(tmpString);
}
public void setValeurRealisateur(String tmpString) {
jValeurRealisateur.setText(tmpString);
}
public void setValeurPays(String tmpString) {
jValeurPays.setText(tmpString);
}
public void setValeurDuree(String tmpString) {
jValeurDuree.setText(tmpString);
}
public void setValeurGenre(String tmpString) {
jValeurGenre.setText(tmpString);
}
public void setValeurRecompenses(String tmpString) {
jValeurRecompenses.setText(tmpString);
}
public void setValeurDateSortie(String tmpString) {
jValeurDateSortie.setText(tmpString);
}
public void setValeurNomIdmb(String tmpString) {
jValeurNomImdb.setText(tmpString);
}
public void afficherLogoImdb(String path){
jPanelLogoImdb.add( this.add(new ImageResized(Toolkit.getDefaultToolkit().getImage(path),new Dimension(jPanelLogoImdb.getWidth(),jPanelLogoImdb.getHeight()))));
}
public void afficherImage1(String path){
jPanelImage1.add( this.add(new ImageResized(Toolkit.getDefaultToolkit().getImage(path),new Dimension(jPanelImage1.getWidth(),jPanelImage1.getHeight()))));
}
public void afficherImage2(String path){
jPanelImage2.add( this.add(new ImageResized(Toolkit.getDefaultToolkit().getImage(path),new Dimension(jPanelImage2.getWidth(),jPanelImage2.getHeight()))));
}
public void afficherImage3(String path){
jPanelImage3.add( this.add(new ImageResized(Toolkit.getDefaultToolkit().getImage(path),new Dimension(jPanelImage3.getWidth(),jPanelImage3.getHeight()))));
}
public JTable getJTableActeurs(){
return jTableActeurs;
}
}