Changeset 292 in PSPA
- Timestamp:
- Jan 29, 2013, 3:04:19 PM (11 years ago)
- Location:
- Interface_Web/trunk/pspaWT
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
Interface_Web/trunk/pspaWT/History
r291 r292 7 7 8 8 29 Janvier 2012 Laurent Garnier 9 - Ajout de GWt_abstractElementFactory 9 - Ajout de la classe GWt_abstractElementFactory 10 - GWt_bend, GWt_drift, GWt_beam 11 GWt_soleno, GWt_fit, GWt_rfgun 12 GWt_cell, GWt_pspaApplication, 13 GWt_dropZoneLigneFaisceau : Déplacement des mimeTypes et imagesUrl directement 14 dans les élements 15 16 - GWt_abstractElement : Déplacement de methode createDragImage() 17 18 - GWt_elementLigneFaisceau : passage d'une référence vers "pspaApplication" 19 20 - GWt_pspaApplication : ajout d'une abstractElementFactory 10 21 11 22 28 Janvier 2012 Laurent Garnier -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_abstractElement.h
r290 r292 47 47 48 48 virtual void dialogDone() = 0; 49 virtual WImage* getImage() = 0;50 49 virtual WString print() = 0; 51 50 virtual string getMimeType()= 0; … … 53 52 virtual string getBigImageURL()= 0; 54 53 virtual string getName()= 0; 54 55 void createDragImage(WContainerWidget*); 56 WImage* getImage(); 55 57 56 // virtual void createDragImage() = 0; 57 58 protected: 59 WImage* image_; 58 60 private: 59 61 GWt_elementLigneFaisceau* elementLigneFaiseauContainer_; -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_beam.h
r290 r292 23 23 virtual void dialogDone(); 24 24 25 WImage* getImage();26 25 WString print(); 27 26 … … 31 30 inline string getName() {return "beam"; } 32 31 33 private:34 WImage* image_;35 32 }; 36 33 -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_bend.h
r290 r292 30 30 inline string getName() {return "bend"; } 31 31 32 private:33 WImage* image_;34 32 }; 35 33 #endif -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_cell.h
r290 r292 41 41 inline string getName() {return "cell"; } 42 42 43 private:44 WImage* image_;45 43 }; 46 44 #endif -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_drift.h
r290 r292 32 32 inline string getName() {return "drift"; } 33 33 34 private:35 WImage* image_;36 34 }; 37 35 #endif -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_dropZoneLigneFaisceau.h
r273 r292 3 3 4 4 #include "GWt_dropZoneLigneFaisceau.h" 5 #include "GWt_pspaApplication.h" 5 6 6 7 #include <Wt/WContainerWidget> … … 13 14 public : 14 15 15 GWt_dropZoneLigneFaisceau( );16 GWt_dropZoneLigneFaisceau(PspaApplication* pspa_); 16 17 ~GWt_dropZoneLigneFaisceau(); 17 18 18 19 private: 19 void initialise( );20 void initialise( PspaApplication* pspa); 20 21 void mouseOver(const WMouseEvent &e ); 21 22 void mouseOut(const WMouseEvent &e ); -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_elementLigneFaisceau.h
r287 r292 6 6 #include "GWt_abstractElement.h" 7 7 #include "GWt_dropZoneLigneFaisceau.h" 8 #include "GWt_pspaApplication.h" 8 9 9 10 #include <Wt/WContainerWidget> … … 32 33 */ 33 34 34 GWt_elementLigneFaisceau( );35 GWt_elementLigneFaisceau(abstractElement* );35 GWt_elementLigneFaisceau(PspaApplication*); 36 GWt_elementLigneFaisceau(abstractElement*,PspaApplication*); 36 37 37 38 ~GWt_elementLigneFaisceau(); … … 69 70 GWt_dropZoneLigneFaisceau* dropZoneRight_; 70 71 WText* elementName_; 71 72 PspaApplication* pspa_; 72 73 GWt_abstractElement* abstractElement_; 73 74 }; -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_fit.h
r290 r292 27 27 inline string getName() {return "fit"; } 28 28 29 private:30 WImage* image_;31 29 }; 32 30 #endif -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_pspaApplication.h
r289 r292 115 115 void updateSelections(); 116 116 string getSelection(); 117 inline GWt_abstractElementFactory* getAbstractElementFactory() { 118 return abstractElementFactory_; 119 } 117 120 }; 118 121 #endif -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_rfgun.h
r290 r292 38 38 inline string getName() {return "rfgun"; } 39 39 40 private:41 WImage* image_;42 43 40 }; 44 41 #endif -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_soleno.h
r290 r292 39 39 inline string getName() {return "soleno"; } 40 40 41 private:42 WImage* image_;43 41 }; 44 42 #endif -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_abstractElement.cc
r289 r292 12 12 #include "GWt_beam.h" 13 13 #include "GWt_fit.h" 14 #include "GWt_draggableImage.h" 14 15 15 16 #include "mixedTools.h" … … 114 115 } 115 116 117 118 void GWt_abstractElement::createDragImage(WContainerWidget* w){ 119 120 GWt_draggableImage *result = new GWt_draggableImage(getBigImageURL(),w); 121 122 /* 123 * Set the image to be draggable, showing the other image (dragImage) 124 * to be used as the widget that is visually dragged. 125 */ 126 result->setDraggable(getMimeType(),new WImage(getSmallImageURL(),w),true); 127 } 128 129 WImage* GWt_abstractElement::getImage() { 130 return image_; 131 } -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_beam.cc
r290 r292 46 46 47 47 // make image 48 image_ = new WImage( "htdocs/beam.jpg",this);48 image_ = new WImage(getBigImageURL(),this); 49 49 50 50 // activate slots … … 76 76 } 77 77 78 WImage* GWt_beam::getImage() {79 return image_;80 }81 82 78 83 79 WString GWt_beam::print(){ 84 80 return WString(abstractElement_->print()); 85 81 } 82 -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_bend.cc
r289 r292 47 47 48 48 // make image 49 image_ = new WImage( "htdocs/bend.jpg",this);49 image_ = new WImage(getBigImageURL(),this); 50 50 51 51 // activate slots -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_cell.cc
r289 r292 69 69 70 70 // make image 71 image_ = new WImage( "htdocs/cell.jpg",this);71 image_ = new WImage(getBigImageURL(),this); 72 72 73 73 // activate slots -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_drift.cc
r289 r292 25 25 26 26 // make image 27 image_ = new WImage( "htdocs/drift.jpg",this);27 image_ = new WImage(getBigImageURL(),this); 28 28 29 29 // activate slots -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_dropZoneLigneFaisceau.cc
r287 r292 12 12 //#define PSPA_DEBUG 1 13 13 14 GWt_dropZoneLigneFaisceau::GWt_dropZoneLigneFaisceau( )14 GWt_dropZoneLigneFaisceau::GWt_dropZoneLigneFaisceau( PspaApplication* pspa) 15 15 : WContainerWidget(){ 16 initialise( );16 initialise(pspa); 17 17 } 18 18 … … 23 23 24 24 25 void GWt_dropZoneLigneFaisceau::initialise( )25 void GWt_dropZoneLigneFaisceau::initialise( PspaApplication* pspa) 26 26 { 27 27 … … 37 37 38 38 // accept drops 39 acceptDrops("htdocs/beam.jpg");40 acceptDrops("htdocs/rfgun.jpg");41 acceptDrops("htdocs/drift.jpg");42 acceptDrops("htdocs/cell.jpg");43 acceptDrops("htdocs/bend.jpg");44 acceptDrops("htdocs/soleno.jpg");45 acceptDrops("htdocs/fit.jpg");46 39 40 vector <GWt_abstractElement*> elems = pspa->getAbstractElementFactory()->getAllElements(); 41 for (int a = 0; a< elems.size(); a++) { 42 acceptDrops(elems[a]->getMimeType()); 43 } 47 44 setMinimumSize(10,32); 48 45 } -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_elementLigneFaisceau.cc
r289 r292 26 26 #define PSPA_DEBUG 1 27 27 28 GWt_elementLigneFaisceau::GWt_elementLigneFaisceau() 29 : WContainerWidget(), 30 firstTimeInsertMessage_(NULL), 31 dropZoneLeft_(NULL), 32 dropZoneRight_(NULL), 33 abstractElement_(NULL) 34 { 35 // set the css name 36 setObjectName("elementLigneFaisceau"); 37 38 initialize_ligneFaisceau(NULL); 39 } 40 41 42 GWt_elementLigneFaisceau::GWt_elementLigneFaisceau(abstractElement* abstractElement) 28 29 GWt_elementLigneFaisceau::GWt_elementLigneFaisceau(PspaApplication* pspa) 43 30 : WContainerWidget(), 44 31 firstTimeInsertMessage_(NULL), … … 46 33 dropZoneRight_(NULL), 47 34 abstractElement_(NULL), 48 elementName_(NULL) 49 { 35 elementName_(NULL), 36 pspa_(pspa) 37 { 38 39 initialize_ligneFaisceau(NULL); 40 } 41 42 GWt_elementLigneFaisceau::GWt_elementLigneFaisceau(abstractElement* abstractElement, PspaApplication* pspa) 43 : WContainerWidget(), 44 firstTimeInsertMessage_(NULL), 45 dropZoneLeft_(NULL), 46 dropZoneRight_(NULL), 47 abstractElement_(NULL), 48 elementName_(NULL), 49 pspa_(pspa) 50 { 51 // set the css name 52 setObjectName("elementLigneFaisceau"); 53 50 54 initialize_ligneFaisceau(abstractElement); 51 55 } … … 72 76 73 77 // add first line : initialize arrow and link images 74 dropZoneLeft_ = new GWt_dropZoneLigneFaisceau( );78 dropZoneLeft_ = new GWt_dropZoneLigneFaisceau(pspa_); 75 79 dragElementZone_ = new WContainerWidget(); 76 dropZoneRight_ = new GWt_dropZoneLigneFaisceau( );80 dropZoneRight_ = new GWt_dropZoneLigneFaisceau(pspa_); 77 81 78 82 // change object name in order to manage css : -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_fit.cc
r289 r292 48 48 49 49 // make image 50 image_ = new WImage( "htdocs/fit.jpg",this);50 image_ = new WImage(getBigImageURL(),this); 51 51 52 52 // activate slots -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_ligneFaisceau.cc
r289 r292 38 38 // add the first drop zone 39 39 decorationStyle().setBorder (WBorder (WBorder::Dotted)); 40 GWt_dropZoneLigneFaisceau* allDropZone= new GWt_dropZoneLigneFaisceau( );40 GWt_dropZoneLigneFaisceau* allDropZone= new GWt_dropZoneLigneFaisceau(pspa_); 41 41 WVBoxLayout* fit = new WVBoxLayout(); 42 42 allDropZone->setLayout(fit); … … 68 68 nObjets_[ptr->getNomdElement().getElementType()].incr(); 69 69 70 ligneFaisceauLayout_->addWidget(new GWt_elementLigneFaisceau(ptr ),1);70 ligneFaisceauLayout_->addWidget(new GWt_elementLigneFaisceau(ptr,pspa_),1); 71 71 72 72 } … … 104 104 ligneFaisceauLayout_->clear(); 105 105 // add first element 106 ligneFaisceauLayout_->addWidget(new GWt_elementLigneFaisceau(ptr ),1);106 ligneFaisceauLayout_->addWidget(new GWt_elementLigneFaisceau(ptr,pspa_),1); 107 107 // remove arrow from begin and end 108 108 … … 129 129 if (index != -1) { 130 130 nObjets_[ptr->getNomdElement().getElementType()].incr(); 131 ligneFaisceauLayout_->insertWidget(index,new GWt_elementLigneFaisceau(ptr ),1);131 ligneFaisceauLayout_->insertWidget(index,new GWt_elementLigneFaisceau(ptr,pspa_),1); 132 132 } 133 133 } -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_pspaApplication.cc
r289 r292 189 189 // nomdElements bidon; 190 190 191 // FIXME a reprendre avec un patern 192 createDragImage("htdocs/beam.jpg","htdocs/beam.jpg","htdocs/beam.jpg",palette,"beam"); 193 new WBreak(palette); 194 createDragImage("htdocs/rfgun.jpg","htdocs/rfgun.jpg","htdocs/rfgun.jpg",palette,"rfgun"); 195 new WBreak(palette); 196 createDragImage("htdocs/drift.jpg","htdocs/drift.jpg","htdocs/drift.jpg",palette,"drift"); 197 new WBreak(palette); 198 createDragImage("htdocs/cell.jpg","htdocs/cell.jpg","htdocs/cell.jpg",palette,"cell"); 199 new WBreak(palette); 200 createDragImage("htdocs/bend.jpg","htdocs/bend.jpg","htdocs/bend.jpg",palette,"bend"); 201 new WBreak(palette); 202 createDragImage("htdocs/soleno.jpg","htdocs/soleno.jpg","htdocs/soleno.jpg",palette,"soleno"); 203 new WBreak(palette); 204 createDragImage("htdocs/fit.jpg","htdocs/fit.jpg","htdocs/fit.jpg",palette,"fit"); 205 new WBreak(palette); 206 191 vector <GWt_abstractElement*> elems = abstractElementFactory_->getAllElements(); 192 for (int a = 0; a< elems.size(); a++) { 193 elems[a]->createDragImage(palette); 194 new WBreak(palette); 195 } 207 196 208 197 // palette->setMinimumSize(100,300); … … 214 203 { 215 204 GWt_draggableImage *result = new GWt_draggableImage(url,p); 216 WImage *dragImage = new WImage(smallurl,p);217 205 218 206 /* … … 220 208 * to be used as the widget that is visually dragged. 221 209 */ 222 result->setDraggable(mimeType, dragImage,true);210 result->setDraggable(mimeType,new WImage(smallurl,p),true); 223 211 } 224 212 -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_rfgun.cc
r289 r292 43 43 44 44 // make image 45 image_ = new WImage( "htdocs/rfgun.jpg",this);45 image_ = new WImage(getBigImageURL(),this); 46 46 47 47 // activate slots -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_soleno.cc
r289 r292 29 29 30 30 // make image 31 image_ = new WImage( "htdocs/soleno.jpg",this);31 image_ = new WImage(getBigImageURL(),this); 32 32 33 33 // activate slots
Note: See TracChangeset
for help on using the changeset viewer.