Package com.treemap
Class AbstractLabeling<N,Row,Column,Color,Font>
java.lang.Object
com.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 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
FieldsModifier and TypeFieldDescriptionprotected static final float
protected static final float
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected com.macrofocus.igraphics.CPColor<Color>
adjustLabelColor
(TreeMapFieldSettings<Color, Font> settings, com.macrofocus.igraphics.CPColor<Color> foreground, com.macrofocus.igraphics.CPColor<Color> nodeColor) static com.macrofocus.geom.Point2D
calcCenterOfMass
(com.macrofocus.geom.Point2D[] points) Returns a Point2D object that represents the center of mass of the given point array which represents a polygon.protected static com.macrofocus.geom.Rectangle
findEnclosedRectangle
(com.macrofocus.geom.Shape shape, int y, int height) static double
getArea
(com.macrofocus.geom.Shape shape) static com.macrofocus.geom.Point2D
getCentroid
(com.macrofocus.geom.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 com.macrofocus.geom.Point2D[]
getPoints
(com.macrofocus.geom.Shape shape) double
getTopHeaderSpacing
(N parent, N node, TreeMapView view, TreeMapModel model) double
getTopSpace
(TreeMapModel<N, Row, Column, Color, Font> model) protected List<TreeMapField>
getTreeMapFieldsByVerticalAlignment
(TreeMapModel model, TreeMapField[] fields, int alignement) protected int
paintFields
(TGraphics<Color, Font> g2, com.macrofocus.geom.Shape shape, com.macrofocus.geom.Rectangle bounds, N node, TreeMapView view, TreeMapModel<N, Row, Column, Color, Font> model, 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, com.macrofocus.geom.Rectangle bounds, com.macrofocus.geom.Rectangle drawingArea) void
paintLeaf
(TGraphics<Color, Font> g2, com.macrofocus.geom.Shape shape, com.macrofocus.geom.Rectangle bounds, N node, TreeMapView view) com.macrofocus.geom.Shape
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.treemap.Labeling
paintParent
-
Field Details
-
SHARE_OF_ZOOM_FACTOR
protected static final float SHARE_OF_ZOOM_FACTOR- See Also:
-
COLOR_SIMILARITY_THRESHOLD
protected static final float COLOR_SIMILARITY_THRESHOLD- See Also:
-
-
Constructor Details
-
AbstractLabeling
public AbstractLabeling()
-
-
Method Details
-
subtract
-
getTopSpace
-
getLeftSpace
-
paintLeaf
public void paintLeaf(TGraphics<Color, Font> g2, com.macrofocus.geom.Shape shape, com.macrofocus.geom.Rectangle bounds, N node, TreeMapView view) -
getTreeMapFieldsByVerticalAlignment
protected List<TreeMapField> getTreeMapFieldsByVerticalAlignment(TreeMapModel model, TreeMapField[] fields, int alignement) -
paintFields
protected int paintFields(TGraphics<Color, Font> g2, com.macrofocus.geom.Shape shape, com.macrofocus.geom.Rectangle bounds, N node, TreeMapView view, TreeMapModel<N, Row, Column, Color, Font> model, List<TreeMapField> fields, boolean paint, int y) -
paintLabel
-
adjustLabelColor
-
findEnclosedRectangle
protected static com.macrofocus.geom.Rectangle findEnclosedRectangle(com.macrofocus.geom.Shape shape, int y, int height) -
getTopHeaderSpacing
-
getArea
public static double getArea(com.macrofocus.geom.Shape shape) -
calcCenterOfMass
public static com.macrofocus.geom.Point2D calcCenterOfMass(com.macrofocus.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 com.macrofocus.geom.Point2D getCentroid(com.macrofocus.geom.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 com.macrofocus.geom.Point2D[] getPoints(com.macrofocus.geom.Shape shape)
-