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 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
|
public class InvoiceViewerPanel extends JPanel implements ActionListener, MouseListener,
SignActionListener, SelectionAreaListener {
//declaration des variable
private String _CLASSNAME = this.getClass().getName();
private String mvinstall = null;
private String temppath = null;
public InvoiceViewerPanel() {
mvinstall = ResourceTools.getConfigFolder();
temppath = System.getProperty("user.home") + File.separator + mvinstall + File.separator
+ "Temp";
FileTools.createDirectory(temppath);
getImages();
getLabels();
doGUI();
}
public InvoiceViewerPanel(JFrame aParent) {
this();
parent = aParent;
}
public InvoiceViewerPanel(JFrame aParent, InvoiceViewerBean ivb) {
mvinstall = ResourceTools.getConfigFolder();
temppath = System.getProperty("user.home") + File.separator + mvinstall + File.separator
+ "Temp";
FileTools.createDirectory(temppath);
getImages();
getLabels();
_ivb = ivb;
parent = aParent;
doGUI();
}
private void getImages() {
Properties p = null;
p = PropsTools.getProperties(new StringBuffer(_CLASSNAME).append(".pics").toString());
if (p != null) {
_ico_reward = p.getProperty(_ico_reward);
_ico_back = p.getProperty(_ico_back);
_ico_next = p.getProperty(_ico_next);
_ico_forward = p.getProperty(_ico_forward);
_ico_info = p.getProperty(_ico_info);
_ico_statut = p.getProperty(_ico_statut);
_ico_pdf = p.getProperty(_ico_pdf);
_ico_sign = p.getProperty(_ico_sign);
_ima_fond = p.getProperty(_ima_fond);
p = null;
}
}
private void getLabels() {
Properties p = null;
p = PropsTools.getProperties(new StringBuffer(_CLASSNAME).append(".labs").toString());
if (p != null) {
_i18n_invoice_title = p.getProperty(_i18n_invoice_title);
_i18n_reward = p.getProperty(_i18n_reward);
_i18n_back = p.getProperty(_i18n_back);
_i18n_next = p.getProperty(_i18n_next);
_i18n_forward = p.getProperty(_i18n_forward);
_i18n_info1 = p.getProperty(_i18n_info1);
_i18n_sign = p.getProperty(_i18n_sign);
_i18n_sign_tooltip = p.getProperty(_i18n_sign_tooltip);
_i18n_xml = p.getProperty(_i18n_xml);
_i18n_text = p.getProperty(_i18n_text);
_i18n_title_error = p.getProperty(_i18n_title_error);
_i18n_error_message = p.getProperty(_i18n_error_message);
_i18n_connection_error_message = p.getProperty(_i18n_connection_error_message);
_i18n_distant_folder_error_message = p.getProperty(_i18n_distant_folder_error_message);
_i18n_encapsulation_error_message = p.getProperty(_i18n_encapsulation_error_message);
_i18n_parsing_error_message = p.getProperty(_i18n_parsing_error_message);
_i18n_pattern_error_message = p.getProperty(_i18n_pattern_error_message);
_i18n_protocol_setup_error_message = p.getProperty(_i18n_protocol_setup_error_message);
_i18n_setup_error_message = p.getProperty(_i18n_setup_error_message);
_i18n_upload_error_message = p.getProperty(_i18n_upload_error_message);
_i18n_title_success = p.getProperty(_i18n_title_success);
_i18n_invoice_upload_success_message = p.getProperty(_i18n_invoice_upload_success_message);
_i18n_title_Qweeby = p.getProperty(_i18n_title_Qweeby);
_i18n_no = p.getProperty(_i18n_no);
_i18n_yes = p.getProperty(_i18n_yes);
_i18n_close_question = p.getProperty(_i18n_close_question);
p = null;
}
}
private void doGUI() {
...
...
statuts_bt = GUITools.createButtonImage(_ico_statut, null, "Etats et Statuts", -1, -1, false);
statuts_bt.addActionListener(this);
statuts_bt.addMouseListener(this);
help_bt = GUITools.createButtonImage(_ico_info, null, _i18n_info1, -1, -1, false);
help_bt.addActionListener(this);
help_bt.addMouseListener(this);
....
} // fin de la methode DoGUI()
public void paintComponent(Graphics g) {
Image imag = Toolkit.getDefaultToolkit().getImage(_ima_fond);
g.drawImage(imag, 0, 0, getWidth(), getHeight(), this);
}
...
...
public void mouseEntered(MouseEvent e) {
Object source = null;
source = e.getSource();
if (source == help_bt) {
help_bt.setBorderPainted(true);
} else if (source == statuts_bt) {
statuts_bt.setBorderPainted(true);
}
}
public void mouseExited(MouseEvent e) {
Object source = null;
source = e.getSource();
if (source == help_bt) {
help_bt.setBorderPainted(false);
} else if (source == statuts_bt) {
statuts_bt.setBorderPainted(false);
}
}
....
}//fin de la classe InvoiceViewerPanel |
Partager