public class LegendGlyph extends RectangleGlyph
限定符和类型 | 字段和说明 |
---|---|
protected FRFont |
font |
static double |
MAX_LEFT_WIDTH
图例左右两侧时, 允许的图例最大宽度比例
1.
|
protected static int |
PADDING_GAP |
protected static int |
ROW_COL_GAP |
protected static double |
START_HEIGHT |
protected static double |
START_WIDTH |
static java.lang.String |
THIRTY_PERCENT |
bounds, visible
构造器和说明 |
---|
LegendGlyph() |
LegendGlyph(LegendItem[] items) |
限定符和类型 | 方法和说明 |
---|---|
void |
changeLegendBounds(java.awt.geom.Rectangle2D newBounds,
int resolution)
更改图例边界
|
void |
draw(java.awt.Graphics g,
int resolution)
画GeneralGlyph
|
boolean |
equals(java.lang.Object ob) |
FRFont |
getFont() |
LegendItem[] |
getItems() |
protected double |
getLegendHeight(java.awt.geom.Rectangle2D chartBounds,
int resolution) |
protected double |
getLegendWidth(java.awt.geom.Rectangle2D chartBounds,
int resolution) |
protected double |
getLegendWithProportion() |
protected double |
getLegendX(java.awt.geom.Rectangle2D chartOriginalBounds,
java.awt.geom.Rectangle2D chartBounds,
int resolution) |
protected double |
getLegendY(java.awt.geom.Rectangle2D chartOriginalBounds,
java.awt.geom.Rectangle2D chartBounds,
int resolution) |
int |
getPosition() |
protected void |
initMaxLegendWidth4DrawisCut(java.awt.geom.Rectangle2D legendBounds,
int resolution)
初始化 左右侧时 图例的最大宽度, 并确定过长标签的画法, 是省略 还是剪切.
|
protected boolean |
isNotEnough4ItemInTopAndBottom(double preWidth,
java.awt.geom.Dimension2D itemDim,
java.awt.geom.Rectangle2D legendItemBounds) |
void |
layoutLegendAndRefreshChartBounds(java.awt.geom.Rectangle2D chartOriginalBounds,
java.awt.geom.Rectangle2D chartBounds,
double width_gap,
double height_gap,
int resolution)
布局图例内部并刷新图表的边界
|
java.awt.geom.Dimension2D |
prefferedLegendSizeWithChartBounds(java.awt.geom.Rectangle2D chartBounds,
int resolution)
预计算图例的实际大小
策略: 上下位置时: 根据每个小图例的实际宽度 填充, 充满chartBounds宽度
左右位置时: 根据每个小图例的实际高度填充, 充满chartBounds高度
其余放不下时: 省略
|
protected java.awt.geom.Dimension2D |
preLegendDim4TopAndBottom(java.awt.geom.Rectangle2D legendBounds,
int resolution) |
protected void |
refreshChartBoundsWithLegendBounds(java.awt.geom.Rectangle2D chartBounds,
java.awt.geom.Rectangle2D legendBounds,
double widthGap,
double heightGap) |
protected void |
refreshItem4TopAndBottom(java.awt.geom.Rectangle2D legendBounds,
int resolution) |
protected void |
refresItemBounds(int index,
double x,
double y,
java.awt.geom.Dimension2D dim) |
java.util.Iterator |
selectableChildren()
选中的集合
|
void |
setFont(FRFont font) |
protected void |
setItemBoundsNull(int index) |
void |
setItems(LegendItem[] items) |
protected void |
setLegendBounds(java.awt.geom.Rectangle2D legendBounds) |
void |
setPosition(int position) |
JSONObject |
toJSONObject(Repository repo)
转为json数据
|
JSONObject |
toVanJSONObject(Repository repo) |
clone, getBounds, getOutline4Fill, getShape, isInvisible, isVisible, setBounds, setVisible
dealCondition, dealConditionWithSeriesColor, drawOnlyBorder, drawWithOutBorder, getAlpha, getBackground, getBorderColor, getBorderStyle, getGeneralInfo, getRoundRadius, is3DIE6, isRoundBorder, isShadow, paint, paintBackground, putBackgroundJSON, putPlotBackgroundJSON, setAlpha, setBackground, setBorderColor, setBorderStyle, setGeneralInfo, setRoundBorder
protected static final int PADDING_GAP
protected static final int ROW_COL_GAP
public static final java.lang.String THIRTY_PERCENT
public static final double MAX_LEFT_WIDTH
protected static final double START_WIDTH
protected static final double START_HEIGHT
protected FRFont font
public LegendGlyph()
public LegendGlyph(LegendItem[] items)
public void setItems(LegendItem[] items)
public LegendItem[] getItems()
public void setFont(FRFont font)
public FRFont getFont()
public void setPosition(int position)
public int getPosition()
public java.util.Iterator selectableChildren()
public void draw(java.awt.Graphics g, int resolution)
GeneralGlyph
draw
在接口中 Glyph
draw
在类中 GeneralGlyph
g
- 图形对象resolution
- 分辨率public void layoutLegendAndRefreshChartBounds(java.awt.geom.Rectangle2D chartOriginalBounds, java.awt.geom.Rectangle2D chartBounds, double width_gap, double height_gap, int resolution)
chartOriginalBounds
- 最初图表边界(没有title等裁剪)chartBounds
- 图表边界width_gap
- 宽度间隔height_gap
- 高度间隔resolution
- 分辨率protected void setLegendBounds(java.awt.geom.Rectangle2D legendBounds)
public void changeLegendBounds(java.awt.geom.Rectangle2D newBounds, int resolution)
newBounds
- 新边界resolution
- 分辨率protected void refreshChartBoundsWithLegendBounds(java.awt.geom.Rectangle2D chartBounds, java.awt.geom.Rectangle2D legendBounds, double widthGap, double heightGap)
protected double getLegendX(java.awt.geom.Rectangle2D chartOriginalBounds, java.awt.geom.Rectangle2D chartBounds, int resolution)
protected double getLegendY(java.awt.geom.Rectangle2D chartOriginalBounds, java.awt.geom.Rectangle2D chartBounds, int resolution)
protected double getLegendWidth(java.awt.geom.Rectangle2D chartBounds, int resolution)
protected double getLegendHeight(java.awt.geom.Rectangle2D chartBounds, int resolution)
public java.awt.geom.Dimension2D prefferedLegendSizeWithChartBounds(java.awt.geom.Rectangle2D chartBounds, int resolution)
chartBounds
- 边界resolution
- 像素protected boolean isNotEnough4ItemInTopAndBottom(double preWidth, java.awt.geom.Dimension2D itemDim, java.awt.geom.Rectangle2D legendItemBounds)
protected void refreshItem4TopAndBottom(java.awt.geom.Rectangle2D legendBounds, int resolution)
protected java.awt.geom.Dimension2D preLegendDim4TopAndBottom(java.awt.geom.Rectangle2D legendBounds, int resolution)
protected void initMaxLegendWidth4DrawisCut(java.awt.geom.Rectangle2D legendBounds, int resolution)
protected double getLegendWithProportion()
protected void refresItemBounds(int index, double x, double y, java.awt.geom.Dimension2D dim)
protected void setItemBoundsNull(int index)
public boolean equals(java.lang.Object ob)
equals
在类中 RectangleGlyph
public JSONObject toJSONObject(Repository repo) throws JSONException
toJSONObject
在接口中 Glyph
toJSONObject
在类中 RectangleGlyph
repo
- 请求JSONException
- 抛错public JSONObject toVanJSONObject(Repository repo) throws JSONException
toVanJSONObject
在类中 GeneralGlyph
JSONException