Statistics
| Revision:

root / trunk / applications / appgvSIG / src / com / iver / cit / gvsig / gui / preferencespage / PrintPropertiesPage.java @ 8142

History | View | Annotate | Download (4.75 KB)

1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *  Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Ib??ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *      +34 963862235
28
 *   gvsig@gva.es
29
 *      www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41

    
42
/* CVS MESSAGES:
43
*
44
* $Id: PrintPropertiesPage.java 8142 2006-10-18 07:59:46Z jaume $
45
* $Log$
46
* Revision 1.1  2006-10-18 07:57:47  jaume
47
* *** empty log message ***
48
*
49
*
50
*/
51
package com.iver.cit.gvsig.gui.preferencespage;
52

    
53
import java.awt.Dimension;
54
import java.awt.GridLayout;
55

    
56
import javax.swing.ButtonGroup;
57
import javax.swing.ImageIcon;
58
import javax.swing.JCheckBox;
59
import javax.swing.JLabel;
60
import javax.swing.JPanel;
61
import javax.swing.JRadioButton;
62
import javax.swing.JTextField;
63

    
64
import com.iver.andami.PluginServices;
65
import com.iver.andami.preferences.AbstractPreferencePage;
66
import com.iver.andami.preferences.StoreException;
67

    
68
public class PrintPropertiesPage extends AbstractPreferencePage{
69

    
70
        private static final boolean FACTORY_DEFAULT_LANDSCAPED_PAGE = true;
71
        protected static String id = PrintPropertiesPage.class.getName();
72
        private ImageIcon icon;
73
        private JRadioButton rdBtnPortraitPage;
74
        private JRadioButton rdBtnLandscapePage;
75
        private JCheckBox chkCustomMargins;
76
        private JTextField txtTopMargin;
77
        private JTextField txtLeftMargin;
78
        private JTextField txtBottomMargin;
79
        private JTextField txtRightMargin;
80

    
81
        public PrintPropertiesPage() {
82
                super();
83
                setParentID(LayoutPage.class.getName());
84
                icon = new ImageIcon(this.getClass().getClassLoader().getResource("images/prepare-page.png"));
85
                rdBtnPortraitPage = new JRadioButton(PluginServices.getText(this, "options.layout.paper_properties.portrait"));
86
                ImageIcon portrait = new ImageIcon(this.getClass().
87
                                                getClassLoader().getResource("images/portrait-page.png"));
88
                rdBtnLandscapePage = new JRadioButton(PluginServices.getText(this, "options.layout.paper_properties.landscaped"));
89
                ImageIcon landscape = new ImageIcon(this.getClass().
90
                                                getClassLoader().getResource("images/landscape-page.png"));
91

    
92
                ButtonGroup group = new ButtonGroup();
93
                group.add(rdBtnLandscapePage);
94
                group.add(rdBtnPortraitPage);
95

    
96
                JPanel aux = new JPanel(new GridLayout(2,2,10,0));
97
                aux.setPreferredSize(new Dimension(200, 150));
98
                aux.setSize(200, 150);
99
                aux.add(new JLabel(landscape));
100
                aux.add(new JLabel(portrait));
101
                aux.add(rdBtnLandscapePage);
102
                aux.add(rdBtnPortraitPage);
103

    
104
                addComponent(new JLabel(PluginServices.
105
                        getText(this, "options.layout.paper_properties.paper_direction")));
106
                addComponent("", aux);
107
                addComponent(chkCustomMargins = new JCheckBox(PluginServices.getText(this, "personalizar_margenes")));
108

    
109
                JPanel aux2 = new JPanel(new GridLayout(2, 4, 10, 3));
110
                aux2.add(new JLabel(PluginServices.getText(this, "Superior")));
111
                aux2.add(txtTopMargin = new JTextField(10));
112
                aux2.add(new JLabel(PluginServices.getText(this, "Izquierdo")));
113
                aux2.add(txtLeftMargin = new JTextField(10));
114
                aux2.add(new JLabel(PluginServices.getText(this, "Inferior")));
115
                aux2.add(txtBottomMargin = new JTextField(10));
116
                aux2.add(new JLabel(PluginServices.getText(this, "Derecho")));
117
                aux2.add(txtRightMargin = new JTextField(10));
118
                addComponent("", aux2);
119
        }
120

    
121
        public void storeValues() throws StoreException {
122
                // TODO Auto-generated method stub
123

    
124
        }
125

    
126
        public void setChangesApplied() {
127
                // TODO Auto-generated method stub
128

    
129
        }
130

    
131
        public String getID() {
132
                return id;
133
        }
134

    
135
        public String getTitle() {
136
                return PluginServices.getText(this, "options.layout.paper_properties.title");
137
        }
138

    
139
        public JPanel getPanel() {
140
                return this;
141
        }
142

    
143
        public void initializeValues() {
144
                // TODO Auto-generated method stub
145

    
146
        }
147

    
148
        public void initializeDefaults() {
149
                rdBtnLandscapePage.setSelected(FACTORY_DEFAULT_LANDSCAPED_PAGE);
150
                rdBtnPortraitPage.setSelected(!FACTORY_DEFAULT_LANDSCAPED_PAGE);
151
        }
152

    
153
        public ImageIcon getIcon() {
154
                return icon;
155
        }
156

    
157
        public boolean isValueChanged() {
158
                // TODO Auto-generated method stub
159
                return false;
160
        }
161

    
162
}