01: /*
02: * SwingML
03: * Copyright (C) 2002 Robert J. Morris.
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation; either
08: * version 2 of the License, or (at your option) any later version.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library; if not, write to the
17: * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18: * Boston, MA 02111-1307, USA.
19: *
20: * Authors:
21: * Robert J. Morris <robertj@morris.net>
22: */
23:
24: package org.swingml.xml.mapper;
25:
26: import java.awt.*;
27:
28: import org.swingml.*;
29: import org.swingml.model.*;
30: import org.w3c.dom.*;
31:
32: /**
33: * @author <a href="mailto:robertj@morris.net">Robert J. Morris</a>
34: *
35: */
36: public class GridBagCellMapper extends GridBagBaseMapper {
37:
38: /**
39: * @see org.swingml.xml.Mapper#getModelToMap(Node, Object)
40: */
41: public Object getModelToMap(Node aNode, Object aParent,
42: Container aContainer) {
43: GridBagCellModel theModel = new GridBagCellModel();
44: SwingMLModel theSwingMLModel = (SwingMLModel) aParent;
45: theSwingMLModel.addChild(theModel);
46: theModel.setParent(theSwingMLModel);
47: return theModel;
48: }
49:
50: /**
51: * @see org.swingml.xml.Mapper#mapModel(Node, Object)
52: */
53: public void mapModel(Node aNode, Object aParent,
54: Container aContainer) {
55: GridBagCellModel theModel = (GridBagCellModel) this
56: .getModelToMap(aNode, aParent, aContainer);
57: this.mapModelAttributes(aNode, theModel, aParent);
58: super.iterate(aNode, theModel, aContainer);
59: }
60: }
|