|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.davisor.graphics.chart.ChartFactory.ChartMetrics
com.davisor.graphics.chart.ScaleLegendFactory.ScaleLegendMetrics
Legend metrics contain the legend sizing information. Scale legends are divided into several sections as shown in the following diagram.
---------------------lbw----------------- bp = border padding | bp | hlg = horizontal label gap | |---------------------------------| | hlo = horizontal label offset | | | vlo* | | | hsg = horizontal shape gap | | ----------------------------- | | lbw = legend border width | | | | | vsg/2 | | | | | | vlo = vertical label offset | |h |h |h ---------h |h | |h | | vsg = vertical shape gap | |l |l |s | |s |l | |l | | | |o |g |g | shape |g |g | label |o | l | |* |/ |/ | |/ |/ | | | b | | |2 |2 ---------2 |2 | | | w | | | | | vsg/2 | | | | | | | | |---------------------------- | | | | | vlo | | | | |---------------------------------| | | | -----------------------------------------
The gaps are given as percents from the shape's dimensions. Therefore, the gaps are scaled automatically when the shape is scaled.
The shape and label can switch places when the entries in the legend are drawn. The switch does not affect the sizing of the legend.
The horizontal and vertical label offsets that are marked with an asterisk (*), are added to the left and top sides of the legend.
| Field Summary | |
int |
borderPadding
|
int |
horizontalLabelOffset
|
boolean |
isDrawable
|
boolean[] |
isFirstValueNull
|
boolean |
isHorizontal
|
java.util.List[] |
labelHeights
|
java.util.List[] |
labelWidths
|
float |
legendBorderWidth
|
float[] |
maximumEntryHeight
|
float[] |
maximumLabelHeight
|
float[] |
maximumLabelWidth
|
float[] |
maximumShapeHeight
|
float[] |
maximumShapeWidth
|
java.util.List[] |
shapeHeights
|
java.util.List[] |
shapeWidths
|
int |
verticalLabelOffset
|
int |
verticalShapeGap
|
float |
xPositioning
|
float |
yPositioning
|
| Fields inherited from class com.davisor.graphics.chart.ChartFactory.ChartMetrics |
M_height, M_width |
| Constructor Summary | |
ScaleLegendFactory.ScaleLegendMetrics(float width,
float height,
int borderPadding,
int horizontalLabelOffset,
boolean[] isFirstValueNull,
boolean isHorizontal,
java.util.List[] labelHeights,
java.util.List[] labelWidths,
float legendBorderWidth,
float[] maximumEntryHeight,
float[] maximumLabelHeight,
float[] maximumLabelWidth,
float[] maximumShapeHeight,
float[] maximumShapeWidth,
java.util.List[] shapeHeights,
java.util.List[] shapeWidths,
int verticalLabelOffset,
int verticalShapeGap,
float xPositioning,
float yPositioning)
Creates new scale legend chart metrics. |
|
| Method Summary | |
void |
scale(float xFactor,
float yFactor)
Scales all metrics components. |
void |
scale(int dim,
float factor)
Scales the image in given dimension. |
void |
scaleToSize(java.lang.Number width,
java.lang.Number height)
Scales the image to the given width and height. |
void |
setHeight(float height)
Sets height of the chart. |
void |
setSize(float width,
float height)
Set size of the image. |
void |
setSize(int dim,
float size)
Set size in the given dim. |
void |
setWidth(float width)
Sets width of the chart. |
| Methods inherited from class com.davisor.graphics.chart.ChartFactory.ChartMetrics |
add, getHeight, getSize, getWidth |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public int borderPadding
public int horizontalLabelOffset
public boolean isDrawable
public boolean[] isFirstValueNull
public boolean isHorizontal
public java.util.List[] labelHeights
public java.util.List[] labelWidths
public float legendBorderWidth
public float[] maximumEntryHeight
public float[] maximumLabelHeight
public float[] maximumLabelWidth
public float[] maximumShapeHeight
public float[] maximumShapeWidth
public java.util.List[] shapeHeights
public java.util.List[] shapeWidths
public int verticalLabelOffset
public int verticalShapeGap
public float xPositioning
public float yPositioning
| Constructor Detail |
public ScaleLegendFactory.ScaleLegendMetrics(float width,
float height,
int borderPadding,
int horizontalLabelOffset,
boolean[] isFirstValueNull,
boolean isHorizontal,
java.util.List[] labelHeights,
java.util.List[] labelWidths,
float legendBorderWidth,
float[] maximumEntryHeight,
float[] maximumLabelHeight,
float[] maximumLabelWidth,
float[] maximumShapeHeight,
float[] maximumShapeWidth,
java.util.List[] shapeHeights,
java.util.List[] shapeWidths,
int verticalLabelOffset,
int verticalShapeGap,
float xPositioning,
float yPositioning)
width - chart widthheight - chart heightborderPadding - padding between entries and bordershorizontalLabelOffset - horizontal offset between entries/seriesisFirstValueNull - is the value of the smallest position nullisHorizontal - is the legend positioned in horizontal waylabelHeights - label heightslabelWidths - label widthslegendBorderWidth - legend border widthmaximumEntryHeight - maximum height of an entrymaximumLabelHeight - maximum height of a labelmaximumLabelWidth - maximum width of a labelmaximumShapeHeight - maximum height of a shapemaximumShapeWidth - maximum width of a shapeshapeHeights - shape heightsshapeWidths - shape widthsverticalLabelOffset - vertical offset between entries/seriesverticalShapeGap - vertical gap of shapexPositioning - position of legend edge in X-directionyPositioning - position of legend edge in Y-direction| Method Detail |
public void scale(int dim,
float factor)
scale in class ChartFactory.ChartMetricsdim - to be scaledfactor - of scalingChartFactory.ChartMetrics.add(int,float)
public void scaleToSize(java.lang.Number width,
java.lang.Number height)
null size is given, that size is not scaled.
scaleToSize in class ChartFactory.ChartMetricswidth - height - ChartFactory.ChartMetrics.getSize(int)
public void scale(float xFactor,
float yFactor)
scale in class ChartFactory.ChartMetricsxFactor - horizontal scaling factoryFactor - vertical scaling factorpublic void setWidth(float width)
setWidth in class ChartFactory.ChartMetricswidth - strictly positive witdthChartFactory.ChartMetrics.getWidth()public void setHeight(float height)
setHeight in class ChartFactory.ChartMetricsheight - strictly positive heightChartFactory.ChartMetrics.getHeight()
public void setSize(int dim,
float size)
setSize in class ChartFactory.ChartMetricsdim - X or Ysize - strictly positiveChartFactory.ChartMetrics.getSize(int)
public void setSize(float width,
float height)
width - strictly positiveheight - strictly positive
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||