public ControlsFrame(String title, final CropScreen attatched) {
		super(title);
		this.attatched = attatched;
		
    	ActionListener langChanged = new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {				
				ControlsFrame.this.attatched.setLanguage(((JRadioButton)arg0.getSource()).getText());
			}
		};
		
		ActionListener blockChanged = new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {				
				blockType = ((JRadioButton)arg0.getSource()).getText();
				if (blockType.equals("Image"))
					attatched.renderingColor = Color.RED;
				else if (blockType.equals("Paragraph"))
					attatched.renderingColor = Color.GREEN;
				else
					attatched.renderingColor = Color.ORANGE;
					
			}
		};
		
		ActionListener reset = new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {				
				attatched.reset();
			}
		};
		
		ActionListener motion = new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
                System.out.println("Dechid ecrane");
                ((JButton)arg0.getSource()).setEnabled(false);
                EventQueue.invokeLater(new Runnable() {
                    @Override
                    public void run() {
                    	MotionScreen.startMotionSCreen(attatched.getRoot());
                    }
                });
			}
		};
		
		ActionListener edit = new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
                System.out.println("Dechid ecrane");
                ((JButton)arg0.getSource()).setEnabled(false);
                EventQueue.invokeLater(new Runnable() {
                    @Override
                    public void run() {
                        UserInterface layoutGUI = new UserInterface(attatched.getRoot());
                    }
                });
			}
		};
		
		ActionListener export = new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
				XMLWriter writer = new XMLWriter();
				try {
					writer.writeFile(attatched.getRoot(), "exported.xml");
				} catch (TransformerConfigurationException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} catch (TransformerException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		};
		
		JPanel top = new JPanel();
		top.setLayout(new BorderLayout());
		getContentPane().add(top);
    	
		/**
		 * Adding the lang buttons
		 */
    	for (String lang : LANGS) {
    		JRadioButton btn = new JRadioButton(lang);
    		langGroup.add(btn);
    		langPanel.add(btn);
    		if (lang.equals("eng"))
    			btn.setSelected(true);
    		btn.addActionListener(langChanged);
    	}
    	
    	/**
    	 * Add the block type buttons
    	 */
    	for (String lang : BLOCK_TYPES) {
    		JRadioButton btn = new JRadioButton(lang);
    		blockTypeGroup.add(btn);
    		blockPanel.add(btn);
    		if (lang.equals("Paragraph"))
    			btn.setSelected(true);
    		btn.addActionListener(blockChanged);
    	}
    	
    	langPanel.setBorder(BorderFactory.createTitledBorder("Choose text language"));
    	panel.addTab("Language Settings", langPanel);
    	
    	blockPanel.setBorder(BorderFactory.createTitledBorder("Choose block type"));
    	panel.addTab("Block Type", blockPanel);
    	
    	JButton btn = new JButton("Edit");
    	buttonsPanel.add(btn);
		btn.addActionListener(edit);
		
		btn = new JButton("Rearrange");
    	buttonsPanel.add(btn);
		btn.addActionListener(motion);
		
		btn = new JButton("Reset");
		buttonsPanel.add(btn);
		btn.addActionListener(reset);
		
		btn = new JButton("Export to XML");
		buttonsPanel.add(btn);
		btn.addActionListener(export);
    	
    	buttonsPanel.setBorder(BorderFactory.createTitledBorder("Actions"));
    	panel.addTab("Actions", buttonsPanel);
    	top.add(panel, BorderLayout.CENTER);
    	add(panel);
	}