Revision 1367 org.gvsig.raster.wms/trunk/org.gvsig.raster.wms/org.gvsig.raster.wms.app/org.gvsig.raster.wms.app.wmsclient/src/main/java/org/gvsig/raster/wms/app/wmsclient/infobypoint/MainInfoByPointDialog.java

View differences:

MainInfoByPointDialog.java
24 24
import java.awt.BorderLayout;
25 25
import java.awt.Component;
26 26
import java.awt.Dimension;
27
import java.io.Reader;
28 27
import java.util.HashMap;
29 28

  
30 29
import javax.swing.ImageIcon;
......
110 109
		if(type.equals("text/html")) {
111 110
			HTMLEditorKit kit = new HTMLEditorKit();
112 111
			jeditor.setEditorKit(kit);
113

  
114
			if(text.contains("<style") && text.contains("</style>")) {
115
				int initIndex = text.indexOf("<style");
116
				int endIndex = text.indexOf("</style>");
117
				text = text.substring(0, initIndex) + text.substring(endIndex + 8, text.length());
118
			}
119 112
			
113
			text = removeLabelBlock(text, "style");
114
			text = removeLabelBlock(text, "meta");
115
			
120 116
			StyleSheet s = kit.getStyleSheet();
121 117
			s.addRule("body {font-family:verdana; margin: 15px; }");
122 118
			s.addRule("caption {background-color:#FBFFE1;font-style:normal;color:black}");
......
129 125
		jeditor.setText(text);
130 126
	}
131 127
	
128
	/**
129
	 * Removes a label from the text
130
	 * @param text
131
	 * @param label
132
	 * @return
133
	 */
134
	private String removeLabelBlock(String text, String label) {
135
		if(text.contains("<" + label) && text.contains("/" + label + ">")) {
136
			int initIndex = text.indexOf("<" + label);
137
			int endIndex = text.indexOf("/" + label + ">");
138
			return text.substring(0, initIndex) + text.substring(endIndex + 7, text.length());
139
		}
140
		return text;
141
	}
142
	
132 143
	/*
133 144
	 * (non-Javadoc)
134 145
	 * @see com.iver.andami.ui.mdiManager.IWindow#getWindowInfo()
......
137 148
		WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODELESSDIALOG | WindowInfo.RESIZABLE);
138 149
		m_viewinfo.setTitle(PluginServices.getText(this, "WMS InfoByPoint"));
139 150
		m_viewinfo.setHeight(380);
140
		m_viewinfo.setWidth(500);
151
		m_viewinfo.setWidth(700);
141 152
		return m_viewinfo;
142 153
	}
143 154
	

Also available in: Unified diff