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 rmorris
34: *
35: */
36: public class GridBagRowMapper extends GridBagBaseMapper {
37: /**
38: * @see org.swingml.xml.Mapper#getModelToMap(Node, Object)
39: */
40: public Object getModelToMap(Node aNode, Object aParent,
41: Container aContainer) {
42: GridBagRowModel theModel = new GridBagRowModel();
43: SwingMLModel theContainer = (SwingMLModel) aParent;
44: theContainer.addChild(theModel);
45: theModel.setParent(theContainer);
46: return theModel;
47: }
48:
49: /**
50: * @see org.swingml.xml.Mapper#mapModel(Node, Object)
51: */
52: public void mapModel(Node aNode, Object aParent,
53: Container aContainer) {
54: GridBagRowModel theModel = (GridBagRowModel) this
55: .getModelToMap(aNode, aParent, aContainer);
56: this.mapModelAttributes(aNode, theModel, aParent);
57: super.iterate(aNode, theModel, aContainer);
58: }
59: }
|