UMLListView Class Reference
This is one of the main classes used in this program. Displays the list view for the program. More...
#include <umllistview.h>
Public Slots | |
| void | slotDiagramCreated (Uml::IDType id) |
| Creates a new item to represent a new diagram. | |
| void | slotDiagramRenamed (Uml::IDType id) |
| renames a diagram in the list view | |
| void | slotObjectCreated (UMLObject *object) |
| Creates a new list view item and connects the appropriate signals/slots. | |
| void | connectNewObjectsSlots (UMLObject *object) |
| connect some signals into slots in the list view for newly created UMLObjects | |
| void | childObjectAdded (UMLClassifierListItem *obj) |
| Adds a new operation, attribute or template item to a classifier. | |
| void | slotObjectRemoved (UMLObject *object) |
| disconnects signals and removes the list view item | |
| void | childObjectRemoved (UMLClassifierListItem *obj) |
| deletes the list view item | |
| void | slotObjectChanged () |
| calls updateObject() on the item representing the sending object no parameters, uses sender() to work out which object called the slot | |
| void | slotDiagramRemoved (Uml::IDType id) |
| removes the item representing a diagram | |
| void | popupMenuSel (int sel) |
| Called when a right mouse button menu has an item selected. | |
| void | slotDropped (QDropEvent *de, QListViewItem *parent, QListViewItem *item) |
| Something has been dragged and dropped onto the list view. | |
| void | slotExpanded (QListViewItem *item) |
| calls updateFolder() on the item to update the icon to open | |
| void | slotCollapsed (QListViewItem *item) |
| calls updateFolder() on the item to update the icon to closed | |
| void | expandAll (QListViewItem *item) |
| Open all items in the list view. | |
| void | collapseAll (QListViewItem *item) |
| Close all items in the list view. | |
| void | slotCutSuccessful () |
| Connects to the signal that UMLApp emits when a cut operation is successful. | |
Public Member Functions | |
| UMLListView (QWidget *parent, const char *name) | |
| Constructs the tree view. | |
| ~UMLListView () | |
| Standard deconstructor. | |
| void | setDocument (UMLDoc *d) |
| Sets the document his is associated with. | |
| void | init () |
| Carries out initalisation of attributes in class. | |
| void | setView (UMLView *v) |
| Set the current view to the given view. | |
| int | getSelectedItems (UMLListViewItemList &ItemList) |
| Get selected items. | |
| int | getSelectedItemsRoot (UMLListViewItemList &ItemList) |
| Get selected items, but only root elements selected (without children). | |
| UMLListViewItem * | createDiagramItem (UMLView *v) |
| Create a listview item for an existing diagram. | |
| UMLListViewItem * | createItem (UMLListViewItem &Data, IDChangeLog &IDChanges, UMLListViewItem *parent=0) |
| CHECK - This is perhaps redundant since the UMLListViewItemData => UMLListViewItem merge. | |
| UMLListViewItem * | findFolderForDiagram (Uml::Diagram_Type dt) |
| Find the parent folder for a diagram. | |
| UMLListViewItem * | determineParentItem (UMLObject *object) const |
| Determine the parent ListViewItem given an UMLObject. | |
| UMLListViewItem * | determineParentItem (Uml::ListView_Type lvt) const |
| Determine the parent ListViewItem given a ListView_Type. | |
| int | getSelectedCount () |
| Return the amount of items selected. | |
| QPixmap & | getPixmap (Uml::Icon_Type type) |
| Returns the correct pixmap for the given type. | |
| UMLDoc * | getDocument () |
| Returns the document pointer. | |
| void | addNewItem (UMLListViewItem *parent, Uml::ListView_Type type) |
| Adds a new item to the tree of the given type under the given parent. | |
| UMLListViewItem * | findUMLObject (const UMLObject *p) const |
| Find an UMLObject in the listview. | |
| UMLListViewItem * | findView (UMLView *v) |
| Searches through the tree for the item which represents the diagram given. | |
| UMLListViewItem * | findItem (Uml::IDType id) |
| Searches through the tree for the item with the given ID. | |
| UMLListViewItem * | rootView (Uml::ListView_Type type) |
| Returns the corresponding view if the listview type is one of the root views, Root/Logical/UseCase/Component/Deployment/EntityRelation View. | |
| void | changeIconOf (UMLObject *o, Uml::Icon_Type to) |
| Changes the icon for the given UMLObject to the given icon. | |
| UMLObject * | createUMLObject (UMLListViewItem *item, Uml::Object_Type type) |
| Creates a UMLObject out of the given list view item. | |
| bool | createChildUMLObject (UMLListViewItem *item, Uml::Object_Type type) |
| Creates a child UMLObject out of the given list view item. | |
| void | createDiagram (UMLListViewItem *item, Uml::Diagram_Type type) |
| Creates a diagram out of the given list view item. | |
| QString | getUniqueDiagramName (Uml::Diagram_Type type) |
| Returns a unique name for a diagram. | |
| bool | isUnique (UMLListViewItem *item, const QString &name) |
| Returns if the given name is unique for the given items type. | |
| void | cancelRename (QListViewItem *item) |
| Cancel rename event has occurred for the given item. | |
| void | setStartedCut (bool startedCut) |
| Set the variable m_bStartedCut to indicate that selection should be deleted in slotCutSuccessful(). | |
| void | setStartedCopy (bool startedCopy) |
| Set the variable m_bStartedCopy. | |
| bool | startedCopy () const |
| Return the variable m_bStartedCopy. | |
| UMLListViewItem * | moveObject (Uml::IDType srcId, Uml::ListView_Type srcType, UMLListViewItem *newParent) |
| Moves an object given is unique ID and listview type to an other listview parent item. | |
| bool | itemRenamed (QListViewItem *item, int col) |
| Called for informing the list view that an item was renamed. | |
| void | closeDatatypesFolder () |
| UMLListViewItem * | theRootView () |
| UMLListViewItem * | theLogicalView () |
| UMLListViewItem * | theUseCaseView () |
| UMLListViewItem * | theComponentView () |
| UMLListViewItem * | theDeploymentView () |
| UMLListViewItem * | theDatatypeFolder () |
| Uml::ListView_Type | rootViewType (UMLListViewItem *item) |
| Determines the root listview type of the given UMLListViewItem. | |
| void | saveToXMI (QDomDocument &qDoc, QDomElement &qElement) |
| bool | loadFromXMI (QDomElement &element) |
| bool | loadChildrenFromXMI (UMLListViewItem *parent, QDomElement &element) |
Static Public Member Functions | |
| static bool | mayHaveChildItems (Uml::Object_Type type) |
| Return true if the given Object_Type permits child items. | |
Protected Member Functions | |
| bool | eventFilter (QObject *o, QEvent *e) |
| void | contentsMouseReleaseEvent (QMouseEvent *me) |
| void | contentsMousePressEvent (QMouseEvent *me) |
| void | contentsMouseDoubleClickEvent (QMouseEvent *me) |
| void | focusOutEvent (QFocusEvent *fe) |
| QDragObject * | dragObject () |
| void | startDrag () |
| bool | acceptDrag (QDropEvent *event) const |
| void | keyPressEvent (QKeyEvent *) |
| UMLListViewItem * | findUMLObjectInFolder (UMLListViewItem *item, UMLObject *o) |
| This methods looks for a object in a folder an its subfolders recursive. | |
| void | loadPixmaps () |
| Loads the pixmaps to use in the list items. | |
| void | deleteChildrenOf (QListViewItem *parent) |
Deletes all child-items of parent. | |
| bool | deleteItem (UMLListViewItem *temp) |
| Delete a listview item. | |
| void | childObjectAdded (UMLClassifierListItem *child, UMLClassifier *parent) |
| Adds a new operation, attribute or template item to a classifier, identical to childObjectAdded(obj) but with an explicit parent. | |
| void | addAtContainer (UMLListViewItem *item, UMLListViewItem *parent) |
| Auxiliary method for moveObject(): Adds the model object at the proper new container (package if nested, UMLDoc if at global level), and updates the containment relationships in the model. | |
Static Protected Member Functions | |
| static bool | isExpandable (Uml::ListView_Type lvt) |
| Return true if the given list view type can be expanded/collapsed. | |
Protected Attributes | |
| UMLListViewItem * | m_rv |
| UMLListViewItem * | m_lv [Uml::N_MODELTYPES] |
| UMLListViewItem * | m_datatypeFolder |
| ListPopupMenu * | m_pMenu |
| QString | oldText |
| QString | message |
| UMLDoc * | m_doc |
| bool | m_bStartedCut |
| bool | m_bStartedCopy |
| bool | m_bIgnoreCancelRename |
| bool | m_bCreatingChildObject |
| Used when creating an attribute or an operation to stop it adding a second listViewItem. | |
| QPixmap | m_Pixmaps [Uml::N_ICONTYPES] |
Detailed Description
This is one of the main classes used in this program. Displays the list view for the program.Information is displayed here in a tree view. No objects are created here. A call to UMLDoc make any additions/deletion or updates to objects. This class will then wait for a signal before updating the tree view.
- Author:
- Paul Hensgen <phensgen@techie.com> Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org
Definition at line 44 of file umllistview.h.
Constructor & Destructor Documentation
|
||||||||||||
|
Constructs the tree view.
Definition at line 95 of file umllistview.cpp. |
|
|
Standard deconstructor.
Definition at line 141 of file umllistview.cpp. |
Member Function Documentation
|
|
Sets the document his is associated with. This is important as this is required as to setup the callbacks.
Definition at line 817 of file umllistview.cpp. References slotDiagramCreated(), slotDiagramRemoved(), slotDiagramRenamed(), slotObjectCreated(), and slotObjectRemoved(). Referenced by UMLApp::initView(). |
|
|
Carries out initalisation of attributes in class.
Definition at line 1000 of file umllistview.cpp. References Model_Utils::convert_MT_LVT(), deleteChildrenOf(), UMLDoc::getDatatypeFolder(), UMLFolder::getLocalName(), UMLDoc::getRootFolder(), m_bCreatingChildObject, and UMLListViewItem::setOpen(). Referenced by UMLDoc::closeDocument(), and UMLApp::initView(). |
|
|
Set the current view to the given view.
Definition at line 1029 of file umllistview.cpp. References findView(). |
|
|
Get selected items.
Definition at line 1520 of file umllistview.cpp. Referenced by UMLClipboard::copy(). |
|
|
Get selected items, but only root elements selected (without children).
Definition at line 1535 of file umllistview.cpp. |
|
|
Create a listview item for an existing diagram.
Definition at line 1556 of file umllistview.cpp. References Model_Utils::convert_DT_LVT(), determineParentItem(), findUMLObject(), UMLListViewItem::getID(), and UMLObject::getName(). Referenced by UMLFolder::activateViews(). |
|
||||||||||||||||
|
CHECK - This is perhaps redundant since the UMLListViewItemData => UMLListViewItem merge. Creates a new UMLListViewItem from a UMLListViewItem, if parent is null the ListView Decides who is going to be the parent Definition at line 1581 of file umllistview.cpp. References Model_Utils::convert_DT_LVT(), determineParentItem(), UMLClassifier::findChildObjectById(), UMLDoc::findObjectById(), UMLDoc::findView(), UMLView::getName(), UMLView::getType(), and UMLListViewItem::getType(). |
|
|
Find the parent folder for a diagram. If the currently selected item in the list view is a folder then that folder is returned as the parent.
Definition at line 531 of file umllistview.cpp. References UMLListViewItem::getType(), and Model_Utils::typeIsRootView(). Referenced by UMLDrag::decodeClip2(), and slotDiagramCreated(). |
|
|
Determine the parent ListViewItem given an UMLObject.
Definition at line 570 of file umllistview.cpp. References findUMLObject(), UMLObject::getName(), UMLListViewItem::getType(), and Model_Utils::guessContainer(). Referenced by createDiagramItem(), createItem(), and slotObjectCreated(). |
|
|
Determine the parent ListViewItem given a ListView_Type. This parent is used for creating new UMLListViewItems.
Definition at line 1666 of file umllistview.cpp. |
|
|
Return true if the given Object_Type permits child items. A "child item" is anything that qualifies as a UMLClassifierListItem, e.g. operations and attributes of classifiers. Definition at line 620 of file umllistview.cpp. Referenced by slotObjectCreated(). |
|
|
Return the amount of items selected.
Definition at line 1699 of file umllistview.cpp. |
|
|
Returns the correct pixmap for the given type.
Definition at line 1742 of file umllistview.cpp. Referenced by UMLListViewItem::setIcon(). |
|
|
Returns the document pointer. Called by the UMLListViewItem class. Definition at line 166 of file umllistview.h. Referenced by UMLListViewItem::loadFromXMI(), UMLListViewItem::okRename(), and UMLListViewItem::saveToXMI(). |
|
||||||||||||
|
Adds a new item to the tree of the given type under the given parent. Method will take care of signalling anyone needed on creation of new item. e.g. UMLDoc if an UMLObject is created. Definition at line 1841 of file umllistview.cpp. References Model_Utils::convert_LVT_DT(), Model_Utils::convert_LVT_IT(), Model_Utils::convert_LVT_OT(), getUniqueDiagramName(), UMLListViewItem::setCreating(), UMLListViewItem::setIcon(), UMLListViewItem::setOpen(), UMLCanvasObject::uniqChildName(), and Model_Utils::uniqObjectName(). Referenced by popupMenuSel(). |
|
|
Find an UMLObject in the listview.
Definition at line 915 of file umllistview.cpp. References UMLListViewItem::findUMLObject(). Referenced by changeIconOf(), childObjectAdded(), childObjectRemoved(), UMLClipboard::copy(), createDiagramItem(), Import_Utils::createUMLObject(), determineParentItem(), slotObjectChanged(), and slotObjectCreated(). |
|
|
Searches through the tree for the item which represents the diagram given.
Definition at line 933 of file umllistview.cpp. References Model_Utils::convert_DT_LVT(), UMLListViewItem::getID(), and UMLListViewItem::getType(). Referenced by createDiagram(), isUnique(), UMLApp::setCurrentView(), setView(), slotDiagramCreated(), and slotDiagramRenamed(). |
|
|
Searches through the tree for the item with the given ID.
Definition at line 983 of file umllistview.cpp. References UMLListViewItem::findItem(). Referenced by UMLFolder::activateViews(), UMLListViewItem::isOwnParent(), UMLView::isSavedInSeparateFile(), moveObject(), slotDiagramRemoved(), and slotObjectRemoved(). |
|
|
Returns the corresponding view if the listview type is one of the root views, Root/Logical/UseCase/Component/Deployment/EntityRelation View.
Definition at line 2595 of file umllistview.cpp. |
|
||||||||||||
|
Changes the icon for the given UMLObject to the given icon.
Definition at line 926 of file umllistview.cpp. References findUMLObject(), and UMLListViewItem::setIcon(). Referenced by UMLClassifier::setBaseType(). |
|
||||||||||||
|
Creates a UMLObject out of the given list view item.
Definition at line 2005 of file umllistview.cpp. References UMLPackage::addObject(), connectNewObjectsSlots(), UMLObject::getName(), UMLListViewItem::getType(), UMLListViewItem::getUMLObject(), UMLClassifier::setBaseType(), and UMLObject::setUMLPackage(). Referenced by itemRenamed(). |
|
||||||||||||
|
||||||||||||
|
Creates a diagram out of the given list view item.
Definition at line 2182 of file umllistview.cpp. References UMLView::activate(), findView(), UMLListViewItem::getUMLObject(), UMLView::setID(), UMLView::setName(), and UMLView::setType(). Referenced by itemRenamed(). |
|
|
Returns a unique name for a diagram.
Definition at line 2209 of file umllistview.cpp. References UMLDoc::uniqViewName(). Referenced by addNewItem(). |
|
||||||||||||
|
Returns if the given name is unique for the given items type.
Definition at line 2213 of file umllistview.cpp. References UMLCanvasObject::findChildObject(), UMLPackage::findObject(), UMLDoc::findUMLObject(), UMLDoc::findView(), findView(), UMLListViewItem::getType(), and UMLListViewItem::getUMLObject(). Referenced by itemRenamed(). |
|
|
Cancel rename event has occurred for the given item.
Definition at line 2304 of file umllistview.cpp. Referenced by UMLListViewItem::cancelRename(), and popupMenuSel(). |
|
|
Set the variable m_bStartedCut to indicate that selection should be deleted in slotCutSuccessful().
Definition at line 2583 of file umllistview.cpp. |
|
|
Set the variable m_bStartedCopy. NB: While m_bStartedCut is reset as soon as the Cut operation is done, the variable m_bStartedCopy is reset much later - upon pasting. Definition at line 2587 of file umllistview.cpp. |
|
|
Return the variable m_bStartedCopy.
Definition at line 2591 of file umllistview.cpp. Referenced by UMLDrag::decodeClip1(). |
|
||||||||||||||||
|
||||||||||||
|
Called for informing the list view that an item was renamed.
Definition at line 1885 of file umllistview.cpp. References Model_Utils::convert_LVT_OT(), createChildUMLObject(), createDiagram(), createUMLObject(), isUnique(), and UMLObject::setStereotype(). Referenced by UMLListViewItem::okRename(). |
|
|
Determines the root listview type of the given UMLListViewItem. Starts at the given item, compares it against each of the predefined root views (Root, Logical, UseCase, Component, Deployment, EntityRelationship.) Returns the ListView_Type of the matching root view; if no match then continues the search using the item's parent, then grandparent, and so forth. Returns Uml::lvt_Unknown if no match at all is found. Definition at line 1723 of file umllistview.cpp. |
|
||||||||||||
|
This methods looks for a object in a folder an its subfolders recursive.
Definition at line 875 of file umllistview.cpp. References UMLListViewItem::getType(), and UMLListViewItem::getUMLObject(). |
|
|
Return true if the given list view type can be expanded/collapsed.
Definition at line 1806 of file umllistview.cpp. Referenced by slotCollapsed(), and slotExpanded(). |
|
|
Loads the pixmaps to use in the list items.
Definition at line 1751 of file umllistview.cpp. |
|
|
Deletes all child-items of
Definition at line 2625 of file umllistview.cpp. Referenced by init(). |
|
|
Delete a listview item.
Definition at line 2641 of file umllistview.cpp. References UMLPackage::containedObjects(), UMLListViewItem::getUMLObject(), UMLCanvasObject::removeAllChildObjects(), UMLDoc::removeDiagram(), and UMLDoc::removeUMLObject(). Referenced by popupMenuSel(). |
|
||||||||||||
|
Adds a new operation, attribute or template item to a classifier, identical to childObjectAdded(obj) but with an explicit parent.
Definition at line 766 of file umllistview.cpp. References connectNewObjectsSlots(), Model_Utils::convert_OT_LVT(), UMLListViewItem::findChildObject(), findUMLObject(), UMLDoc::loading(), m_bCreatingChildObject, and UMLListViewItem::setText(). Referenced by childObjectAdded(), connectNewObjectsSlots(), and slotObjectCreated(). |
|
||||||||||||
|
Auxiliary method for moveObject(): Adds the model object at the proper new container (package if nested, UMLDoc if at global level), and updates the containment relationships in the model.
Definition at line 1220 of file umllistview.cpp. References UMLPackage::addObject(), UMLApp::getCurrentView(), UMLListViewItem::getText(), UMLListViewItem::getType(), UMLListViewItem::getUMLObject(), UMLObject::setUMLPackage(), and UMLView::updateContainment(). Referenced by moveObject(). |
|
|
Creates a new item to represent a new diagram.
Definition at line 557 of file umllistview.cpp. References Model_Utils::convert_DT_LVT(), findFolderForDiagram(), findView(), UMLView::getName(), UMLView::getType(), and UMLDoc::loading(). Referenced by setDocument(). |
|
|
renames a diagram in the list view
Definition at line 806 of file umllistview.cpp. References findView(), UMLDoc::findView(), UMLView::getName(), and UMLListViewItem::setText(). Referenced by setDocument(). |
|
|
Creates a new list view item and connects the appropriate signals/slots.
Definition at line 635 of file umllistview.cpp. References childObjectAdded(), connectNewObjectsSlots(), Model_Utils::convert_LVT_IT(), Model_Utils::convert_OT_LVT(), determineParentItem(), findUMLObject(), UMLApp::getDocWindow(), UMLClassifier::getFilteredList(), UMLFolder::getFolderFile(), UMLListViewItem::getType(), UMLDoc::loading(), m_bCreatingChildObject, mayHaveChildItems(), UMLListViewItem::setIcon(), UMLListViewItem::setOpen(), and DocWindow::showDocumentation(). Referenced by setDocument(). |
|
|
connect some signals into slots in the list view for newly created UMLObjects
Definition at line 682 of file umllistview.cpp. References childObjectAdded(), childObjectRemoved(), and slotObjectChanged(). Referenced by childObjectAdded(), createChildUMLObject(), createUMLObject(), moveObject(), and slotObjectCreated(). |
|
|
Adds a new operation, attribute or template item to a classifier.
Definition at line 761 of file umllistview.cpp. References childObjectAdded(). |
|
|
disconnects signals and removes the list view item
Definition at line 831 of file umllistview.cpp. References findItem(), UMLApp::getDocWindow(), UMLDoc::loading(), slotObjectChanged(), and DocWindow::updateDocumentation(). Referenced by setDocument(). |
|
|
deletes the list view item
Definition at line 795 of file umllistview.cpp. References UMLListViewItem::deleteChildItem(), and findUMLObject(). Referenced by connectNewObjectsSlots(). |
|
|
calls updateObject() on the item representing the sending object no parameters, uses sender() to work out which object called the slot
Definition at line 750 of file umllistview.cpp. References findUMLObject(), UMLDoc::loading(), and UMLListViewItem::updateObject(). Referenced by connectNewObjectsSlots(), and slotObjectRemoved(). |
|
|
removes the item representing a diagram
Definition at line 841 of file umllistview.cpp. References findItem(), UMLApp::getDocWindow(), and DocWindow::updateDocumentation(). Referenced by setDocument(). |
|
|
Called when a right mouse button menu has an item selected.
Definition at line 239 of file umllistview.cpp. References addNewItem(), cancelRename(), UMLListViewItem::cancelRename(), collapseAll(), ListPopupMenu::convert_MT_DT(), UMLDoc::createDiagram(), deleteItem(), expandAll(), UMLViewImageExporter::exportView(), UMLDoc::findView(), UMLObject::getBaseType(), UMLApp::getDocWindow(), UMLListViewItem::getID(), UMLView::getImageExporter(), UMLDoc::getName(), UMLListViewItem::getText(), UMLListViewItem::getUMLObject(), UMLFolder::setFolderFile(), UMLDoc::setName(), UMLListViewItem::setText(), DocWindow::showDocumentation(), UMLView::showPropDialog(), UMLObject::showProperties(), UMLApp::slotImportClasses(), Model_Utils::typeIsDiagram(), DocWindow::updateDocumentation(), and UMLDoc::URL(). Referenced by slotCutSuccessful(). |
|
||||||||||||||||
|
Something has been dragged and dropped onto the list view.
Definition at line 1500 of file umllistview.cpp. References UMLListViewItem::getText(), and moveObject(). |
|
|
calls updateFolder() on the item to update the icon to open
Definition at line 1821 of file umllistview.cpp. References UMLListViewItem::getType(), isExpandable(), and UMLListViewItem::updateFolder(). |
|
|
calls updateFolder() on the item to update the icon to closed
Definition at line 1827 of file umllistview.cpp. References UMLListViewItem::getType(), isExpandable(), and UMLListViewItem::updateFolder(). |
|
|
Open all items in the list view.
Definition at line 2570 of file umllistview.cpp. References UMLListViewItem::setOpen(). Referenced by popupMenuSel(). |
|
|
Close all items in the list view.
Definition at line 2577 of file umllistview.cpp. References UMLListViewItem::setOpen(). Referenced by popupMenuSel(). |
|
|
Connects to the signal that UMLApp emits when a cut operation is successful.
Definition at line 1833 of file umllistview.cpp. References popupMenuSel(). |
Member Data Documentation
|
|
Used when creating an attribute or an operation to stop it adding a second listViewItem.
Definition at line 311 of file umllistview.h. Referenced by childObjectAdded(), createChildUMLObject(), init(), moveObject(), and slotObjectCreated(). |
The documentation for this class was generated from the following files:
