[Uml-devel] branches/work/soc-umbrello-2011/umbrello/newcanvas

Camila San Martin Ayres smayres at gmail.com
Thu May 12 15:53:06 UTC 2011


SVN commit 1231606 by ayres:

Working on the UML Scene.

 A             diagram.cpp   [License: GPL (v2+)]
 A             diagram.h   [License: GPL (v2+)]
 D             diagrams.cpp  
 D             diagrams.h  
 M  +18 -4     newscene.cpp  
 M  +10 -3     newscene.h  
 M  +2 -1      print.cpp  


--- branches/work/soc-umbrello-2011/umbrello/newcanvas/newscene.cpp #1231605:1231606
@@ -14,8 +14,12 @@
 #include "print.h"
 #include "folder.h"
 #include "associationwidget.h"
+#include "toolbarstatefactory.h"
+#include "toolbarstate.h"
+#include "diagram.h"
+#include "uml.h"
+#include "umlview.h"
 
-
 #include <QtGui/QGraphicsItem>
 
 
@@ -36,11 +40,21 @@
 {
     m_folder = folder;
     m_view = view;
-    m_diagrams = new Diagrams(this);
+    m_diagram = new Diagram(this);
     m_print = new Print(this);
     setBackgroundBrush(QColor(195, 195, 195));
+    
+    //create a grid 
     m_layoutgrid = new LayoutGrid();
 
+    // TODO: Create the ToolBarState factory. This class is not a singleton, because it
+    // needs a pointer to this object.
+    m_pToolBarStateFactory = new ToolBarStateFactory();
+    //m_pToolBarState = m_pToolBarStateFactory->getState(WorkToolBar::tbb_Arrow, dynamic_cast<UMLView*>(m_view));
+    m_doc = UMLApp::app()->document();  
+    //m_doc = view->parent(); //view's parent
+    
+
 }
 
 /**
@@ -139,9 +153,9 @@
     //emit sigShowGridToggled(bShow);
 }
 
-Diagrams *NewScene::diagrams() const
+Diagram *NewScene::diagram() const
 {  
-  return m_diagrams;
+  return m_diagram;
 }
 
 
--- branches/work/soc-umbrello-2011/umbrello/newcanvas/newscene.h #1231605:1231606
@@ -19,12 +19,16 @@
 #include "umlwidgetlist.h"
 #include "associationwidgetlist.h"
 #include "layoutgrid.h"
-#include "diagrams.h"
 
+
+class ToolBarStateFactory;
+class ToolBarState;
 class NewView;
 class Print;
 class UMLFolder;
 class LayouGrid;
+class Diagram;
+class UMLApp;
 
 
 class NewScene : public QGraphicsScene
@@ -48,7 +52,7 @@
     AssociationWidgetList selectedAssocs();
     bool isSnapGridVisible() const;
     void setSnapGridVisible(bool bShow);
-    Diagrams *diagrams() const;
+    Diagram *diagram() const;
 
 private:
 
@@ -56,9 +60,12 @@
     UMLFolder *m_folder;
     NewView * m_view;      ///< The view the canvas is associated with.
     QColor    m_gridColor;  ///< Color for the grid dots.
-    Diagrams *m_diagrams;
+    Diagram *m_diagram;
     Print *m_print;
     Settings::OptionState m_Options;  ///< Options used by view.
+    ToolBarStateFactory* m_pToolBarStateFactory;
+    ToolBarState* m_pToolBarState;
+    UMLDoc* m_doc;                 ///< Pointer to the UMLDoc.
 
 
     
--- branches/work/soc-umbrello-2011/umbrello/newcanvas/print.cpp #1231605:1231606
@@ -15,6 +15,7 @@
 #include "umlwidget.h"
 #include "umlwidgetlist.h"
 #include "associationwidgetlist.h"
+#include "diagram.h"
 
 
 
@@ -215,7 +216,7 @@
     pPainter.setViewport(left, top, width, height);
 
     // get Diagram
-    m_scene->diagrams()->diagram(QRect(rect.x(), rect.y(), windowWidth, diagramHeight), pPainter);
+    m_scene->diagram()->paintDiagram(QRect(rect.x(), rect.y(), windowWidth, diagramHeight), pPainter);
 
     if (isFooter) {
         //draw foot note




More information about the umbrello-devel mailing list