private int calcaluteWidth() {

		@SuppressWarnings("deprecation")
		FontMetrics fm = Toolkit.getDefaultToolkit().getFontMetrics(
				FontFactory.getInstance().createTextFont());
		// TODO use non deprecated methods Font.getLineMetrics! But that
		// needs a FontRenderContext.
		// FontRenderContext frc = new FontRenderContext(FontFactory
		// .getInstance().createTextFont().getTransform(), true, true);

		int inputWidth = 0;
		int outputWidth = 0;
		String[] inputList = getModel().inputList();
		for (String input : inputList) {
			int size = SwingUtilities.computeStringWidth(fm, input);
			inputWidth = inputWidth < size ? size : inputWidth;
		}
		String[] outputList = getModel().outputList();
		for (String output : outputList) {
			int size = SwingUtilities.computeStringWidth(fm, output);
			outputWidth = outputWidth < size ? size : outputWidth;
		}

		// find minimal necessary width for all inputs, outputs and blocks
		// header
		int width = inputWidth + WIDTH_GAP + outputWidth;
		int headerWidth = SwingUtilities.computeStringWidth(fm, getModel()
				.getBlockType().getScreenName());
		width = width < headerWidth ? headerWidth : width;
		width += PADDING + PADDING + INTERNAL_PADDING + INTERNAL_PADDING;

		assert width >= headerWidth;
		assert width >= inputWidth;
		assert width >= outputWidth;
		assert width > WIDTH_GAP;
		return width;
	}