protected void clearAllContent() {
		if (getDocument().getLength() <= 0)
			return;
		stopSound();
		stopImageAnimators();
		additionalResourceFiles = null;
		backgroundSound = null;
		loopBackgroundSound = false;
		if (componentPool != null)
			componentPool.resetStatus();
		InstancePool.sharedInstance().reset();
		List<Embeddable> list = getEmbeddedComponents();
		if (list != null) {
			for (Embeddable embed : list) {
				if (embed instanceof Engine) {
					InstancePool.sharedInstance().setStatus(embed, false);
				} else {
					embed.destroy();
				}
			}
		}
		resetToDefaultParagraphAttributes(0);
		getDocument().removeDocumentListener(editResponder);
		try {
			getDocument().remove(0, getDocument().getLength());
		} catch (BadLocationException e) {
			e.printStackTrace();
		}
		getDocument().addDocumentListener(editResponder);
		setFillMode(FillMode.getNoFillMode());
		properties.clear();
		if (!asApplet)
			resetUndoManager();
		removeHighlights();
		unhighlightEmbedded();
		if (loadCallbacks != null)
			loadCallbacks.clear();
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				if (decoder.getProgressBar() != null) {
					decoder.getProgressBar().setIndeterminate(false);
					decoder.getProgressBar().setValue(0);
				}
				if (encoder != null) {
					if (encoder.getProgressBar() != null) {
						encoder.getProgressBar().setIndeterminate(false);
						encoder.getProgressBar().setValue(0);
					}
				}
			}
		});
		// settleComponentSize();
	}