OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 156 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 156 Rev 174
Line 14... Line 14...
14
 package org.openconcerto.erp.core.sales.pos.ui;
14
 package org.openconcerto.erp.core.sales.pos.ui;
15
 
15
 
16
import org.openconcerto.erp.config.ComptaPropsConfiguration;
16
import org.openconcerto.erp.config.ComptaPropsConfiguration;
17
import org.openconcerto.erp.config.Gestion;
17
import org.openconcerto.erp.config.Gestion;
18
import org.openconcerto.erp.core.sales.pos.POSConfiguration;
18
import org.openconcerto.erp.core.sales.pos.POSConfiguration;
19
import org.openconcerto.erp.core.sales.pos.model.Article;
-
 
20
import org.openconcerto.erp.core.sales.pos.model.Client;
19
import org.openconcerto.erp.core.sales.pos.model.Client;
21
import org.openconcerto.erp.core.sales.pos.model.DBState;
20
import org.openconcerto.erp.core.sales.pos.model.DBState;
22
import org.openconcerto.erp.core.sales.pos.model.ReceiptCode;
21
import org.openconcerto.erp.core.sales.pos.model.ReceiptCode;
23
import org.openconcerto.erp.core.sales.pos.model.RegisterDB;
22
import org.openconcerto.erp.core.sales.pos.model.RegisterDB;
24
import org.openconcerto.erp.core.sales.pos.model.RegisterFiles;
23
import org.openconcerto.erp.core.sales.pos.model.RegisterFiles;
25
import org.openconcerto.erp.core.sales.pos.model.RegisterLog;
24
import org.openconcerto.erp.core.sales.pos.model.RegisterLog;
26
import org.openconcerto.erp.core.sales.pos.model.RegisterState;
25
import org.openconcerto.erp.core.sales.pos.model.RegisterState;
27
import org.openconcerto.erp.core.sales.pos.model.RegisterState.Status;
26
import org.openconcerto.erp.core.sales.pos.model.RegisterState.Status;
28
import org.openconcerto.erp.core.sales.pos.model.Ticket;
27
import org.openconcerto.erp.core.sales.pos.model.Ticket;
-
 
28
import org.openconcerto.erp.core.sales.pos.model.TicketItem;
29
import org.openconcerto.erp.utils.TM;
29
import org.openconcerto.erp.utils.TM;
30
import org.openconcerto.sql.PropsConfiguration;
30
import org.openconcerto.sql.PropsConfiguration;
31
import org.openconcerto.sql.RemoteShell;
31
import org.openconcerto.sql.RemoteShell;
32
import org.openconcerto.sql.element.SQLElementDirectory;
32
import org.openconcerto.sql.element.SQLElementDirectory;
33
import org.openconcerto.sql.model.SQLBase;
33
import org.openconcerto.sql.model.SQLBase;
Line 223... Line 223...
223
 
223
 
224
            SwingUtilities.invokeLater(new Runnable() {
224
            SwingUtilities.invokeLater(new Runnable() {
225
                public void run() {
225
                public void run() {
226
 
226
 
227
                    try {
227
                    try {
228
                        // UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
-
 
229
                    } catch (Exception e) {
-
 
230
                        e.printStackTrace();
-
 
231
                    }
-
 
232
                    try {
-
 
233
                        CaisseFrame f = new CaisseFrame(posConf, conf, registerFiles, registerDB);
228
                        CaisseFrame f = new CaisseFrame(posConf, conf, registerFiles, registerDB);
234
                        f.setUndecorated(true);
229
                        f.setUndecorated(true);
235
                        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
230
                        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
236
 
231
 
237
                        f.pack();
232
                        f.pack();
Line 246... Line 241...
246
                        } else {
241
                        } else {
247
                            f.setSize(new Dimension(screenSize.getSize().width - f.getX(), screenSize.getSize().height - f.getY()));
242
                            f.setSize(new Dimension(screenSize.getSize().width - f.getX(), screenSize.getSize().height - f.getY()));
248
                        }
243
                        }
249
                        System.out.println("Affichage de l'interface");
244
                        System.out.println("Affichage de l'interface");
250
                        f.setVisible(true);
245
                        f.setVisible(true);
251
                        if (screenSize.getWidth() < 1280 || screenSize.getHeight() < 720) {
246
                        if (screenSize.getWidth() < 1024 || screenSize.getHeight() < 720) {
252
                            JOptionPane.showMessageDialog(f,
247
                            JOptionPane.showMessageDialog(f,
253
                                    "La résolution de votre écran est trop faible.\nLa largeur doit être au minium de 1280 pixels.\nLa hauteur doit être au minium de 720 pixels.");
248
                                    "La résolution de votre écran est trop faible.\nLa largeur doit être au minium de 1024 pixels.\nLa hauteur doit être au minium de 720 pixels.");
254
                        }
249
                        }
255
                    } catch (Throwable e) {
250
                    } catch (Throwable e) {
256
                        // Catch throwable to be able to see NoClassDefFound and other hard issues
251
                        // Catch throwable to be able to see NoClassDefFound and other hard issues
257
                        ExceptionHandler.handle("Erreur d'initialisation de la caisse (main)", e);
252
                        ExceptionHandler.handle("Erreur d'initialisation de la caisse (main)", e);
258
                    }
253
                    }
Line 513... Line 508...
513
        this.getGlassPane().setVisible(true);
508
        this.getGlassPane().setVisible(true);
514
        this.validate();
509
        this.validate();
515
        this.repaint();
510
        this.repaint();
516
    }
511
    }
517
 
512
 
518
    public void showPriceEditor(Article article, CaisseControler caisseControler) {
513
    public void showPriceEditor(TicketItem item, CaisseControler caisseControler) {
519
        getControler().disableBarcodeReader();
514
        getControler().disableBarcodeReader();
520
        System.out.println("CaisseFrame.showPriceEditor()");
515
        System.out.println("CaisseFrame.showPriceEditor()");
521
        this.invalidate();
516
        this.invalidate();
522
        final PriceEditorPanel panel = new PriceEditorPanel(this, article);
517
        final PriceEditorPanel panel = new PriceEditorPanel(this, item);
523
 
518
 
524
        final POSGlassPane glassPane2 = new POSGlassPane(panel, (getWidth() - panel.getPreferredSize().width) / 2, 100) {
519
        final POSGlassPane glassPane2 = new POSGlassPane(panel, (getWidth() - panel.getPreferredSize().width) / 2, 100) {
525
            @Override
520
            @Override
526
            public void mousePressed(MouseEvent e) {
521
            public void mousePressed(MouseEvent e) {
527
                Point containerPoint = SwingUtilities.convertPoint(this, e.getPoint(), panel);
522
                Point containerPoint = SwingUtilities.convertPoint(this, e.getPoint(), panel);
Line 583... Line 578...
583
        getGlassPane().setVisible(false);
578
        getGlassPane().setVisible(false);
584
        super.setContentPane(contentPane);
579
        super.setContentPane(contentPane);
585
        this.validate();
580
        this.validate();
586
        this.repaint();
581
        this.repaint();
587
    }
582
    }
-
 
583
 
-
 
584
    public void showPostalCodeFrame(CaissePanel caissePanel) {
-
 
585
        System.out.println("CaisseFrame.showPostalCodeFrame()");
-
 
586
        this.invalidate();
-
 
587
        final PostalCodeEditorPanel panel = new PostalCodeEditorPanel(this, caissePanel);
-
 
588
        final POSGlassPane glassPane2 = new POSGlassPane(panel, (getWidth() - panel.getPreferredSize().width) / 2, 100);
-
 
589
        this.setGlassPane(glassPane2);
-
 
590
        this.getGlassPane().setVisible(true);
-
 
591
        this.validate();
-
 
592
        this.repaint();
-
 
593
 
-
 
594
    }
588
}
595
}