public void setModel(MDModel mod) {
		if (mod == null) {
			model = null;
			return;
		}
		if (!(mod instanceof MesoModel))
			throw new IllegalArgumentException("Input model error");
		model = (MesoModel) mod;
		super.setModel(mod);
		gb = model.getParticles();
		initEditFieldActions();
		if (!layerBasket.isEmpty()) {
			for (Layered l : layerBasket) {
				((ModelComponent) l).setModel(model);
			}
		}
		defaultPopupMenu = new DefaultMesoPopupMenu(this);
	}