01: /*
02: * Copyright 2006 Ethan Nicholas. All rights reserved.
03: * Use is subject to license terms.
04: */
05: package jaxx.beaninfos;
06:
07: import java.beans.*;
08: import javax.swing.*;
09:
10: import jaxx.runtime.swing.*;
11:
12: public class VBoxBeanInfo extends SimpleBeanInfo {
13: public BeanInfo[] getAdditionalBeanInfo() {
14: try {
15: return new BeanInfo[] { Introspector
16: .getBeanInfo(JPanel.class) };
17: } catch (IntrospectionException e) {
18: throw new RuntimeException(e);
19: }
20: }
21:
22: public PropertyDescriptor[] getPropertyDescriptors() {
23: try {
24: PropertyDescriptor spacing = new PropertyDescriptor(
25: "spacing", VBox.class);
26: spacing.setBound(true);
27:
28: PropertyDescriptor margin = new PropertyDescriptor(
29: "margin", VBox.class);
30: margin.setBound(true);
31:
32: PropertyDescriptor horizontalAlignment = new PropertyDescriptor(
33: "horizontalAlignment", VBox.class);
34: horizontalAlignment.setBound(true);
35: horizontalAlignment.setValue("enumerationValues",
36: new Object[] { "left",
37: new Integer(SwingConstants.LEFT),
38: "SwingConstants.LEFT", "center",
39: new Integer(SwingConstants.CENTER),
40: "SwingConstants.CENTER", "right",
41: new Integer(SwingConstants.RIGHT),
42: "SwingConstants.RIGHT" });
43:
44: PropertyDescriptor verticalAlignment = new PropertyDescriptor(
45: "verticalAlignment", VBox.class);
46: verticalAlignment.setBound(true);
47: verticalAlignment.setValue("enumerationValues",
48: new Object[] { "top",
49: new Integer(SwingConstants.TOP),
50: "SwingConstants.TOP", "middle",
51: new Integer(SwingConstants.CENTER),
52: "SwingConstants.CENTER", "bottom",
53: new Integer(SwingConstants.BOTTOM),
54: "SwingConstants.BOTTOM" });
55:
56: return new PropertyDescriptor[] { spacing, margin,
57: horizontalAlignment, verticalAlignment };
58: } catch (IntrospectionException e) {
59: throw new RuntimeException(e);
60: }
61: }
62: }
|