Revision 1633
trunk/org.gvsig.app.document.layout2.app/org.gvsig.app.document.layout2.app.mainplugin/src/main/java/org/gvsig/app/project/documents/layout/gui/LayoutPanelImpl.java | ||
---|---|---|
1 | 1 |
package org.gvsig.app.project.documents.layout.gui; |
2 | 2 |
|
3 |
import java.awt.GridBagConstraints; |
|
3 | 4 |
import java.awt.event.ActionEvent; |
4 | 5 |
import java.awt.event.ActionListener; |
6 |
import java.util.Collections; |
|
5 | 7 |
|
6 | 8 |
import org.gvsig.andami.PluginsLocator; |
7 | 9 |
import org.gvsig.app.ApplicationLocator; |
8 | 10 |
import org.gvsig.app.gui.preferencespage.PreferenceKeys; |
9 | 11 |
import org.gvsig.app.project.documents.layout.gui.dialogs.FConfigLayoutDialog; |
12 |
import org.gvsig.tools.ToolsLocator; |
|
13 |
import org.gvsig.tools.i18n.I18nManager; |
|
10 | 14 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
11 | 15 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager; |
16 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager_v2; |
|
12 | 17 |
import org.gvsig.utils.XMLEntity; |
13 | 18 |
|
14 | 19 |
/** |
... | ... | |
45 | 50 |
* @see com.iver.mdiApp.ui.MDIManager.IWindow#windowActivated() |
46 | 51 |
*/ |
47 | 52 |
public void windowActivated() { |
48 |
if (getLayoutContext()!=null && !getLayoutContext().hasDocBeenOpened()) {
|
|
49 |
getLayoutContext().setHasDocBeenOpened(true);
|
|
53 |
if (getLayoutContext() != null && !getLayoutContext().hasDocBeenOpened()) {
|
|
54 |
getLayoutContext().setHasDocBeenOpened(true);
|
|
50 | 55 |
if (isInitConfigDialogEnabled()) { |
51 |
FConfigLayoutDialog configDialog = new FConfigLayoutDialog(this, true); |
|
52 |
ToolsSwingLocator.getWindowManager().showWindow(configDialog, |
|
53 |
configDialog.getWindowInfo().getTitle(), WindowManager.MODE.TOOL); |
|
54 |
configDialog.addCancelButtonActionListener(new ActionListener() { |
|
56 |
FConfigLayoutDialog configDialog = new FConfigLayoutDialog(this, true); |
|
57 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
58 |
((WindowManager_v2) ToolsSwingLocator.getWindowManager()).showWindow( |
|
59 |
configDialog, |
|
60 |
i18n.getTranslation("Preparar_pagina"), |
|
61 |
WindowManager.MODE.WINDOW, |
|
62 |
Collections.singletonMap("align", GridBagConstraints.CENTER) |
|
63 |
); |
|
64 |
configDialog.addCancelButtonActionListener(new ActionListener() { |
|
55 | 65 |
|
56 |
public void actionPerformed(ActionEvent e) {
|
|
57 |
LayoutPanelImpl.this.onInitialConfigCanceled();
|
|
58 |
}
|
|
59 |
|
|
60 |
});
|
|
66 |
public void actionPerformed(ActionEvent e) {
|
|
67 |
LayoutPanelImpl.this.onInitialConfigCanceled();
|
|
68 |
}
|
|
69 |
|
|
70 |
});
|
|
61 | 71 |
} |
62 |
|
|
63 |
}
|
|
64 |
super.windowActivated();
|
|
72 |
|
|
73 |
}
|
|
74 |
super.windowActivated();
|
|
65 | 75 |
} |
66 | 76 |
|
67 | 77 |
} |
trunk/org.gvsig.app.document.layout2.app/org.gvsig.app.document.layout2.app.mainplugin/src/main/java/org/gvsig/app/project/documents/layout/gui/DefaultLayoutPanel.java | ||
---|---|---|
24 | 24 |
import java.awt.BorderLayout; |
25 | 25 |
import java.awt.Component; |
26 | 26 |
import java.awt.Graphics2D; |
27 |
import java.awt.GridBagConstraints; |
|
27 | 28 |
import java.awt.event.ActionEvent; |
28 | 29 |
import java.awt.event.ActionListener; |
29 | 30 |
import java.awt.geom.AffineTransform; |
... | ... | |
35 | 36 |
import java.beans.PropertyChangeEvent; |
36 | 37 |
import java.beans.PropertyChangeListener; |
37 | 38 |
import java.io.File; |
39 |
import java.util.Collections; |
|
38 | 40 |
|
39 | 41 |
import javax.print.Doc; |
40 | 42 |
import javax.print.DocFlavor; |
... | ... | |
81 | 83 |
import org.gvsig.gui.beans.swing.JFileChooser; |
82 | 84 |
import org.gvsig.tools.ToolsLocator; |
83 | 85 |
import org.gvsig.tools.dynobject.DynStruct; |
86 |
import org.gvsig.tools.i18n.I18nManager; |
|
84 | 87 |
import org.gvsig.tools.observer.Observable; |
85 | 88 |
import org.gvsig.tools.persistence.PersistenceManager; |
86 | 89 |
import org.gvsig.tools.persistence.PersistentState; |
87 | 90 |
import org.gvsig.tools.persistence.exception.PersistenceException; |
88 | 91 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
89 | 92 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager; |
93 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager_v2; |
|
90 | 94 |
import org.gvsig.utils.GenericFileFilter; |
91 | 95 |
import org.gvsig.utils.XMLEntity; |
92 | 96 |
|
... | ... | |
274 | 278 |
|
275 | 279 |
public void showFConfig() { |
276 | 280 |
FConfigLayoutDialog m_configLayout = new FConfigLayoutDialog(this); |
277 |
ToolsSwingLocator.getWindowManager().showWindow(m_configLayout, |
|
278 |
m_configLayout.getWindowInfo().getTitle(), WindowManager.MODE.TOOL); |
|
281 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
282 |
((WindowManager_v2)ToolsSwingLocator.getWindowManager()).showWindow( |
|
283 |
m_configLayout, |
|
284 |
i18n.getTranslation("Preparar_pagina"), |
|
285 |
WindowManager.MODE.WINDOW, |
|
286 |
Collections.singletonMap("align", GridBagConstraints.CENTER) |
|
287 |
); |
|
279 | 288 |
} |
280 | 289 |
|
281 | 290 |
public boolean showFProperties() { |
trunk/org.gvsig.app.document.layout2.app/org.gvsig.app.document.layout2.app.mainplugin/src/main/java/org/gvsig/app/project/documents/layout/gui/dialogs/FConfigLayoutDialog.java | ||
---|---|---|
59 | 59 |
import org.gvsig.fmap.mapcontext.MapContext; |
60 | 60 |
import org.gvsig.gui.beans.AcceptCancelPanel; |
61 | 61 |
import org.gvsig.i18n.Messages; |
62 |
import org.gvsig.tools.swing.api.ToolsSwingUtils; |
|
62 | 63 |
import org.gvsig.tools.swing.api.usability.UsabilitySwingManager; |
63 | 64 |
|
64 | 65 |
/** |
... | ... | |
67 | 68 |
* @author Vicente Caballero Navarro |
68 | 69 |
* @author Cesar Martinez Izquierdo |
69 | 70 |
*/ |
70 |
public class FConfigLayoutDialog extends JPanel implements SingletonWindow, ActionListener {
|
|
71 |
public class FConfigLayoutDialog extends JPanel implements ActionListener { |
|
71 | 72 |
|
72 | 73 |
private static final long serialVersionUID = -425263925680280142L; |
73 | 74 |
private javax.swing.JLabel lTamPag = null; |
... | ... | |
168 | 169 |
c.gridx = GridBagConstraints.RELATIVE; |
169 | 170 |
c.fill = GridBagConstraints.HORIZONTAL; |
170 | 171 |
c.gridwidth = GridBagConstraints.REMAINDER; |
172 |
c.weightx = 1; |
|
171 | 173 |
this.add(getCbTipoFolio(), c); |
174 |
c.weightx = 0; |
|
172 | 175 |
c.gridx = 0; |
173 | 176 |
c.gridy = row++; |
174 | 177 |
c.gridwidth = 1; |
... | ... | |
199 | 202 |
c.gridwidth = GridBagConstraints.REMAINDER; |
200 | 203 |
this.add(getCbResolucion(), c); |
201 | 204 |
if (this.showViewList) { |
202 |
c.gridy = row++;
|
|
205 |
c.gridy = row++;
|
|
203 | 206 |
c.gridx = 0; |
204 | 207 |
c.gridwidth = 1; |
205 | 208 |
this.add(getChbViews(), c); |
206 | 209 |
c.gridx = 1; |
207 | 210 |
c.gridwidth = GridBagConstraints.REMAINDER; |
211 |
c.weighty = 1; |
|
212 |
c.fill = GridBagConstraints.BOTH; |
|
208 | 213 |
this.add(getViewScrollPane(), c); |
214 |
c.weighty = 0; |
|
215 |
c.fill = GridBagConstraints.HORIZONTAL; |
|
209 | 216 |
c.gridy = row++; |
210 | 217 |
c.gridx = 1; |
211 | 218 |
c.gridwidth = 1; |
... | ... | |
223 | 230 |
c.gridx = 0; |
224 | 231 |
c.gridwidth = GridBagConstraints.REMAINDER; |
225 | 232 |
this.add(getPnlAcceptCancel(), c); |
233 |
if (!this.showViewList) { |
|
234 |
c.gridy = row++; |
|
235 |
c.gridx = 0; |
|
236 |
c.gridwidth = GridBagConstraints.REMAINDER; |
|
237 |
c.weighty = 1; |
|
238 |
this.add(new JLabel(""), c); |
|
239 |
} |
|
240 |
|
|
241 |
ToolsSwingUtils.ensureRowsCols(this, 16, 80, 24, 120); |
|
226 | 242 |
} |
227 | 243 |
|
228 | 244 |
public AcceptCancelPanel getPnlAcceptCancel() { |
... | ... | |
950 | 966 |
return chbViews; |
951 | 967 |
} |
952 | 968 |
|
953 |
/* |
|
954 |
* (non-Javadoc) |
|
955 |
* |
|
956 |
* @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo() |
|
957 |
*/ |
|
958 |
public WindowInfo getWindowInfo() { |
|
959 |
if (windowInfo==null) { |
|
960 |
windowInfo = new WindowInfo(WindowInfo.RESIZABLE); |
|
961 |
if (showViewList) { |
|
962 |
windowInfo.setWidth(600); |
|
963 |
windowInfo.setHeight(450); |
|
964 |
} |
|
965 |
else { |
|
966 |
windowInfo.setWidth(550); |
|
967 |
windowInfo.setHeight(300); |
|
968 |
} |
|
969 |
windowInfo.setTitle(PluginServices.getText(this, "Preparar_pagina")); |
|
970 |
} |
|
971 |
return windowInfo; |
|
972 |
} |
|
973 |
|
|
974 |
public Dimension getPreferredSize() { |
|
975 |
return new Dimension(getWindowInfo().getWidth(), getWindowInfo().getHeight()); |
|
976 |
} |
|
969 |
// public WindowInfo getWindowInfo() { |
|
970 |
// if (windowInfo==null) { |
|
971 |
// windowInfo = new WindowInfo(WindowInfo.RESIZABLE); |
|
972 |
// if (showViewList) { |
|
973 |
// windowInfo.setWidth(650); |
|
974 |
// windowInfo.setHeight(450); |
|
975 |
// } |
|
976 |
// else { |
|
977 |
// windowInfo.setWidth(550); |
|
978 |
// windowInfo.setHeight(300); |
|
979 |
// } |
|
980 |
// windowInfo.setTitle(PluginServices.getText(this, "Preparar_pagina")); |
|
981 |
// } |
|
982 |
// return windowInfo; |
|
983 |
// } |
|
984 |
// |
|
985 |
// public Dimension getPreferredSize() { |
|
986 |
// return new Dimension(getWindowInfo().getWidth(), getWindowInfo().getHeight()); |
|
987 |
// } |
|
977 | 988 |
|
978 | 989 |
|
979 | 990 |
/** |
... | ... | |
1022 | 1033 |
.fromUnits(Double.valueOf(s).doubleValue()); |
1023 | 1034 |
} |
1024 | 1035 |
|
1025 |
public Object getWindowProfile() { |
|
1026 |
return WindowInfo.DIALOG_PROFILE; |
|
1027 |
} |
|
1036 |
// public Object getWindowProfile() { |
|
1037 |
// return WindowInfo.DIALOG_PROFILE; |
|
1038 |
// } |
|
1039 |
// |
|
1040 |
// public Object getWindowModel() { |
|
1041 |
// // necessary for considering them as separate SingletonWindows depending showViewList option |
|
1042 |
// if (showViewList) { |
|
1043 |
// return m_layout; |
|
1044 |
// } |
|
1045 |
// else { |
|
1046 |
// return m_layout.getLayoutControl(); |
|
1047 |
// } |
|
1048 |
// } |
|
1028 | 1049 |
|
1029 |
public Object getWindowModel() { |
|
1030 |
// necessary for considering them as separate SingletonWindows depending showViewList option |
|
1031 |
if (showViewList) { |
|
1032 |
return m_layout; |
|
1033 |
} |
|
1034 |
else { |
|
1035 |
return m_layout.getLayoutControl(); |
|
1036 |
} |
|
1037 |
} |
|
1038 |
|
|
1039 | 1050 |
public void actionPerformed(ActionEvent e) { |
1040 | 1051 |
if (e.getActionCommand()=="OK") { |
1041 | 1052 |
onAcceptPressed(); |
Also available in: Unified diff