Revision 6501 trunk/extensions/extWCS/src/com/iver/cit/gvsig/gui/panels/InfoPanel.java

View differences:

InfoPanel.java
43 43
*
44 44
* $Id$
45 45
* $Log$
46
* Revision 1.3  2006-05-23 10:37:39  jaume
46
* Revision 1.4  2006-07-21 11:51:55  jaume
47
* improved appearance
48
*
49
* Revision 1.3  2006/05/23 10:37:39  jaume
47 50
* fixed import of Cancellable
48 51
*
49 52
* Revision 1.2  2006/03/28 09:14:04  jaume
......
69 72
    private final String bgColor1 = "\"#EAEAEA\""; // light grey
70 73
    private final String bgColor2 = "\"#F2FEFF\""; // light blue
71 74
    private final String bgColor3 = "\"#FBFFE1\""; // light yellow
72
    
75

  
73 76
    private final String service_title       = PluginServices.getText(this, "service_info");
74 77
    private final String server              = PluginServices.getText(this, "server");
75 78
    private final String server_type         = PluginServices.getText(this, "server_type");
......
85 88
    private final String properties			 = PluginServices.getText(this, "properties");
86 89
    private final String layer_name			 = PluginServices.getText(this, "name");
87 90
	private JEditorPane editor = null;
88
    
89
    
91

  
92

  
90 93
    /**
91 94
     * Creates a new instance of InfoPanel with double buffer and null layout
92 95
     *
......
95 98
		super();
96 99
        setLayout(null);
97 100
        JScrollPane src = new JScrollPane();
98
        src.setBounds(5, 5, 455, 375);
101
        src.setBounds(5, 5, 485, 375);
99 102
        add(src, null);
100 103
        src.setViewportView(getEditor());
101 104
	}
102 105

  
103 106
    /**
104
     * This method initializes tblInfo  
105
     *  
106
     * @return javax.swing.JTable   
107
     */    
107
     * This method initializes tblInfo
108
     *
109
     * @return javax.swing.JTable
110
     */
108 111
    private JEditorPane getEditor() {
109 112
        if (editor == null) {
110 113
            editor = new JEditorPane();
......
113 116
        return editor;
114 117
    }
115 118

  
116
    
119

  
117 120
    /**
118 121
     * Fills the text pane with a data table describing the service and the
119 122
     * selected settings.
120
     * 
123
     *
121 124
     * @param WCSWizardData dataSource: connection info
122 125
     * @param WCSLayer layer: the selected layer
123 126
     * @param String time: the time value.
......
125 128
     * @param String crs: the CRS value
126 129
     * @param String parameters: comma-separated key-value string containing the values for the parameters
127 130
     */
128
    
131

  
129 132
    public void refresh(WCSWizardData dataSource, WCSLayer layer, String time, String format, String crs, String parameters) {
130
        
133

  
131 134
        String server_text = dataSource.getHost();
132 135
        String server_type_text = dataSource.getServerType();
133
        String server_title_text = dataSource.getTitle(); 
136
        String server_title_text = dataSource.getTitle();
134 137
        String server_abstract_text = dataSource.getAbstract();
135 138
        String font = "Arial";
136
        
137
        if (server_text == null) 
139

  
140
        if (server_text == null)
138 141
            server_text = "-";
139 142
        if (server_type_text == null)
140 143
            server_type_text = "-";
......
142 145
            server_title_text = "-";
143 146
        if (server_abstract_text == null)
144 147
            server_abstract_text = "-";
145
        
148

  
146 149
        if (format == null)
147 150
            format = PluginServices.getText(this, "none_selected");
148 151
        if (crs == null)
149 152
            crs = PluginServices.getText(this, "none_selected");
150
        
153

  
151 154
        String layers_html = "";
152 155
        if (layer!=null) {
153 156
            String layer_name_text = layer.getName();
154 157
            String time_text = (time==null) ? PluginServices.getText(this, "not_available") : time;//((FMapWMSStyle) selectedStyles.get(i)).title;
155 158
            String layer_abstract_text = layer.getDescription();
156 159
            String layer_title_text = layer.getTitle();
157
        
160

  
158 161
            if (layer_name_text ==null)
159 162
            	layer_name_text = "-";
160 163
            if (time_text==null)
......
203 206
        			"  </tr>";
204 207
        		swap = !swap;
205 208
        	}
206
        	parameter_html += 
209
        	parameter_html +=
207 210
        		"  <tr>" +
208 211
        		"  </tr>";
209
        }	
212
        }
210 213
        if (!parameter_html.equals(""))
211
        	parameter_html = 
214
        	parameter_html =
212 215
        		"  <tr valign=\"top\">" +
213 216
        		"    <td width=\"92\" height=\"18\" bgcolor="+bgColor3+" colspan=\"2\"><font face=\""+font+"\" size=\"4\"><b>"+selected_parameters+"</font></b></td>" +
214 217
        		"  </tr>" + parameter_html;
215
        
216
        String format_html = 
218

  
219
        String format_html =
217 220
        	"  <tr valign=\"top\" bgcolor=\"#FFFFFF\">" +
218 221
            "    <td width=\"92\" height=\"18\" bgcolor="+bgColor3+" colspan=\"2\"><font face=\""+font+"\" size=\"4\"><b>"+properties+"</font></b></td>" +
219
            "  </tr>" + 
222
            "  </tr>" +
220 223
            "  <tr valign=\"top\" bgcolor="+bgColor0+">" +
221 224
            "    <td height=\"18\" bgcolor=\"#D6D6D6\" align=\"right\"><font face=\""+font+"\" size=\"3\"><b>"+format_title+"</b></font></td>" +
222 225
            "    <td><font face=\""+font+"\" size=\"3\"><font face=\""+font+"\" size=\"3\">"+format+"</font></td>" +
......
225 228
            "    <td height=\"18\" bgcolor=\"#D6D6D6\" align=\"right\"><font face=\""+font+"\" size=\"3\"><b>"+srs_title+"</font></b></td>" +
226 229
            "    <td><font face=\""+font+"\" size=\"3\">"+crs+"</font></td>" +
227 230
            "  </tr>";
228
            
229
        String html = 
230 231

  
232
        String html =
233

  
231 234
            "<html>" +
232 235
            "<body>" +
233 236
            "<table align=\"center\" width=\"437\" height=\"156\" border=\"0\" cellpadding=\"4\" cellspacing=\"4\">" +
......
250 253
            "    <td height=\"18\" bgcolor=\"#D6D6D6\" align=\"right\"><font face=\""+font+"\" size=\"3\"><b>"+server_abstract+"</font></b></td>" +
251 254
            "    <td><font face=\""+font+"\" size=\"3\">"+server_abstract_text+"</font></td>" +
252 255
            "  </tr>" +
253
            
256

  
254 257
            "  <tr>" +
255 258
            "  </tr>" +
256 259
            layers_html +
......
259 262
            "</table>" +
260 263
            "</body>" +
261 264
            "</html>";
262
        
265

  
263 266
        getEditor().setContentType("text/html");
264 267
        getEditor().setText(html);
265 268
    }

Also available in: Unified diff