01: /*
02: * Copyright 2006 Ethan Nicholas. All rights reserved.
03: * Use is subject to license terms.
04: */
05: package jaxx.types;
06:
07: import java.awt.*;
08:
09: public class GridBagConstraintsConverter implements TypeConverter {
10: public String getJavaCode(Object object) {
11: GridBagConstraints g = (GridBagConstraints) object;
12: return "new GridBagConstraints(" + g.gridx + ", " + g.gridy
13: + ", " + g.gridwidth + ", " + g.gridheight + ", "
14: + g.weightx + ", " + g.weighty + ", " + g.anchor + ", "
15: + g.fill + ", " + TypeManager.getJavaCode(g.insets)
16: + ", " + g.ipadx + ", " + g.ipady + ")";
17: }
18:
19: public Object convertFromString(String string, Class type) {
20: throw new UnsupportedOperationException(
21: "GridBagConstraints must be represented using Java code");
22: }
23: }
|