Update of /cvsroot/tn5250j/tn5250j/src/org/tn5250j/settings
In directory sc8-pr-cvs1:/tmp/cvs-serv31510/org/tn5250j/settings
Modified Files:
PrinterAttributesPanel.java
Log Message:
update printer attributes to define margins used for screen prints
Index: PrinterAttributesPanel.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/settings/PrinterAttributesPanel.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PrinterAttributesPanel.java 9 Jul 2003 18:55:40 -0000 1.2
--- PrinterAttributesPanel.java 11 Dec 2003 07:00:47 -0000 1.3
***************
*** 1,84 ****
! package org.tn5250j.settings;
! /**
! * Title: PrinterAttributesPanel
! * Copyright: Copyright (c) 2001
! * Company:
! * @author Kenneth J. Pouncey
! * @version 0.5
! *
! * Description:
! *
! * 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, 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 software; see the file COPYING. If not, write to
! * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
! * Boston, MA 02111-1307 USA
! *
! */
!
! import java.awt.*;
! import javax.swing.*;
!
! import org.tn5250j.tools.*;
! import org.tn5250j.SessionConfig;
!
! public class PrinterAttributesPanel extends AttributesPanel {
!
! JCheckBox defaultPrinter;
!
! public PrinterAttributesPanel(SessionConfig config ) {
! super(config,"Printer");
! }
!
! /**Component initialization*/
! public void initPanel() throws Exception {
!
! setLayout(new BorderLayout());
! contentPane = new JPanel();
! contentPane.setLayout(new BoxLayout(contentPane,BoxLayout.Y_AXIS));
! add(contentPane,BorderLayout.NORTH);
!
! // define ppPanel panel
! JPanel ppp = new JPanel();
! ppp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.print")));
! defaultPrinter = new JCheckBox(LangTool.getString("sa.defaultPrinter"));
!
! if (getStringProperty("defaultPrinter").equals("Yes"))
! defaultPrinter.setSelected(true);
!
! ppp.add(defaultPrinter);
!
! contentPane.add(ppp);
!
! }
!
! public void save() {
!
! }
!
! public void applyAttributes() {
!
! if (defaultPrinter.isSelected()) {
! changes.firePropertyChange(this,"defaultPrinter",
! getStringProperty("defaultPrinter"),
! "Yes");
! setProperty("defaultPrinter","Yes");
! }
! else {
! changes.firePropertyChange(this,"defaultPrinter",
! getStringProperty("defaultPrinter"),
! "No");
! setProperty("defaultPrinter","No");
! }
!
! }
}
--- 1,182 ----
! package org.tn5250j.settings;
! /**
! * Title: PrinterAttributesPanel
! * Copyright: Copyright (c) 2001
! * Company:
! * @author Kenneth J. Pouncey
! * @version 0.5
! *
! * Description:
! *
! * 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, 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 software; see the file COPYING. If not, write to
! * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
! * Boston, MA 02111-1307 USA
! *
! */
!
! import java.awt.*;
! import javax.swing.*;
!
! import org.tn5250j.tools.*;
! import org.tn5250j.SessionConfig;
!
! public class PrinterAttributesPanel extends AttributesPanel {
!
! JCheckBox defaultPrinter;
! JTextField leftMargin;
! JTextField rightMargin;
! JTextField topMargin;
! JTextField bottomMargin;
!
! public PrinterAttributesPanel(SessionConfig config ) {
! super(config,"Printer");
! }
!
! /**Component initialization*/
! public void initPanel() throws Exception {
!
! setLayout(new BorderLayout());
! contentPane = new JPanel();
! contentPane.setLayout(new BoxLayout(contentPane,BoxLayout.Y_AXIS));
! add(contentPane,BorderLayout.NORTH);
!
! // define ppPanel panel
! JPanel ppp = new JPanel();
! ppp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.print")));
! defaultPrinter = new JCheckBox(LangTool.getString("sa.defaultPrinter"));
!
! if (getStringProperty("defaultPrinter").equals("Yes"))
! defaultPrinter.setSelected(true);
!
! ppp.add(defaultPrinter);
!
! topMargin = new JTextField("10.0",5);
! leftMargin = new JTextField("4.0",5);
! rightMargin = new JTextField("4.0",5);
! bottomMargin = new JTextField("15.0",5);
!
! if (getStringProperty("leftMargin").length() != 0)
! leftMargin.setText(getStringProperty("leftMargin"));
! if (getStringProperty("rightMargin").length() != 0)
! rightMargin.setText(getStringProperty("rightMargin"));
! if (getStringProperty("topMargin").length() != 0)
! topMargin.setText(getStringProperty("topMargin"));
! if (getStringProperty("bottomMargin").length() != 0)
! bottomMargin.setText(getStringProperty("bottomMargin"));
!
! // define page panel
! JPanel page = new JPanel();
! page.setBorder(BorderFactory.createTitledBorder(
! LangTool.getString("sa.pageMargins")));
!
! page.setLayout(new AlignLayout(6,5,5));
!
!
! //----------------------------------------------
! page.add(new JLabel(" "));
! page.add(new JLabel(" "));
!
! page.add(new JLabel(LangTool.getString("sa.topMargin")));
!
! page.add(new JLabel(" "));
! page.add(new JLabel(" "));
! page.add(new JLabel(" "));
!
! //----------------------------------------------
!
! page.add(new JLabel(" "));
! page.add(new JLabel(" "));
!
! page.add(topMargin);
!
! page.add(new JLabel(" "));
! page.add(new JLabel(" "));
! page.add(new JLabel(" "));
!
! //----------------------------------------------
!
! page.add(new JLabel(LangTool.getString("sa.leftMargin")));
! page.add(leftMargin);
!
! page.add(new JLabel(" "));
!
! page.add(rightMargin);
! page.add(new JLabel(LangTool.getString("sa.rightMargin")));
!
! page.add(new JLabel(" "));
! //----------------------------------------------
! page.add(new JLabel(" "));
! page.add(new JLabel(" "));
!
! page.add(bottomMargin);
!
! page.add(new JLabel(" "));
! page.add(new JLabel(" "));
! page.add(new JLabel(" "));
! //----------------------------------------------
!
! page.add(new JLabel(" "));
! page.add(new JLabel(" "));
!
! page.add(new JLabel(LangTool.getString("sa.bottomMargin")));
!
! page.add(new JLabel(" "));
! page.add(new JLabel(" "));
! page.add(new JLabel(" "));
! //----------------------------------------------
!
! contentPane.add(ppp);
! contentPane.add(page);
! }
!
! public void save() {
!
! }
!
! public void applyAttributes() {
!
! if (defaultPrinter.isSelected()) {
! changes.firePropertyChange(this,"defaultPrinter",
! getStringProperty("defaultPrinter"),
! "Yes");
! setProperty("defaultPrinter","Yes");
! }
! else {
! changes.firePropertyChange(this,"defaultPrinter",
! getStringProperty("defaultPrinter"),
! "No");
! setProperty("defaultPrinter","No");
! }
!
! changes.firePropertyChange(this,"leftMargin",
! getStringProperty("leftMargin"),
! leftMargin.getText());
! setProperty("leftMargin",leftMargin.getText());
!
! changes.firePropertyChange(this,"rightMargin",
! getStringProperty("rightMargin"),
! rightMargin.getText());
! setProperty("rightMargin",rightMargin.getText());
!
! changes.firePropertyChange(this,"topMargin",
! getStringProperty("topMargin"),
! topMargin.getText());
! setProperty("topMargin",topMargin.getText());
!
! changes.firePropertyChange(this,"bottomMargin",
! getStringProperty("bottomMargin"),
! bottomMargin.getText());
! setProperty("bottomMargin",bottomMargin.getText());
! }
}
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.