<?xml version="1.0" encoding="UTF-8"?>
<rules xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<Profile>
		<Import name="Import">
			<Statement>javax.swing.*</Statement>
			<Statement>javax.swing.event.*</Statement>
			<Statement>javax.swing.border.*</Statement>
			<Statement>java.awt.*</Statement>
			<Statement>java.awt.event.*</Statement>
			<Statement>javax.swing.tree.*</Statement>
		</Import>
		<DisplayMethod>show</DisplayMethod>
		<ToolKit>SWING</ToolKit>
		<Accessor>
			<Method name="getComponent" returnType="Object">
				<Parameter type="String">name</Parameter>
			</Method>
		</Accessor>
	</Profile>
	<Event>
		<Action>
			<Field name="actionListener" method="addActionListener">
				<Type>ActionEventHandler</Type>
			</Field>
		</Action>
		<Focus>
			<Field name="focusListener" method="addFocusListener">
				<Type>FocusEventHandler</Type>
			</Field>
		</Focus>
		<Window>
			<Field name="windowListener" method="addWindowListener">
				<Type>WindowEventHandler</Type>
			</Field>
		</Window>
		<Selection>
			<Field name="selectionListener" method="addListSelectionListener">
				<Type>ListSelectionEventHandler</Type>
			</Field>
		</Selection>
		<Mouse>
			<Field name="mouseListener" method="addMouseListener">
				<Type>MouseEventHandler</Type>
			</Field>
		</Mouse>
		<MouseMotion>
			<Field name="mouseMotionListener" method="addMouseMotionListener">
				<Type>MouseMotionEventHandler</Type>
			</Field>
		</MouseMotion>
	</Event>
	<Tag>
		<rule>
			<ToolItem>
				<widget>JButton</widget>
				<attribute>
					<Method name="name" type="String">setTitle</Method>
				</attribute>
			</ToolItem>
		</rule>
		<rule>
			<Screen>
				<!-- define the control mapping -->
				<widget>Class</widget>
				<!-- define the attribute mapping -->
				<attribute>
					<Method name="title" type="String">setTitle</Method>
					<Method name="name" type="String">setName</Method>
				</attribute>
				<!-- define the composition mapping -->
			</Screen>
		</rule>
		<rule>
			<Window>
				<!-- define the control mapping -->
				<widget>JFrame</widget>
				<!-- define the attribute mapping -->
				<attribute>
					<Method name="name" type="String">setTitle</Method>
				</attribute>
				<!-- define the composition mapping -->
				<composition>
					<SplitPane>
						<Method name="getContentPane().add"/>
					</SplitPane>
					<Panel>
						<Method name="getContentPane().add"/>
					</Panel>
					<button>
						<Method name="getContentPane().add"/>
					</button>
					<FlowLayout>
						<Method name="setLayout"/>
					</FlowLayout>
					<TextBox type="text">
						<Method name="getContentPane().add"/>
					</TextBox>
					<BoxLayout>
						<Method name="setLayout"/>
					</BoxLayout>
					<MenuBar>
						<Method name="setJMenuBar"/>
					</MenuBar>
					<ToolBar>
						<Method name="getContentPane().add"/>
					</ToolBar>
					<TabbedPane>
						<Method name="getContentPane().add"/>
					</TabbedPane>
				</composition>
			</Window>
		</rule>
		<rule>
			<LineBorder>
				<widget>LineBorder
					<Constructor cast="explicit" method="BorderFactory.createLineBorder">
						<Parameter type="String" method="Color">$color</Parameter>
					</Constructor>
				</widget>
				<attribute>
					<Method name="color" type="String" variable="yes"/>
				</attribute>
			</LineBorder>
		</rule>
		<rule>
			<Group>
				<widget>ButtonGroup</widget>
				<composition>
					<RadioButton>
						<Method name="add"/>
					</RadioButton>
					<CheckBox>
						<Method name="add"/>
					</CheckBox>
				</composition>
			</Group>
		</rule>
		<rule>
			<RadioButton>
				<widget>JRadioButton</widget>
				<attribute>
					<Method name="text" type="String">setText</Method>
				</attribute>
			</RadioButton>
		</rule>
		<rule>
			<CheckBox>
				<widget>JCheckBox</widget>
				<attribute>
					<Method name="text" type="String">setText</Method>
				</attribute>
			</CheckBox>
		</rule>
		<rule>
			<Separator>
				<widget>JSeparator</widget>
			</Separator>
		</rule>
		<rule>
			<GridLayout>
				<!-- define the control mapping -->
				<widget>GridLayout	</widget>
				<!-- define the attribute mapping -->
				<attribute>
					<Method name="rows" type="int">setRows</Method>
					<Method name="columns" type="int">setColumns</Method>
				</attribute>
			</GridLayout>
		</rule>
		<rule>
			<FlowLayout>
				<!-- define the control mapping -->
				<widget>FlowLayout	</widget>
			</FlowLayout>
		</rule>
		<rule>
			<BoxLayout>
				<!-- define the control mapping -->
				<widget>BoxLayout
					<Constructor>
						<Parameter type="text">$Parent</Parameter>
						<Parameter type="int">$axis</Parameter>
					</Constructor>
				</widget>
				<!-- define the attribute mapping -->
				<attribute>
					<Method name="axis" type="int" variable="yes"/>
				</attribute>
			</BoxLayout>
		</rule>
		<rule>
			<Label>
				<!-- define the control mapping -->
				<!-- this will always define a data type i.e JLabel jlabel = new JLabel(); -->
				<widget>JLabel</widget>
				<!-- define the attribute mapping -->
				<attribute>
					<Method name="title" type="String">setTitle</Method>
					<Method name="text" type="String">setText</Method>
					<Method name="icon" type="text">setIcon</Method>
				</attribute>
				<!-- define the composition mapping -->
			</Label>
		</rule>
		<rule>
			<TextBox type="text">
				<!-- define the control mapping -->
				<widget>JTextField</widget>
				<!-- define the attribute mapping -->
				<attribute>
					<Method name="background" type="Color">setBackground</Method>
					<Method name="columns" type="int">setColumns</Method>
				</attribute>
				<!-- define the composition mapping -->
				<composition/>
			</TextBox>
		</rule>
		<rule>
			<ToolBar>
				<!-- define the control mapping -->
				<widget>JToolBar</widget>
				<!-- define the attribute mapping -->
				<attribute>
					<Method name="background" type="Color">setBackground</Method>
					<Method name="columns" type="int">setColumns</Method>
				</attribute>
				<!-- define the composition mapping -->
				<composition>
					<ToolItem>
						<Method name="add">
						</Method>
					</ToolItem>
				</composition>
			</ToolBar>
		</rule>
		<rule>
			<TabbedPane>
				<!-- define the control mapping -->
				<widget>JTabbedPane</widget>
				<!-- define the attribute mapping -->
				<attribute>
					<Method name="title" type="String">setTitle</Method>
					<Method name="name" type="String">setName</Method>
				</attribute>
				<!-- define the composition mapping -->
				<composition>
					<Tabs>
						<Method name="addTab">
							<Parameter>$name</Parameter>
							<Parameter>$child</Parameter>
						</Method>
					</Tabs>
				</composition>
			</TabbedPane>
		</rule>
		<rule>
			<Tabs>
				<!-- define the control mapping -->
				<widget>JPanel</widget>
				<!-- define the attribute mapping -->
				<attribute>
					<Method name="title" type="String">setTitle</Method>
					<Method name="name" type="String">setName</Method>
				</attribute>
				<!-- define the composition mapping -->
				<composition>
					<GridLayout>
						<Method name="setLayout"/>
					</GridLayout>
					<Button>
						<Method name="add"/>
					</Button>
					<TextBox>
						<Method name="add"/>
					</TextBox>
					<Panel>
						<Method name="add"/>
					</Panel>
					<Slider>
						<Method name="add"/>
					</Slider>
					<Separator>
						<Method name="add"/>
					</Separator>
					<ProgressBar>
						<Method name="add"/>
					</ProgressBar>
					<BoxLayout>
						<Method name="setLayout"/>
					</BoxLayout>
					<ToolBar>
						<Method name="add"/>
					</ToolBar>
					<Label>
						<Method name="add"/>
					</Label>
					<CheckBox>
						<Method name="add"/>
					</CheckBox>
					<RadioButton>
						<Method name="add"/>
					</RadioButton>
					<Choice>
						<Method name="add" type="combobox"/>
					</Choice>
					<List>
						<Method name="add">
							<Parameter>$JList</Parameter>
						</Method>
					</List>
					<Group>
						<Method name="add"/>
					</Group>
				</composition>
			</Tabs>
		</rule>
		<rule>
			<Button>
				<!-- define the control mapping -->
				<widget>JButton</widget>
				<!-- define the attribute mapping -->
				<attribute>
					<Method name="title" type="String">setTitle</Method>
					<Method name="text" type="String">setText</Method>
				</attribute>
				<!-- define the composition mapping -->
			</Button>
		</rule>
		<rule>
			<Panel>
				<!-- define the control mapping -->
				<widget>JPanel</widget>
				<!-- define the attribute mapping -->
				<attribute>
					<Method name="title" type="String">setTitle</Method>
					<Method name="name" type="String">setName</Method>
				</attribute>
				<!-- define the composition mapping -->
				<composition>
					<GridLayout>
						<Method name="setLayout"/>
					</GridLayout>
					<Button>
						<Method name="add"/>
					</Button>
					<TextBox type="text">
						<Method name="add"/>
					</TextBox>
					<Panel>
						<Method name="add"/>
					</Panel>
					<Slider>
						<Method name="add"/>
					</Slider>
					<Separator>
						<Method name="add"/>
					</Separator>
					<ProgressBar>
						<Method name="add"/>
					</ProgressBar>
					<BoxLayout>
						<Method name="setLayout"/>
					</BoxLayout>
					<ToolBar>
						<Method name="add"/>
					</ToolBar>
					<Label>
						<Method name="add"/>
					</Label>
					<CheckBox>
						<Method name="add"/>
					</CheckBox>
					<RadioButton>
						<Method name="add"/>
					</RadioButton>
					<ComboBox>
						<Method name="add"/>
					</ComboBox>
					<List>
						<Method name="add">
							<Parameter rule="List">$myList</Parameter>
						</Method>
					</List>
					<LineBorder>
						<Method name="setBorder"/>
					</LineBorder>
					<Image>
						<Method name="add"/>
					</Image>
					<Tree>
						<Method name="add">
							<Parameter rule="Tree">$myTree</Parameter>
						</Method>
					</Tree>
				</composition>
			</Panel>
		</rule>
		<rule>
			<MenuBar>
				<!-- define the control mapping -->
				<widget>JMenuBar</widget>
				<!-- define the attribute mapping -->
				<attribute>
					<Method name="title" type="String">setTitle</Method>
					<Method name="name" type="String">setName</Method>
				</attribute>
				<!-- define the composition mapping -->
				<composition>
					<Menu>
						<Method name="add"/>
					</Menu>
				</composition>
			</MenuBar>
		</rule>
		<rule>
			<MenuItem>
				<!-- define the control mapping -->
				<widget>JMenuItem</widget>
				<!-- define the attribute mapping -->
				<attribute>
					<Method name="text" type="String">setText</Method>
					<Method name="name" type="String">setName</Method>
					<Method name="mneonomic" type="char">setMnemonic</Method>
				</attribute>
				<!-- define the composition mapping -->
				<composition/>
			</MenuItem>
		</rule>
		<rule>
			<MenuItem type="checkbox">
				<!-- define the control mapping -->
				<widget>JCheckBoxMenuItem</widget>
				<!-- define the attribute mapping -->
				<attribute>
					<Method name="text" type="String">setText</Method>
					<Method name="name" type="String">setName</Method>
					<Method name="mneonomic" type="char">setMnemonic</Method>
				</attribute>
				<!-- define the composition mapping -->
				<composition/>
			</MenuItem>
		</rule>
		<rule>
			<MenuItem type="radiobutton">
				<!-- define the control mapping -->
				<widget>JRadioButtonMenuItem</widget>
				<!-- define the attribute mapping -->
				<attribute>
					<Method name="text" type="String">setText</Method>
					<Method name="name" type="String">setName</Method>
					<Method name="mneonomic" type="char">setMnemonic</Method>
				</attribute>
				<!-- define the composition mapping -->
				<composition/>
			</MenuItem>
		</rule>
		<rule>
			<Menu>
				<!-- define the control mapping -->
				<widget>JMenu</widget>
				<!-- define the attribute mapping -->
				<attribute>
					<Method name="text" type="String">setText</Method>
					<Method name="name" type="String">setName</Method>
					<Method name="title " type="String">setTitle </Method>
				</attribute>
				<!-- define the composition mapping -->
				<composition>
					<MenuItem>
						<method name="add"/>
					</MenuItem>
					<MenuItem type="checkbox">
						<method name="add"/>
					</MenuItem>
					<MenuItem type="radiobutton">
						<method name="add"/>
					</MenuItem>
					<Menu>
						<method name="add"/>
					</Menu>
				</composition>
			</Menu>
		</rule>
		<rule>
			<List>
				<!-- define the control mapping -->
				<widget component="JList">DefaultListModel</widget>
				<!-- define the attribute mapping -->
				<attribute>
					<Method name="text" type="String">setText</Method>
					<Method name="title" type="String">setTitle</Method>
					<!-- very important we need to know how to add individual element to this component -->
				</attribute>
				<!-- define the composition mapping -->
				<define>
					<Method name="myList" order="post" type="JList">
						<Parameter>$List</Parameter>
					</Method>
				</define>
				<composition>
					<ListItem>
						<Method name="add">
							<Parameter>$counter</Parameter>
							<Parameter>$default</Parameter>
						</Method>
					</ListItem>
				</composition>
			</List>
		</rule>
		<rule>
			<ListItem>
				<widget create="false">DefaultListModel</widget>
			</ListItem>
		</rule>
		<rule>
			<ComboBox>
				<widget>JComboBox</widget>
				<attribute>
					<Method name="title" type="String">setTitle</Method>
					<Method name="text" type="String">setText</Method>
				</attribute>
				<Composition>
					<Item>
						<Method name="addItem" type="String"/>
					</Item>
				</Composition>
			</ComboBox>
		</rule>
		<rule>
			<Item>
				<widget create="false">JComboBox</widget>
			</Item>
		</rule>
		<rule>
			<Slider>
				<widget>JSlider</widget>
				<attribute>
					<Method name="maximum" type="int">setMaximum</Method>
					<Method name="minimum" type="int">setMinimum</Method>
				</attribute>
			</Slider>
		</rule>
		<rule>
			<ProgressBar>
				<widget>JProgressBar</widget>
				<attribute>
					<Method name="maximum" type="int">setMaximum</Method>
					<Method name="minimum" type="int">setMinimum</Method>
					<Method name="value" type="int">setValue</Method>
				</attribute>
			</ProgressBar>
		</rule>
		<rule>
			<Image>
				<widget>JLabel
					<Constructor>
						<Parameter type="text">$image</Parameter>
					</Constructor>
				</widget>
				<define>
					<Method name="image" type="ImageIcon">
						<Parameter type="String">$imagesrc</Parameter>
					</Method>
				</define>
				<attribute>
					<Method name="imagesrc" type="String" variable="yes">setImage</Method>
				</attribute>
			</Image>
		</rule>
		<rule>
			<Tree>
				<widget>DefaultMutableTreeNode</widget>
				<attribute>
					<Method name="text" type="String">setText</Method>
				</attribute>
				<define>
					<Method name="myTree" order="post" type="JTree">
						<Parameter>$Tree</Parameter>
					</Method>
				</define>
				<composition>
					<Node>
						<Method name="add"/>
					</Node>
				</composition>
			</Tree>
		</rule>
		<rule>
			<Node>
				<widget>DefaultMutableTreeNode
					<Constructor>
						<Parameter type="String">$text</Parameter>
					</Constructor>
				</widget>
				<composition>
					<Node>
						<Method name="add"/>
					</Node>
				</composition>
			</Node>
		</rule>
		<rule>
			<SplitPane>
				<widget>JSplitPane</widget>
				<Composition>
					<Panel name="left">
						<Method name="setLeftComponent"/>
					</Panel>
					<Panel name="right">
						<Method name="setRightComponent"/>
					</Panel>
				</Composition>
			</SplitPane>
		</rule>
	</Tag>
</rules>
