|
Envision
A visual programming IDE for object-oriented languages
|
The ViewItemNode class is used in the ViewItem class and simply wraps a top level node to give another level of indirection. More...
Public Member Functions | |
| int | purpose () const |
| Model::Node * | reference () const |
| void | setPosition (MajorMinorIndex pos) |
| Use setPosition to set the position of this node in the ViewItem's grid before calling toJson. More... | |
| void | setPurpose (int purpose) |
| void | setReference (Model::Node *reference) |
| void | setSpacingParent (ViewItemNode *spacingParent) |
| void | setSpacingParentPosition (MajorMinorIndex pos) |
| If a spacing parent exists, use this to set the position of its spacing parent's position in the ViewItem's grid before calling toJson. More... | |
| void | setSpacingTarget (Model::Node *spacingTarget) |
| ViewItemNode * | spacingParent () const |
| Model::Node * | spacingTarget () const |
| virtual QJsonValue | toJson () const override |
Static Public Member Functions | |
| static ViewItemNode * | fromJson (QJsonObject json, const ViewItem *view) |
| Creates a new ViewItemNode using the given Json object for initialization. More... | |
| static ViewItemNode * | withReference (Model::Node *reference, int purpose) |
| Creates a new ViewItemNode which is used to render the given reference's visualization. More... | |
| static ViewItemNode * | withSpacingTarget (Model::Node *spacingTarget, ViewItemNode *spacingParent) |
| Creates a new ViewItemNode which is used to render an empty spacing item. More... | |
Private Attributes | |
| MajorMinorIndex | position_ |
| int | purpose_ {-1} |
| Model::Node * | reference_ {} |
| ViewItemNode * | spacingParent_ {} |
| MajorMinorIndex | spacingParentPosition_ |
| Model::Node * | spacingTarget_ {} |
Additional Inherited Members | |
Protected Types inherited from Core::Reflect< Base > | |
| using | Super = Reflect< Base > |
The ViewItemNode class is used in the ViewItem class and simply wraps a top level node to give another level of indirection.
This helps with distinguishing different items when the same node is added to a ViewItem multiple times, as is possible.
A ViewItemNode can either hold a reference to another node - in which case its visualization renders that node. It can also hold a spacing target and spacing parent - in which case it will render as white space, aligning its bottom end with the top end of that given spacing target.
|
static |
Creates a new ViewItemNode using the given Json object for initialization.
This can then be either a ViewItemNode with a reference or a spacing target.
|
inline |
|
inline |
|
inline |
Use setPosition to set the position of this node in the ViewItem's grid before calling toJson.
|
inline |
|
inline |
|
inline |
|
inline |
If a spacing parent exists, use this to set the position of its spacing parent's position in the ViewItem's grid before calling toJson.
|
inline |
|
inline |
|
inline |
|
overridevirtual |
|
static |
Creates a new ViewItemNode which is used to render the given reference's visualization.
|
static |
Creates a new ViewItemNode which is used to render an empty spacing item.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |