private void drawCollection(Graphics2D g, Object collection, Class cls) {
		ModelEntityAdapter adapter = modelAdapters.get(cls);
		if (adapter == null) return;

		if (collection instanceof Map) {
			Map map = (Map)collection;
			for (Object key: map.keySet()) {
				Object obj = map.get(key);
				ModelEntity en = (ModelEntity)obj;
				if (!isObjectActive(en)) adapter.drawEntity(g, en, false);
			}
		}
		else if (collection instanceof java.util.List) {
			java.util.List list = (java.util.List)collection;
			for (Object obj: list) {
				ModelEntity en = (ModelEntity)obj;
				if (!isObjectActive(en)) adapter.drawEntity(g, en, false);
			}
		}

		for (ModelEntity en: activeObjects) {
			if (cls.isInstance(en)) adapter.drawEntity(g, en, true);
		}
	}