public void paint(Graphics g) {
		
		/**
		 * {@link uk.ac.aber.dcs.cs124.clg11.data.ClassDiagData} object that contains data about the class
		 */
		
		//Link to Data Model layer of object and retrieve all variables/methods
		ClassDiagData d = (ClassDiagData) data;
		
		ArrayList<String> varList = d.getInstanceVariables();
		ArrayList<String> opList = d.getMethods();

		/**
		 * Holds the longest length of any of the variables/methods in class inputed
		 * by user
		 */
		int maxWidth = 0;

		//Determine the longest length of both the variables and methods
		if (d.getClassName().length() > maxWidth) {
			maxWidth = d.getClassName().length();
		}
		
		for (int i = 0; i < varList.size(); i++) {
			
			if (varList.get(i).length() > maxWidth) {
				
				maxWidth = varList.get(i).length();
			}
		}

		for (int i = 0; i < opList.size(); i++) {
			
			if (opList.get(i).length() > maxWidth) {
				
				maxWidth = opList.get(i).length();
			}
		}

		//Set the width of the class diagram using the maximum width determined before
		this.width = (maxWidth * 5) + 80 ;

		//Set the vertical offset to allow equal spacing of variables/methods
		setOffset(y + 50);
		
		//Set the background colour of the class diagram
		g.setColor(backColour);
		
		//Draw the class diagram background
		g.fillRoundRect(x, y, getWidth(), getHeight(), 5, 5);
		
		//Set the text/line colour of the class diagram
		g.setColor(textColour);
		
		//Draw the class name / variables separation line
		g.drawLine(x, (y + 30), (x + getWidth()), (y + 30)); 
		
		//Draw the class diagram outline
		g.drawRoundRect(x, y, getWidth(), getHeight(), 5, 5); 
		g.drawString(d.getAccessModifier() + " " + d.getClassName(), (x + 10), (y + 20)); 


		//Loop through all the variables to be drawn
		for (int i = 0; i < getVarNo(); i++) {
			
			//Draw the variable
			g.drawString(varList.get(i), (x + 10), (getOffset()));
			
			//Increment the offset to allow the next variable to be drawn an equal distance below
			setOffset(getOffset() + 15);
			
		}

		//Draw variables / methods separator line
		g.drawLine(x, (getOffset() - 5), (x + getWidth()), (getOffset() - 5)); // Variable separator
		setOffset(getOffset() + 15);

		//Loop through all the methods to be drawn
		for (int i = 0; i < getOpNo(); i++) {
			
			//Check if method is main method
			if (opList.get(i).equals("main")){
				
				//If so draw special parameters for method
				g.drawString(opList.get(i) + "(String[ ] args)", (x + 10), (getOffset())); // Add variables
				setOffset(getOffset() + 15);
			} else {
				
				//Otherwise just draw method as inputed by user
				g.drawString(opList.get(i), (x + 10), (getOffset())); // Add variables
				setOffset(getOffset() + 15);
			}
		}
	}