1
2
3
4
5
6 package com.hack23.cia.web.views.components.panels;
7
8 import thinwire.ui.Image;
9 import thinwire.ui.Panel;
10 import thinwire.ui.layout.TableLayout;
11 import thinwire.util.ImageInfo;
12
13 /***
14 * The Class ImagePanel.
15 */
16 public class ImagePanel extends Panel {
17
18 /***
19 * Instantiates a new image panel.
20 *
21 * @param fileName the file name
22 */
23 public ImagePanel(final String fileName) {
24 setLayout(new TableLayout(new double[][] { { 0 },
25 { 0 } },
26 1,
27 5));
28
29 if (fileName != null) {
30 final ImageInfo imageInfo = new ImageInfo("services/image?filename=" + fileName,ImageInfo.Format.PNG , 800, 600);
31 final Image image = new Image(imageInfo);
32 image.setLimit("0,0,1,1");
33 image.setVisible(true);
34 getChildren().add(image);
35 }
36 }
37 }