Revision 3480

View differences:

trunk/applications/appCatalogYNomenclatorClient/text.properties
101 101
errorServerException=El servidor ha devuelto una excepci?n
102 102
errorSOAPProtocol=Error en el protocolo SOAP
103 103
errorFENotSupported=De momento solo se pueden hacer querys usando la codificaci?n FILTER ENCODING que no est? soportada por el servidor
104
mantainold=Eliminar las busquedas anteriores
105
goto=Hacer un zoom a la b?squeda
106
aspect=Configuracion de aspecto
104 107

  
trunk/applications/appCatalogYNomenclatorClient/src/es/gva/cit/catalogClient/ui/serverConnect/ServerConnectPanel.java
515 515
        }
516 516

  
517 517
        return dbText.getText();
518
    }
519
    
518
    }  
520 519
 
521 520
    
522 521

  
trunk/applications/appCatalogYNomenclatorClient/src/es/gva/cit/gazetteer/querys/Query.java
57 57
    private Coordinates coordinates;
58 58
    private String coordinatesFilter;
59 59
    private boolean isCoordinatesClicked;
60
    private boolean isGotoclicked;
61
    private boolean isKeepOldClicked;
60 62
       
61 63
    
62 64
    /**
......
196 198
    public void setCoordinatesClicked(boolean isCoordinatesClicked) {
197 199
        this.isCoordinatesClicked = isCoordinatesClicked;
198 200
    }
201
    /**
202
     * @return Returns the isGotoclicked.
203
     */
204
    public boolean isGotoclicked() {
205
        return isGotoclicked;
206
    }
207
    /**
208
     * @param isGotoclicked The isGotoclicked to set.
209
     */
210
    public void setGotoclicked(boolean isGotoclicked) {
211
        this.isGotoclicked = isGotoclicked;
212
    }
213
    /**
214
     * @return Returns the isKeepOldClicked.
215
     */
216
    public boolean isKeepOldClicked() {
217
        return isKeepOldClicked;
218
    }
219
    /**
220
     * @param isKeepOldClicked The isKeepOldClicked to set.
221
     */
222
    public void setKeepOldClicked(boolean isKeepOldClicked) {
223
        this.isKeepOldClicked = isKeepOldClicked;
224
    }
199 225
}
trunk/applications/appCatalogYNomenclatorClient/src/es/gva/cit/gazetteer/ui/showResults/ShowResultsDialog.java
61 61
    protected GazetteerClient client;
62 62
    protected Feature[] features;
63 63
    int recordsByPage;
64
    protected boolean isGotoClicked;
65
    protected boolean isKeepOldClicked;
64 66

  
65 67
    /**
66 68
     * Crea un nuevo ShowResultsDialog.
67 69
     *
68
     * @param client DOCUMENT ME!
69
     * @param features DOCUMENT ME!
70
     * @param recordsByPage DOCUMENT ME!
70
     * @param client 
71
     * Gazetteer Client
72
     * @param features
73
     * The found features  
74
     * @param recordsByPage
75
     * Number of records that will be showed 
71 76
     */
72 77
    public ShowResultsDialog(GazetteerClient client, Feature[] features,
73
        int recordsByPage) {
78
        int recordsByPage, boolean isGotoClicked, boolean isKeepOldClicked) {
74 79
        super();
75 80
        this.client = client;
76 81
        this.features = features;
77 82
        this.recordsByPage = recordsByPage;
83
        this.isGotoClicked = isGotoClicked;
84
        this.isKeepOldClicked = isKeepOldClicked;
78 85
        initialize();
79 86
    }
80 87

  
......
88 95
        this.setTitle("Cliente Gazetteer");
89 96

  
90 97
        ShowResultsDialogPanel panel = new ShowResultsDialogPanel(client,
91
                features, recordsByPage, new WithOutAndamiTranslator());
98
                features, recordsByPage, new WithOutAndamiTranslator(),isGotoClicked,isKeepOldClicked);
92 99
        panel.setParent(this);
93 100
        getContentPane().add(panel);
94 101

  
trunk/applications/appCatalogYNomenclatorClient/src/es/gva/cit/gazetteer/ui/showResults/ShowResultsDialogPanel.java
65 65
    protected ShowResultsPanel ppalPanel = null;
66 66
    protected Feature[] features = null;
67 67
    protected GazetteerClient client = null;
68
    protected boolean isGotoClicked;
69
    protected boolean isKeepOldClicked;
70

  
68 71
    
69 72
    private int currentPage = 0;
70 73
    private int recordsByPage = 0;
......
76 79
    private ITranslator translator = null;
77 80

  
78 81
    public ShowResultsDialogPanel(GazetteerClient client, Feature[] features,
79
            int recordsByPage,ITranslator translator) {
82
            int recordsByPage,ITranslator translator,boolean isGotoClicked, boolean isKeepOldClicked) {
80 83
        this.features = features;
81 84
        this.client = client;
82 85
        this.currentPage = 1;
83 86
        this.recordsByPage = recordsByPage;
84 87
        this.translator = translator;
88
        this.isGotoClicked = isGotoClicked;
89
        this.isKeepOldClicked = isKeepOldClicked;
85 90
         initialize(client,features,recordsByPage);     
86 91
    }
87 92

  
trunk/applications/appCatalogYNomenclatorClient/src/es/gva/cit/gazetteer/ui/search/SearchDialogPanel.java
293 293
               lowerPanel.getNPaginas(),
294 294
               lowerPanel.getCoordenadas(),
295 295
               lowerPanel.getCoordenadasOpcion());
296
       query.setCoordinatesClicked(upperPanel.getRestrictAreaClicked());
296
       query.setCoordinatesClicked(upperPanel.isRestrictAreaClicked());
297
       query.setGotoclicked(lowerPanel.isGoToClicked());
298
       query.setKeepOldClicked(lowerPanel.isKeepOldClicked());
297 299
       return query;
298 300
    }
299 301
    
......
357 359
    }
358 360
    
359 361
    protected void ShowResultsActionPerformed(Feature[] features){
360
        new ShowResultsDialog(client,features,lowerPanel.getNPaginas());
362
        new ShowResultsDialog(client,
363
                features,
364
                lowerPanel.getNPaginas(),
365
                lowerPanel.isGoToClicked(),
366
                lowerPanel.isKeepOldClicked());
361 367
    }    
362 368
   
363 369
    /**
trunk/applications/appCatalogYNomenclatorClient/src/es/gva/cit/gazetteer/ui/search/SearchLowerPanel.java
62 62

  
63 63
import javax.swing.JScrollPane;
64 64
import javax.swing.tree.DefaultMutableTreeNode;
65
import javax.swing.JCheckBox;
66
import java.awt.FlowLayout;
67
import java.awt.GridBagLayout;
68
import java.awt.GridBagConstraints;
65 69
/**
66 70
 * @author Jorge Piera Llodra (piera_jor@gva.es)
67 71
 */
......
91 95
    private JLabel BRYLabel = null;
92 96
    private JTextField BRYText = null;
93 97
    private JPanel jPanel = null;
94
    private JPanel jPanel8 = null;
98
    private JPanel panelShowOptions = null;
95 99
    private JPanel panelNResultadosCombo = null;
96 100
    private JPanel panelLabTipo = null;
97 101
    private JPanel panelListTipo = null;
98 102
    private JLabel tipoLabel = null;
99 103
    private ThesaurusJTree thesaurusTree = null;
100 104
    private JComboBox coordenadasCombo = null;
101
    private JPanel jPanel4 = null;
105
    private JPanel panelCoordinates = null;
102 106
    private JPanel componentesPanel = null;
103 107
    private JScrollPane jScrollThesaurus = null;
104 108
    private ITranslator translator = null;
105 109
    private String serverType = null;
106 110
	
111
	private JCheckBox checkBGoTo = null;
112
	private JCheckBox checkBKeepOld = null;
113
	private JPanel jPanel1 = null;
114
	private JPanel panelShowOptionsPosition = null;
107 115
   /**
108 116
    * 
109 117
    * @param features
......
120 128
        this.serverType = serverType;
121 129
        initialize();
122 130
        disableComponents(serverType);
131
        getCheckBGoTo().setSelected(true);
132
        getCheckBKeepOld().setSelected(true);
123 133
    }
124 134

  
125 135
    /**
......
267 277
            panelRigth.setLayout(new BoxLayout(
268 278
                    panelRigth, BoxLayout.Y_AXIS));
269 279
            panelRigth.setPreferredSize(new java.awt.Dimension(250,320));
270
            panelRigth.add(getJPanel4(), null);
271
            panelRigth.add(getJPanel8(), null);
280
            panelRigth.add(getPanelCoordinates(), null);
281
            panelRigth.add(getPanelShowOptions(), null);
282
            panelRigth.add(getJPanel1(), null);
272 283
        }
273 284

  
274 285
        return panelRigth;
......
429 440
     *
430 441
     * @return javax.swing.JPanel
431 442
     */
432
    private JPanel getJPanel8() {
433
        if (jPanel8 == null) {
434
            jPanel8 = new JPanel();
435
            jPanel8.setPreferredSize(new java.awt.Dimension(10,200));
443
    private JPanel getPanelShowOptions() {
444
        if (panelShowOptions == null) {
445
            FlowLayout flowLayout4 = new FlowLayout();
446
            panelShowOptions = new JPanel();
447
            panelShowOptions.setLayout(flowLayout4);
448
            panelShowOptions.setPreferredSize(new java.awt.Dimension(10,75));
449
            panelShowOptions.setBorder(javax.swing.BorderFactory.createTitledBorder(null, Translator.getText(translator,"aspect"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
450
            flowLayout4.setAlignment(java.awt.FlowLayout.LEFT);
451
            panelShowOptions.add(getPanelShowOptionsPosition(), null);
436 452
        }
437 453

  
438
        return jPanel8;
454
        return panelShowOptions;
439 455
    }
440 456

  
441 457
    /**
......
607 623
     *
608 624
     * @return javax.swing.JPanel
609 625
     */
610
    private JPanel getJPanel4() {
611
        if (jPanel4 == null) {
612
            jPanel4 = new JPanel();
613
            jPanel4.setLayout(new BoxLayout(jPanel4, BoxLayout.Y_AXIS));
614
            jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(
626
    private JPanel getPanelCoordinates() {
627
        if (panelCoordinates == null) {
628
            panelCoordinates = new JPanel();
629
            panelCoordinates.setLayout(new BoxLayout(panelCoordinates, BoxLayout.Y_AXIS));
630
            panelCoordinates.setBorder(javax.swing.BorderFactory.createTitledBorder(
615 631
                    null, Translator.getText(translator,"coordinates"),
616 632
                    javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
617 633
                    javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
618
            jPanel4.setPreferredSize(new java.awt.Dimension(315,175));
619
            jPanel4.add(getPanelSuperiores(), null);
620
            jPanel4.add(getPanelInferiores(), null);
621
            jPanel4.add(getJPanel(), null);
634
            panelCoordinates.setPreferredSize(new java.awt.Dimension(315,175));
635
            panelCoordinates.add(getPanelSuperiores(), null);
636
            panelCoordinates.add(getPanelInferiores(), null);
637
            panelCoordinates.add(getJPanel(), null);
622 638
        }
623 639

  
624
        return jPanel4;
640
        return panelCoordinates;
625 641
    }
626 642

  
627 643
    /**
......
729 745
        
730 746
    }
731 747
    
732
  } //  @jve:decl-index=0:visual-constraint="10,10"
748
	/**
749
	 * This method initializes jCheckBox	
750
	 * 	
751
	 * @return javax.swing.JCheckBox	
752
	 */    
753
	private JCheckBox getCheckBGoTo() {
754
		if (checkBGoTo == null) {
755
			checkBGoTo = new JCheckBox();
756
			checkBGoTo.setText(Translator.getText(translator,"goto"));
757
		}
758
		return checkBGoTo;
759
	}
760
	/**
761
	 * This method initializes jCheckBox	
762
	 * 	
763
	 * @return javax.swing.JCheckBox	
764
	 */    
765
	private JCheckBox getCheckBKeepOld() {
766
		if (checkBKeepOld == null) {
767
			checkBKeepOld = new JCheckBox();
768
			checkBKeepOld.setText(Translator.getText(translator,"mantainold"));
769
		}
770
		return checkBKeepOld;
771
	}
772
	/**
773
	 * This method initializes jPanel1	
774
	 * 	
775
	 * @return javax.swing.JPanel	
776
	 */    
777
	private JPanel getJPanel1() {
778
		if (jPanel1 == null) {
779
			jPanel1 = new JPanel();
780
			jPanel1.setPreferredSize(new java.awt.Dimension(10,300));
781
		}
782
		return jPanel1;
783
	}
784
	/**
785
	 * This method initializes jPanel2	
786
	 * 	
787
	 * @return javax.swing.JPanel	
788
	 */    
789
	private JPanel getPanelShowOptionsPosition() {
790
		if (panelShowOptionsPosition == null) {
791
			panelShowOptionsPosition = new JPanel();
792
			panelShowOptionsPosition.setLayout(new BoxLayout(panelShowOptionsPosition, BoxLayout.Y_AXIS));
793
			panelShowOptionsPosition.add(getCheckBGoTo(), null);
794
			panelShowOptionsPosition.add(getCheckBKeepOld(), null);
795
		}
796
		return panelShowOptionsPosition;
797
	}
798
	
799
	/**
800
	 * It returns if the GOTO component is clicked
801
	 * @return
802
	 */
803
	public boolean isGoToClicked(){
804
	    return getCheckBGoTo().isSelected();
805
	}
806
	
807
	/**
808
	 * return if the Mantain Old button is enabled
809
	 * @return
810
	 */
811
	public boolean isKeepOldClicked(){
812
	    return getCheckBKeepOld().isSelected();
813
	}
814
    } //  @jve:decl-index=0:visual-constraint="10,10"
trunk/applications/appCatalogYNomenclatorClient/src/es/gva/cit/gazetteer/ui/search/SearchUpperPanel.java
178 178
    /* (non-Javadoc)
179 179
     * @see es.gva.cit.catalogClient.ui.ISearchPanel#getRestrictAreaClicked()
180 180
     */
181
    public boolean getRestrictAreaClicked() {
181
    public boolean isRestrictAreaClicked() {
182 182
        // TODO Auto-generated method stub
183 183
        return coordinatesCheckBox.isSelected();
184 184
    }
trunk/extensions/extCatalogYNomenclator/src/es/gva/cit/gvsig/gazetteer/gui/ShowResultsDialog.java
55 55
 * @author Jorge Piera Llodra (piera_jor@gva.es)
56 56
 */
57 57
public class ShowResultsDialog extends ShowResultsDialogPanel implements View  {
58
    private SearchDialog searchDialog= null;
58
    private SearchDialog searchDialog = null;
59 59
    
60 60
    /**
61 61
     * @param client
62 62
     * @param features
63 63
     * @param recordsByPage
64 64
     */
65
    public ShowResultsDialog(GazetteerClient client, Feature[] features, int recordsByPage) {
66
        super(client, features, recordsByPage,new AndamiTranslation());
67
        
68
        
65
    public ShowResultsDialog(GazetteerClient client, Feature[] features, int recordsByPage,boolean isGotoClicked, boolean isKeepOldClicked) {
66
        super(client, features, recordsByPage,new AndamiTranslation(),isGotoClicked,isKeepOldClicked);
69 67
    }
70 68

  
71 69
      /* (non-Javadoc)
......
91 89
   public void loadButtonActionPerformed() {
92 90
       Feature feature = ppalPanel.getFeature();
93 91
       if (feature != null){
94
           new FeatureLoader().load(feature,true,true);
92
           new FeatureLoader().load(feature,isGotoClicked,isKeepOldClicked);
95 93
       }
96 94
       closeJDialog();
97 95
       //getSearchDialog().closeJDialog();
trunk/extensions/extCatalogYNomenclator/src/es/gva/cit/gvsig/gazetteer/gui/SearchDialog.java
80 80
    }
81 81
    
82 82
    public void ShowResultsActionPerformed(Feature[] features) {
83
        ShowResultsDialog dialog = new ShowResultsDialog(client,features,lowerPanel.getNPaginas());
83
        ShowResultsDialog dialog = new ShowResultsDialog(client,
84
                features,
85
                lowerPanel.getNPaginas(),
86
                lowerPanel.isGoToClicked(),
87
                lowerPanel.isKeepOldClicked());
84 88
		dialog.setBounds(0, 0, 420, 227);
85 89
		dialog.setName(PluginServices.getText(this, "gazetteer_search"));
86 90
		dialog.setVisible(true);
trunk/extensions/extCatalogYNomenclator/src/es/gva/cit/gvsig/gazetteer/loaders/FeatureLoader.java
62 62
 * 
63 63
 * @author Jorge Piera Llodra (piera_jor@gva.es)
64 64
 */
65
public class FeatureLoader extends AbstractLoader{
66
     
65
public class FeatureLoader extends AbstractLoader{     
67 66
    /**
68 67
     * It makes a zoom in gvSIG
69 68
     * @param
......
76 75
     * @return
77 76
     * true or false if fail
78 77
     */
79
    public boolean load(Feature feature,boolean focus,boolean removeOld) {
80
        if (removeOld){
81
            removeOldSearches();
82
        }
78
    public boolean load(Feature feature,boolean isGotoClicked,boolean isRemoveOldClicked) {
83 79
        
84
        addAndDrawLabel(feature);
80
        addAndDrawLabel(feature,isRemoveOldClicked);
85 81
        
86
        if (focus){
82
        if (isGotoClicked){
87 83
            focusCenter(feature);
88 84
        }        
89 85
       
......
110 106
                10000,
111 107
                10000));
112 108
        }          
113
    }
109
    } 
114 110
    
115 111
    /**
116
     * This method removes all the old searches
117
     *
118
     */
119
    private void removeOldSearches(){
120
        com.iver.cit.gvsig.gui.View activeView = 
121
			(com.iver.cit.gvsig.gui.View) PluginServices.getMDIManager().getActiveView();
122
        
123
        GraphicLayer lyr = activeView.getMapControl().getMapContext().getGraphicsLayer();
124
        lyr.clearAllGraphics();
125
        activeView.getMapControl().drawGraphics();
126
    }
127
    
128
    /**
129 112
     * It adds a new Label to the current view
130 113
     * @param feature
131 114
     * To obtain the coordinates and the toponim name
115
     * @param isRemoveOldClicked
116
     * To remove or keep the old searches
132 117
     */
133
    private void addAndDrawLabel(Feature feature){
118
    private void addAndDrawLabel(Feature feature,boolean isRemoveOldClicked){
134 119
        com.iver.cit.gvsig.gui.View activeView = 
135 120
			(com.iver.cit.gvsig.gui.View) PluginServices.getMDIManager().getActiveView();
136 121
        
137 122
        GraphicLayer lyr = activeView.getMapControl().getMapContext().getGraphicsLayer();
138
                
139
        FSymbol theSymbol = new FSymbol(FConstant.SYMBOL_TYPE_POINT); 
123
        if (isRemoveOldClicked){
124
            lyr.clearAllGraphics();
125
        }
126
        
127
        FSymbol theSymbol = new FSymbol(FConstant.SYMBOL_TYPE_TEXT); 
140 128
        theSymbol.setColor(Color.RED);
129
        theSymbol.setStyle(FConstant.SYMBOL_STYLE_MARKER_CIRCLE);
130
        theSymbol.setFontColor(Color.BLACK);
131
                   
141 132
        int idSymbol = lyr.addSymbol(theSymbol);
142 133
        
143
        IGeometry geom = ShapeFactory.createPoint2D(new FPoint2D(feature.getCoordinates().getX(),
144
		        feature.getCoordinates().getY()));
134
        IGeometry geom = ShapeFactory.createPoint2D(new FPoint2D(feature.getCoordinates()));
145 135
              
146 136
        FGraphicLabel theLabel = new FGraphicLabel(geom, idSymbol, feature.getName());
147 137
        lyr.addGraphic(theLabel);
148 138
       
149 139
        activeView.getMapControl().drawGraphics();
150
              
140
        
141
        //This line could look stupid, but is necessary because grawGraphics does't
142
        //remove the old Graphics searched
143
        activeView.getMapControl().getViewPort().setExtent(activeView.getMapControl().getViewPort().getExtent());
151 144
    }
152 145
}
trunk/extensions/extCatalogYNomenclator/text.properties
101 101
errorServerException=El servidor ha devuelto una excepci?n
102 102
errorSOAPProtocol=Error en el protocolo SOAP
103 103
errorFENotSupported=De momento solo se pueden hacer querys usando la codificaci?n FILTER ENCODING que no est? soportada por el servidor
104
mantainold=Eliminar las busquedas anteriores
105
goto=Hacer un zoom a la b?squeda
106
aspect=Configuracion de aspecto
trunk/extensions/extCatalogYNomenclator/text_en.properties
100 100
errorIsASRWServer=It is a SRW server!
101 101
errorServerException=The server has returned an exception
102 102
errorSOAPProtocol=SOAP error
103
errorFENotSupported=gvSIG only supports the Filter Encoding Language to do Querys
103
errorFENotSupported=gvSIG only supports the Filter Encoding Language to do Querys
104
mantainold=Remove old searches
105
goto=Go to the place
106
aspect=Aspect Setup

Also available in: Unified diff