Source code: com/mvsteenb/javauitransformer/xmltransformer/components/swing/XmlSwingComponentMapper.java
1 package com.mvsteenb.javauitransformer.xmltransformer.components.swing;
2
3 import com.mvsteenb.javauitransformer.xmltransformer.components.awt.*;
4 import com.mvsteenb.javauitransformer.xmltransformer.components.exception.UnknownComponentException;
5 import com.mvsteenb.javauitransformer.xmltransformer.layout.XmlLayoutMapper;
6 import com.mvsteenb.javauitransformer.xmltransformer.layout.exception.UnknownLayoutManagerException;
7
8 import javax.swing.*;
9 import java.awt.*;
10
11 /**
12 * com.mvsteenb.javauitransformer.xmltransformer.components.swing
13 *
14 * <p><b>About</b></p>
15 *
16 * <p>
17 * This class is part of the JavaUIFormatter version @build.version@ (build #@build.number@) which was built on @build.date@.
18 * </p>
19 *
20 * <p><b>Description</b></p>
21 *
22 *
23 *
24 * <p><b>Free Software</b></p>
25 *
26 * <p>
27 * Copyright (C) 2003 Mario Van Steenberghe
28 * </p>
29 *
30 * <p>
31 * <small>
32 * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser
33 * General Public License as published by the Free Software Foundation; either version 2.1 of the License, or
34 * (at your option) any later version. This library is distributed in the hope that it will be useful,
35 * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
36 * PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the
37 * GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc.,
38 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
39 * </small>
40 * </p>
41 *
42 * <p>
43 * <small>
44 * Please contact me at mario.vansteenberghe@pandora.be for more information.
45 * </small>
46 * </p>
47 *
48 * <p><b>Revision History</b></p>
49 *
50 * <p>
51 * Aug 30, 2003 : mvsteenb : Initial Revision
52 * </p>
53 *
54 */
55
56 public class XmlSwingComponentMapper extends XmlAWTComponentMapper {
57
58 /**
59 * Constructor
60 */
61
62 public XmlSwingComponentMapper(XmlLayoutMapper l) {
63 super(l);
64 }
65
66 /**
67 * Maps Java component to Xml Component
68 */
69
70 public XmlComponent findComponent(Component c) throws UnknownComponentException, UnknownLayoutManagerException {
71
72 if (c instanceof Box)
73 return new XmlBox((Box) c, this);
74
75 return super.findComponent(c);
76 }
77
78 }