Revision 34266
branches/v2_0_0_prep/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/tools/persistence/DimensionPersistenceFactory.java | ||
---|---|---|
60 | 60 |
|
61 | 61 |
DynStruct definition = this.getDefinition(); |
62 | 62 |
|
63 |
definition.addDynFieldDouble(FIELD_WIDTH).setMandatory(true);
|
|
64 |
definition.addDynFieldDouble(FIELD_HEIGHT).setMandatory(true);
|
|
63 |
definition.addDynFieldInt(FIELD_WIDTH).setMandatory(true);
|
|
64 |
definition.addDynFieldInt(FIELD_HEIGHT).setMandatory(true);
|
|
65 | 65 |
} |
66 | 66 |
|
67 | 67 |
public Object createFromState(PersistentState state) |
68 | 68 |
throws PersistenceException { |
69 | 69 |
Dimension dimension = new Dimension(); |
70 |
dimension.setSize( |
|
71 |
state.getDouble(FIELD_WIDTH), |
|
72 |
state.getDouble(FIELD_HEIGHT) |
|
73 |
); |
|
70 |
dimension.width = state.getInt(FIELD_WIDTH); |
|
71 |
dimension.height = state.getInt(FIELD_HEIGHT); |
|
74 | 72 |
return dimension; |
75 | 73 |
} |
76 | 74 |
|
... | ... | |
78 | 76 |
throws PersistenceException { |
79 | 77 |
Dimension dim = (Dimension) obj; |
80 | 78 |
|
81 |
state.set(FIELD_HEIGHT, dim.getHeight());
|
|
82 |
state.set(FIELD_WIDTH, dim.getWidth());
|
|
79 |
state.set(FIELD_HEIGHT, dim.height);
|
|
80 |
state.set(FIELD_WIDTH, dim.width);
|
|
83 | 81 |
} |
84 | 82 |
} |
Also available in: Unified diff