Revision 33

View differences:

trunk/org.gvsig.app.document.layout.app/org.gvsig.app.document.layout.app.mainplugin/src/main/java/org/gvsig/app/project/documents/layout/LayoutManager.java
37 37
 */
38 38
public interface LayoutManager extends DocumentManager {
39 39

  
40
    public static String TEMPLATE_FILE_EXTENSION = ".gvsLayoutTemp";
40
    public static final String TEMPLATE_FILE_POINTEXT = ".gvsLayoutTemp";
41 41

  
42 42
    public IFFrame createFrame(String frameName);
43 43

  
trunk/org.gvsig.app.document.layout.app/org.gvsig.app.document.layout.app.mainplugin/src/main/java/org/gvsig/app/extension/LayoutExtension.java
40 40
import org.gvsig.andami.ui.mdiManager.IWindow;
41 41
import org.gvsig.app.gui.preferencespage.LayoutPage;
42 42
import org.gvsig.app.project.documents.layout.FLayoutZooms;
43
import org.gvsig.app.project.documents.layout.LayoutManager;
43 44
import org.gvsig.app.project.documents.layout.gui.LayoutPanel;
44 45
import org.gvsig.tools.ToolsLocator;
45 46
import org.gvsig.tools.persistence.PersistenceManager;
......
99 100
    private void saveLayout() {
100 101
        layout = (LayoutPanel) PluginServices.getMDIManager().getActiveWindow();
101 102
        JFileChooser jfc = new JFileChooser();
102
        jfc.addChoosableFileFilter(new GenericFileFilter("gvt", PluginServices
103
            .getText(this, "plantilla")));
103
        jfc.addChoosableFileFilter(new GenericFileFilter(
104
            LayoutManager.TEMPLATE_FILE_POINTEXT,
105
            PluginServices.getText(this, "plantilla")));
104 106

  
105 107
        if (jfc.showSaveDialog((Component) PluginServices.getMainFrame()) == JFileChooser.APPROVE_OPTION) {
106 108
            File file = jfc.getSelectedFile();
107
            if (!(file.getPath().endsWith(".gvt") || file.getPath().endsWith(
108
                ".GVT"))) {
109
                file = new File(file.getPath() + ".gvt");
109
            if (!(file.getPath().endsWith(
110
                LayoutManager.TEMPLATE_FILE_POINTEXT.toLowerCase())
111
                || file.getPath().endsWith(
112
                    LayoutManager.TEMPLATE_FILE_POINTEXT))) {
113
                file = new File(file.getPath() +
114
                    LayoutManager.TEMPLATE_FILE_POINTEXT);
110 115
            }
111 116
            if (file.exists()) {
112 117
                int resp =
trunk/org.gvsig.app.document.layout.app/org.gvsig.app.document.layout.app.mainplugin/src/main/java/org/gvsig/app/extension/LayoutMainExtension.java
149 149
        JFileChooser jfc =
150 150
            new JFileChooser(LAYOUT_TEMPLATE_FILECHOOSER_ID, templatesPath);
151 151
        jfc.addChoosableFileFilter(new GenericFileFilter(
152
            LayoutManager.TEMPLATE_FILE_EXTENSION, PluginServices.getText(this,
152
            LayoutManager.TEMPLATE_FILE_POINTEXT, PluginServices.getText(this,
153 153
                "_Layout_template")));
154 154

  
155 155
        if (jfc.showOpenDialog((Component) PluginServices.getMainFrame()) == JFileChooser.APPROVE_OPTION) {
156 156
            File file = jfc.getSelectedFile();
157 157
            if (!file.getPath().toLowerCase()
158
                .endsWith(LayoutManager.TEMPLATE_FILE_EXTENSION.toLowerCase())) {
158
                .endsWith(LayoutManager.TEMPLATE_FILE_POINTEXT.toLowerCase())) {
159 159
                file =
160 160
                    new File(file.getPath()
161
                        + LayoutManager.TEMPLATE_FILE_EXTENSION);
161
                        + LayoutManager.TEMPLATE_FILE_POINTEXT);
162 162
            }
163 163
            try {
164 164
                File xmlFile = new File(file.getAbsolutePath());
......
188 188
                ApplicationLocator.getManager().getProjectManager()
189 189
                    .getCurrentProject();
190 190
            p.add(layoutDocument);
191
            
192
            layout.getLayoutControl().setTool("layoutselect");
191 193
            PluginServices.getMDIManager().addWindow(layout);
192 194

  
193 195
        }

Also available in: Unified diff