Statistics
| Revision:

svn-document-layout / tags / 2059 / org.gvsig.app.document.layout.app.mainplugin / src / main / java / org / gvsig / app / extension / PrintProperties.java @ 46

History | View | Annotate | Download (2.92 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22
package org.gvsig.app.extension;
23

    
24
/**
25
 */
26
import java.awt.geom.Rectangle2D;
27

    
28
import org.gvsig.andami.IconThemeHelper;
29
import org.gvsig.andami.PluginServices;
30
import org.gvsig.andami.plugins.Extension;
31
import org.gvsig.andami.ui.mdiManager.IWindow;
32
import org.gvsig.app.project.documents.layout.gui.LayoutPanel;
33

    
34
/**
35
 * DOCUMENT ME!
36
 * 
37
 * @author vcn
38
 */
39
public class PrintProperties extends Extension /*
40
                                                * implements
41
                                                * IPreferenceExtension
42
                                                */{
43

    
44
    private LayoutPanel l;
45
    // private static final IPreference printPropertiesPage = new
46
    // PrintPropertiesPage();
47
    // private Paper paper;
48
    Rectangle2D.Double aux = null;
49

    
50
    /**
51
     * DOCUMENT ME!
52
     * 
53
     * @param s
54
     *            DOCUMENT ME!
55
     */
56
    public void execute(String s) {
57
        if (s.compareTo("application-page-setup-layout") == 0) {
58
            l = (LayoutPanel) PluginServices.getMDIManager().getActiveWindow();
59
            l.showFConfig();
60
        }
61
    }
62

    
63
    /**
64
     * DOCUMENT ME!
65
     * 
66
     * @return DOCUMENT ME!
67
     */
68
    public boolean isVisible() {
69
        IWindow f = PluginServices.getMDIManager().getActiveWindow();
70

    
71
        if (f == null) {
72
            return false;
73
        }
74

    
75
        return (f instanceof LayoutPanel);
76
    }
77

    
78
    /**
79
     * @see com.iver.mdiApp.plugins.IExtension#isEnabled()
80
     */
81
    public boolean isEnabled() {
82
        LayoutPanel f =
83
            (LayoutPanel) PluginServices.getMDIManager().getActiveWindow();
84

    
85
        if (f == null || !f.getLayoutContext().isEditable()) {
86
            return false;
87
        }
88

    
89
        return true;
90
    }
91

    
92
    /**
93
     * @see org.gvsig.andami.plugins.IExtension#initialize()
94
     */
95
    public void initialize() {
96
        registerIcons();
97
    }
98

    
99
    private void registerIcons() {
100
        IconThemeHelper.registerIcon("action", "application-page-setup", this);
101
    }
102

    
103
    // public IPreference getPreferencesPage() {
104
    // return printPropertiesPage;
105
    // }
106
}