Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Tool Class Reference

A tool in the tool window. More...

#include <Tool.h>

Inheritance diagram for Tool:

Object CircleTool ColorTool CutTool ExitTool MoveTool MutateTool RectangleTool SelectTool ToBackTool ToFrontTool List of all members.

Public Methods

 Tool (const std::string &s)
virtual ~Tool ()
virtual void add_feature (std::string, std::string)
 Tool overrides add_feature in order to be able to set its bitmap_name variable from the "image" key.

std::string get_bitmap_name () const
virtual void start ()=0
 called when the tool is selected in the tool window

virtual int mouseClick (const Position &)=0
 called when a mouse click on the canvas is noticed

virtual void stop ()=0
 called when another tool is selected


Protected Attributes

Drawingdrawing
 A pointer to the Drawing for this tool.


Private Attributes

std::string bitmap_name
 The name of the bitmap displayed for this tool in the tool window.


Friends

class Drawing

Detailed Description

A tool in the tool window.

Used by the ToolWindow class in Drawing.h. Tool by itself does nothing, but it provides the public interface for its subclasses. Subclasses of Tool do not provide a public interface of any kind, and exist only in a .cpp file; they are only accessed through their Factories and the public interface defined here.


Constructor & Destructor Documentation

Tool::Tool const std::string &    s
 

00011 : drawing(0), bitmap_name(bmp) {}

Tool::~Tool   [virtual]
 

00012 {}


Member Function Documentation

void Tool::add_feature std::string    key,
std::string    value
[virtual]
 

Tool overrides add_feature in order to be able to set its bitmap_name variable from the "image" key.

Reimplemented from Object.

Reimplemented in ColorTool.

00018                                                      {
00019   if (key == "image") {
00020     bitmap_name = value;
00021   } else {
00022     Object::add_feature(key,value);
00023   }
00024 }

std::string Tool::get_bitmap_name   const
 

00026                                       {
00027   return bitmap_name;
00028 }

virtual int Tool::mouseClick const Position &    [pure virtual]
 

called when a mouse click on the canvas is noticed

Implemented in CircleTool, ColorTool, CutTool, ExitTool, MoveTool, MutateTool, RectangleTool, SelectTool, ToBackTool, and ToFrontTool.

virtual void Tool::start   [pure virtual]
 

called when the tool is selected in the tool window

Implemented in CircleTool, ColorTool, CutTool, ExitTool, MoveTool, MutateTool, RectangleTool, SelectTool, ToBackTool, and ToFrontTool.

virtual void Tool::stop   [pure virtual]
 

called when another tool is selected

Implemented in CircleTool, ColorTool, CutTool, ExitTool, MoveTool, MutateTool, RectangleTool, SelectTool, ToBackTool, and ToFrontTool.


Friends And Related Function Documentation

friend class Drawing [friend]
 


Member Data Documentation

std::string Tool::bitmap_name [private]
 

The name of the bitmap displayed for this tool in the tool window.

Drawing* Tool::drawing [protected]
 

A pointer to the Drawing for this tool.


The documentation for this class was generated from the following files:
Generated on Fri Nov 8 10:52:33 2002 for Draw by doxygen1.2.17