* @return the created Dataset
*/
private DefaultCategoryDataset createSpiderDataset(List<Element> elements,
AccessLayer accessLayer, CacheManager cacheManager,
boolean showGoalRating, boolean weighted) {
DefaultCategoryDataset categoryDataset = new DefaultCategoryDataset();
for (Element element : elements) {
List<Element> leafElements = null;
if (showGoalRating == true)
leafElements = cacheManager
.getLeafApplicableElementElements(GSSLayer.layer1);
else
leafElements = cacheManager
.getLeafApplicableElementElements(GSSLayer.layer3);
for (Element leafElement : leafElements) {
if (leafElement.getClass() == element.getClass())
continue; // skip case principle <-> principle
Float ratingValue = cacheManager.getIndirectRatingWeight(
(ConstrainedElement) element, leafElement);
if (ratingValue == null) {
ratingValue = 0.0f;
}
if (weighted) {
Float weight = 0.0f;
if (leafElement instanceof Principle)
weight = cacheManager
.getSelectedPrinciplePriority((Principle) leafElement);
if (leafElement instanceof Goal)
weight = cacheManager
.getSelectedGoalPriority((Goal) leafElement);
if (weight == null)
weight = 0.0f;
ratingValue = (ratingValue * weight / 100.0f) + 100;
} else {
ratingValue += 100.0f;
}
categoryDataset.addValue(ratingValue,
accessLayer.getAttributeValue(element, "name"),
accessLayer.getAttributeValue(leafElement, "name"));
}
}