Version: 8.3.0
YACS::HMI::SchemaComponentItem Class Reference

#include <SchemaComponentItem.hxx>

Inheritance diagram for YACS::HMI::SchemaComponentItem:
Collaboration diagram for YACS::HMI::SchemaComponentItem:

Public Member Functions

 SchemaComponentItem (SchemaItem *parent, QString label, Subject *subject)
 
virtual void update (GuiEvent event, int type, Subject *son)
 
virtual void popupMenu (QWidget *caller, const QPoint &globalPos)
 
- Public Member Functions inherited from YACS::HMI::SchemaItem
 SchemaItem (SchemaItem *parent, QString label, Subject *subject)
 
virtual ~SchemaItem ()
 
virtual void appendChild (SchemaItem *child)
 
virtual void removeChild (SchemaItem *child)
 
virtual void insertChild (int row, SchemaItem *child)
 
virtual SchemaItemchild (int row)
 
virtual int childCount () const
 
virtual int columnCount () const
 
virtual QVariant data (int column, int role) const
 
virtual Qt::ItemFlags flags (const QModelIndex &index)
 
virtual int row () const
 
virtual SchemaItemparent ()
 
virtual SubjectgetSubject ()
 
virtual void select (bool isSelected)
 
virtual void toggleState ()
 
QModelIndex modelIndex (int column=0)
 
virtual ItemMimeDatamimeData (ItemMimeData *mime)
 
virtual bool dropMimeData (const QMimeData *data, Qt::DropAction action)
 
virtual void reparent (SchemaItem *parent)
 
virtual void setCaseValue ()
 used in node derived classes More...
 
bool isEmphasized ()
 
void setEmphasize (bool emphasize)
 
- Public Member Functions inherited from YACS::HMI::GuiObserver
 GuiObserver ()
 
virtual ~GuiObserver ()
 
virtual void incrementSubjects (Subject *subject)
 
virtual void decrementSubjects (Subject *subject)
 
int getNbSubjects ()
 
bool isDestructible ()
 

Protected Member Functions

virtual QVariant editionWhatsThis (int column) const
 
- Protected Member Functions inherited from YACS::HMI::SchemaItem
virtual QVariant editionToolTip (int column) const
 
virtual QVariant runToolTip (int column) const
 
virtual QVariant runWhatsThis (int column) const
 
virtual QString getMimeFormat ()
 
virtual void setExecState (int execState)
 

Additional Inherited Members

- Static Public Member Functions inherited from YACS::HMI::GuiObserver
static std::string eventName (GuiEvent event)
 
static void setEventMap ()
 
- Protected Attributes inherited from YACS::HMI::SchemaItem
QList< SchemaItem * > _childItems
 
QList< QVariant > _itemData
 
QList< QVariant > _itemDeco
 
QList< QVariant > _itemForeground
 
QList< QVariant > _itemBackground
 
QList< QVariant > _itemCheckState
 
QList< QVariant > _itemToolTip
 
QList< QVariant > _itemWhatsThis
 
QString _label
 
SchemaItem_parentItem
 
Subject_subject
 
int _execState
 
bool _emphasized
 
- Static Protected Attributes inherited from YACS::HMI::GuiObserver
static std::map< int, std::string > _eventNameMap
 

Detailed Description

Definition at line 29 of file SchemaComponentItem.hxx.

Constructor & Destructor Documentation

SchemaComponentItem::SchemaComponentItem ( SchemaItem parent,
QString  label,
Subject subject 
)

Definition at line 37 of file SchemaComponentItem.cxx.

References YACS::HMI::SchemaItem::_itemDeco, and YACS::HMI::YLabel.

38  : SchemaItem(parent, label, subject)
39 {
40  _itemDeco.replace(YLabel, QIcon("icons:component.png"));
41 }

Member Function Documentation

QVariant SchemaComponentItem::editionWhatsThis ( int  column) const
protectedvirtual

Reimplemented from YACS::HMI::SchemaItem.

Definition at line 122 of file SchemaComponentItem.cxx.

123 {
124  return "<p>To edit the component instance properties, select the component instance and use the input panel. <a href=\"modification.html#property-page-for-component-instance-definition\">More...</a></p>";
125 }
void SchemaComponentItem::popupMenu ( QWidget caller,
const QPoint &  globalPos 
)
virtual

Reimplemented from YACS::HMI::SchemaItem.

Definition at line 116 of file SchemaComponentItem.cxx.

References gui.GraphViewer::m, and YACS::HMI::ComponentInstanceMenu::popupMenu().

117 {
119  m.popupMenu(caller, globalPos);
120 }
void SchemaComponentItem::update ( GuiEvent  event,
int  type,
Subject son 
)
virtual

Reimplemented from YACS::HMI::SchemaItem.

Definition at line 43 of file SchemaComponentItem.cxx.

References YACS::HMI::QtGuiContext::_mapOfSchemaItem, YACS::HMI::ADDCHILDREF, YACS::HMI::SchemaItem::childCount(), YACS::HMI::CUT, DEBTRACE, YACS::ENGINE::ComposedNode::getChildName(), YACS::HMI::GuiContext::getCurrent(), YACS::HMI::Subject::getName(), YACS::HMI::SubjectNode::getNode(), YACS::HMI::GuiContext::getProc(), YACS::HMI::QtGuiContext::getQtCurrent(), YACS::HMI::SubjectReference::getReference(), YACS::HMI::QtGuiContext::getSchemaModel(), YACS::HMI::SchemaItem::getSubject(), YACS::HMI::SchemaItem::modelIndex(), YACS::HMI::PASTE, gui.CONNECTOR::ref(), YACS::HMI::SchemaItem::removeChild(), YACS::HMI::REMOVECHILDREF, and YASSERT.

Referenced by gui.graph.MyCanvas::customEvent().

44 {
45  DEBTRACE("SchemaComponentItem::update");
46  //SchemaItem::update(event, type, son);
47  SchemaModel *model = 0;
48  SchemaReferenceItem *item =0;
49  switch (event)
50  {
52  {
53  DEBTRACE("ADDCHILDREF ");
55  SubjectReference *ref = dynamic_cast<SubjectReference*>(son);
56  YASSERT(ref);
57  SubjectServiceNode *service = dynamic_cast<SubjectServiceNode*>(ref->getReference());
58  YASSERT(service);
60  string serviceName = proc->getChildName(service->getNode());
61  DEBTRACE("ADDCHILDREF " << ref->getReference()->getName());
62 
63  int nbsons = childCount();
64  model->beginInsertRows(modelIndex(), nbsons, nbsons);
65  item = new SchemaReferenceItem(this,
66  serviceName.c_str(),
67  son);
68  model->endInsertRows();
69  }
70  break;
71 
73  {
74  DEBTRACE("REMOVECHILDREF ");
75  }
76  break;
77 
78  case YACS::HMI::CUT:
79  {
80  DEBTRACE("CUT on " << getSubject()->getName());
82  SubjectReference *ref = dynamic_cast<SubjectReference*>(son);
83  YASSERT(ref);
84  DEBTRACE("CUT " << ref->getReference()->getName());
86 
87  int position = toMove->row();
88  model->beginRemoveRows(modelIndex(), position, position);
89  removeChild(toMove);
90  model->endRemoveRows();
91  }
92  break;
93 
94  case YACS::HMI::PASTE:
95  {
96  DEBTRACE("PASTE on " << getSubject()->getName());
98  SubjectReference *ref = dynamic_cast<SubjectReference*>(son);
99  YASSERT(ref);
100  DEBTRACE("PASTE " << ref->getReference()->getName());
102 
103  int nbsons = childCount();
104  model->beginInsertRows(modelIndex(), nbsons, nbsons);
105  toPaste->reparent(this);
106  model->endInsertRows();
107  }
108  break;
109 
110 
111  default:
112  ;
113  }
114 }

The documentation for this class was generated from the following files: