root / branches / v2_0_0_prep / applications / appgvSIG / src / org / gvsig / app / extension / PrintProperties.java @ 29596
History | View | Annotate | Download (3.59 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 org.gvsig.app.extension; |
48 |
|
49 |
/**
|
50 |
*/
|
51 |
import java.awt.geom.Rectangle2D; |
52 |
|
53 |
import org.gvsig.andami.PluginServices; |
54 |
import org.gvsig.andami.plugins.Extension; |
55 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
56 |
import org.gvsig.app.project.documents.layout.gui.Layout; |
57 |
|
58 |
|
59 |
|
60 |
/**
|
61 |
* DOCUMENT ME!
|
62 |
*
|
63 |
* @author vcn
|
64 |
*/
|
65 |
public class PrintProperties extends Extension /*implements IPreferenceExtension*/ { |
66 |
private Layout l;
|
67 |
// private static final IPreference printPropertiesPage = new PrintPropertiesPage();
|
68 |
// private Paper paper;
|
69 |
Rectangle2D.Double aux = null; |
70 |
|
71 |
/**
|
72 |
* DOCUMENT ME!
|
73 |
*
|
74 |
* @param s DOCUMENT ME!
|
75 |
*/
|
76 |
public void execute(String s) { |
77 |
l = (Layout) PluginServices.getMDIManager().getActiveWindow(); |
78 |
l.showFConfig(); |
79 |
//l.showPagePropertiesWindow(Print.printerJob);
|
80 |
} |
81 |
|
82 |
/**
|
83 |
* DOCUMENT ME!
|
84 |
*
|
85 |
* @return DOCUMENT ME!
|
86 |
*/
|
87 |
public boolean isVisible() { |
88 |
IWindow f = PluginServices.getMDIManager().getActiveWindow(); |
89 |
|
90 |
if (f == null) { |
91 |
return false; |
92 |
} |
93 |
|
94 |
return (f instanceof Layout); |
95 |
} |
96 |
|
97 |
/**
|
98 |
* @see com.iver.mdiApp.plugins.IExtension#isEnabled()
|
99 |
*/
|
100 |
public boolean isEnabled() { |
101 |
Layout f = (Layout) PluginServices.getMDIManager().getActiveWindow(); |
102 |
|
103 |
if (f == null || !f.getLayoutContext().isEditable()) { |
104 |
return false; |
105 |
} |
106 |
|
107 |
return true; |
108 |
} |
109 |
|
110 |
/**
|
111 |
* @see org.gvsig.andami.plugins.IExtension#initialize()
|
112 |
*/
|
113 |
public void initialize() { |
114 |
registerIcons(); |
115 |
} |
116 |
|
117 |
private void registerIcons(){ |
118 |
PluginServices.getIconTheme().registerDefault( |
119 |
"layout-page-setup",
|
120 |
this.getClass().getClassLoader().getResource("images/Frame.gif") |
121 |
); |
122 |
PluginServices.getIconTheme().registerDefault( |
123 |
"prepare-page-icon",
|
124 |
this.getClass().getClassLoader().getResource("images/prepare-page.png") |
125 |
); |
126 |
PluginServices.getIconTheme().registerDefault( |
127 |
"portrait-page-setup",
|
128 |
this.getClass().getClassLoader().getResource("images/portrait-page.png") |
129 |
); |
130 |
PluginServices.getIconTheme().registerDefault( |
131 |
"landscape-page-setup",
|
132 |
this.getClass().getClassLoader().getResource("images/landscape-page.png") |
133 |
); |
134 |
} |
135 |
|
136 |
// public IPreference getPreferencesPage() {
|
137 |
// return printPropertiesPage;
|
138 |
// }
|
139 |
} |