@SuppressWarnings("unchecked")
	String getState() {
		StringBuffer commands = new StringBuffer("# selection state;\n");
		String cmd = null;
		Hashtable temp = new Hashtable();
		if (viewer.firstAtomOf(bsHidden) >= 0)
			temp.put("hide selected", bsHidden);
		if (viewer.firstAtomOf(bsSubset) >= 0)
			temp.put("subset selected", bsSubset);
		cmd = StateManager.getCommands(temp);
		if (cmd != null)
			commands.append(cmd);
		temp = new Hashtable();
		temp.put("-", bsSelection);
		cmd = StateManager.getCommands(temp, null, viewer.getAtomCount());
		if (cmd == null)
			commands.append("select none;");
		else commands.append(cmd);

		commands.append("\n");
		return commands.toString();
	}