Statistics
| Revision:

svn-gvsig-desktop / branches / v2_0_0_prep / applications / appgvSIG / src / com / iver / cit / gvsig / PrintProperties.java @ 25232

History | View | Annotate | Download (3.58 KB)

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

    
49
/**
50
 */
51
import java.awt.geom.Rectangle2D;
52

    
53
import com.iver.andami.PluginServices;
54
import com.iver.andami.plugins.Extension;
55
import com.iver.andami.ui.mdiManager.IWindow;
56
import com.iver.cit.gvsig.project.documents.layout.gui.Layout;
57

    
58

    
59
/**
60
 * DOCUMENT ME!
61
 *
62
 * @author vcn
63
 */
64
public class PrintProperties extends Extension /*implements IPreferenceExtension*/ {
65
    private Layout l;
66
//    private static final IPreference printPropertiesPage = new PrintPropertiesPage();
67
   // private Paper paper;
68
    Rectangle2D.Double aux = null;
69

    
70
    /**
71
     * DOCUMENT ME!
72
     *
73
     * @param s DOCUMENT ME!
74
     */
75
    public void execute(String s) {
76
        l = (Layout) PluginServices.getMDIManager().getActiveWindow();
77
                l.showFConfig();
78
        //l.showPagePropertiesWindow(Print.printerJob);
79
    }
80

    
81
    /**
82
     * DOCUMENT ME!
83
     *
84
     * @return DOCUMENT ME!
85
     */
86
    public boolean isVisible() {
87
        IWindow f = PluginServices.getMDIManager().getActiveWindow();
88

    
89
        if (f == null) {
90
            return false;
91
        }
92

    
93
        return (f instanceof Layout);
94
    }
95

    
96
    /**
97
     * @see com.iver.mdiApp.plugins.IExtension#isEnabled()
98
     */
99
    public boolean isEnabled() {
100
        Layout f = (Layout) PluginServices.getMDIManager().getActiveWindow();
101

    
102
        if (f == null || !f.getLayoutContext().isEditable()) {
103
            return false;
104
        }
105

    
106
        return true;
107
    }
108

    
109
        /**
110
         * @see com.iver.andami.plugins.IExtension#initialize()
111
         */
112
        public void initialize() {
113
                registerIcons();
114
        }
115
        
116
        private void registerIcons(){
117
                PluginServices.getIconTheme().registerDefault(
118
                                "layout-page-setup",
119
                                this.getClass().getClassLoader().getResource("images/Frame.gif")
120
                        );
121
                PluginServices.getIconTheme().registerDefault(
122
                                "prepare-page-icon",
123
                                this.getClass().getClassLoader().getResource("images/prepare-page.png")
124
                        );
125
                PluginServices.getIconTheme().registerDefault(
126
                                "portrait-page-setup",
127
                                this.getClass().getClassLoader().getResource("images/portrait-page.png")
128
                        );
129
                PluginServices.getIconTheme().registerDefault(
130
                                "landscape-page-setup",
131
                                this.getClass().getClassLoader().getResource("images/landscape-page.png")
132
                        );
133
        }
134

    
135
//        public IPreference getPreferencesPage() {
136
//                return printPropertiesPage;
137
//        }
138
}