com.steema.teechart.styles
Class Shape

java.lang.Object
  extended by com.steema.teechart.TeeBase
      extended by com.steema.teechart.styles.Series
          extended by com.steema.teechart.styles.Shape
All Implemented Interfaces:
ISeries

public class Shape
extends Series

Title: Shape class

Description: Shape Series.

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

Company: Steema Software SL


Nested Class Summary
 
Nested classes/interfaces inherited from class com.steema.teechart.styles.Series
Series.MarkTextResolver
 
Field Summary
 
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
Shape()
           
Shape(IBaseChart c)
           
 
Method Summary
protected  void addSampleValues(int numValues)
           
 void calcZOrder()
           
 int clicked(int x, int y)
          Returns the ValueIndex of the "clicked" point in the Series.
 void createSubGallery(Gallery addSubChart)
           
protected  void drawLegendShape(IGraphics3D g, int valueIndex, Rectangle rect)
           
 void drawValue(int valueIndex)
          Called internally.
 ChartBrush getBrush()
          Defines the brush used to fill shape background.
 java.lang.String getDescription()
          Gets descriptive text.
 ChartFont getFont()
          Determines the font attributes used to output ShapeSeries.
 TextShape getFormat()
           
 Gradient getGradient()
          Gets Gradient fill characteristics for the ShapeSeries Shape.
 ShapeTextHorizAlign getHorizAlignment()
          Horizontally aligns the text.
 ChartPen getPen()
          Defines pen to draw Series Shape.
 ShapeStyle getStyle()
          Defines how a TChartShape component appears on a Chart.
 java.lang.String[] getText()
          Displays customized Strings inside Shapes.
 java.lang.String getText(int index)
           
 boolean getTransparent()
          Allows Shape Brush attributes to fill the interior of the Shape.
 ShapeTextVertAlign getVertAlignment()
          Sets the vertical alignment of Text within a TChartShape Series shape.
 double getX0()
          Coordinate used to define the englobing ShapeSeries rectangle.
 double getX1()
          Coordinate used to define the englobing ShapeSeries rectangle.
 ShapeXYStyle getXYStyle()
          Can be set to:- Axis, AxisOrigin or Pixels.
 double getY0()
          Coordinate used to define the englobing ShapeSeries rectangle.
 double getY1()
          Coordinate used to define the englobing ShapeSeries rectangle.
 boolean isValidSourceOf(Series s)
          Returns false if the Value parameter is the same as Self.
protected  boolean moreSameZOrder()
          Returns true if there are more series that share the same Z order.
 void prepareForGallery(boolean isEnabled)
           
 void setChart(IBaseChart c)
          Chart associated with this object.
 void setHorizAlignment(ShapeTextHorizAlign value)
          Horizontally aligns the text.
 void setStyle(ShapeStyle value)
          Defines how a TChartShape component appears on a Chart.
 void setSubGallery(int index)
          Creates and prepares the index'th Series style to show at sub-gallery dialog.
 void setText(java.lang.String[] value)
           
 void setTransparent(boolean value)
          Allows Shape Brush attributes to fill the interior of the Shape.
 void setVertAlignment(ShapeTextVertAlign value)
          Sets the vertical alignment of Text within a TChartShape Series shape.
 void setX0(double value)
          Coordinate used to define the englobing ShapeSeries rectangle.
 void setX1(double value)
          Coordinate used to define the englobing ShapeSeries rectangle.
 void setXYStyle(ShapeXYStyle value)
          Can be set to:- Axis, AxisOrigin or Pixels.
 void setY0(double value)
          Coordinate used to define the englobing ShapeSeries rectangle.
 void setY1(double value)
          Coordinate used to define the englobing ShapeSeries rectangle.
 
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, 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, clone, cloneSeries, convertArray, countLegendItems, createNewSeries, createNewSeries, createNewSeries, dataSourceArray, delete, delete, delete, dispose, doAfterDrawValues, doBeforeDrawChart, doBeforeDrawValues, doClick, doClickPointer, doDoubleClick, draw, drawHiddenValue, drawLegend, drawLegend, drawMark, drawMarks, drawMarksSeries, drawSeries, drawSeriesForward, drawValuesForward, endUpdate, fillSampleValues, fillSampleValues, fireSeriesMouseEvent, fireSeriesPaint, firstDisplayed, galleryChanged3D, getActive, getAllowSinglePoint, getColor, getColorEach, getColorMember, getColors, getCount, getCountLegendItems, getCursor, getCustomHorizAxis, getCustomVertAxis, getDataSource, getDefaultColor, getDefaultNullValue, getDepth, getEndZ, getFields, getFirstVisible, getFunction, getHasZValues, getHorizAxis, getHorizontalAxis, getLabelMember, getLabels, getLastVisible, getLegendString, getMandatory, getMandatoryAxis, getMarks, getMarkText, getMarkValue, getMaxXValue, getMaxYValue, getMaxZValue, getMiddleZ, getMinXValue, getMinYValue, getMinZValue, getNotMandatory, getNumGallerySeries, getNumSampleValues, getOriginValue, getPercentFormat, getPoint, getSeriesColor, getShowInLegend, getStartZ, getTitle, getUseAxis, getValueColor, getValueFormat, getValueIndexSwapper, getValueList, getValueList, getValueMarkText, getValuesLists, getVertAxis, getVerticalAxis, getVisible, getXValues, getYMandatory, getYValueList, getYValues, getZOrder, hasClickEvents, hasDataSource, hasListenersOf, hasNoMandatoryValues, isNull, isPointInChartRect, isValidSeriesSource, lastDisplayed, lastVisibleMark, legendItemColor, legendToValueIndex, maxMarkWidth, mouseEvent, newFromType, numSampleValues, onDisposing, prepareLegendCanvas, randomBounds, readResolve, 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, valueListOfAxis, 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
 

Constructor Detail

Shape

public Shape()

Shape

public Shape(IBaseChart c)
Method Detail

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

drawLegendShape

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

getText

public java.lang.String getText(int index)

getX0

public double getX0()
Coordinate used to define the englobing ShapeSeries rectangle.
The values should be expressed in Axis coordinates.
You can convert from Screen pixel coordinates to values and vice-versa using several TChart and Series methods like XScreenToValue and YScreenToValue.

Returns:
double

setX0

public void setX0(double value)
Coordinate used to define the englobing ShapeSeries rectangle.

Parameters:
value - double

getX1

public double getX1()
Coordinate used to define the englobing ShapeSeries rectangle.
The values should be expressed in Axis coordinates.
You can convert from Screen pixel coordinates to values and vice-versa using several TChart and Series methods like XScreenToValue and YScreenToValue.

Returns:
double

setX1

public void setX1(double value)
Coordinate used to define the englobing ShapeSeries rectangle.

Parameters:
value - double

getY0

public double getY0()
Coordinate used to define the englobing ShapeSeries rectangle.
The values should be expressed in Axis coordinates.
You can convert from Screen pixel coordinates to values and vice-versa using several TChart and Series methods like XScreenToValue and YScreenToValue.

Returns:
double

setY0

public void setY0(double value)
Coordinate used to define the englobing ShapeSeries rectangle.

Parameters:
value - double

getY1

public double getY1()
Coordinate used to define the englobing ShapeSeries rectangle.
The values should be expressed in Axis coordinates.
You can convert from Screen pixel coordinates to values and vice-versa using several TChart and Series methods like XScreenToValue and YScreenToValue.

Returns:
double

setY1

public void setY1(double value)
Coordinate used to define the englobing ShapeSeries rectangle.

Parameters:
value - double

getStyle

public ShapeStyle getStyle()
Defines how a TChartShape component appears on a Chart.
Default value: Circle

Returns:
ShapeStyle

setStyle

public void setStyle(ShapeStyle value)
Defines how a TChartShape component appears on a Chart.
Default value: Circle

Parameters:
value - ShapeStyle

getFormat

public TextShape getFormat()

getVertAlignment

public ShapeTextVertAlign getVertAlignment()
Sets the vertical alignment of Text within a TChartShape Series shape.
It can be Top, Center, Bottom.

Returns:
ShapeTextVertAlign

setVertAlignment

public void setVertAlignment(ShapeTextVertAlign value)
Sets the vertical alignment of Text within a TChartShape Series shape.

Parameters:
value - ShapeTextVertAlign

getHorizAlignment

public ShapeTextHorizAlign getHorizAlignment()
Horizontally aligns the text.
There are three options; Centre, Left or Right.

Returns:
ShapeTextHorizAlign

setHorizAlignment

public void setHorizAlignment(ShapeTextHorizAlign value)
Horizontally aligns the text.

Parameters:
value - ShapeTextHorizAlign

drawValue

public void drawValue(int valueIndex)
Called internally. Draws the "ValueIndex" point of the Series.

Specified by:
drawValue in interface ISeries
Overrides:
drawValue in class Series
Parameters:
valueIndex - int

addSampleValues

protected void addSampleValues(int numValues)
Overrides:
addSampleValues in class Series

clicked

public int clicked(int x,
                   int y)
Returns the ValueIndex of the "clicked" point in the Series.

Specified by:
clicked in interface ISeries
Overrides:
clicked in class Series
Parameters:
x - int
y - int
Returns:
int

getFont

public ChartFont getFont()
Determines the font attributes used to output ShapeSeries.
No auto font sizing is performed, so you must specify the desired font size to avoid shape text from overlapping the Shape boundaries.

Returns:
ChartFont

getBrush

public ChartBrush getBrush()
Defines the brush used to fill shape background.

Example:


 //shape1
 shape[0] = new Shape(myChart.getChart());
 tmpShape = shape[0];
 tmpShape.getMarks().setVisible(false);
 tmpShape.setColor(Color.WHITE);
 tmpShape.getBrush().setColor(Color.WHITE);
 tmpShape.getBrush().setImageMode(ImageMode.TILE);
 tmpShape.getBrush().loadImage(ChartSamplePanel.class.getResource(URL_IMAGE1));

 tmpShape.setStyle(ShapeStyle.CIRCLE);
 tmpShape.getPen().setColor(Color.RED);
 tmpShape.getPen().setWidth(2);
 tmpShape.setX1(50);
 tmpShape.setY1(50);
 

Overrides:
getBrush in class Series
Returns:
ChartBrush

getPen

public ChartPen getPen()
Defines pen to draw Series Shape.

Returns:
ChartPen

getGradient

public Gradient getGradient()
Gets Gradient fill characteristics for the ShapeSeries Shape.

Returns:
Gradient

getText

public java.lang.String[] getText()
Displays customized Strings inside Shapes.
You can use the Font and Aligment properties to control Text display.
Note: You may need to change Shape Font size to a different value when creating metafiles or when zooming Charts.

Returns:
String[]

setText

public void setText(java.lang.String[] value)

getTransparent

public boolean getTransparent()
Allows Shape Brush attributes to fill the interior of the Shape.
When false, Shapes do not redraw their background, so charting contents behind Shape Series is seen inside the Shape.
Default value: false

Returns:
boolean

setTransparent

public void setTransparent(boolean value)
Allows Shape Brush attributes to fill the interior of the Shape.
Default value: false

Parameters:
value - boolean

prepareForGallery

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

calcZOrder

public void calcZOrder()
Overrides:
calcZOrder in class Series

moreSameZOrder

protected boolean moreSameZOrder()
Description copied from class: Series
Returns true if there are more series that share the same Z order.
For example Stacked Bars.

Overrides:
moreSameZOrder in class Series
Returns:
boolean

getXYStyle

public ShapeXYStyle getXYStyle()
Can be set to:- Axis, AxisOrigin or Pixels.

Returns:
ShapeXYStyle

setXYStyle

public void setXYStyle(ShapeXYStyle value)
Can be set to:- Axis, AxisOrigin or Pixels.

Parameters:
value - ShapeXYStyle

isValidSourceOf

public boolean isValidSourceOf(Series s)
Returns false if the Value parameter is the same as Self.

Overrides:
isValidSourceOf in class Series
Parameters:
s - Series
Returns:
boolean

createSubGallery

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

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

getDescription

public java.lang.String getDescription()
Gets descriptive text.

Overrides:
getDescription in class Series
Returns:
String