Package com.macrofocus.treemap
Class AbstractLabeling<N,Row,Column,Color,Font>
- java.lang.Object
-
- com.macrofocus.treemap.AbstractLabeling<N,Row,Column,Color,Font>
-
- Type Parameters:
N
- the type of nodes
- All Implemented Interfaces:
Labeling<N,Row,Column,Color,Font>
- Direct Known Subclasses:
ExpandLabeling
,OverlayLabeling
,SurroundLabeling
@JsType public abstract class AbstractLabeling<N,Row,Column,Color,Font> extends java.lang.Object implements Labeling<N,Row,Column,Color,Font>
This class provides a skeletal implementation of the Labeling interface to minimize the effort required to implement this interface.
-
-
Field Summary
Fields Modifier and Type Field Description protected static float
COLOR_SIMILARITY_THRESHOLD
protected static float
SHARE_OF_ZOOM_FACTOR
-
Constructor Summary
Constructors Constructor Description AbstractLabeling()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.macrofocus.igraphics.CPColor<Color>
adjustLabelColor(TreeMapFieldSettings<Color,Font> settings, com.macrofocus.igraphics.CPColor<Color> foreground, com.macrofocus.igraphics.CPColor<Color> nodeColor)
static java.awt.geom.Point2D
calcCenterOfMass(java.awt.geom.Point2D[] points)
Returns a Point2D object that represents the center of mass of the given point array which represents a polygon.protected static java.awt.Rectangle
findEnclosedRectangle(java.awt.Shape shape, int y, int height)
static double
getArea(java.awt.Shape shape)
static java.awt.geom.Point2D
getCentroid(java.awt.Shape shape)
Returns a Point2D object that represents the center of mass of the given shape.double
getLeftSpace(TreeMapModel<N,Row,Column,Color,Font> model)
static java.awt.geom.Point2D[]
getPoints(java.awt.Shape shape)
double
getTopHeaderSpacing(N parent, N node, TreeMapView view, TreeMapModel model)
double
getTopSpace(TreeMapModel<N,Row,Column,Color,Font> model)
protected java.util.List<TreeMapField>
getTreeMapFieldsByVerticalAlignment(TreeMapModel model, TreeMapField[] fields, int alignement)
protected int
paintFields(TGraphics<Color,Font> g2, java.awt.Shape shape, java.awt.Rectangle bounds, N node, TreeMapView view, TreeMapModel<N,Row,Column,Color,Font> model, java.util.List<TreeMapField> fields, boolean paint, int y)
protected void
paintLabel(TGraphics<Color,Font> g2, N node, TreeMapField<N,Column> field, com.macrofocus.labeling.EnhancedLabel<Color,Font> label, java.awt.Rectangle bounds, java.awt.Rectangle drawingArea)
void
paintLeaf(TGraphics<Color,Font> g2, java.awt.Shape shape, java.awt.Rectangle bounds, N node, TreeMapView view)
java.awt.Shape
subtract(TreeMapModel<N,Row,Column,Color,Font> model, java.awt.Shape shape, N node)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.macrofocus.treemap.Labeling
paintParent
-
-
-
-
Field Detail
-
SHARE_OF_ZOOM_FACTOR
protected static final float SHARE_OF_ZOOM_FACTOR
- See Also:
- Constant Field Values
-
COLOR_SIMILARITY_THRESHOLD
protected static final float COLOR_SIMILARITY_THRESHOLD
- See Also:
- Constant Field Values
-
-
Method Detail
-
subtract
public java.awt.Shape subtract(TreeMapModel<N,Row,Column,Color,Font> model, java.awt.Shape shape, N node)
-
paintLeaf
public void paintLeaf(TGraphics<Color,Font> g2, java.awt.Shape shape, java.awt.Rectangle bounds, N node, TreeMapView view)
-
getTreeMapFieldsByVerticalAlignment
protected java.util.List<TreeMapField> getTreeMapFieldsByVerticalAlignment(TreeMapModel model, TreeMapField[] fields, int alignement)
-
paintFields
protected int paintFields(TGraphics<Color,Font> g2, java.awt.Shape shape, java.awt.Rectangle bounds, N node, TreeMapView view, TreeMapModel<N,Row,Column,Color,Font> model, java.util.List<TreeMapField> fields, boolean paint, int y)
-
paintLabel
protected void paintLabel(TGraphics<Color,Font> g2, N node, TreeMapField<N,Column> field, com.macrofocus.labeling.EnhancedLabel<Color,Font> label, java.awt.Rectangle bounds, java.awt.Rectangle drawingArea)
-
adjustLabelColor
protected com.macrofocus.igraphics.CPColor<Color> adjustLabelColor(TreeMapFieldSettings<Color,Font> settings, com.macrofocus.igraphics.CPColor<Color> foreground, com.macrofocus.igraphics.CPColor<Color> nodeColor)
-
findEnclosedRectangle
protected static java.awt.Rectangle findEnclosedRectangle(java.awt.Shape shape, int y, int height)
-
getTopHeaderSpacing
public double getTopHeaderSpacing(N parent, N node, TreeMapView view, TreeMapModel model)
-
getArea
public static double getArea(java.awt.Shape shape)
-
calcCenterOfMass
public static java.awt.geom.Point2D calcCenterOfMass(java.awt.geom.Point2D[] points)
Returns a Point2D object that represents the center of mass of the given point array which represents a polygon.- Parameters:
points
-- Returns:
- a Point2D object that represents the center of mass of the given point array
-
getCentroid
public static java.awt.geom.Point2D getCentroid(java.awt.Shape shape)
Returns a Point2D object that represents the center of mass of the given shape.- Parameters:
shape
-- Returns:
- a Point2D object that represents the center of mass of the given shape
-
getPoints
public static java.awt.geom.Point2D[] getPoints(java.awt.Shape shape)
-
-