public void setModel(MDModel m) {

		getModel().setView(this);
		setBoundary(getModel().getBoundary());
		setPreferredSize(new Dimension((int) getModel().getBoundary().getWidth(), (int) getModel().getBoundary().getHeight()));

		boolean macOS = System.getProperty("os.name").startsWith("Mac");
		Action a = new DefaultModelAction(getModel(), new Executable() {
			public void execute() {
				removeSelectedComponent();
			}
		});
		a.putValue(Action.NAME, CUT);
		a.putValue(Action.SMALL_ICON, IconPool.getIcon("cut"));
		a.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_U);
		a.putValue(Action.ACCELERATOR_KEY, macOS ? KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.META_MASK, true) : KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.CTRL_MASK, true));
		getInputMap().put((KeyStroke) a.getValue(Action.ACCELERATOR_KEY), CUT);
		getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0, true), CUT);
		getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0, true), CUT);
		getActionMap().put(CUT, a);

		a = new AbstractAction() {
			public void actionPerformed(ActionEvent e) {
				copySelectedComponent();
			}
		};
		a.putValue(Action.NAME, COPY);
		a.putValue(Action.SMALL_ICON, getIcon(DUPL_ID));
		a.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_C);
		a.putValue(Action.ACCELERATOR_KEY, macOS ? KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.META_MASK, true) : KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.CTRL_MASK, true));
		getInputMap().put((KeyStroke) a.getValue(Action.ACCELERATOR_KEY), COPY);
		getActionMap().put(COPY, a);

		a = new DefaultModelAction(getModel(), new Executable() {
			public void execute() {
				if (mousePressedPoint == null)
					return;
				pasteBufferedComponent(mousePressedPoint.x, mousePressedPoint.y);
			}
		});
		a.putValue(Action.NAME, PASTE);
		a.putValue(Action.SMALL_ICON, IconPool.getIcon("paste"));
		a.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_P);
		a.putValue(Action.SHORT_DESCRIPTION, "Paste to the last clicked point");
		a.putValue(Action.ACCELERATOR_KEY, macOS ? KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.META_MASK, true) : KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.CTRL_MASK, true));
		getInputMap().put((KeyStroke) a.getValue(Action.ACCELERATOR_KEY), PASTE);
		getActionMap().put(PASTE, a);

		a = new DefaultModelAction(getModel(), new Executable() {
			public void execute() {
				if (JOptionPane.showConfirmDialog(JOptionPane.getFrameForComponent(MDView.this), "Do you really want to remove all the objects?", "Object removal", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
					removeAllObjects();
				}
			}
		});
		a.putValue(Action.NAME, CLEAR);
		a.putValue(Action.SMALL_ICON, IconPool.getIcon("erase"));
		a.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_L);
		a.putValue(Action.SHORT_DESCRIPTION, "Remove all objects");
		a.putValue(Action.ACCELERATOR_KEY, macOS ? KeyStroke.getKeyStroke(KeyEvent.VK_E, KeyEvent.META_MASK, true) : KeyStroke.getKeyStroke(KeyEvent.VK_E, KeyEvent.CTRL_MASK, true));
		getInputMap().put((KeyStroke) a.getValue(Action.ACCELERATOR_KEY), CLEAR);
		getActionMap().put(CLEAR, a);

	}