TAChart: Add some strict protected/strict private annotations. Get rid of TCustomSeriesCrack class.

git-svn-id: trunk@31827 -
This commit is contained in:
ask 2011-07-30 08:25:18 +00:00
parent d0b5c54609
commit e8d1819c83
7 changed files with 29 additions and 34 deletions

View File

@ -46,7 +46,7 @@ type
{ TChartAxisTitle }
TChartAxisTitle = class(TCustomChartAxisTitle)
private
strict private
FCaption: String;
function GetFont: TFont;

View File

@ -122,7 +122,7 @@ type
{ TIndexedComponent }
TIndexedComponent = class(TComponent)
protected
strict protected
function GetIndex: Integer; virtual; abstract;
procedure SetIndex(AValue: Integer); virtual; abstract;
public

View File

@ -34,7 +34,7 @@ type
{ TCustomChartSeries }
TCustomChartSeries = class(TBasicChartSeries)
private
strict private
FAxisIndexX: Integer;
FAxisIndexY: Integer;
FLegend: TChartSeriesLegend;
@ -60,11 +60,11 @@ type
procedure ReadState(Reader: TReader); override;
procedure SetParentComponent(AParent: TComponent); override;
protected
strict protected
function GetIndex: Integer; override;
procedure SetIndex(AValue: Integer); override;
protected
public
function AxisToGraph(const APoint: TDoublePoint): TDoublePoint;
function AxisToGraphX(AX: Double): Double; override;
function AxisToGraphY(AY: Double): Double; override;
@ -73,7 +73,6 @@ type
function GraphToAxis(APoint: TDoublePoint): TDoublePoint;
function GraphToAxisX(AX: Double): Double; override;
function GraphToAxisY(AY: Double): Double; override;
function IsRotated: Boolean;
public
@ -106,7 +105,7 @@ type
{ TChartSeries }
TChartSeries = class(TCustomChartSeries)
private
strict private
FBuiltinSource: TCustomChartSource;
FListener: TListener;
FMarks: TChartMarks;
@ -187,13 +186,13 @@ type
{ TBasicPointSeries }
TBasicPointSeries = class(TChartSeries)
private
strict private
FMarkPositions: TLinearMarkPositions;
function GetLabelDirection(AIndex: Integer): TLabelDirection;
procedure SetMarkPositions(AValue: TLinearMarkPositions);
procedure SetPointer(AValue: TSeriesPointer);
procedure SetUseReticule(AValue: Boolean);
protected
strict protected
FGraphPoints: array of TDoublePoint;
FLoBound: Integer;
FMinXRange: Double;
@ -201,6 +200,7 @@ type
FUpBound: Integer;
FUseReticule: Boolean;
protected
procedure AfterAdd; override;
procedure AfterDrawPointer(
ADrawer: IChartDrawer; AIndex: Integer; const APos: TPoint); virtual;
@ -214,10 +214,10 @@ type
procedure UpdateGraphPoints(AIndex: Integer);
procedure UpdateMargins(ADrawer: IChartDrawer; var AMargins: TRect); override;
procedure UpdateMinXRange;
property Pointer: TSeriesPointer read FPointer write SetPointer;
property UseReticule: Boolean
read FUseReticule write SetUseReticule default false;
protected
property Pointer: TSeriesPointer read FPointer write SetPointer;
public
destructor Destroy; override;
public

View File

@ -51,10 +51,10 @@ type
{ TCustomChartSource }
TCustomChartSource = class(TComponent)
private
strict private
FBroadcaster: TBroadcaster;
FUpdateCount: Integer;
protected
strict protected
FExtent: TDoubleRect;
FExtentIsValid: Boolean;
FValuesTotal: Double;
@ -100,7 +100,7 @@ type
{ TChartSourceBuffer }
TChartSourceBuffer = class
private
strict private
FBuf: array of TChartDataItem;
FCount: Cardinal;
FStart: Cardinal;

View File

@ -40,7 +40,7 @@ type
{ TBasicFuncSeries }
TBasicFuncSeries = class(TCustomChartSeries)
private
strict private
FExtent: TChartExtent;
procedure SetExtent(AValue: TChartExtent);
protected
@ -61,7 +61,7 @@ type
{ TFuncSeries }
TFuncSeries = class(TBasicFuncSeries)
private
strict private
FDomainExclusions: TIntervalList;
FOnCalculate: TFuncCalculateEvent;
FPen: TChartPen;
@ -99,7 +99,7 @@ type
{ TBSplineSeries }
TBSplineSeries = class(TBasicPointSeries)
private
strict private
FDegree: TSplineDegree;
FPen: TChartPen;
FStep: TFuncSeriesStep;
@ -198,7 +198,7 @@ type
{ TColorMapSeries }
TColorMapSeries = class(TBasicFuncSeries)
private
strict private
FBrush: TBrush;
FColorSource: TCustomChartSource;
FColorSourceListener: TListener;
@ -337,9 +337,6 @@ begin
OnCalculate(AX, Result)
end;
type
TCustomSeriesCrack = class(TCustomChartSeries);
procedure DrawFunction(
ADrawer: IChartDrawer; ASeries: TCustomChartSeries;
ADomainExclusions: TIntervalList; ACalc: TTransformFunc; AStep: Integer);
@ -388,10 +385,10 @@ var
hint: Integer;
xg, xa, xg1, xa1, xmax, graphStep: Double;
begin
chart := TCustomSeriesCrack(ASeries).FChart;
chart := ASeries.ParentChart;
r := chart.CurrentExtent;
with TCustomSeriesCrack(ASeries) do
with ASeries do
if IsRotated then begin
axisToGraphXr := @AxisToGraphY;
axisToGraphYr := @AxisToGraphX;
@ -444,9 +441,7 @@ begin
else
exit;
ADrawer.Pen := Pen;
DrawFunction(
ADrawer, TCustomSeriesCrack(TCustomChartSeries(Self)),
DomainExclusions, calc, Step);
DrawFunction(ADrawer, Self, DomainExclusions, calc, Step);
end;
procedure TFuncSeries.GetLegendItems(AItems: TChartLegendItems);

View File

@ -67,7 +67,7 @@ type
procedure VisitSources(
AVisitor: TChartOnSourceVisitor; AAxis: TChartAxis; var AData); virtual;
protected
public
function AxisToGraphX(AX: Double): Double; virtual;
function AxisToGraphY(AY: Double): Double; virtual;
function GraphToAxisX(AX: Double): Double; virtual;

View File

@ -51,7 +51,7 @@ type
{ TChartPen }
TChartPen = class(TPen)
private
strict private
FVisible: Boolean;
procedure SetVisible(AValue: Boolean);
public
@ -67,7 +67,7 @@ type
{ TChartElement }
TChartElement = class(TPersistent)
protected
strict protected
FVisible: Boolean;
procedure SetVisible(AValue: Boolean);
protected
@ -275,7 +275,7 @@ type
{ TSeriesPointer }
TSeriesPointer = class(TChartElement)
private
strict private
FBrush: TBrush;
FHorizSize: Integer;
FPen: TChartPen;
@ -308,7 +308,7 @@ type
EExtentError = class(EChartError);
TChartRange = class(TChartElement)
private
strict private
FBounds: array [1..2] of Double;
FUseBounds: array [1..2] of Boolean;
@ -330,7 +330,7 @@ type
{ TChartExtent }
TChartExtent = class(TChartElement)
private
strict private
FExtent: TDoubleRect;
FUseBounds: array [1..4] of Boolean;
@ -358,7 +358,7 @@ type
{ TChartMargins }
TChartMargins = class(TChartElement)
private
strict private
FData: record
case Integer of
0: (FRect: TRect;);
@ -379,7 +379,7 @@ type
end;
TChartArrow = class(TChartElement)
private
strict private
FLength: TChartDistance;
FWidth: TChartDistance;
procedure SetLength(AValue: TChartDistance);