svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.app / org.gvsig.app.mainplugin / src / main / java / org / gvsig / app / project / documents / view / gui / ViewProperties.java @ 47799
History | View | Annotate | Download (2.98 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
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 3
|
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 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
package org.gvsig.app.project.documents.view.gui; |
25 |
|
26 |
import java.awt.Dimension; |
27 |
import org.gvsig.andami.PluginServices; |
28 |
import org.gvsig.andami.ui.mdiManager.SingletonWindow; |
29 |
import org.gvsig.andami.ui.mdiManager.WindowInfo; |
30 |
import org.gvsig.app.project.documents.view.ViewDocument; |
31 |
import org.gvsig.i18n.Messages; |
32 |
import org.gvsig.propertypage.BasePropertiesPageDialog; |
33 |
|
34 |
/**
|
35 |
* Dialogo donde se muestran las propiedades de una vista
|
36 |
*
|
37 |
* @author gvSIG Team
|
38 |
*/
|
39 |
public class ViewProperties extends BasePropertiesPageDialog implements SingletonWindow { |
40 |
|
41 |
private static final long serialVersionUID = 5328865370833315385L; |
42 |
private ViewDocument viewDocument;
|
43 |
|
44 |
/**
|
45 |
* This is the default constructor
|
46 |
*
|
47 |
* @param viewDocument
|
48 |
* Vista que se representa
|
49 |
*/
|
50 |
public ViewProperties(ViewDocument viewDocument) {
|
51 |
this.setProperty("ViewProperties", this); |
52 |
this.viewDocument = viewDocument;
|
53 |
this.init(ViewDocument.VIEW_PROPERTIES_PAGE_GROUP,viewDocument);
|
54 |
} |
55 |
|
56 |
@Override
|
57 |
protected boolean useTabsAlwais() { |
58 |
return super.useTabsAlwais(); |
59 |
// return true;
|
60 |
} |
61 |
|
62 |
|
63 |
public boolean isAcceppted() { |
64 |
return this.getUserAction()==BasePropertiesPageDialog.ACTION_ACCEPT; |
65 |
} |
66 |
|
67 |
public Object getWindowModel() { |
68 |
return viewDocument;
|
69 |
} |
70 |
|
71 |
public Object getWindowProfile() { |
72 |
return WindowInfo.PROPERTIES_PROFILE;
|
73 |
} |
74 |
|
75 |
public WindowInfo getWindowInfo() {
|
76 |
WindowInfo m_viewinfo = new WindowInfo(
|
77 |
WindowInfo.RESIZABLE | |
78 |
WindowInfo.MAXIMIZABLE | |
79 |
WindowInfo.MAXIMIZABLE | |
80 |
WindowInfo.ICONIFIABLE |
81 |
); |
82 |
|
83 |
this.validate();
|
84 |
m_viewinfo.setTitle(Messages.getText("propiedades_vista"));
|
85 |
Dimension dim = getPreferredSize();
|
86 |
m_viewinfo.setWidth(dim.width); |
87 |
m_viewinfo.setHeight(dim.height); |
88 |
return m_viewinfo;
|
89 |
} |
90 |
|
91 |
@Override
|
92 |
protected void closeDialog() { |
93 |
PluginServices.getMDIManager().closeWindow(this);
|
94 |
} |
95 |
|
96 |
|
97 |
} |