|
From: Logs S. c. messages. <gvs...@li...> - 2013-11-23 15:45:18
|
Revision: 1073
http://sourceforge.net/p/gvsigce/code/1073
Author: vicgonco
Date: 2013-11-23 15:45:14 +0000 (Sat, 23 Nov 2013)
Log Message:
-----------
Applying https://devel.gvsig.org/redmine/projects/gvsig-desktop/repository/revisions/38050
Modified Paths:
--------------
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/preferencespage/ViewPage.java
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/gui/ProjectWindow.java
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/ProjectView.java
Modified: trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/preferencespage/ViewPage.java
===================================================================
--- trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/preferencespage/ViewPage.java 2013-11-23 15:41:21 UTC (rev 1072)
+++ trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/preferencespage/ViewPage.java 2013-11-23 15:45:14 UTC (rev 1073)
@@ -220,6 +220,7 @@
private static final String ADD_NEW_LAYERS_IN_INVISIBLE_MODE_KEY_NAME = "NewLayersInInvisibleMode";
private static final String SHOW_FILE_EXTENSIONS_KEY_NAME = "ShowFileExtensions";
private static final String KEEP_SCALE_ON_RESIZING_KEY_NAME = "KeepScaleOnResizing";
+ public static final String OPEN_VIEW_WINDOW_MAXIMIZED = "options.view.open_view_window_maximized";
private static final String DEFAULT_SELECTION_COLOR_KEY_NAME = "DefaultSelectionColor";
private static final String DEFAULT_VIEW_BACK_COLOR_KEY_NAME = "DefaultViewBackColor";
private static final String DEFAULT_DISTANCE_AREA_KEY_NAME = "DefaultDistanceArea";
@@ -253,6 +254,7 @@
private String fontName;
private JCheckBox chkInvisibleNewLayers;
private JCheckBox chkKeepScaleOnResizing;
+ private JCheckBox chkOpenViewWindowMaximized;
private JCheckBox chkShowFileExtensions;
private ColorChooserPanel jccDefaultSelectionColor;
private ColorChooserPanel jccDefaultViewBackColor;
@@ -360,6 +362,10 @@
chkKeepScaleOnResizing.setEnabled(false);
addComponent("", chkKeepScaleOnResizing);
+ chkOpenViewWindowMaximized = new JCheckBox(PluginServices.getText(this,
+ "options.view.open_view_window_maximized"));
+ addComponent("", chkOpenViewWindowMaximized);
+
// just a separator
addComponent(new JLabel(" "));
@@ -438,6 +444,14 @@
xml.getBooleanProperty(KEEP_SCALE_ON_RESIZING_KEY_NAME));
}
+ if (xml.contains(OPEN_VIEW_WINDOW_MAXIMIZED)) {
+ chkOpenViewWindowMaximized.setSelected(xml
+ .getBooleanProperty(OPEN_VIEW_WINDOW_MAXIMIZED));
+ } else {
+ chkOpenViewWindowMaximized.setSelected(true);
+ xml.putProperty(OPEN_VIEW_WINDOW_MAXIMIZED, true);
+ }
+
// Zoom-in factor
if (xml.contains(ZOOM_IN_FACTOR_KEY_NAME)) {
double zoomInFactor = xml.getDoubleProperty(ZOOM_IN_FACTOR_KEY_NAME);
@@ -557,6 +571,7 @@
Project.setDefaultDistanceArea(jCmbDistanceArea.getSelectedIndex());
invisibleNewLayers = chkInvisibleNewLayers.isSelected();
keepScaleOnResize = chkKeepScaleOnResizing.isSelected();
+
showFileExtensions = chkShowFileExtensions.isSelected();
} catch (Exception e) {
throw new StoreException(PluginServices.getText(this,"factor_zoom_incorrecto"));
@@ -572,6 +587,8 @@
xml.putProperty(ZOOM_OUT_FACTOR_KEY_NAME, zof);
xml.putProperty(ADD_NEW_LAYERS_IN_INVISIBLE_MODE_KEY_NAME, invisibleNewLayers);
xml.putProperty(KEEP_SCALE_ON_RESIZING_KEY_NAME, keepScaleOnResize);
+ xml.putProperty(OPEN_VIEW_WINDOW_MAXIMIZED,
+ chkOpenViewWindowMaximized.isSelected());
xml.putProperty(SHOW_FILE_EXTENSIONS_KEY_NAME, showFileExtensions);
xml.putProperty(DEFAULT_VIEW_BACK_COLOR_KEY_NAME, StringUtilities.color2String(viewBackColor));
/*
@@ -591,6 +608,7 @@
txtZoomOutFactor.setText(String.valueOf(DEFAULT_ZOOM_OUT_FACTOR));
chkInvisibleNewLayers.setSelected(false);
chkKeepScaleOnResizing.setSelected(false);
+ chkOpenViewWindowMaximized.setSelected(true);
jccDefaultViewBackColor.setColor(FACTORY_DEFAULT_VIEW_BACK_COLOR);
/*
* Locator's background color, for when we let it be possible
Modified: trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/gui/ProjectWindow.java
===================================================================
--- trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/gui/ProjectWindow.java 2013-11-23 15:41:21 UTC (rev 1072)
+++ trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/gui/ProjectWindow.java 2013-11-23 15:45:14 UTC (rev 1073)
@@ -80,6 +80,7 @@
import com.iver.cit.gvsig.project.documents.ProjectDocument;
import com.iver.cit.gvsig.project.documents.ProjectDocumentFactory;
import com.iver.cit.gvsig.project.documents.contextMenu.gui.DocumentContextMenu;
+import com.iver.cit.gvsig.project.documents.view.ProjectViewBase;
import com.iver.utiles.DefaultListModel;
import com.iver.utiles.extensionPoints.ExtensionPoint;
import com.iver.utiles.extensionPoints.ExtensionPoints;
@@ -87,13 +88,14 @@
/**
- * Clase principal del proyecto donde se puede operar para crear
- * cualquier tipo de documento.
- *
+ * Main class of the project where any kind of document can be created
+ *
* @author Vicente Caballero Navarro
*/
public class ProjectWindow extends JPanel implements PropertyChangeListener,
IWindow, SingletonWindow {
+
+ private static final long serialVersionUID = -1991932402182134580L;
private JPanel jPanel = null;
private JRadioButton[] btnsDocuments = null;
private ButtonGroup grupo = new ButtonGroup();
@@ -115,21 +117,15 @@
private JButton btnImportar = null;
private JButton btnExportar = null;
private JButton btnEditar = null;
- // The properties of the Project Manager window (size, position, etc):
private WindowInfo m_viewInfo=null;
- /** Proyecto representado en la vista */
+ /** Project represented in the view */
private Project p;
private JScrollPane jScrollPane = null;
private JPanel jPanel4 = null;
private JScrollPane jScrollPane1 = null;
- /**
- * This is the default constructor
- *
- * @param project Extension
- */
public ProjectWindow() {
super();
initialize();
@@ -143,23 +139,23 @@
JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
}
- /**
- * Asigna el proyecto a la ventana
- *
- * @param p Proyecto con el que se operar\xE1 a trav\xE9s de este di\xE1logo
- */
+ /**
+ * Assign the project to the window
+ *
+ * @param p
+ * Project which will be handled through this dialog
+ */
public void setProject(Project p) {
this.p = p;
p.addPropertyChangeListener(this);
refreshControls();
}
- /**
- * Activa los botones de la botonera del medio o los desactiva en funci\xF3n
- * de que est\xE9 seleccionado o no un elemento de proyecto en la lista del
- * medio
- */
- private void activarBotones() {
+ /**
+ * Enable or disable the buttons based on if is selected or not an element
+ * of a project in the list of the center
+ */
+ private void enableButtons() {
if (lstDocs.getSelectedIndex() != -1) {
btnAbrir.setEnabled(true);
btnBorrar.setEnabled(true);
@@ -178,10 +174,10 @@
}
}
- /**
- * Refresca la lista de elementos de proyecto con vistas, mapas o tablas,
- * seg\xFAn la opci\xF3n activada
- */
+ /**
+ * Refresh the list of elements of a project with views, layouts or tables
+ * based on the active option
+ */
private void refreshList() {
if (p != null) {
DefaultListModel model=null;
@@ -194,17 +190,15 @@
lstDocs.setModel(model);
((TitledBorder)getJPanel1().getBorder()).setTitle(tituloMarco);
getJPanel1().repaint(1);
- activarBotones();
+ enableButtons();
}
}
- /**
- * Devuelve el nombre del tipo de documento
- * activo (el mismo que ProjectDocumentFactory.getRegisterName)
- *
- *
- * @return
- */
-
+
+ /**
+ * Returns the name of the kind of document active. (the same of
+ * ProjectDocumentFactory.getRegisterName
+ *
+ */
public String getDocumentSelected() {
JRadioButton btnSelected=null;
for (int i=0;i<btnsDocuments.length;i++) {
@@ -216,6 +210,7 @@
return null;
}
+
private String getDocumentSelectedName() {
JRadioButton btnSelected=null;
for (int i=0;i<btnsDocuments.length;i++) {
@@ -227,9 +222,10 @@
return null;
}
- /**
- * Refresca las etiquetas con la informaci\xF3n del proyecto
- */
+
+ /**
+ * Refresh the labes with the information of the project
+ */
private void refreshProperties() {
if (p != null) {
lblNombreSesion.setText(p.getName());
@@ -244,17 +240,15 @@
}
}
- /**
- * Refresca todo el di\xE1logo
- */
+ /**
+ * Refresh all the dialog
+ */
public void refreshControls() {
refreshList();
refreshProperties();
}
- /**
- * This method initializes this
- */
+
private void initialize() {
GridBagConstraints gridBagConstraints = new GridBagConstraints();
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
@@ -300,7 +294,7 @@
ExtensionPointsSingleton.getInstance();
ExtensionPoint extensionPoint =(ExtensionPoint)extensionPoints.get("Documents");
- Iterator iterator = extensionPoint.keySet().iterator();
+ Iterator iterator = extensionPoint.keySet().iterator();
while (iterator.hasNext()) {
try {
ProjectDocumentFactory documentFactory = (ProjectDocumentFactory)extensionPoint.create((String)iterator.next());
@@ -321,11 +315,10 @@
}
return null;
}
- /**
- * Crea un nuevo project element
- *
- * @throws Exception DOCUMENT ME!
- */
+
+ /**
+ * Creates a new document of the selected type
+ */
private void newProjectDocument() throws Exception {
String s=getDocumentSelected();
ProjectDocument doc=createDocument(s);
@@ -335,10 +328,7 @@
}
}
- /**
- * Abre la ventana de un nuevo project element
- */
- private void abrir() {
+ private void openSelectedDocument() {
int[] indexes = lstDocs.getSelectedIndices();
for (int i=indexes.length-1;i>=0;i--) {
int index=indexes[i];
@@ -346,7 +336,7 @@
return;
}
String s=getDocumentSelected();
- ArrayList documents=p.getDocumentsByType(s);
+ ArrayList<ProjectDocument> documents = p.getDocumentsByType(s);
ProjectDocument doc=(ProjectDocument)documents.get(index);
IWindow window=doc.createWindow();
if (window == null){
@@ -358,21 +348,19 @@
p.setModified(true);
}
- /**
- * Cambia el nombre de un project element
- */
- private void renombrar() {
+ private void renameSelectedDocument() {
int index = lstDocs.getSelectedIndex();
if (index == -1) {
return;
}
String s=getDocumentSelected();
- ArrayList documents=p.getDocumentsByType(s);
+ ArrayList<ProjectDocument> documents = p.getDocumentsByType(s);
ProjectDocument doc=(ProjectDocument)documents.get(index);
if (doc.isLocked()) {
- JOptionPane.showMessageDialog(this, PluginServices.getText(this, "locked_element_it_cannot_be_renamed"));
+ JOptionPane.showMessageDialog(this, PluginServices.getText(this,
+ "locked_element_it_cannot_be_renamed"));
return;
}
@@ -389,14 +377,10 @@
String nuevoNombre = pane.getInputValue().toString().trim();
- if (nuevoNombre.length() == 0) {
+ if ((nuevoNombre == null) || (nuevoNombre.length() == 0)) {
return;
}
- if (nuevoNombre == null) {
- return;
- }
-
for (int i=0; i<lstDocs.getModel().getSize(); i++){
if (i==index) continue;
if (((ProjectDocument)lstDocs.getModel().getElementAt(i)).getName().equals(nuevoNombre)){
@@ -411,10 +395,7 @@
p.setModified(true);
}
- /**
- * Borra un project element
- */
- private void borrar() {
+ private void removeSelectedDocuments() {
int res = JOptionPane.showConfirmDialog((Component) PluginServices.getMainFrame(),
PluginServices.getText(this, "confirmar_borrar"),
PluginServices.getText(this, "borrar"),
@@ -425,7 +406,7 @@
for (int i=indexes.length-1;i>=0;i--) {
int index=indexes[i];
String s=getDocumentSelected();
- ArrayList documents=p.getDocumentsByType(s);
+ ArrayList<ProjectDocument> documents = p.getDocumentsByType(s);
ProjectDocument doc=(ProjectDocument)documents.get(index);
if (doc.isLocked()) {
JOptionPane.showMessageDialog(this, PluginServices.getText(this, "locked_element_it_cannot_be_deleted"));
@@ -439,10 +420,7 @@
}
}
- /**
- * Muestra el di\xE1logo de propiedades de un project element
- */
- private void propiedades() {
+ private void showSelectedDocumentProperties() {
int index = lstDocs.getSelectedIndex();
if (index == -1) {
@@ -451,10 +429,11 @@
IWindow dlg = null;
String s=getDocumentSelected();
- ArrayList documents=p.getDocumentsByType(s);
+ ArrayList<ProjectDocument> documents = p.getDocumentsByType(s);
ProjectDocument doc=(ProjectDocument) documents.get(index);
if (doc.isLocked()) {
- JOptionPane.showMessageDialog(this, PluginServices.getText(this, "locked_element"));
+ JOptionPane.showMessageDialog(this,
+ PluginServices.getText(this, "locked_element"));
return;
}
dlg=doc.getProperties();
@@ -465,11 +444,6 @@
p.setModified(true);
}
- /**
- * This method initializes jPanel
- *
- * @return JPanel
- */
private JPanel getJPanel() {
if (jPanel == null) {
jPanel = new JPanel();
@@ -494,19 +468,14 @@
return jPanel;
}
- /**
- * This method initializes btnVistas
- *
- * @return JRadioButton
- */
private JRadioButton[] getBtnDocuments() {
if (btnsDocuments == null) {
ExtensionPoints extensionPoints =
ExtensionPointsSingleton.getInstance();
ExtensionPoint extensionPoint =(ExtensionPoint)extensionPoints.get("Documents");
- ArrayList btns=new ArrayList();
- ArrayList priorities=new ArrayList();
+ ArrayList<JRadioButton> btns = new ArrayList<JRadioButton>();
+ ArrayList<Integer> priorities = new ArrayList<Integer>();
Iterator iterator = extensionPoint.keySet().iterator();
while (iterator.hasNext()) {
try {
@@ -556,11 +525,7 @@
return btnsDocuments;
}
- /**
- * This method initializes jPanel1
- *
- * @return JPanel
- */
+
private JPanel getJPanel1() {
if (jPanel1 == null) {
jPanel1 = new JPanel();
@@ -600,11 +565,7 @@
return jPanel1;
}
- /**
- * This method initializes lstDocs
- *
- * @return JList
- */
+
private JList getLstDocs() {
if (lstDocs == null) {
lstDocs = new JList();
@@ -630,10 +591,6 @@
public void mouseClicked(java.awt.event.MouseEvent e) {
if (e.getButton() == java.awt.event.MouseEvent.BUTTON3) {
- /*
- getDocumentSelected();//ProjectView
- getDocumentSelectedName();//Vista
- */
String docType = getDocumentSelected();
ProjectDocument[] selecteds = this.getSelecteds();
@@ -646,7 +603,7 @@
}
if (e.getClickCount() == 2) {
- abrir();
+ openSelectedDocument();
}
}
@@ -654,7 +611,7 @@
lstDocs.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
public void valueChanged(
javax.swing.event.ListSelectionEvent e) {
- activarBotones();
+ enableButtons();
}
});
}
@@ -662,19 +619,12 @@
return lstDocs;
}
- /**
- * This method initializes jPanel2
- *
- * @return JPanel
- */
+
private JPanel getJPanel2() {
if (jPanel2 == null) {
jPanel2 = new JPanel();
-
- //FlowLayout layout = new FlowLayout();
GridLayout layout = new GridLayout(5,1);
layout.setVgap(7);
-
jPanel2.setLayout(layout);
jPanel2.add(getBtnNuevo(), null);
jPanel2.add(getBtnAbrir(), null);
@@ -685,15 +635,10 @@
jPanel2.setMinimumSize(new java.awt.Dimension(100, 150));
jPanel2.setMaximumSize(new java.awt.Dimension(100, 150));
}
-
return jPanel2;
}
- /**
- * This method initializes btnNuevo
- *
- * @return JButton
- */
+
private JButton getBtnNuevo() {
if (btnNuevo == null) {
btnNuevo = new JButton();
@@ -715,11 +660,6 @@
return btnNuevo;
}
- /**
- * This method initializes btnPropiedades
- *
- * @return JButton
- */
private JButton getBtnPropiedades() {
if (btnPropiedades == null) {
btnPropiedades = new JButton();
@@ -729,7 +669,7 @@
btnPropiedades.setMargin(new java.awt.Insets(2, 2, 2, 2));
btnPropiedades.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
- propiedades();
+ showSelectedDocumentProperties();
}
});
}
@@ -737,11 +677,6 @@
return btnPropiedades;
}
- /**
- * This method initializes btnAbrir
- *
- * @return JButton
- */
private JButton getBtnAbrir() {
if (btnAbrir == null) {
btnAbrir = new JButton();
@@ -751,7 +686,7 @@
btnAbrir.setMargin(new java.awt.Insets(2, 2, 2, 2));
btnAbrir.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
- abrir();
+ openSelectedDocument();
}
});
}
@@ -759,11 +694,6 @@
return btnAbrir;
}
- /**
- * This method initializes btnBorrar
- *
- * @return JButton
- */
private JButton getBtnBorrar() {
if (btnBorrar == null) {
btnBorrar = new JButton();
@@ -773,7 +703,7 @@
btnBorrar.setMargin(new java.awt.Insets(2, 2, 2, 2));
btnBorrar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
- borrar();
+ removeSelectedDocuments();
}
});
}
@@ -781,11 +711,7 @@
return btnBorrar;
}
- /**
- * This method initializes btnRenombrar
- *
- * @return JButton
- */
+
private JButton getBtnRenombrar() {
if (btnRenombrar == null) {
btnRenombrar = new JButton();
@@ -795,7 +721,7 @@
btnRenombrar.setMargin(new java.awt.Insets(2, 2, 2, 2));
btnRenombrar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
- renombrar();
+ renameSelectedDocument();
}
});
}
@@ -803,11 +729,7 @@
return btnRenombrar;
}
- /**
- * This method initializes jPanel3
- *
- * @return JPanel
- */
+
private JPanel getJPanel3() {
if (jPanel3 == null) {
jPanel3 = new JPanel();
@@ -866,11 +788,7 @@
return jPanel3;
}
- /**
- * This method initializes jLabel
- *
- * @return JLabel
- */
+
private JLabel getJLabel() {
if (jLabel == null) {
jLabel = new JLabel();
@@ -881,11 +799,7 @@
return jLabel;
}
- /**
- * This method initializes lblNombreSesion
- *
- * @return JLabel
- */
+
private JLabel getLblNombreSesion() {
if (lblNombreSesion == null) {
lblNombreSesion = new JLabel();
@@ -898,11 +812,7 @@
return lblNombreSesion;
}
- /**
- * This method initializes jLabel1
- *
- * @return JLabel
- */
+
private JLabel getJLabel1() {
if (jLabel1 == null) {
jLabel1 = new JLabel();
@@ -913,11 +823,7 @@
return jLabel1;
}
- /**
- * This method initializes lblGuardado
- *
- * @return JLabel
- */
+
private JLabel getLblGuardado() {
if (lblGuardado == null) {
lblGuardado = new JLabel();
@@ -929,11 +835,6 @@
return lblGuardado;
}
- /**
- * This method initializes jLabel2
- *
- * @return JLabel
- */
private JLabel getJLabel2() {
if (jLabel2 == null) {
jLabel2 = new JLabel();
@@ -945,11 +846,7 @@
return jLabel2;
}
- /**
- * This method initializes lblFecha
- *
- * @return JLabel
- */
+
private JLabel getLblFecha() {
if (lblFecha == null) {
lblFecha = new JLabel();
@@ -961,11 +858,7 @@
return lblFecha;
}
- /**
- * This method initializes btnImportar
- *
- * @return JButton
- */
+
private JButton getBtnImportar() {
if (btnImportar == null) {
btnImportar = new JButton();
@@ -980,11 +873,7 @@
return btnImportar;
}
- /**
- * This method initializes btnExportar
- *
- * @return JButton
- */
+
private JButton getBtnExportar() {
if (btnExportar == null) {
btnExportar = new JButton();
@@ -999,11 +888,7 @@
return btnExportar;
}
- /**
- * This method initializes btnEditar
- *
- * @return JButton
- */
+
private JButton getBtnEditar() {
if (btnEditar == null) {
btnEditar = new JButton();
@@ -1025,11 +910,7 @@
return btnEditar;
}
- /**
- * This method initializes jScrollPane
- *
- * @return JScrollPane
- */
+
private JScrollPane getJScrollPane() {
if (jScrollPane == null) {
jScrollPane = new JScrollPane();
@@ -1089,11 +970,7 @@
public void viewActivated() {
}
- /**
- * This method initializes jPanel4
- *
- * @return JPanel
- */
+
private JPanel getJPanel4() {
if (jPanel4 == null) {
jPanel4 = new JPanel();
@@ -1109,11 +986,7 @@
return jPanel4;
}
- /**
- * This method initializes jScrollPane1
- *
- * @return javax.swing.JScrollPane
- */
+
private JScrollPane getJScrollPane1() {
if (jScrollPane1 == null) {
jScrollPane1 = new JScrollPane();
@@ -1127,4 +1000,4 @@
public Object getWindowProfile() {
return WindowInfo.PROJECT_PROFILE;
}
-} // @jve:decl-index=0:visual-constraint="10,10"
+}
\ No newline at end of file
Modified: trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/ProjectView.java
===================================================================
--- trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/ProjectView.java 2013-11-23 15:41:21 UTC (rev 1072)
+++ trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/ProjectView.java 2013-11-23 15:45:14 UTC (rev 1073)
@@ -47,16 +47,15 @@
import java.util.Map.Entry;
import com.hardcode.gdbms.driver.exceptions.ReadDriverException;
-import com.hardcode.gdbms.engine.data.driver.DriverException;
import com.iver.andami.PluginServices;
import com.iver.andami.ui.mdiManager.IWindow;
import com.iver.cit.gvsig.fmap.MapContext;
-import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
import com.iver.cit.gvsig.fmap.layers.FLayer;
import com.iver.cit.gvsig.fmap.layers.FLayers;
import com.iver.cit.gvsig.fmap.layers.LayersIterator;
import com.iver.cit.gvsig.fmap.layers.XMLException;
import com.iver.cit.gvsig.fmap.layers.layerOperations.AlphanumericData;
+import com.iver.cit.gvsig.gui.preferencespage.ViewPage;
import com.iver.cit.gvsig.project.Project;
import com.iver.cit.gvsig.project.documents.ProjectDocument;
import com.iver.cit.gvsig.project.documents.ProjectDocumentFactory;
@@ -74,34 +73,14 @@
* @author Fernando Gonz\xE1lez Cort\xE9s
*/
public class ProjectView extends ProjectViewBase {
- //public static int numViews = 0;
- //public static int METROS = 0;
- //public static int KILOMETROS = 1;
- //public static int[] unidades = new int[] { METROS, KILOMETROS };
- ///private Color backgroundColor = new Color(255, 255, 255);
-
-
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- * @throws XMLException
- * @throws SaveException
- */
public XMLEntity getXMLEntity() throws SaveException {
XMLEntity xml = super.getXMLEntity();
- //xml.putProperty("nameClass", this.getClass().getName());
try{
int numViews=((Integer)ProjectDocument.NUMS.get(ProjectViewFactory.registerName)).intValue();
xml.putProperty("numViews", numViews);
- // remove old hyperlink persistence
-// xml.putProperty("m_selectedField", m_selectedField);
-// xml.putProperty("m_typeLink", m_typeLink);
-// xml.putProperty("m_extLink", m_extLink);
xml.addChild(mapContext.getXMLEntity());
if (mapOverViewContext != null) {
@@ -121,14 +100,6 @@
}
/**
- * DOCUMENT ME!
- *
- * @param xml DOCUMENT ME!
- * @param p DOCUMENT ME!
- * @throws XMLException
- * @throws DriverException
- * @throws DriverIOException
- *
* @see com.iver.cit.gvsig.project.documents.ProjectDocument#setXMLEntity(com.iver.utiles.XMLEntity)
*/
public void setXMLEntity03(XMLEntity xml)
@@ -149,15 +120,6 @@
}
/**
- * DOCUMENT ME!
- *
- * @param xml DOCUMENT ME!
- * @param p DOCUMENT ME!
- * @throws XMLException
- * @throws DriverException
- * @throws DriverIOException
- * @throws OpenException
- *
* @see com.iver.cit.gvsig.project.documents.ProjectDocument#setXMLEntity(com.iver.utiles.XMLEntity)
*/
public void setXMLEntity(XMLEntity xml)
@@ -189,9 +151,7 @@
applyHyperlinkToLayers(selectedField, type, extension);
}
-
-
- showErrors();
+ showErrors();
}catch (Exception e) {
throw new OpenException(e,this.getClass().getName());
}
@@ -224,22 +184,6 @@
}
- /**
- * DOCUMENT ME!
- *
- * @param p DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- * @throws XMLException
- * @throws DriverException
- * @throws DriverIOException
- * @throws OpenException
- */
- /*public ProjectView cloneProjectView(Project p)
- throws XMLException, DriverException, DriverIOException, OpenException {
- return (ProjectView) createFromXML(getXMLEntity(), p);
- }
-*/
public String getFrameName() {
return PluginServices.getText(this,"Vista");
@@ -251,6 +195,13 @@
view.setWindowData(windowData);
view.initialize();
view.setModel(this);
+ XMLEntity xml = PluginServices.getPluginServices(this)
+ .getPersistentXML();
+ if (xml.contains(ViewPage.OPEN_VIEW_WINDOW_MAXIMIZED)) {
+ view.getWindowInfo()
+ .setMaximized(
+ xml.getBooleanProperty(ViewPage.OPEN_VIEW_WINDOW_MAXIMIZED));
+ }
callCreateWindow(view);
return view;
}
@@ -301,19 +252,16 @@
}
-
-
//Cargamos las tables vinculadas:
//Recuperamos todos los nombres
XMLEntity tablesRoot = project.getExportXMLTypeRootNode(root,ProjectTableFactory.registerName);
- int childIndex;
XMLEntity child;
// Lo hacemos en un map por si una vista se usa varias veces
- HashMap tablesName = new HashMap();
- Iterator iterTables = tablesRoot.findChildren("viewName",this.getName());
+ HashMap<String, String> tablesName = new HashMap<String, String>();
+ Iterator<XMLEntity> iterTables = tablesRoot.findChildren("viewName",this.getName());
while (iterTables.hasNext()){
- child = (XMLEntity)iterTables.next();
+ child = iterTables.next();
tablesName.put(child.getStringProperty("name"),child.getStringProperty("name"));
}
@@ -363,49 +311,4 @@
}
-// public int computeSignature() {
-// int result = 17;
-//
-// Class clazz = getClass();
-// Field[] fields = clazz.getDeclaredFields();
-// for (int i = 0; i < fields.length; i++) {
-// try {
-// String type = fields[i].getType().getName();
-// if (type.equals("boolean")) {
-// result += 37 + ((fields[i].getBoolean(this)) ? 1 : 0);
-// } else if (type.equals("java.lang.String")) {
-// Object v = fields[i].get(this);
-// if (v == null) {
-// result += 37;
-// continue;
-// }
-// char[] chars = ((String) v).toCharArray();
-// for (int j = 0; j < chars.length; j++) {
-// result += 37 + (int) chars[i];
-// }
-// } else if (type.equals("byte")) {
-// result += 37 + (int) fields[i].getByte(this);
-// } else if (type.equals("char")) {
-// result += 37 + (int) fields[i].getChar(this);
-// } else if (type.equals("short")) {
-// result += 37 + (int) fields[i].getShort(this);
-// } else if (type.equals("int")) {
-// result += 37 + fields[i].getInt(this);
-// } else if (type.equals("long")) {
-// long f = fields[i].getLong(this) ;
-// result += 37 + (f ^ (f >>> 32));
-// } else if (type.equals("float")) {
-// result += 37 + Float.floatToIntBits(fields[i].getFloat(this));
-// } else if (type.equals("double")) {
-// long f = Double.doubleToLongBits(fields[i].getDouble(this));
-// result += 37 + (f ^ (f >>> 32));
-// } else {
-// Object obj = fields[i].get(this);
-// result += 37 + ((obj != null)? obj.hashCode() : 0);
-// }
-// } catch (Exception e) { e.printStackTrace(); }
-//
-// }
-// return result;
-// }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|