@ -7,9 +7,13 @@ import com.fr.design.mainframe.share.ui.online.CarouselStateManger;
import com.fr.design.mainframe.share.ui.widgetfilter.FilterPane ;
import com.fr.design.mainframe.share.ui.widgetfilter.FilterPane ;
import com.fr.form.share.base.DataLoad ;
import com.fr.form.share.base.DataLoad ;
import com.fr.form.share.bean.OnlineShareWidget ;
import com.fr.form.share.bean.OnlineShareWidget ;
import com.fr.form.share.constants.ShareComponentConstants ;
import com.fr.form.share.exception.NetWorkFailedException ;
import com.fr.form.share.exception.NetWorkFailedException ;
import com.fr.general.http.HttpClient ;
import com.fr.general.http.HttpClient ;
import com.fr.log.FineLoggerFactory ;
import com.fr.module.ModuleContext ;
import com.fr.module.ModuleContext ;
import com.fr.stable.EncodeConstants ;
import com.fr.third.springframework.web.util.UriUtils ;
import javax.imageio.ImageIO ;
import javax.imageio.ImageIO ;
import javax.swing.JPanel ;
import javax.swing.JPanel ;
@ -22,6 +26,7 @@ import java.awt.Rectangle;
import java.awt.event.AWTEventListener ;
import java.awt.event.AWTEventListener ;
import java.awt.event.MouseEvent ;
import java.awt.event.MouseEvent ;
import java.io.IOException ;
import java.io.IOException ;
import java.io.UnsupportedEncodingException ;
import java.net.HttpURLConnection ;
import java.net.HttpURLConnection ;
import java.util.concurrent.CountDownLatch ;
import java.util.concurrent.CountDownLatch ;
import java.util.concurrent.ScheduledExecutorService ;
import java.util.concurrent.ScheduledExecutorService ;
@ -96,6 +101,12 @@ public class OnlineEmbedFilterSelectPane extends AbstractOnlineWidgetSelectPane
}
}
private Image getPreviewImage ( String url ) throws NetWorkFailedException {
private Image getPreviewImage ( String url ) throws NetWorkFailedException {
try {
url = UriUtils . encodePath ( url , EncodeConstants . ENCODING_UTF_8 ) ;
} catch ( UnsupportedEncodingException e ) {
FineLoggerFactory . getLogger ( ) . error ( e . getMessage ( ) , e ) ;
return ShareComponentConstants . DEFAULT_COVER ;
}
HttpClient httpClient = new HttpClient ( url ) ;
HttpClient httpClient = new HttpClient ( url ) ;
httpClient . setTimeout ( CAROUSE_IMAGE_LOAD_TIMEOUT ) ;
httpClient . setTimeout ( CAROUSE_IMAGE_LOAD_TIMEOUT ) ;
httpClient . asGet ( ) ;
httpClient . asGet ( ) ;