OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 144 | Rev 174 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 144 Rev 156
Line 39... Line 39...
39
import javax.swing.JPanel;
39
import javax.swing.JPanel;
40
import javax.swing.JSeparator;
40
import javax.swing.JSeparator;
41
 
41
 
42
public class TextAreaTicketPanel extends JPanel {
42
public class TextAreaTicketPanel extends JPanel {
43
 
43
 
44
    public TextAreaTicketPanel(SQLRow row) {
44
    public TextAreaTicketPanel(final POSConfiguration conf, SQLRow row) {
45
        super(new GridBagLayout());
45
        super(new GridBagLayout());
46
        GridBagConstraints c = new DefaultGridBagConstraints();
46
        GridBagConstraints c = new DefaultGridBagConstraints();
47
        c.fill = GridBagConstraints.BOTH;
47
        c.fill = GridBagConstraints.BOTH;
48
        c.weightx = 0;
48
        c.weightx = 0;
49
        c.weighty = 0;
49
        c.weighty = 0;
Line 52... Line 52...
52
 
52
 
53
        JButton button = new JButton("Imprimer");
53
        JButton button = new JButton("Imprimer");
54
        button.addActionListener(new ActionListener() {
54
        button.addActionListener(new ActionListener() {
55
            @Override
55
            @Override
56
            public void actionPerformed(ActionEvent e) {
56
            public void actionPerformed(ActionEvent e) {
57
                POSConfiguration.getInstance().print(ticket);
57
                conf.print(ticket);
58
 
-
 
59
            }
58
            }
60
        });
59
        });
61
 
60
 
62
        c.fill = GridBagConstraints.NONE;
61
        c.fill = GridBagConstraints.NONE;
63
        c.anchor = GridBagConstraints.CENTER;
62
        c.anchor = GridBagConstraints.CENTER;
Line 72... Line 71...
72
        final TextAreaTicketPrinter comp = new TextAreaTicketPrinter();
71
        final TextAreaTicketPrinter comp = new TextAreaTicketPrinter();
73
        c.gridy++;
72
        c.gridy++;
74
        c.weighty = 1;
73
        c.weighty = 1;
75
        this.add(comp, c);
74
        this.add(comp, c);
76
 
75
 
77
        ticket.print(comp, POSConfiguration.getInstance().getTicketPrinterConfiguration1().getTicketWidth());
76
        ticket.print(comp, conf.getTicketPrinterConfiguration1().getTicketWidth());
78
    }
77
    }
79
 
78
 
80
    private Ticket createTicket(SQLRow row) {
79
    private Ticket createTicket(SQLRow row) {
81
        final Ticket t;
80
        final Ticket t;
82
        try {
81
        try {