Commit e2400453 authored by Kai-Holger Brassel's avatar Kai-Holger Brassel
Browse files

Wall mountings consisting of several layers of materials added

parent cdf9e894
...@@ -70,3 +70,19 @@ _UI_Material_constructionDescription_feature = Construction Description ...@@ -70,3 +70,19 @@ _UI_Material_constructionDescription_feature = Construction Description
_UI_Material_disposalEnergy_feature = Disposal Energy _UI_Material_disposalEnergy_feature = Disposal Energy
_UI_Material_disposalCarbon_feature = Disposal Carbon _UI_Material_disposalCarbon_feature = Disposal Carbon
_UI_Material_disposalDescription_feature = Disposal Description _UI_Material_disposalDescription_feature = Disposal Description
_UI_ConstructionCategory_type = Construction Category
_UI_Mounting_type = Mounting
_UI_Layer_type = Layer
_UI_MaterialCatalog_constructionCategories_feature = Construction Categories
_UI_ConstructionCategory_name_feature = Name
_UI_ConstructionCategory_mountings_feature = Mountings
_UI_Mounting_id_feature = Id
_UI_Mounting_name_feature = Name
_UI_Mounting_layers_feature = Layers
_UI_Layer_material_feature = Material
_UI_Layer_thickness_feature = Thickness
_UI_MaterialCategory_materials_feature = Materials
_UI_WindowType_windowTypeId_feature = Window Type Id
_UI_Material_materialId_feature = Material Id
_UI_Mounting_mountingId_feature = Mounting Id
_UI_Layer__feature =
...@@ -210,6 +210,75 @@ public class BuildingPhysicsItemProviderAdapterFactory extends BuildingPhysicsAd ...@@ -210,6 +210,75 @@ public class BuildingPhysicsItemProviderAdapterFactory extends BuildingPhysicsAd
return materialItemProvider; return materialItemProvider;
} }
/**
* This keeps track of the one adapter used for all {@link de.hftstuttgart.buildingphysics.ConstructionCategory} instances.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ConstructionCategoryItemProvider constructionCategoryItemProvider;
/**
* This creates an adapter for a {@link de.hftstuttgart.buildingphysics.ConstructionCategory}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Adapter createConstructionCategoryAdapter() {
if (constructionCategoryItemProvider == null) {
constructionCategoryItemProvider = new ConstructionCategoryItemProvider(this);
}
return constructionCategoryItemProvider;
}
/**
* This keeps track of the one adapter used for all {@link de.hftstuttgart.buildingphysics.Mounting} instances.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected MountingItemProvider mountingItemProvider;
/**
* This creates an adapter for a {@link de.hftstuttgart.buildingphysics.Mounting}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Adapter createMountingAdapter() {
if (mountingItemProvider == null) {
mountingItemProvider = new MountingItemProvider(this);
}
return mountingItemProvider;
}
/**
* This keeps track of the one adapter used for all {@link de.hftstuttgart.buildingphysics.Layer} instances.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected LayerItemProvider layerItemProvider;
/**
* This creates an adapter for a {@link de.hftstuttgart.buildingphysics.Layer}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Adapter createLayerAdapter() {
if (layerItemProvider == null) {
layerItemProvider = new LayerItemProvider(this);
}
return layerItemProvider;
}
/** /**
* This returns the root adapter factory that contains this factory. * This returns the root adapter factory that contains this factory.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
...@@ -327,6 +396,12 @@ public class BuildingPhysicsItemProviderAdapterFactory extends BuildingPhysicsAd ...@@ -327,6 +396,12 @@ public class BuildingPhysicsItemProviderAdapterFactory extends BuildingPhysicsAd
materialCategoryItemProvider.dispose(); materialCategoryItemProvider.dispose();
if (materialItemProvider != null) if (materialItemProvider != null)
materialItemProvider.dispose(); materialItemProvider.dispose();
if (constructionCategoryItemProvider != null)
constructionCategoryItemProvider.dispose();
if (mountingItemProvider != null)
mountingItemProvider.dispose();
if (layerItemProvider != null)
layerItemProvider.dispose();
} }
} }
/**
*/
package de.hftstuttgart.buildingphysics.provider;
import de.hftstuttgart.buildingphysics.BuildingPhysicsFactory;
import de.hftstuttgart.buildingphysics.BuildingPhysicsPackage;
import de.hftstuttgart.buildingphysics.ConstructionCategory;
import java.util.Collection;
import java.util.List;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.ResourceLocator;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;
/**
* This is the item provider adapter for a {@link de.hftstuttgart.buildingphysics.ConstructionCategory} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class ConstructionCategoryItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider,
IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ConstructionCategoryItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}
/**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
addNamePropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
/**
* This adds a property descriptor for the Name feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addNamePropertyDescriptor(Object object) {
itemPropertyDescriptors.add(createItemPropertyDescriptor(
((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(),
getString("_UI_ConstructionCategory_name_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_ConstructionCategory_name_feature",
"_UI_ConstructionCategory_type"),
BuildingPhysicsPackage.Literals.CONSTRUCTION_CATEGORY__NAME, true, false, false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}
/**
* This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
* {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
* {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
if (childrenFeatures == null) {
super.getChildrenFeatures(object);
childrenFeatures.add(BuildingPhysicsPackage.Literals.CONSTRUCTION_CATEGORY__MOUNTINGS);
}
return childrenFeatures;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EStructuralFeature getChildFeature(Object object, Object child) {
// Check the type of the specified child object and return the proper feature to use for
// adding (see {@link AddCommand}) it as a child.
return super.getChildFeature(object, child);
}
/**
* This returns ConstructionCategory.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/ConstructionCategory"));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected boolean shouldComposeCreationImage() {
return true;
}
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getText(Object object) {
String label = ((ConstructionCategory) object).getName();
return label == null || label.length() == 0 ? getString("_UI_ConstructionCategory_type")
: getString("_UI_ConstructionCategory_type") + " " + label;
}
/**
* This handles model notifications by calling {@link #updateChildren} to update any cached
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
switch (notification.getFeatureID(ConstructionCategory.class)) {
case BuildingPhysicsPackage.CONSTRUCTION_CATEGORY__NAME:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
case BuildingPhysicsPackage.CONSTRUCTION_CATEGORY__MOUNTINGS:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
return;
}
super.notifyChanged(notification);
}
/**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
newChildDescriptors.add(createChildParameter(BuildingPhysicsPackage.Literals.CONSTRUCTION_CATEGORY__MOUNTINGS,
BuildingPhysicsFactory.eINSTANCE.createMounting()));
}
/**
* Return the resource locator for this item provider's resources.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public ResourceLocator getResourceLocator() {
return BuildingPhysicsEditPlugin.INSTANCE;
}
}
/**
*/
package de.hftstuttgart.buildingphysics.provider;
import de.hftstuttgart.buildingphysics.BuildingPhysicsPackage;
import de.hftstuttgart.buildingphysics.Layer;
import de.hftstuttgart.cityunits.model.NullableQuantity;
import java.util.Collection;
import java.util.List;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.ResourceLocator;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;
/**
* This is the item provider adapter for a {@link de.hftstuttgart.buildingphysics.Layer} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class LayerItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider,
IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public LayerItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}
/**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
addMaterialPropertyDescriptor(object);
addThicknessPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
/**
* This adds a property descriptor for the Material feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addMaterialPropertyDescriptor(Object object) {
itemPropertyDescriptors
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
getResourceLocator(), getString("_UI_Layer_material_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Layer_material_feature", "_UI_Layer_type"),
BuildingPhysicsPackage.Literals.LAYER__MATERIAL, true, false, true, null, null, null));
}
/**
* This adds a property descriptor for the Thickness feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addThicknessPropertyDescriptor(Object object) {
itemPropertyDescriptors
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
getResourceLocator(), getString("_UI_Layer_thickness_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Layer_thickness_feature",
"_UI_Layer_type"),
BuildingPhysicsPackage.Literals.LAYER__THICKNESS, true, false, false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}
/**
* This returns Layer.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/Layer"));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected boolean shouldComposeCreationImage() {
return true;
}
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getText(Object object) {
NullableQuantity labelValue = ((Layer) object).getThickness();
String label = labelValue == null ? null : labelValue.toString();
return label == null || label.length() == 0 ? getString("_UI_Layer_type")
: getString("_UI_Layer_type") + " " + label;
}
/**
* This handles model notifications by calling {@link #updateChildren} to update any cached
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
switch (notification.getFeatureID(Layer.class)) {
case BuildingPhysicsPackage.LAYER__THICKNESS:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
}
super.notifyChanged(notification);
}
/**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
}
/**
* Return the resource locator for this item provider's resources.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public ResourceLocator getResourceLocator() {
return BuildingPhysicsEditPlugin.INSTANCE;
}
}
...@@ -62,6 +62,7 @@ public class MaterialCatalogItemProvider extends CatalogItemProvider { ...@@ -62,6 +62,7 @@ public class MaterialCatalogItemProvider extends CatalogItemProvider {
if (childrenFeatures == null) { if (childrenFeatures == null) {
super.getChildrenFeatures(object); super.getChildrenFeatures(object);
childrenFeatures.add(BuildingPhysicsPackage.Literals.MATERIAL_CATALOG__MATERIAL_CATEGORIES); childrenFeatures.add(BuildingPhysicsPackage.Literals.MATERIAL_CATALOG__MATERIAL_CATEGORIES);
childrenFeatures.add(BuildingPhysicsPackage.Literals.MATERIAL_CATALOG__CONSTRUCTION_CATEGORIES);
} }
return childrenFeatures; return childrenFeatures;
} }
...@@ -126,6 +127,7 @@ public class MaterialCatalogItemProvider extends CatalogItemProvider { ...@@ -126,6 +127,7 @@ public class MaterialCatalogItemProvider extends CatalogItemProvider {
switch (notification.getFeatureID(MaterialCatalog.class)) { switch (notification.getFeatureID(MaterialCatalog.class)) {
case BuildingPhysicsPackage.MATERIAL_CATALOG__MATERIAL_CATEGORIES: case BuildingPhysicsPackage.MATERIAL_CATALOG__MATERIAL_CATEGORIES:
case BuildingPhysicsPackage.MATERIAL_CATALOG__CONSTRUCTION_CATEGORIES:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
return; return;
} }
...@@ -146,6 +148,10 @@ public class MaterialCatalogItemProvider extends CatalogItemProvider { ...@@ -146,6 +148,10 @@ public class MaterialCatalogItemProvider extends CatalogItemProvider {
newChildDescriptors newChildDescriptors
.add(createChildParameter(BuildingPhysicsPackage.Literals.MATERIAL_CATALOG__MATERIAL_CATEGORIES, .add(createChildParameter(BuildingPhysicsPackage.Literals.MATERIAL_CATALOG__MATERIAL_CATEGORIES,
BuildingPhysicsFactory.eINSTANCE.createMaterialCategory())); BuildingPhysicsFactory.eINSTANCE.createMaterialCategory()));
newChildDescriptors
.add(createChildParameter(BuildingPhysicsPackage.Literals.MATERIAL_CATALOG__CONSTRUCTION_CATEGORIES,
BuildingPhysicsFactory.eINSTANCE.createConstructionCategory()));
} }
} }
...@@ -89,7 +89,7 @@ public class MaterialCategoryItemProvider extends ItemProviderAdapter implements ...@@ -89,7 +89,7 @@ public class MaterialCategoryItemProvider extends ItemProviderAdapter implements
public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) { public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
if (childrenFeatures == null) { if (childrenFeatures == null) {
super.getChildrenFeatures(object); super.getChildrenFeatures(object);
childrenFeatures.add(BuildingPhysicsPackage.Literals.MATERIAL_CATEGORY__MATERIAL); childrenFeatures.add(BuildingPhysicsPackage.Literals.MATERIAL_CATEGORY__MATERIALS);
} }
return childrenFeatures; return childrenFeatures;
} }
...@@ -156,7 +156,7 @@ public class MaterialCategoryItemProvider extends ItemProviderAdapter implements ...@@ -156,7 +156,7 @@ public class MaterialCategoryItemProvider extends ItemProviderAdapter implements
case BuildingPhysicsPackage.MATERIAL_CATEGORY__NAME: case BuildingPhysicsPackage.MATERIAL_CATEGORY__NAME: