// $Revision: 1.5 $ // Copyright (C) 1995 Taligent, Inc. All rights reserved. #if 0 --------------------------------------------------------------------------- > Class: | TStockGraphConstructor > Taxonomy Category: | Documented Samples | Stock Browser > Interface Category: | Sample. > Inherits From: | None. > Inherited By: | TPriceGraphConstructor | TVolumeGraphConstructor > Purpose: | An abstract base class for objects that are able to initialize a TStandardGraph object with appropriate drawer objects. This class has many data members that are used in initializing drawer objects. > Instantiation: | Allocate on the heap or the stack. > Deriving Classes: | Derived classes can override HandleDoBegin, CalcGraphRange, AdjustGraphRanges, HandleAddStandardDrawers, HandleAddExtendedDrawers, and HandleDoEnd to manipulate the graph and data appropriately. > Concurrency: | _Not_ multithread safe. > Resource Use: | No special requirements. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::~ TStockGraphConstructor ; | virtual ~ TStockGraphConstructor () > Interface Category: | Sample. > Purpose: | Destructor. > Calling Context: | Called to destroy an object. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::operator =; | TStockGraphConstructor & operator =(const TStockGraphConstructor & source) > Interface Category: | Sample. > Purpose: | Assignment operator. > Calling Context: | Called when an object is assigned to another compatible object. > Parameters: = const TStockGraphConstructor & source -The object to copy. > Return Value: | A non-const reference to the left-hand side object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::operator >>=; | virtual TStream & operator >>=(TStream & toStream) const > Interface Category: | Sample. > Purpose: | Stream-out operator. > Calling Context: | Called to stream out data. > Parameters: = TStream & toStream -The stream the object streams itself out to. > Return Value: | Returns a reference to the stream the object streams itself out to. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::operator <<= ; | virtual TStream & operator <<= (TStream & fromStream) > Interface Category: | Sample. > Purpose: | Stream-in operator. > Calling Context: | Called to stream in data. > Parameters: = TStream & fromStream -The stream the object streams itself in from. > Return Value: | Returns a reference to the stream the object streams itself in from. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::GetDescription ; | const TStandardText & GetDescription () const > Interface Category: | Sample. > Purpose: | Provides a short description of what this object does. The Stock Viewer uses each graph constructor's description as menu item text in the View menu. > Calling Context: | Call this function directly. > Parameters: = Takes no parameters. > Return Value: | A const reference to a text object containing the object's description. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::SetDescription ; | virtual void SetDescription (const TStandardText & newDescription) > Interface Category: | Sample. > Purpose: | Sets the object's description text data member. > Calling Context: | Call this function directly. > Parameters: = const TStandardText & newDescription -A reference to the text object containing the new description text. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::GetXAxisLabel ; | virtual void GetXAxisLabel (TStandardText & label) const > Interface Category: | Sample. > Purpose: | Gets the text to use for the x-axis title. > Calling Context: | Call this function directly. > Parameters: = TStandardText & label -An empty text object in which to copy the x-axis title text. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::GetYAxisLabel ; | virtual void GetYAxisLabel (TStandardText & label) const > Interface Category: | Sample. > Purpose: | Gets the text to use for the y-axis title. > Calling Context: | Call this function directly. > Parameters: = TStandardText & label -An empty text object in which to copy the y-axis title text. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::SetXAxisLabel ; | virtual void SetXAxisLabel (const TStandardText & newLabel) > Interface Category: | Sample. > Purpose: | Sets the text to use for the x-axis title. > Calling Context: | Call this function directly. > Parameters: = const TStandardText & newLabel -The new x-axis title text. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::SetYAxisLabel ; | virtual void SetYAxisLabel (const TStandardText & newLabel) > Interface Category: | Sample. > Purpose: | Sets the text to use for the y-axis title. > Calling Context: | Call this function directly. > Parameters: = const TStandardText & newLabel -The new y-axis title text. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::Do ; | virtual void Do (TStandardGraph & graph, const TStockData & stock) > Interface Category: | Sample. > Purpose: | Initializes the specified graph with drawer objects. > Calling Context: | Called by TGraphView::ReconstructGraph. > Parameters: = TStandardGraph & graph -The graph to set up. = const TStockData & stock -The stock whose data will be drawn in the graph. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::GetLabelDistanceFromAxis ; | virtual GraphValue GetLabelDistanceFromAxis () const > Interface Category: | Sample. > Purpose: | Returns how far from any axis the text will be placed. > Calling Context: | Called by HandleAddStandardDrawers and directly. > Parameters: = Takes no parameters. > Return Value: | A value indicating how from any axis the text will be placed. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::GetXLabelInterval ; | virtual GraphValue GetXLabelInterval () const > Interface Category: | Sample. > Purpose: | Returns the interval between successive x-axis data point labels. An interval of 10 draws at 0..10..20..and so on. > Calling Context: | Called when initializing a drawer object. > Parameters: = Takes no parameters. > Return Value: | The x-axis data point label interval. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::GetLabelPointSize ; | virtual GraphValue GetLabelPointSize () const > Interface Category: | Sample. > Purpose: | The font size for displaying labels. > Calling Context: | Called when initializing a drawer object. > Parameters: = Takes no parameters. > Return Value: | A font point size. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::GetMarkLength ; | virtual GraphValue GetMarkLength () const > Interface Category: | Sample. > Purpose: | The length of the line to use for drawing axis marks. This value is specified by a GraphValue, not in graphical points. > Calling Context: | Called when initializing a drawer object. > Parameters: = Takes no parameters. > Return Value: | The mark line length. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::GetXMarkInterval ; | virtual GraphValue GetXMarkInterval () const > Interface Category: | Sample. > Purpose: | Returns the interval between successive x-axis data point marks. An interval of 10 draws at 0..10..20..and so on. > Calling Context: | Called when initializing a drawer object. > Parameters: = Takes no parameters. > Return Value: | The x-axis data point mark interval as a GraphValue. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::GetXAxisLocation ; | virtual GraphValue GetXAxisLocation () const > Interface Category: | Sample. > Purpose: | Returns the location on the y-axis of the x-axis line. The default is zero, so the x- and y-axes meet at (0,0). > Calling Context: | Called when initializing a drawer object. > Parameters: = Takes no parameters. > Return Value: | The x-axis location specified as a GraphValue. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::GetNumberOfYMarks ; | virtual unsigned short GetNumberOfYMarks () const > Interface Category: | Sample. > Purpose: | Returns the number of y-axis marks to display. > Calling Context: | Called when initializing a drawer object. > Parameters: = Takes no parameters. > Return Value: | The number of y-axis marks. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::GetDrawerWidth ; | virtual GCoordinate GetDrawerWidth () const > Interface Category: | Sample. > Purpose: | A generic width value for any drawer. This width is used by TPriceDrawer as the length of the top and bottom lines of each data point representation, and by TBarDrawer as the width of each bar. > Calling Context: | Called when initializing a drawer object. > Parameters: = Takes no parameters. > Return Value: | The drawer width in graphical points. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::SetLabelDistanceFromAxis ; | virtual void SetLabelDistanceFromAxis (GraphValue distance) > Interface Category: | Sample. > Purpose: | Sets how far from any axis the text will be placed. > Calling Context: | Call this function directly. > Parameters: = GraphValue distance -The new distance in GraphValues. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::SetXLabelInterval ; | virtual void SetXLabelInterval (GraphValue xLabelInterval) > Interface Category: | Sample. > Purpose: | Sets the interval between successive x-axis data point labels. An interval of 10 draws at 0..10..20..and so on. > Calling Context: | Call this function directly. > Parameters: = GraphValue xLabelInterval -The new interval in GraphValues. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::SetLabelPointSize ; | virtual void SetLabelPointSize (GraphValue pointSize) > Interface Category: | Sample. > Purpose: | Sets the size of the text used for labels. > Calling Context: | Call this function directly. > Parameters: = GraphValue pointSize -The new font point size. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::SetMarkLength ; | virtual void SetMarkLength (GraphValue markLength) > Interface Category: | Sample. > Purpose: | Sets the length of the line to use for drawing axis marks. > Calling Context: | Call this function directly. > Parameters: = GraphValue markLength -The new mark length in GraphValues. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::SetXMarkInterval ; | virtual void SetXMarkInterval (GraphValue markInterval) > Interface Category: | Sample. > Purpose: | Sets the interval between successive x-axis data point marks. An interval of 10 draws at 0..10..20..and so on. > Calling Context: | Call this function directly. > Parameters: = GraphValue markInterval -The new mark interval in GraphValues. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::SetXAxisLocation ; | virtual void SetXAxisLocation (GraphValue yAxisLocation) > Interface Category: | Sample. > Purpose: | Sets the location of the x-axis line. > Calling Context: | Call this function directly. > Parameters: = GraphValue yAxisLocation -The new x-axis location in GraphValues. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::SetNumberOfYMarks ; | virtual void SetNumberOfYMarks (unsigned short numberOfYMarks) > Interface Category: | Sample. > Purpose: | Sets the number of y-axis marks to display. > Calling Context: | Call this function directly. > Parameters: = unsigned short numberOfYMarks -The new number of y-axis marks to display. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::SetDrawerWidth ; | virtual void SetDrawerWidth (GCoordinate drawerWidth) > Interface Category: | Sample. > Purpose: | Sets the generic width value to use for a data drawer. > Calling Context: | Call this function directly. > Parameters: = GCoordinate drawerWidth -The new generic drawer width in GraphValues. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::TStockGraphConstructor ; | 1. TStockGraphConstructor () | 2. TStockGraphConstructor (const TStockGraphConstructor & source) | 3. TStockGraphConstructor (const TStandardText & description, const TStandardText & xAxisLabel, const TStandardText & yAxisLabel, GraphValue labelDistFromAxis =kDefaultLabelDistanceFromAxis, GraphValue xLabelInterval =kDefaultXLabelInterval, GraphValue labelPointSize =kDefaultLabelPointSize, GraphValue markLength =kDefaultMarkLength, GraphValue xMarkInterval =kDefaultXMarkInterval, GraphValue xAxisLocation =kDefaultXAxisLocation, unsigned short numberOfYMarks =kDefaultNumberOfYMarks, GCoordinate drawerWidth =kDefaultDrawerWidth) > Interface Category: | Sample. > Purpose: | 1. Default constructor. | 2. Copy constructor. | 3. Standard constructor. > Calling Context: | 1. Called by derived classes and to construct an object. | 2. Called to copy an object. | 3. Called to construct a valid object. > Parameters: = 1. Takes no parameters. = 2. const TStockGraphConstructor & source -The object to copy. = 3. const TStandardText & description -A short description of this graph constructor's job. = 3. const TStandardText & xAxisLabel -The text with which to title the x-axis. = 3. const TStandardText & yAxisLabel -The text with which to title the y-axis. = 3. GraphValue labelDistFromAxis =kDefaultLabelDistanceFromAxis -How far away from an axis to place labels. = 3. GraphValue xLabelInterval =kDefaultXLabelInterval -The interval between successive x-axis data point labels. = 3. GraphValue labelPointSize =kDefaultLabelPointSize -The font point size to use for labels. = 3. GraphValue markLength =kDefaultMarkLength -The length of each mark line. = 3. GraphValue xMarkInterval =kDefaultXMarkInterval -The interval between successive x-axis marks. = 3. GraphValue xAxisLocation =kDefaultXAxisLocation -The vertical coordinate where the x-axis crosses the y-axis. = 3. unsigned short numberOfYMarks =kDefaultNumberOfYMarks -The number of y-axis marks to display. = 3. GCoordinate drawerWidth =kDefaultDrawerWidth -The generic drawer width. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::CalcGraphRanges ; | virtual void CalcGraphRanges (TGraphRange & xRange, TGraphRange & yRange, const TCollectionOf < TStockDay > & data) > Interface Category: | Sample. > Purpose: | Examines the set of stock data and determines the extent of the data --that is, the actual ranges of the data for both the x-axis and y-axis. > Calling Context: | Called by TStockGraphConstructor::Do when this object is called upon to construct a graph. > Parameters: = TGraphRange & xRange -The modifiable x-axis range. = TGraphRange & yRange -The modifiable y-axis range. = const TCollectionOf < TStockDay > & data - The collection of stock data. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::AdjustGraphRanges ; | virtual void AdjustGraphRanges (TGraphRange & xRange, TGraphRange & yRange) > Interface Category: | Sample. > Purpose: | A separate function to munge the graph ranges after they have been determined by CalcGraphRanges. By default, this function rounds the minimum and maximum of the graph ranges to useful numbers. > Calling Context: | Called by TStockGraphConstructor::Do when this object is called upon to construct a graph. > Parameters: = TGraphRange & xRange -The modifiable x-axis range. = TGraphRange & yRange -The modifiable y-axis range. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::HandleDoBegin ; | virtual void HandleDoBegin (TStandardGraph & theGraph, TCollectionOf < TStockDay > & data) > Interface Category: | Sample. > Purpose: | A hook function to allow some preprocessing of the graph and data, before drawers are added or graph ranges are calculated. > Calling Context: | Called by TStockGraphConstructor::Do when this object is called upon to construct a graph. > Parameters: = TStandardGraph & theGraph -The graph to modify. = TCollectionOf < TStockDay > & data - The modifiable stock data. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::HandleDoEnd ; | virtual void HandleDoEnd (TStandardGraph & theGraph, const TCollectionOf < TStockDay > & data, const TGraphRange & xRange, const TGraphRange & yRange) > Interface Category: | Sample. > Purpose: | A hook function for post-processing the graph, after drawers have been added. For instance, you might set the size of the graph in this function. > Calling Context: | Called by TStockGraphConstructor::Do when this object is called upon to construct a graph. > Parameters: = TStandardGraph & theGraph -The graph to modify. = const TCollectionOf < TStockDay > & data - The collection of stock data to be graphed. = const TGraphRange & xRange -The range of values to graph on the x-axis. = const TGraphRange & yRange -The range of values to graph on the y-axis. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::HandleAddStandardDrawers ; | virtual void HandleAddStandardDrawers (TStandardGraph & theGraph, const TCollectionOf < TStockDay > & data, const TGraphRange & xRange, const TGraphRange & yRange) > Interface Category: | Sample. > Purpose: | Adds standard stock graph drawer objects. > Calling Context: | Called by TStockGraphConstructor::Do when this object is called upon to construct a graph. > Parameters: = TStandardGraph & theGraph -The graph to add drawer objects to. = const TCollectionOf < TStockDay > & data - The collection of stock data to plot on the graph. = const TGraphRange & xRange -The range of values to graph on the x-axis. = const TGraphRange & yRange -The range of values to graph on the y-axis. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStockGraphConstructor::HandleAddExtendedDrawers ; | virtual void HandleAddExtendedDrawers (TStandardGraph & theGraph, const TCollectionOf < TStockDay > & data, const TGraphRange & xRange, const TGraphRange & yRange) > Interface Category: | Sample. > Purpose: | Adds drawer objects specific to the type of graph being constructed. > Calling Context: | Called by TStockGraphConstructor::Do when this object is called upon to construct a graph. > Parameters: = TStandardGraph & theGraph -The graph to add drawer objects to. = const TCollectionOf < TStockDay > & data - The collection of stock data to plot on the graph. = const TGraphRange & xRange -The range of values to graph on the x-axis. = const TGraphRange & yRange -The range of values to graph on the y-axis. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif