BALL::VIEW::DatasetController Class Reference
#include <BALL/VIEW/DATATYPE/dataset.h>
List of all members.
Public Slots |
virtual bool | write () |
| Show a file dialog for writing the selected Dataset.
|
bool | open () |
virtual bool | deleteDatasets () |
| Delete all Datasets.
|
virtual bool | deleteDataset () |
| Delete the currently highlighted Dataset.
|
Public Member Functions |
| DatasetController () |
| DatasetController (DatasetController &dc) |
virtual | ~DatasetController () |
void | setDatasetControl (DatasetControl *dc) |
DatasetControl * | getDatasetControl () |
virtual bool | handle (DatasetMessage *msg) |
virtual bool | insertDataset (Dataset *set) |
virtual bool | deleteDataset (Dataset *set) |
virtual bool | createMenuEntries () |
virtual QMenu * | buildContextMenu (QTreeWidgetItem *item) |
vector< Dataset * > | getDatasets () |
| Get all Datasets of this type in the DatasetControl.
|
vector< Dataset * > | getSelectedDatasets () |
| Get all selected Datasets of this type in the DatasetControl.
|
Dataset * | getSelectedDataset () |
bool | hasDataset (Dataset *set) |
bool | hasItem (QTreeWidgetItem *item) |
| Test if a given QTreeWidgetItem corresponds to a registered Dataset.
|
Dataset * | getDataset (QTreeWidgetItem *item) |
| Get the Dataset for a QTreeWidgetItem.
|
String | getType () |
virtual void | checkMenu (MainControl &mc) |
vector< String > | getSupportedFileFormats () |
Protected Member Functions |
void | setStatusbarText (const String &text, bool important=false) |
virtual bool | write (Dataset *, String, String) |
virtual Dataset * | open (String, String) |
String | getFileTypes_ () |
String | getNameFromFileName_ (String filename) |
QAction * | insertMenuEntry_ (Position pid, const String &name, const char *slot, const String &description="", QKeySequence accel=QKeySequence()) |
virtual void | deleteDataset_ (Dataset *) |
Protected Attributes |
String | type_ |
vector< String > | file_formats_ |
DatasetControl * | control_ |
vector< QAction * > | actions_ |
HashSet< QAction * > | actions_for_one_set_ |
HashMap< QTreeWidgetItem
*, Dataset * > | item_to_dataset_ |
HashMap< Dataset
*, QTreeWidgetItem * > | dataset_to_item_ |
Friends |
class | DatasetControl |
Detailed Description
Controller base class for one type of Dataset A DatasetController provides all neccessary means to manage and manipulate a kind of data in the DatasetControl. The class has the following features:
To use this class, derive a new class from it and overload/create the following methods:
-
getData
-
buildContextMenu
-
creatMenuEntries
-
open
-
write
-
deleteDataset_
Furthermore
-
add a static String member type
-
assign file_formats_ in the derived classes constructor
- See also:
- DatasetControl
-
Dataset
-
DatasetMessage
-
Embeddable
Definition at line 188 of file dataset.h.
Constructor & Destructor Documentation
BALL::VIEW::DatasetController::DatasetController |
( |
|
) |
|
virtual BALL::VIEW::DatasetController::~DatasetController |
( |
|
) |
[virtual] |
Member Function Documentation
virtual QMenu* BALL::VIEW::DatasetController::buildContextMenu |
( |
QTreeWidgetItem * |
item |
) |
[virtual] |
virtual void BALL::VIEW::DatasetController::checkMenu |
( |
MainControl & |
mc |
) |
[virtual] |
Check the menu entries for this data type. If the MainControl is currently busy, all entries are disabled. If multiple entries are selected, it is tested, if an QAction is included in actions_for_one_set_. If true, this QAction is disabled. Overload this method for more sophisticated behaviour.
virtual bool BALL::VIEW::DatasetController::createMenuEntries |
( |
|
) |
[virtual] |
virtual bool BALL::VIEW::DatasetController::deleteDataset |
( |
|
) |
[virtual, slot] |
Delete the currently highlighted Dataset.
virtual bool BALL::VIEW::DatasetController::deleteDataset |
( |
Dataset * |
set |
) |
[virtual] |
virtual void BALL::VIEW::DatasetController::deleteDataset_ |
( |
Dataset * |
|
) |
[inline, protected, virtual] |
virtual bool BALL::VIEW::DatasetController::deleteDatasets |
( |
|
) |
[virtual, slot] |
DatasetControl* BALL::VIEW::DatasetController::getDatasetControl |
( |
|
) |
[inline] |
vector<Dataset*> BALL::VIEW::DatasetController::getDatasets |
( |
|
) |
|
String BALL::VIEW::DatasetController::getFileTypes_ |
( |
|
) |
[protected] |
String BALL::VIEW::DatasetController::getNameFromFileName_ |
( |
String |
filename |
) |
[protected] |
Dataset* BALL::VIEW::DatasetController::getSelectedDataset |
( |
|
) |
|
vector<Dataset*> BALL::VIEW::DatasetController::getSelectedDatasets |
( |
|
) |
|
vector<String> BALL::VIEW::DatasetController::getSupportedFileFormats |
( |
|
) |
[inline] |
Return a vector with all supported file formats. Set the member file_formats_ in the constructor of the derived class. The methods open(...) and write(...) must be overloaded such that they know how to handle the supported file formats.
Definition at line 281 of file dataset.h.
String BALL::VIEW::DatasetController::getType |
( |
|
) |
[inline] |
Get the String type identifier for this data type.
Definition at line 266 of file dataset.h.
bool BALL::VIEW::DatasetController::hasDataset |
( |
Dataset * |
set |
) |
|
Test if a Dataset is registered in this controller.
virtual bool BALL::VIEW::DatasetController::insertDataset |
( |
Dataset * |
set |
) |
[virtual] |
QAction* BALL::VIEW::DatasetController::insertMenuEntry_ |
( |
Position |
pid, |
|
|
const String & |
name, |
|
|
const char * |
slot, |
|
|
const String & |
description = "" , |
|
|
QKeySequence |
accel = QKeySequence() | |
|
) |
| | [protected] |
bool BALL::VIEW::DatasetController::open |
( |
|
) |
[slot] |
Show a file dialog to open a data file. Calls open(String, String). Overload this method to support multiple file formats.
void BALL::VIEW::DatasetController::setDatasetControl |
( |
DatasetControl * |
dc |
) |
[inline] |
void BALL::VIEW::DatasetController::setStatusbarText |
( |
const String & |
text, |
|
|
bool |
important = false | |
|
) |
| | [protected] |
virtual bool BALL::VIEW::DatasetController::write |
( |
|
) |
[virtual, slot] |
Friends And Related Function Documentation
Member Data Documentation