Class 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 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
    • Constructor Detail

      • AbstractLabeling

        public AbstractLabeling()
    • Method Detail

      • 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)
      • 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)