org.conqat.lib.commons.treemap.ITreeMapNode Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of teamscale-lib-commons Show documentation
Show all versions of teamscale-lib-commons Show documentation
Provides common utility functions
/*
* Copyright (c) CQSE GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.conqat.lib.commons.treemap;
import java.awt.Color;
import java.awt.geom.Rectangle2D;
import java.util.List;
import org.conqat.lib.commons.test.IndexValueClass;
/**
* Interface for nodes used for building the tree map node hierarchy which is then rendered as a
* tree map.
*
* @author Benjamin Hummel
*
* @param
* the type the user data has.
*/
@IndexValueClass(containedInBackup = true)
public interface ITreeMapNode {
/** Returns the text of the tree map node */
String getText();
/**
* Returns the list of children of this node. This usually is a readonly list.
*/
List> getChildren();
/** Returns the area of this node including all subnodes. */
double getArea();
/** Returns the base color used for drawing this node. */
Color getColor();
/**
* Returns the rectangle this node was layouted into. If the tree was not yet layouted, this may be
* null, otherwise it should be the value set by {@link #setLayoutRectangle(Rectangle2D)}.
*/
Rectangle2D getLayoutRectangle();
/** Sets the rectangle this node should be layouted into. */
void setLayoutRectangle(Rectangle2D rect);
/**
* Re-calculates the aggregated area for this node and for all of its children. This is required
* after filtering treemap nodes.
*
* @return the new area for this node.
*/
double recalculateAreaAggregates();
}