svn-gvsig-desktop / branches / gvSIG_1.11.0_Mejoras_gvSIG-EIEL / applications / appgvSIG / src / com / iver / cit / gvsig / PrintProperties.java @ 34778
History | View | Annotate | Download (3.58 KB)
1 | 312 | fernando | /*
|
---|---|---|---|
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 | 1103 | fjp | /* 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 | 312 | fernando | package com.iver.cit.gvsig; |
48 | |||
49 | /**
|
||
50 | */
|
||
51 | import java.awt.geom.Rectangle2D; |
||
52 | |||
53 | 596 | fernando | import com.iver.andami.PluginServices; |
54 | import com.iver.andami.plugins.Extension; |
||
55 | 6877 | cesar | import com.iver.andami.ui.mdiManager.IWindow; |
56 | 9392 | caballero | import com.iver.cit.gvsig.project.documents.layout.gui.Layout; |
57 | 312 | fernando | |
58 | |||
59 | /**
|
||
60 | * DOCUMENT ME!
|
||
61 | *
|
||
62 | * @author vcn
|
||
63 | */
|
||
64 | 8143 | jaume | public class PrintProperties extends Extension /*implements IPreferenceExtension*/ { |
65 | 312 | fernando | private Layout l;
|
66 | 8143 | jaume | // private static final IPreference printPropertiesPage = new PrintPropertiesPage();
|
67 | 2429 | caballero | // private Paper paper;
|
68 | 312 | fernando | Rectangle2D.Double aux = null; |
69 | |||
70 | /**
|
||
71 | * DOCUMENT ME!
|
||
72 | *
|
||
73 | * @param s DOCUMENT ME!
|
||
74 | */
|
||
75 | 596 | fernando | public void execute(String s) { |
76 | 6880 | cesar | l = (Layout) PluginServices.getMDIManager().getActiveWindow(); |
77 | 312 | fernando | l.showFConfig(); |
78 | //l.showPagePropertiesWindow(Print.printerJob);
|
||
79 | } |
||
80 | |||
81 | /**
|
||
82 | * DOCUMENT ME!
|
||
83 | *
|
||
84 | * @return DOCUMENT ME!
|
||
85 | */
|
||
86 | public boolean isVisible() { |
||
87 | 6880 | cesar | IWindow f = PluginServices.getMDIManager().getActiveWindow(); |
88 | 312 | fernando | |
89 | if (f == null) { |
||
90 | return false; |
||
91 | } |
||
92 | |||
93 | 5900 | jorpiell | return (f instanceof Layout); |
94 | 312 | fernando | } |
95 | |||
96 | /**
|
||
97 | 5005 | jorpiell | * @see com.iver.mdiApp.plugins.IExtension#isEnabled()
|
98 | 312 | fernando | */
|
99 | public boolean isEnabled() { |
||
100 | 6880 | cesar | Layout f = (Layout) PluginServices.getMDIManager().getActiveWindow(); |
101 | 312 | fernando | |
102 | 9392 | caballero | if (f == null || !f.getLayoutContext().isEditable()) { |
103 | 312 | fernando | return false; |
104 | } |
||
105 | |||
106 | return true; |
||
107 | } |
||
108 | 596 | fernando | |
109 | /**
|
||
110 | 5005 | jorpiell | * @see com.iver.andami.plugins.IExtension#initialize()
|
111 | 596 | fernando | */
|
112 | 5005 | jorpiell | public void initialize() { |
113 | 14821 | jmvivo | registerIcons(); |
114 | 596 | fernando | } |
115 | 14821 | jmvivo | |
116 | private void registerIcons(){ |
||
117 | 15647 | jmvivo | PluginServices.getIconTheme().registerDefault( |
118 | 14821 | jmvivo | "layout-page-setup",
|
119 | this.getClass().getClassLoader().getResource("images/Frame.gif") |
||
120 | ); |
||
121 | 15647 | jmvivo | 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 | 14821 | jmvivo | } |
134 | 8142 | jaume | |
135 | 8143 | jaume | // public IPreference getPreferencesPage() {
|
136 | // return printPropertiesPage;
|
||
137 | // }
|
||
138 | 312 | fernando | } |