public static String drawRequirementElement(RequirementElement target, RequirementElement reference, String direction)
			throws ScriptException {
		// customized parameters
		String layer = target.getLayer();

		double x = 0, y = 0;
		String position = "";
		
		if (direction.equals("up")) {
			x = reference.origin_x;
			y = reference.origin_y - 200;
		} else if (direction.equals("down")) {
			x = reference.origin_x;
			y = reference.origin_y + 200;
		} else if (direction.equals("left")) {
			x = reference.origin_x - 200;
			y = reference.origin_y;
		} else if (direction.equals("right")) {
			x = reference.origin_x + 200;
			y = reference.origin_y;
		} else {
		}
		position = "{"+ x +","+ y +"}";
		// assign the position information to the target element
		target.origin_x=x;
		target.origin_y=y;
		
		String shape = InfoEnum.reverse_req_elem_type_map.get(target.getType());
		String corner_radius = "0";
		String name = target.getName();
		
		if (target.getType().equals(InfoEnum.RequirementElementType.DOMAIN_ASSUMPTION.name())) {
			corner_radius = "5";
		} else if (target.getType().equals(InfoEnum.RequirementElementType.SECURITY_GOAL.name())) {
			name = "(S)\n" + name;
		} else if (target.getType().equals(InfoEnum.RequirementElementType.SECURITY_MECHANISM.name())) {
			name = "(S)\n" + name;
		}
		
		int size_type = 0;
		if(target.getType().equals(InfoEnum.RequirementElementType.ACTOR.name())){
			size_type = InfoEnum.ACTOR_SIZE;
		} else if (target.getType().equals(InfoEnum.RequirementElementType.MIDDLE_POINT.name())){
			size_type = InfoEnum.POINT_SIZE;
		}

//		return drawReferredRequirementElement(reference_id, InfoEnum.REQ_TARGET_CANVAS, layer, offset, shape, size, corner_radius, name);
		return drawArbitraryRequirementElement(InfoEnum.REQ_TARGET_CANVAS, layer, shape, size_type, position, corner_radius, name);
				
	}