// $Revision: 1.9 $ //------------------------------------------------------------------------------ // // Copyright (C) 1994, 1995 Taligent, Inc. All rights reserved. // // Project: StockBrowser // File: LabelDrawer.h // Build/Version: 1.0.0 // // Description: TLabelDrawer derives from TGraphDrawer. It draws // numbers along the axes at a particular interval. This // class is abstract. // // TXLabelDrawer draws labels along the x-axis. TYLabelDrawer // draws labels along the y-axis. // //------------------------------------------------------------------------------ #ifndef TaligentSamples_LABELDRAWER #define TaligentSamples_LABELDRAWER class TLabelDrawer; class TXLabelDrawer; class TYLabelDrawer; #ifndef TaligentSamples_GRAPHDRAWER #include "GraphDrawer.h" #endif #ifndef Taligent_TEXTDISPLAY #include #endif #ifndef Taligent_LINELAYOUTSTYLES #include #endif #ifndef Taligent_FONTSTYLES #include #endif //============================================================================== // TLabelDrawer class TLabelDrawer : public TGraphDrawer { public: TaligentTypeExtensionDeclarationsMacro_Abstract(TLabelDrawer) protected: TLabelDrawer(); TLabelDrawer(GraphValue labelDistanceFromAxis, GraphValue labelInterval, GraphValue pointSize, const TFontFamilyStyle& font = TFontFamilyStyle::GetDefaultFontFamilyStyle(), const TTextColorStyle& labelColor = TTextColorStyle::GetBlack()); TLabelDrawer(const TLabelDrawer& source); virtual ~TLabelDrawer(); TLabelDrawer& operator=(const TLabelDrawer& source); virtual TStream& operator>>=(TStream& toStream) const; virtual TStream& operator<<=(TStream& fromStream); public: virtual const TTextColorStyle& GetLabelColor() const; virtual const TFontFamilyStyle& GetLabelFont() const; virtual GraphValue GetLabelSize() const; virtual GraphValue GetLabelDistance() const; virtual GraphValue GetLabelInterval() const; virtual void SetLabelColor(const TTextColorStyle& color); virtual void SetLabelFont(const TFontFamilyStyle& font); virtual void SetLabelSize(GraphValue pointSize); virtual void SetLabelDistance(GraphValue distance); virtual void SetLabelInterval(GraphValue interval); virtual void DrawIntoGraph(TGrafPort& port) const; virtual TGRect GetBounds() const; private: virtual void PositionLabel(TTextDisplay& label, GraphValue value) const = 0; virtual const TGraphRange& GetRange() const = 0; enum {kOriginalVersion}; TTextColorStyle* fLabelColor; TFontFamilyStyle fLabelFont; GraphValue fLabelSize; GraphValue fLabelDistance; GraphValue fLabelInterval; }; //============================================================================== // TXLabelDrawer class TXLabelDrawer : public TLabelDrawer { public: TaligentTypeExtensionDeclarationsMacro(TXLabelDrawer) public: TXLabelDrawer(); TXLabelDrawer(GraphValue labelDistanceFromAxis, GraphValue labelInterval, GraphValue pointSize, const TFontFamilyStyle& font = TFontFamilyStyle::GetDefaultFontFamilyStyle()); TXLabelDrawer(const TXLabelDrawer& source); virtual ~TXLabelDrawer(); TXLabelDrawer& operator=(const TXLabelDrawer& source); virtual TStream& operator>>=(TStream& toStream) const; virtual TStream& operator<<=(TStream& fromStream); private: virtual void PositionLabel(TTextDisplay& label, GraphValue value) const; virtual const TGraphRange& GetRange() const; private: enum {kOriginalVersion}; }; //============================================================================== // TYLabelDrawer class TYLabelDrawer : public TLabelDrawer { public: TaligentTypeExtensionDeclarationsMacro(TYLabelDrawer) public: TYLabelDrawer(); TYLabelDrawer(GraphValue labelDistanceFromAxis, GraphValue labelInterval, GraphValue pointSize, const TFontFamilyStyle& font = TFontFamilyStyle::GetDefaultFontFamilyStyle()); TYLabelDrawer(const TYLabelDrawer& source); virtual ~TYLabelDrawer(); TYLabelDrawer& operator=(const TYLabelDrawer& source); virtual TStream& operator>>=(TStream& toStream) const; virtual TStream& operator<<=(TStream& fromStream); private: virtual void PositionLabel(TTextDisplay& label, GraphValue value) const; virtual const TGraphRange& GetRange() const; private: enum {kOriginalVersion}; }; #endif