01: package jimm.datavision.layout.swing;
02:
03: import jimm.datavision.field.ImageField;
04: import javax.swing.*;
05:
06: /**
07: * An image.
08: *
09: * @author Jim Menard, <a href="mailto:jimm@io.com">jimm@io.com</a>
10: * @see SwingLE
11: * @see jimm.datavision.field.ImageField
12: */
13: public class SwingImageField extends AbstractSwingField {
14:
15: /**
16: * Constructor.
17: *
18: * @param f image field
19: */
20: public SwingImageField(ImageField f) {
21: super (f, new JLabel());
22: format();
23: }
24:
25: /**
26: * Loads the image.
27: */
28: public void format() {
29: ((JLabel) component).setIcon(((ImageField) field)
30: .getImageIcon());
31: makeBorders();
32: }
33:
34: }
|