package de.retest.recheck.ui.descriptors;

import java.awt.Rectangle;

public class AttributeUtil {

	public static Rectangle getOutline( final IdentifyingAttributes attributes ) {
		final OutlineAttribute outlineAttribute =
				(OutlineAttribute) attributes.getAttribute( OutlineAttribute.RELATIVE_OUTLINE );
		if ( outlineAttribute == null ) {
			return null;
		}
		return outlineAttribute.getValue();
	}

	public static Rectangle getAbsoluteOutline( final IdentifyingAttributes attributes ) {
		final OutlineAttribute outlineAttribute =
				(OutlineAttribute) attributes.getAttribute( OutlineAttribute.ABSOLUTE_OUTLINE );
		if ( outlineAttribute == null ) {
			return null;
		}
		return outlineAttribute.getValue();
	}
}

@@ -67,658 +67,2181 @@
 le;%0A
-%0Apublic class AttributeUtil %7B%0A%0A%09public static Rectangle getOutline( final IdentifyingAttributes attributes ) %7B%0A%09%09final OutlineAttribute outlineAttribute =%0A%09%09%09%09(OutlineAttribute) attributes.getAttribute( OutlineAttribute.RELATIVE_OUTLINE );%0A%09%09if ( outlineAttribute == null ) %7B%0A%09%09%09return null;%0A%09%09%7D%0A%09%09return outlineAttribute.getValue();%0A%09%7D%0A%0A%09public static Rectangle getAbsoluteOutline( final IdentifyingAttributes attributes ) %7B%0A%09%09final OutlineAttribute outlineAttribute =%0A%09%09%09%09(OutlineAttribute) attributes.getAttribute( OutlineAttribute.ABSOLUTE_OUTLINE );%0A%09%09if ( outlineAttribute == null ) %7B%0A%09%09%09return null;%0A%09%09%7D%0A%09%09return outlineAttribute.getValue();%0A%09%7D
+import java.util.List;%0A%0Aimport de.retest.recheck.ui.diff.AttributeDifference;%0Aimport de.retest.recheck.ui.diff.ElementDifference;%0Aimport de.retest.recheck.ui.diff.IdentifyingAttributesDifference;%0A%0Apublic class AttributeUtil %7B%0A%0A%09public static Rectangle getActualOutline( final ElementDifference difference ) %7B%0A%09%09final Rectangle actualRelative = getActualOutline( difference, OutlineAttribute.RELATIVE_OUTLINE );%0A%0A%09%09if ( actualRelative != null ) %7B%0A%09%09%09return actualRelative;%0A%09%09%7D%0A%09%09return getOutline( difference.getIdentifyingAttributes() );%0A%09%7D%0A%0A%09public static Rectangle getActualAbsoluteOutline( final ElementDifference difference ) %7B%0A%09%09final Rectangle actualAbsolute = getActualOutline( difference, OutlineAttribute.ABSOLUTE_OUTLINE );%0A%0A%09%09if ( actualAbsolute != null ) %7B%0A%09%09%09return actualAbsolute;%0A%09%09%7D%0A%09%09return getAbsoluteOutline( difference.getIdentifyingAttributes() );%0A%09%7D%0A%0A%09public static Rectangle getOutline( final IdentifyingAttributes attributes ) %7B%0A%09%09final OutlineAttribute outlineAttribute =%0A%09%09%09%09(OutlineAttribute) attributes.getAttribute( OutlineAttribute.RELATIVE_OUTLINE );%0A%09%09if ( outlineAttribute == null ) %7B%0A%09%09%09return null;%0A%09%09%7D%0A%09%09return outlineAttribute.getValue();%0A%09%7D%0A%0A%09public static Rectangle getAbsoluteOutline( final IdentifyingAttributes attributes ) %7B%0A%09%09final OutlineAttribute outlineAttribute =%0A%09%09%09%09(OutlineAttribute) attributes.getAttribute( OutlineAttribute.ABSOLUTE_OUTLINE );%0A%09%09if ( outlineAttribute == null ) %7B%0A%09%09%09return null;%0A%09%09%7D%0A%09%09return outlineAttribute.getValue();%0A%09%7D%0A%0A%09private static Rectangle getActualOutline( final ElementDifference difference, final String type ) %7B%0A%09%09final IdentifyingAttributesDifference identifyingAttributesDifference =%0A%09%09%09%09(IdentifyingAttributesDifference) difference.getIdentifyingAttributesDifference();%0A%0A%09%09if ( identifyingAttributesDifference != null ) %7B%0A%0A%09%09%09final List%3CAttributeDifference%3E attributeDifferences =%0A%09%09%09%09%09identifyingAttributesDifference.getAttributeDifferences();%0A%0A%09%09%09if ( attributeDifferences != null ) %7B%0A%09%09%09%09for ( final AttributeDifference aDiff : attributeDifferences ) %7B%0A%09%09%09%09%09if ( aDiff.getKey().equals( type ) ) %7B%0A%09%09%09%09%09%09return ((Rectangle) aDiff.getActual());%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return null;%0A%09%7D%0A
 %0A%7D%0A

Add methods for actual outline