Package org.meteoinfo.chart
Class ChartLegend
- java.lang.Object
-
- org.meteoinfo.chart.ChartLegend
-
- Direct Known Subclasses:
ChartColorBar
public class ChartLegend extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classChartLegend.LayoutLegendBeanstatic classChartLegend.LayoutLegendBeanBeanInfostatic classChartLegend.PlotOrientationEditor
-
Field Summary
Fields Modifier and Type Field Description protected float_hBarHeightprotected float_vBarWidthprotected intaspectprotected booleanautoExtendFracprotected java.awt.Colorbackgroundprotected booleandrawBackgroundprotected booleandrawMaxLabelprotected booleandrawMinLabelprotected booleandrawNeatLineprotected booleanextendRectprotected intheightprotected ChartTextlabelprotected java.lang.StringlabelLocationprotected intlegendHeightprotected LegendSchemelegendSchemeprotected intlegendWidthprotected java.awt.ColorneatLineColorprotected floatneatLineSizeprotected PlotOrientationorientationprotected floatshrinkprotected floattickLabelAngleprotected java.awt.ColortickLabelColorprotected java.awt.FonttickLabelFontprotected intwidthprotected floatxprotected floatxshiftprotected floatyprotected floatyshift
-
Constructor Summary
Constructors Constructor Description ChartLegend(LegendScheme ls)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddraw(java.awt.Graphics2D g, PointF point)Draw legendintgetAspect()Get aspectjava.awt.ColorgetBackground()Get backgroundintgetColumnNumber()Get column numberintgetHeight()Get heightChartTextgetLabel()Get labeljava.awt.ColorgetLabelColor()Get label colorjava.awt.FontgetLabelFont()Get label fontjava.lang.StringgetLabelLocation()Get label location (in, out, top, bottom, left, right)java.awt.DimensiongetLegendDimension(java.awt.Graphics2D g, java.awt.Dimension limitDim)Get legend dimensionintgetLegendHeight()Get legend heightLegendSchemegetLegendScheme()Get legend schemeintgetLegendWidth()Get legend widthjava.awt.ColorgetNeatLineColor()Get neat line colorfloatgetNeatLineSize()Get neat line sizePlotOrientationgetPlotOrientation()Get plot orientationLegendPositiongetPosition()Get legend positionfloatgetShrink()Get shrinkjava.awt.DimensiongetSymbolDimension()Get symbol dimensionprotected intgetTickGap(java.awt.Graphics2D g)Update tick gapprotected intgetTickHeight(java.awt.Graphics2D g)floatgetTickLabelAngle()Get tick lable anglejava.awt.ColorgetTickLabelColor()Get tick label colorjava.awt.FontgetTickLabelFont()Get Tick label fontprotected intgetTickWidth(java.awt.Graphics2D g)intgetWidth()Get widthfloatgetX()Get XfloatgetXShift()Get x shift - pixel unitfloatgetY()Get YfloatgetYShift()Get y shift - pixel unitbooleanisAutoExtendFrac()Get if auto set extend fraction - extend has save width and height Only valid for colorbarbooleanisAutoRowColNum()Get if automatic set row/col numberbooleanisColorbar()Get if is color barbooleanisDrawBackground()Get if draw backgroundbooleanisDrawMaxLabel()Get if draw maximum value labelbooleanisDrawMinLabel()Get if draw minimum value labelbooleanisDrawNeatLine()Get if draw neat linebooleanisExtendRect()Get if extend rectangle - or trianglevoidsetAspect(int value)Set aspectvoidsetAutoExtendFrac(boolean value)Set if auto set extend fraction - extend has save width and height Only valid for colorbarvoidsetAutoRowColNum(boolean value)Set if automatic set row/col numbervoidsetBackground(java.awt.Color value)Set backgroundvoidsetColorbar(boolean value)Set if is color barvoidsetColumnNumber(int value)Set column numbervoidsetDrawBackground(boolean value)Set if draw backgroundvoidsetDrawMaxLabel(boolean value)Set if draw maximum value labelvoidsetDrawMinLabel(boolean value)Set if draw minimum value labelvoidsetDrawNeatLine(boolean istrue)Set if draw neat linevoidsetExtendRect(boolean value)Set if extend rectangle - or trianglevoidsetHeight(int value)Set heightvoidsetLabel(ChartText value)Set labelvoidsetLabelColor(java.awt.Color value)Set label colorvoidsetLabelFont(java.awt.Font value)Set label fontvoidsetLabelLocation(java.lang.String value)Set label locationvoidsetLegendHeight(int value)Set legend heightvoidsetLegendScheme(LegendScheme value)Set legend schemevoidsetLegendWidth(int value)Set legend widthvoidsetNeatLineColor(java.awt.Color color)Set neat line colorvoidsetNeatLineSize(float size)Set neat line sizevoidsetPlotOrientation(PlotOrientation value)Set plot orientationvoidsetPosition(LegendPosition value)Set legend positionvoidsetShrink(float value)Set shrinkvoidsetSymbolDimension(java.awt.Dimension value)Set symbol dimensionvoidsetSymbolHeight(int value)Set symbol heightvoidsetSymbolScale(float value)Set symbol scalevoidsetSymbolWidth(int value)Set symbol widthvoidsetTickCaptions(java.util.List<java.lang.String> value)Set tick labelsvoidsetTickLabelAngle(float value)Set tick label anglevoidsetTickLabelColor(java.awt.Color value)Set tick label colorvoidsetTickLabelFont(java.awt.Font font)Set Tick label fontvoidsetWidth(int value)Set widthvoidsetX(float value)Set XvoidsetXShift(float value)Set x shiftvoidsetY(float value)Set YvoidsetYShift(float value)Set y shift
-
-
-
Field Detail
-
legendScheme
protected LegendScheme legendScheme
-
shrink
protected float shrink
-
aspect
protected int aspect
-
x
protected float x
-
y
protected float y
-
orientation
protected PlotOrientation orientation
-
background
protected java.awt.Color background
-
drawBackground
protected boolean drawBackground
-
width
protected int width
-
height
protected int height
-
legendWidth
protected int legendWidth
-
legendHeight
protected int legendHeight
-
label
protected ChartText label
-
labelLocation
protected java.lang.String labelLocation
-
tickLabelFont
protected java.awt.Font tickLabelFont
-
tickLabelColor
protected java.awt.Color tickLabelColor
-
tickLabelAngle
protected float tickLabelAngle
-
drawNeatLine
protected boolean drawNeatLine
-
neatLineColor
protected java.awt.Color neatLineColor
-
neatLineSize
protected float neatLineSize
-
_vBarWidth
protected float _vBarWidth
-
_hBarHeight
protected float _hBarHeight
-
extendRect
protected boolean extendRect
-
autoExtendFrac
protected boolean autoExtendFrac
-
drawMinLabel
protected boolean drawMinLabel
-
drawMaxLabel
protected boolean drawMaxLabel
-
xshift
protected float xshift
-
yshift
protected float yshift
-
-
Constructor Detail
-
ChartLegend
public ChartLegend(LegendScheme ls)
Constructor- Parameters:
ls- LegendScheme
-
-
Method Detail
-
getLegendScheme
public LegendScheme getLegendScheme()
Get legend scheme- Returns:
- Legend scheme
-
setLegendScheme
public void setLegendScheme(LegendScheme value)
Set legend scheme- Parameters:
value- Legend scheme
-
isColorbar
public boolean isColorbar()
Get if is color bar- Returns:
- Boolean
-
setColorbar
public void setColorbar(boolean value)
Set if is color bar- Parameters:
value- Boolean
-
getPosition
public LegendPosition getPosition()
Get legend position- Returns:
- Legend position
-
setPosition
public void setPosition(LegendPosition value)
Set legend position- Parameters:
value- Legend position
-
getShrink
public float getShrink()
Get shrink- Returns:
- Shrink
-
setShrink
public void setShrink(float value)
Set shrink- Parameters:
value- Shrink
-
getAspect
public int getAspect()
Get aspect- Returns:
- Aspect
-
setAspect
public void setAspect(int value)
Set aspect- Parameters:
value- Aspect
-
getX
public float getX()
Get X- Returns:
- X value
-
setX
public void setX(float value)
Set X- Parameters:
value- X value
-
getY
public float getY()
Get Y- Returns:
- Y value
-
setY
public void setY(float value)
Set Y- Parameters:
value- Y value
-
getWidth
public int getWidth()
Get width- Returns:
- Width
-
setWidth
public void setWidth(int value)
Set width- Parameters:
value- Width
-
getHeight
public int getHeight()
Get height- Returns:
- Height
-
setHeight
public void setHeight(int value)
Set height- Parameters:
value- Height
-
getLegendWidth
public int getLegendWidth()
Get legend width- Returns:
- Legend width
-
setLegendWidth
public void setLegendWidth(int value)
Set legend width- Parameters:
value- Legend width
-
getLegendHeight
public int getLegendHeight()
Get legend height- Returns:
- Legend height
-
setLegendHeight
public void setLegendHeight(int value)
Set legend height- Parameters:
value- Legend height
-
getPlotOrientation
public PlotOrientation getPlotOrientation()
Get plot orientation- Returns:
- Plot orientation
-
setPlotOrientation
public void setPlotOrientation(PlotOrientation value)
Set plot orientation- Parameters:
value- Plot orientation
-
getBackground
public java.awt.Color getBackground()
Get background- Returns:
- Background
-
setBackground
public void setBackground(java.awt.Color value)
Set background- Parameters:
value- Background
-
isDrawBackground
public boolean isDrawBackground()
Get if draw background- Returns:
- Boolean
-
setDrawBackground
public void setDrawBackground(boolean value)
Set if draw background- Parameters:
value- Boolean
-
isDrawNeatLine
public boolean isDrawNeatLine()
Get if draw neat line- Returns:
- If draw neat line
-
setDrawNeatLine
public void setDrawNeatLine(boolean istrue)
Set if draw neat line- Parameters:
istrue- If draw neat line
-
getNeatLineColor
public java.awt.Color getNeatLineColor()
Get neat line color- Returns:
- Neat line color
-
setNeatLineColor
public void setNeatLineColor(java.awt.Color color)
Set neat line color- Parameters:
color- Neat line color
-
getNeatLineSize
public float getNeatLineSize()
Get neat line size- Returns:
- Neat line size
-
setNeatLineSize
public void setNeatLineSize(float size)
Set neat line size- Parameters:
size- Neat line size
-
getLabel
public ChartText getLabel()
Get label- Returns:
- Label
-
setLabel
public void setLabel(ChartText value)
Set label- Parameters:
value- Label
-
getLabelFont
public java.awt.Font getLabelFont()
Get label font- Returns:
- Label font
-
setLabelFont
public void setLabelFont(java.awt.Font value)
Set label font- Parameters:
value- Label font
-
getLabelColor
public java.awt.Color getLabelColor()
Get label color- Returns:
- Label color
-
setLabelColor
public void setLabelColor(java.awt.Color value)
Set label color- Parameters:
value- Label color
-
getLabelLocation
public java.lang.String getLabelLocation()
Get label location (in, out, top, bottom, left, right)- Returns:
- Label location
-
setLabelLocation
public void setLabelLocation(java.lang.String value)
Set label location- Parameters:
value- Label location
-
getTickLabelFont
public java.awt.Font getTickLabelFont()
Get Tick label font- Returns:
- The Tick label font
-
setTickLabelFont
public void setTickLabelFont(java.awt.Font font)
Set Tick label font- Parameters:
font- The Tick label font
-
getTickLabelColor
public java.awt.Color getTickLabelColor()
Get tick label color- Returns:
- Tick label color
-
setTickLabelColor
public void setTickLabelColor(java.awt.Color value)
Set tick label color- Parameters:
value- Tick label color
-
getTickLabelAngle
public float getTickLabelAngle()
Get tick lable angle- Returns:
- Tick label angle
-
setTickLabelAngle
public void setTickLabelAngle(float value)
Set tick label angle- Parameters:
value- Tick label angle
-
getColumnNumber
public int getColumnNumber()
Get column number- Returns:
- Column number
-
setColumnNumber
public void setColumnNumber(int value)
Set column number- Parameters:
value- Column number
-
isAutoRowColNum
public boolean isAutoRowColNum()
Get if automatic set row/col number- Returns:
- Boolean
-
setAutoRowColNum
public void setAutoRowColNum(boolean value)
Set if automatic set row/col number- Parameters:
value- Boolean
-
getSymbolDimension
public java.awt.Dimension getSymbolDimension()
Get symbol dimension- Returns:
- Symbol dimension
-
setSymbolDimension
public void setSymbolDimension(java.awt.Dimension value)
Set symbol dimension- Parameters:
value- Symbol dimension
-
setSymbolWidth
public void setSymbolWidth(int value)
Set symbol width- Parameters:
value- Width
-
setSymbolHeight
public void setSymbolHeight(int value)
Set symbol height- Parameters:
value- height
-
setSymbolScale
public void setSymbolScale(float value)
Set symbol scale- Parameters:
value- Symble scale
-
isExtendRect
public boolean isExtendRect()
Get if extend rectangle - or triangle- Returns:
- Boolean
-
setExtendRect
public void setExtendRect(boolean value)
Set if extend rectangle - or triangle- Parameters:
value- Boolean
-
isAutoExtendFrac
public boolean isAutoExtendFrac()
Get if auto set extend fraction - extend has save width and height Only valid for colorbar- Returns:
- Boolean
-
setAutoExtendFrac
public void setAutoExtendFrac(boolean value)
Set if auto set extend fraction - extend has save width and height Only valid for colorbar- Parameters:
value-
-
setTickCaptions
public void setTickCaptions(java.util.List<java.lang.String> value)
Set tick labels- Parameters:
value- Tick labels
-
isDrawMinLabel
public boolean isDrawMinLabel()
Get if draw minimum value label- Returns:
- Boolean
-
setDrawMinLabel
public void setDrawMinLabel(boolean value)
Set if draw minimum value label- Parameters:
value- Boolean
-
isDrawMaxLabel
public boolean isDrawMaxLabel()
Get if draw maximum value label- Returns:
- Boolean
-
setDrawMaxLabel
public void setDrawMaxLabel(boolean value)
Set if draw maximum value label- Parameters:
value- Boolean
-
getXShift
public float getXShift()
Get x shift - pixel unit- Returns:
- X shift
-
setXShift
public void setXShift(float value)
Set x shift- Parameters:
value- X shift
-
getYShift
public float getYShift()
Get y shift - pixel unit- Returns:
- Y shift
-
setYShift
public void setYShift(float value)
Set y shift- Parameters:
value- Y shift
-
draw
public void draw(java.awt.Graphics2D g, PointF point)Draw legend- Parameters:
g- Graphics2Dpoint- Start point
-
getLegendDimension
public java.awt.Dimension getLegendDimension(java.awt.Graphics2D g, java.awt.Dimension limitDim)Get legend dimension- Parameters:
g- Graphics2DlimitDim- Limit dimension- Returns:
- Legend dimension
-
getTickWidth
protected int getTickWidth(java.awt.Graphics2D g)
-
getTickHeight
protected int getTickHeight(java.awt.Graphics2D g)
-
getTickGap
protected int getTickGap(java.awt.Graphics2D g)
Update tick gap- Parameters:
g- Graphics2D- Returns:
- Ticks gap
-
-