1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
|
public class HealthPanel extends DetailsPanel {
public HealthPanel(int val, int pages) {
super(val, MyConstants.HEALTH_FOLDER, pages);
initialize();
}
private void initialize() {
int i;
// First, we need to set up the page-related buttons
if(page == 0){
retButton.setText("Accueil");
} else {
retButton.setText("Retour");
} //Le positionnement de retBouton est gere dans DetailsPanel
//Now, we need to initialize the entry data flow
initData();
// We create the different pages panels
scrollPane.setLayout(null);
// We add the different components
if(inPanel[page] == null){
switch(page){
...
case 6: inPanel[page] = new Recap1Panel(person, this);
//Les trois bouttons suivants sont definis dans DetailsPanel
this.submitButton.setVisible(true);
this.prevButton.setVisible(true);
this.nextButton.setVisible(true);
break;
...
default: break;
}
inPanel[page].setBounds(0, 0, this.contentWidth, this.contentHeight);
inPanel[page].setLayout(null);
inPanel[page].setBackground(MyWindow.bs_bg);
}
scrollPane.setBounds(0, 0, this.contentWidth, this.contentHeight);
scrollPane.setViewportView(inPanel[page]);
this.add(scrollPane, null);
attach.reload(); /*attach est un autre JPanel qui se positionne a droite du inPanel[panel]
On s'en fout ici. */
}
public void submit(){
inPanel[page].submit();
inPanel[page].setVisible(false);
inPanel[page] = null;
initialize();
}
public void reload(){
inPanel[page].setVisible(false);
inPanel[page] = null;
page = 0;
initialize();
}
public void redo(int val, boolean submit){
if(MyWindow.edit) { // Si en mode editable...
submitButton.setEnabled(true);
}
else {
submitButton.setEnabled(false); /* Si on est en mode consultation, le bouton valider doit
* s'afficher en grisé et non-actif */
}
if(submit) {
inPanel[page].submit(); //submit est-il autorise?
}
inPanel[page].setVisible(false);
inPanel[page] = null;
this.page = val;
initialize();
}
} //HealthPanel |
Partager