com.steema.teechart.styles
Class Custom3DPalette

java.lang.Object
  extended by com.steema.teechart.TeeBase
      extended by com.steema.teechart.styles.Series
          extended by com.steema.teechart.styles.Custom3D
              extended by com.steema.teechart.styles.Custom3DPalette
All Implemented Interfaces:
ISeries
Direct Known Subclasses:
Custom3DGrid, Map, Ternary, TriSurface, Vector3D

public class Custom3DPalette
extends Custom3D

Title: Custom3DPalette class

Description: Custom3DPalette Series Style.

Copyright (c) 2005-2013 by Steema Software SL. All Rights Reserved.

Company: Steema Software SL


Nested Class Summary
static interface Custom3DPalette.ColorResolver
           
 
Nested classes/interfaces inherited from class com.steema.teechart.styles.Series
Series.MarkTextResolver
 
Field Summary
protected  boolean bUseColorRange
           
protected  boolean bUsePalette
           
protected  int iPaletteSteps
           
protected  boolean sameBrush
           
 
Fields inherited from class com.steema.teechart.styles.Custom3D
vzValues
 
Fields inherited from class com.steema.teechart.styles.Series
AUTODEPTH, AUTOZORDER, bActive, bBrush, bColorEach, calcVisiblePoints, colorMember, customMarkText, drawBetweenPoints, endZ, firstVisible, hasZValues, iColors, iNumSampleValues, iZOrder, labelMember, lastVisible, listenerList, mandatory, manualData, marks, middleZ, notMandatory, percentDecimal, percentFormat, sLabels, startZ, useAxis, useSeriesColor, valueFormat, vxValues, vyValues, yMandatory
 
Fields inherited from class com.steema.teechart.TeeBase
chart, InternalUse
 
Constructor Summary
Custom3DPalette()
           
Custom3DPalette(IBaseChart c)
           
 
Method Summary
 int addPalette(double aValue, Color aColor)
          Add Color to Palette list
protected  void calcColorRange()
           
 void clearPalette()
          Deletes all Palette information.
protected  int countLegendItems()
           
protected  void createDefaultPalette(int numSteps)
           
 void createSubGallery(Gallery addSubChart)
           
 void doBeforeDrawChart()
           
protected  void drawLegendShape(IGraphics3D g, int valueIndex, Rectangle rect)
           
 void galleryChanged3D(boolean is3D)
           
 double getBlueFactor()
          Defines the alpha value for the Blue of the ARGB component.
 ChartBrush getBrush()
          Defines the Brush to fill the Surface polygons.
 int getCountLegendItems()
           
 Color getEndColor()
          Determines the last Range palette color.
 double getGreenFactor()
          Defines the alpha value for the Green of the ARGB component.
 java.lang.String getLegendString(int legendIndex, LegendTextStyle legendTextStyle)
          Returns LegendString for LegendIndexth item.
 Color getMidColor()
          Determines the middle Range palette color.
 PaletteList getPalette()
          Access the Color Palette list
 double getPaletteMin()
          The starting value used to calculate the color palette when Custom3DPalette.UsePaletteMin is true.
 double getPaletteRange()
          Defines the range of colors in the default color Palette.
 double getPaletteStep()
          The interval amount between palette Colors.
 int getPaletteSteps()
          The number of entries in the default color Palette.
 PaletteStyle getPaletteStyle()
          Selects Pale or Strong color palette.
 ChartPen getPen()
          Defines the Pen to draw the Surface polygons.
 double getRedFactor()
          Defines the alpha value for the Red of the ARGB component.
 Color getStartColor()
          Determines 1 of 3 Colors used to create the palette to fill the Surface polygons.
 boolean getUseColorRange()
          Gradient color palette to fill Surface polygons.
 boolean getUsePalette()
          Determines multi-color palette to fill Surface polygons.
 boolean getUsePaletteMin()
          Forces the color palette to start at getUsePaletteMin() value when true.
 Color getValueColor(int valueIndex)
          Returns the colour of the index point.
protected  Color getValueColorValue(double aValue)
           
 Color legendItemColor(int legendIndex)
           
 void prepareForGallery(boolean isEnabled)
           
protected  java.lang.Object readResolve()
           
 void removeColorResolver()
           
 void setBlueFactor(double value)
          Sets the alpha value for the Blue of the ARGB component.
 void setChart(IBaseChart c)
          Chart associated with this object.
 void setColorResolver(Custom3DPalette.ColorResolver resolver)
           
 void setEndColor(Color value)
          Sets the last Range palette color.
 void setGreenFactor(double value)
          Sets the alpha value for the Green of the ARGB component.
 void setMidColor(Color value)
          Sets the middle Range palette color.
 void setPaletteMin(double value)
          Sets starting value used to calculate the color palette when getUsePaletteMin() is true.
 void setPaletteRange(double value)
          Sets the range of colors in the default color Palette.
 void setPaletteStep(double value)
          Sets interval between palette Colors.
 void setPaletteSteps(int value)
          Sets the number of entries in the default color Palette.
 void setPaletteStyle(PaletteStyle value)
          Sets Pale or Strong color palette.
protected  void setRainbowPalette(int numSteps, double tmpMin, double scaleValue)
           
 void setRedFactor(double value)
          Sets the alpha value for the Red of the ARGB component.
protected  boolean setSameBrush()
           
 void setStartColor(Color value)
          Sets 1 of 3 Colors used to create the palette to fill the Surface polygons.
 void setSubGallery(int index)
          Creates and prepares the index'th Series style to show at sub-gallery dialog.
 void setUseColorRange(boolean value)
          Sets gradient color palette to fill Surface polygons.
 void setUsePalette(boolean value)
          Sets multi-color palette to fill Surface polygons.
 void setUsePaletteMin(boolean value)
          Set to true to force the color palette to start at getUsePaletteMin() value.
 
Methods inherited from class com.steema.teechart.styles.Custom3D
add, add, add, add, add, add, add, add, add, calcZOrder, calcZPos, drawMark, getMaxZValue, getMinZValue, getPoint, getTimesZOrder, getZValues, isValidSourceOf, prepareLegendCanvas, setTimesZOrder, valueListOfAxis
 
Methods inherited from class com.steema.teechart.styles.Series
add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, addChartValue, added, addedValue, addNull, addNullXY, addSampleValues, addSeriesMouseListener, addSeriesPaintListener, addValues, assign, assignDispose, assignValues, associatedToAxis, beginUpdate, calcFirstLastVisibleIndex, calcHorizMargins, calcPercentSt, calcPosValue, calculateMarkPosition, calcVerticalMargins, calcXPos, calcXPosValue, calcXSizeValue, calcYPos, calcYPosValue, calcYSizeValue, canAddRandomPoints, changeType, checkDataSource, checkMouse, checkOrder, checkOtherSeries, clear, clearLists, clicked, clicked, clone, cloneSeries, convertArray, createNewSeries, createNewSeries, createNewSeries, dataSourceArray, delete, delete, delete, dispose, doAfterDrawValues, doBeforeDrawValues, doClick, doClickPointer, doDoubleClick, draw, drawHiddenValue, drawLegend, drawLegend, drawMarks, drawMarksSeries, drawSeries, drawSeriesForward, drawValue, drawValuesForward, endUpdate, fillSampleValues, fillSampleValues, fireSeriesMouseEvent, fireSeriesPaint, firstDisplayed, getActive, getAllowSinglePoint, getColor, getColorEach, getColorMember, getColors, getCount, getCursor, getCustomHorizAxis, getCustomVertAxis, getDataSource, getDefaultColor, getDefaultNullValue, getDepth, getDescription, getEndZ, getFields, getFirstVisible, getFunction, getHasZValues, getHorizAxis, getHorizontalAxis, getLabelMember, getLabels, getLastVisible, getMandatory, getMandatoryAxis, getMarks, getMarkText, getMarkValue, getMaxXValue, getMaxYValue, getMiddleZ, getMinXValue, getMinYValue, getNotMandatory, getNumGallerySeries, getNumSampleValues, getOriginValue, getPercentFormat, getSeriesColor, getShowInLegend, getStartZ, getTitle, getUseAxis, getValueFormat, getValueIndexSwapper, getValueList, getValueList, getValueMarkText, getValuesLists, getVertAxis, getVerticalAxis, getVisible, getXValues, getYMandatory, getYValueList, getYValues, getZOrder, hasClickEvents, hasDataSource, hasListenersOf, hasNoMandatoryValues, isNull, isPointInChartRect, isValidSeriesSource, lastDisplayed, lastVisibleMark, legendToValueIndex, maxMarkWidth, moreSameZOrder, mouseEvent, newFromType, numSampleValues, onDisposing, randomBounds, recalcGetAxis, refreshSeries, removeMarkTextResolver, removeSeriesMouseListener, removeSeriesPaintListener, repaint, sameClass, setActive, setColor, setColorEach, setColorMember, setColors, setCursor, setCustomHorizAxis, setCustomHorizAxis, setCustomVertAxis, setCustomVertAxis, setDataSource, setDefaultNullValue, setDepth, setEndZ, setFunction, setHorizontal, setHorizontalAxis, setLabelMember, setLabels, setMarks, setMarkTextResolver, setMiddleZ, setNull, setNull, setPercentFormat, setSeriesColor, setShowInLegend, setStartZ, setTitle, setValueFormat, setValueList, setVerticalAxis, setVisible, setXValues, setYValues, setZOrder, setZPositions, sortByLabels, sortByLabels, swapValueIndex, titleOrName, toString, valuesListAdd, xScreenToValue, yScreenToValue
 
Methods inherited from class com.steema.teechart.TeeBase
getChart, invalidate, setBooleanProperty, setColorProperty, setDoubleProperty, setIntegerProperty, setStringProperty
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.steema.teechart.styles.ISeries
getChart, invalidate
 

Field Detail

iPaletteSteps

protected int iPaletteSteps

bUseColorRange

protected boolean bUseColorRange

bUsePalette

protected boolean bUsePalette

sameBrush

protected boolean sameBrush
Constructor Detail

Custom3DPalette

public Custom3DPalette(IBaseChart c)

Custom3DPalette

public Custom3DPalette()
Method Detail

setSameBrush

protected boolean setSameBrush()

setColorResolver

public void setColorResolver(Custom3DPalette.ColorResolver resolver)

removeColorResolver

public void removeColorResolver()

countLegendItems

protected int countLegendItems()
Overrides:
countLegendItems in class Series

readResolve

protected java.lang.Object readResolve()
Overrides:
readResolve in class Series

getPen

public ChartPen getPen()
Defines the Pen to draw the Surface polygons.
You can make it invisible by turning the Pen.Visible to false.

Returns:
ChartPen

getPaletteRange

public double getPaletteRange()
Defines the range of colors in the default color Palette.
Default value: O

Returns:
double

setPaletteRange

public void setPaletteRange(double value)
Sets the range of colors in the default color Palette.
Default value: O

Parameters:
value - double

getPaletteSteps

public int getPaletteSteps()
The number of entries in the default color Palette.
The greater the number of steps, the more colors will be used to fill the Surface polygons. Setting this method forces Surface series to recreate the default color palette.
Default value: false

Returns:
int

setPaletteSteps

public void setPaletteSteps(int value)
Sets the number of entries in the default color Palette.
Default value: false

Parameters:
value - int

getRedFactor

public double getRedFactor()
Defines the alpha value for the Red of the ARGB component.
Defalut value: 2

Returns:
double

setRedFactor

public void setRedFactor(double value)
Sets the alpha value for the Red of the ARGB component.
Defalut value: 2

Parameters:
value - double

getGreenFactor

public double getGreenFactor()
Defines the alpha value for the Green of the ARGB component.
Default value: 1

Returns:
double

setGreenFactor

public void setGreenFactor(double value)
Sets the alpha value for the Green of the ARGB component.
Defalut value: 1

Parameters:
value - double

getBlueFactor

public double getBlueFactor()
Defines the alpha value for the Blue of the ARGB component.
Default value: 1

Returns:
double

setBlueFactor

public void setBlueFactor(double value)
Sets the alpha value for the Blue of the ARGB component.
Default value: 1

Parameters:
value - double

drawLegendShape

protected void drawLegendShape(IGraphics3D g,
                               int valueIndex,
                               Rectangle rect)
Overrides:
drawLegendShape in class Series

getEndColor

public Color getEndColor()
Determines the last Range palette color.
When getUseColorRange() is true, Surface series creates a color palette using StartColor, MidColor and EndColor methods.
Default value: WHITE

Returns:
Color

setEndColor

public void setEndColor(Color value)
Sets the last Range palette color.
Default value: WHITE

Parameters:
value - Color

getMidColor

public Color getMidColor()
Determines the middle Range palette color.
When getUseColorRange() is true, Surface series creates a color palette using StartColor, MidColor and EndColor methods.
Default value: Transparent

Returns:
Color

setMidColor

public void setMidColor(Color value)
Sets the middle Range palette color.
Default value: Transparent

Parameters:
value - Color

getStartColor

public Color getStartColor()
Determines 1 of 3 Colors used to create the palette to fill the Surface polygons.
When getUseColorRange() is true, Surface series creates a color palette using StartColor, MidColor and EndColor methods.
Default value: NAVY

Returns:
Color

setStartColor

public void setStartColor(Color value)
Sets 1 of 3 Colors used to create the palette to fill the Surface polygons.
Default value: NAVY

Parameters:
value - Color

getBrush

public ChartBrush getBrush()
Defines the Brush to fill the Surface polygons.
It only works when getUsePalette() and getUseColorRange() are false.

Overrides:
getBrush in class Series
Returns:
ChartBrush

setPaletteStyle

public void setPaletteStyle(PaletteStyle value)
Sets Pale or Strong color palette.
Default value: PaletteStyles.Pale

Example:


 series = new com.steema.teechart.styles.Surface(myChart.getChart());
 series.setPaletteStyle(PaletteStyle.STRONG);
 series.setUsePalette(true);
 series.getPen().setVisible(false);
 series.setPaletteSteps(15);
 series.setUseColorRange(false);
 series.fillSampleValues(30);
 

Parameters:
value - PaletteStyles

getPaletteStyle

public PaletteStyle getPaletteStyle()
Selects Pale or Strong color palette.
Default value: PaletteStyles.Pale

Returns:
PaletteStyles

getPaletteStep

public double getPaletteStep()
The interval amount between palette Colors.
Use getPaletteMin() and getPaletteSteps()
Default value: 0

Returns:
double

setPaletteStep

public void setPaletteStep(double value)
Sets interval between palette Colors.
Use getPaletteMin() and getPaletteSteps()
Default value: 0

Parameters:
value - double

getPalette

public PaletteList getPalette()
Access the Color Palette list

Returns:
PaletteList

getPaletteMin

public double getPaletteMin()
The starting value used to calculate the color palette when Custom3DPalette.UsePaletteMin is true.
Default value: 0

Returns:
double
See Also:
getUsePaletteMin()

setPaletteMin

public void setPaletteMin(double value)
Sets starting value used to calculate the color palette when getUsePaletteMin() is true.
Default value: 0

Parameters:
value - double
See Also:
getUsePaletteMin()

calcColorRange

protected void calcColorRange()

clearPalette

public void clearPalette()
Deletes all Palette information.


addPalette

public int addPalette(double aValue,
                      Color aColor)
Add Color to Palette list

Parameters:
aValue - double data value
aColor - Color color
Returns:
int New Palette Color Index

createSubGallery

public void createSubGallery(Gallery addSubChart)
Overrides:
createSubGallery in class Series

setRainbowPalette

protected void setRainbowPalette(int numSteps,
                                 double tmpMin,
                                 double scaleValue)

createDefaultPalette

protected void createDefaultPalette(int numSteps)

setSubGallery

public void setSubGallery(int index)
Description copied from class: Series
Creates and prepares the index'th Series style to show at sub-gallery dialog.

Specified by:
setSubGallery in interface ISeries
Overrides:
setSubGallery in class Series
Parameters:
index - int

getUseColorRange

public boolean getUseColorRange()
Gradient color palette to fill Surface polygons.
The Palette is defined with three colors: getStartColor() getMidColor() and getEndColor(). When both getUseColorRange() and getUsePalette() are false, all Surface polygons are filled with Surface's Series.Color color.
Default value: true

Returns:
boolean

setUseColorRange

public void setUseColorRange(boolean value)
Sets gradient color palette to fill Surface polygons.
Default value: true

Parameters:
value - boolean

getUsePalette

public boolean getUsePalette()
Determines multi-color palette to fill Surface polygons.
PaletteSteps determines the number of entries in the palette.
Alternatively to getPaletteSteps() you may use getUseColorRange()UseColorRange or the Series ColorEachPoint method to define colour for the Surface Series.
Default value: false

Returns:
boolean

setUsePalette

public void setUsePalette(boolean value)
Sets multi-color palette to fill Surface polygons.
Default value: false

Parameters:
value - boolean

getUsePaletteMin

public boolean getUsePaletteMin()
Forces the color palette to start at getUsePaletteMin() value when true.
Default value: false

Returns:
boolean
See Also:
getUsePaletteMin()

setUsePaletteMin

public void setUsePaletteMin(boolean value)
Set to true to force the color palette to start at getUsePaletteMin() value.
Default value: false

Parameters:
value - boolean
See Also:
getUsePaletteMin()

getValueColorValue

protected Color getValueColorValue(double aValue)

getValueColor

public Color getValueColor(int valueIndex)
Returns the colour of the index point.
Index gives the position of the point, where 0 is the first, 1 is the second, and so on.

Specified by:
getValueColor in interface ISeries
Overrides:
getValueColor in class Series
Parameters:
valueIndex - int
Returns:
Color

getCountLegendItems

public int getCountLegendItems()
Specified by:
getCountLegendItems in interface ISeries
Overrides:
getCountLegendItems in class Series

getLegendString

public java.lang.String getLegendString(int legendIndex,
                                        LegendTextStyle legendTextStyle)
Returns LegendString for LegendIndexth item.

Specified by:
getLegendString in interface ISeries
Overrides:
getLegendString in class Series
Parameters:
legendIndex - int
legendTextStyle - LegendTextStyles
Returns:
String

legendItemColor

public Color legendItemColor(int legendIndex)
Specified by:
legendItemColor in interface ISeries
Overrides:
legendItemColor in class Series

setChart

public void setChart(IBaseChart c)
Description copied from class: TeeBase
Chart associated with this object.

Specified by:
setChart in interface ISeries
Overrides:
setChart in class Series
Parameters:
c - IBaseChart

prepareForGallery

public void prepareForGallery(boolean isEnabled)
Overrides:
prepareForGallery in class Series

doBeforeDrawChart

public void doBeforeDrawChart()
Overrides:
doBeforeDrawChart in class Series

galleryChanged3D

public void galleryChanged3D(boolean is3D)
Overrides:
galleryChanged3D in class Series