com.ijchart.xychart.render.noaxis.pie
Class PieLabelDistributor

java.lang.Object
  extended by com.ijchart.xychart.render.noaxis.pie.PieLabelDistributor
All Implemented Interfaces:
java.io.Serializable

public class PieLabelDistributor
extends java.lang.Object
implements java.io.Serializable

Title: IJChart

Description: a chart library for the Java(tm) platform.

用于排列饼图的外部标签的类.

Copyright: Copyright (c) 2013

Company:

Version:
1.0
Author:
zhang feng min,shanghai china. Contract me by email.
See Also:
Serialized Form

Constructor Summary
PieLabelDistributor()
          构造器.
 
Method Summary
 void addPieLabelRecord(PieLabelRecord record)
          增加一个PieLabelRecord对象.
protected  void adjustDownwards(double minY, double height)
          在标签有重叠的时候,朝下方向调整y坐标.
protected  void adjustInwards()
          在标签有重叠的时候,朝中心方向调整y坐标.
protected  void adjustUpwards(double minY, double height)
          在标签有重叠的时候,朝上方向调整y坐标.
 void clear()
          删除所有的对象.
 void distributeLabels(double minY, double height)
          排列标签.
 int getItemCount()
          返回PieLabelRecord对象的数量.
 PieLabelRecord getPieLabelRecord(int index)
          根据索引查找PieLabelRecord对象.
 void sort()
          根据y值排序.
protected  void spreadEvenly(double minY, double height)
          把标签排列均匀.
 java.lang.String toString()
          覆盖toString方法.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PieLabelDistributor

public PieLabelDistributor()
构造器.

Method Detail

getPieLabelRecord

public PieLabelRecord getPieLabelRecord(int index)
根据索引查找PieLabelRecord对象.

Parameters:
index - 索引.
Returns:
PieLabelRecord对象(可为null).

addPieLabelRecord

public void addPieLabelRecord(PieLabelRecord record)
增加一个PieLabelRecord对象.

Parameters:
record - PieLabelRecord对象.

getItemCount

public int getItemCount()
返回PieLabelRecord对象的数量.

Returns:
The item count.

clear

public void clear()
删除所有的对象.


distributeLabels

public void distributeLabels(double minY,
                             double height)
排列标签.

Parameters:
minY - 最小的y坐标值.
height - 高度.

adjustInwards

protected void adjustInwards()
在标签有重叠的时候,朝中心方向调整y坐标.


adjustDownwards

protected void adjustDownwards(double minY,
                               double height)
在标签有重叠的时候,朝下方向调整y坐标.

Parameters:
minY - 最小的y值.
height - 高度.

adjustUpwards

protected void adjustUpwards(double minY,
                             double height)
在标签有重叠的时候,朝上方向调整y坐标.

Parameters:
minY - 最小的y值.
height - 高度.

spreadEvenly

protected void spreadEvenly(double minY,
                            double height)
把标签排列均匀.

Parameters:
minY - 最小的y值.
height - 高度.

sort

public void sort()
根据y值排序.


toString

public java.lang.String toString()
覆盖toString方法.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the object.