📄 jticketsbagsimple.java
字号:
// Tina POS is a point of sales application designed for touch screens.// Copyright (C) 2005 Adrian Romero Corchado.// http://sourceforge.net/projects/tinapos//// This program is free software; you can redistribute it and/or modify// it under the terms of the GNU General Public License as published by// the Free Software Foundation; either version 2 of the License, or// (at your option) any later version.//// This program is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the// GNU General Public License for more details.//// You should have received a copy of the GNU General Public License// along with this program; if not, write to the Free Software// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USApackage net.adrianromero.tpv.panelsales.simple;import net.adrianromero.tpv.forms.*; import javax.swing.*;import net.adrianromero.tpv.panelsales.*;public class JTicketsBagSimple extends JTicketsBag { private TicketsEditor m_panelticket; /** Creates new form JTicketsBagSimple */ public JTicketsBagSimple(AppView oApp, TicketsEditor panelticket) { super(oApp); m_panelticket = panelticket; initComponents(); } public void activate() { m_panelticket.setActiveTicket(createTicketModel(), null); } public boolean deactivate() { m_panelticket.setActiveTicket(null, null); return true; } public void saveTicket() { saveTicket(m_panelticket.getActiveTicket()); } public void cancelTicket() { m_panelticket.setActiveTicket(createTicketModel(), null); } protected JComponent getBagComponent() { return this; } protected JComponent getNullComponent() { return new JPanel(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ private void initComponents() {//GEN-BEGIN:initComponents m_jDelTicket = new javax.swing.JButton(); setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT)); m_jDelTicket.setText(AppLocal.getIntString("Button.DeleteTicket")); m_jDelTicket.setFocusPainted(false); m_jDelTicket.setFocusable(false); m_jDelTicket.setMargin(new java.awt.Insets(8, 14, 8, 14)); m_jDelTicket.setRequestFocusEnabled(false); m_jDelTicket.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jDelTicketActionPerformed(evt); } }); add(m_jDelTicket); }//GEN-END:initComponents private void m_jDelTicketActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jDelTicketActionPerformed int res = JOptionPane.showConfirmDialog(this, AppLocal.getIntString("message.wannadelete"), AppLocal.getIntString("title.editor"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (res == JOptionPane.YES_OPTION) { cancelTicket(); } }//GEN-LAST:event_m_jDelTicketActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton m_jDelTicket; // End of variables declaration//GEN-END:variables }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -