#include <Tool.h>
Inheritance diagram for Tool:
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 | |
Drawing * | drawing |
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 |
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.
|
00011 : drawing(0), bitmap_name(bmp) {} |
|
00012 {} |
|
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 } |
|
00026 { 00027 return bitmap_name; 00028 } |
|
called when a mouse click on the canvas is noticed
Implemented in CircleTool, ColorTool, CutTool, ExitTool, MoveTool, MutateTool, RectangleTool, SelectTool, ToBackTool, and ToFrontTool. |
|
called when the tool is selected in the tool window
Implemented in CircleTool, ColorTool, CutTool, ExitTool, MoveTool, MutateTool, RectangleTool, SelectTool, ToBackTool, and ToFrontTool. |
|
called when another tool is selected
Implemented in CircleTool, ColorTool, CutTool, ExitTool, MoveTool, MutateTool, RectangleTool, SelectTool, ToBackTool, and ToFrontTool. |
|
|
|
The name of the bitmap displayed for this tool in the tool window.
|
|
A pointer to the Drawing for this tool.
|