NodeGraph is derived by QGraphicsScene
it defines a graphics-scene which shows Node-objects, which are representing AbstractAssets
method to add all nodes, which where created and put into the allItems instance variable, to this scene.
this function defines a rule to autoplace one node at a time. it is made to be called recursively.
Parameters: |
|
---|---|
Returns: | position of the given node |
Return type: | QPointF |
this method decides wether it should append or remove the given node from the selectedNodes-list and therefore, which nodes have to be set as chosen.
:param node:the graphicsItem which was selected in the NodeGraph :type node: Node
this will clear the list of chosen items and will mark each node as unchosen
method to create allNode which are needed for the scene. This method can be reimplemented in case the node-creation should be different for default for each dependent asset of the given parentNode a Node will be created recursively
Parameters: | parentNode (Node) – the parentNode-object |
---|
this is a wrapper to set the drawing order of nodes and connections. it is a reimplemented of the QGraphicsScene
Connections should be painted before Nodes
method will forward the mouseReleaseEvent to the item, which was currently clicked on
TableGraph is derived by QGraphicsScene
It defines a standardized way to show any kind of table rules for the tables can be defined by adding entries to the tables dictionary, which is a property-method of this class
depending on which table-view is set by the currentTableType instance variable the scene paints different kind of tables and offers different editing modes.
this will create all table-items and the table-background and add them to its scene.
method will generate a list with all dependent assets from all selected assets without double entries
Parameters: | selectedAssets (list of AbstractAsset) – list of selected assets |
---|---|
Returns: | list of assets |
Return type: | list of AbstractAsset |
this method outsources a complex functionality from a lambda-function in the tables-property dictionary
Parameters: | selectedAssets (list of AbstractAsset) – list of the assets, represented by the Nodes, selected in the adminGraph |
---|---|
Returns: | a list of dates including the timespan of all assets in selectedAssets an in addition to a certain handleLength |
Return type: | list of datetime.timedelta |
this method outsources a complex functionality from a lambda-function in the tables-property dictionary
Parameters: |
|
---|
method to define what happens, when the table-type changes
Parameters: | tableType (string) – name of the new tableType |
---|
tables returns a dictionary which holds lambda rules on how to treat a certain table-type
the dictionary is build up as follows:
{
'X-Axsis/Y-Axis' : #string description eg: time/task
{
'all' : lambda selectedAssets: function to get all values of the x-achsis, #mandatory
'getter' : lambda item: function to get all values of the current item, #mandatory
'sort' : lambda items: function to sort the output of 'all' and 'getter', #optional
'str' : lambda item: function to convert the item to a string(display information), #optional
'rowSorting' : lambda selectedAssets: allows to sort all rows from top to bottom #optional
'changeMin' : lambda delta, item: function to define what should be done with the item in case the in-point of an item was changed in the interface, #optional
'changeMax' : lambda delta, item: function to define what should be done with the item in case the out-point of an item was changed in the interface, #optional
'move' : lambda delta, item: function to define what should be done with the item in case an item was moved in the interface, #optional
'deleteExisting' : lambda column, item: function to define what should be done with the item in case the item was deleted in the interface, #optional
'createNew' : lambda column, item: function to define what should be done with the item in case a new item was created in the interface, #optional
'keepSeparate' : True/False indicates if the entries should be kept separately or if they should be grouped together. default is grouping #optional
}
}
Note
all mandatory items have to be defined and all optional items define user-actions. if an action is not defined, the missing interaction is not available in the interface
Returns: | the table-definition-dictionary |
---|---|
Return type: | dictionary |
The Node-class is a QGraphicsItem which is used to create a node in the Node-graoh, which represents an AbstractAsset
reimplemented function of QGraphicsItem
Returns: | a rectangle |
---|---|
Return type: | QRectF |
method checks if the node doesn’t collide with other nodes. if it does, it will be moved until it found the first free spot
combines the asset-name and the asset-version toone string
Returns: | name of this node-item |
---|---|
Return type: | string |
draw the node
Returns: | the painter-object, which is used to draw the item |
---|---|
Return type: | QPainter |
calculates the color of the backdrop state of this node
Returns: | state gradient |
---|---|
Return type: | QGradient |
the chosen parameter is similar to the isSelected parameter, but enables the pipeLion to figure out the correct selection order, which is important for some menu-tools, like connect. this method will return wether this node was chosen or not
Returns: | wether this node was chosen or not |
---|---|
Return type: | bool |
everytime there was a double-click a signal called nodeSelected(QString, QString) is emitted
every time a node was clicked this method will check for collisions
generates the color of the node using the colorManager’s module getColorFromObject
Returns: | node-color |
---|---|
Return type: | QColor |
reimplemented function of QGraphicsItem method will paint the item
method is a wrapper around paintUserImage to allow to draw multiple users to be drawn, in case the AbstractAsset of this item is a GroupAsset
Returns: | the painter-object, which is used to draw the item |
---|---|
Return type: | QPainter |
for each user assigned to the AbstractAsset of this object this method will create a new icon and will color this item depending on which user it paints:
if no user is assigned the user will be drawn red if a user was assigned the icon will be drawn blue and if you were assigned the icon will be green
Returns: | the painter-object, which is used to draw the item |
---|---|
Return type: | QPainter |
this Class is derived from QGraphicsItem it will draw all connections between its parentNode and the parents-node-childrens-nodes
the connection will have a different look, depending on the type of connection, which is drawn
reimplementment of QGraphicsItem method returns the items bounding box
Returns: | a rectangle |
---|---|
Return type: | QRectF |
TableTask is derived by QGraphicsItem
The class describes an item in a TableGraph scene and therefore an table-item.
within this class there are methods to automatically generate different user-interactions, depending on a given tableRulesDictionary.
reimplementment of QGraphicsItem method is used to get the bbox
Returns: | a rectangle |
---|---|
Return type: | QRectF |
wrapper to call the changeMax lambda-function in the tableRulesDict instance variable
Parameters: | moveDelta (int) – the mouse movement between the last mouse press and the last mouse release in columns |
---|
wrapper to call the changeMin lambda-function in the tableRulesDict instance variable
Parameters: | moveDelta (int) – the mouse movement between the last mouse press and the last mouse release in columns |
---|
wrapper to call the createNew lambda-function in the tableRulesDict instance variable
Parameters: | tablePos (int) – mouse position of the last release event in columns |
---|
wrapper to call the deleteExisting lambda-function in the tableRulesDict instance variable
Parameters: | tablePos (int) – mouse position of the last release event in columns |
---|
function to get the maximum value of all values of this item
Returns: | minimum value |
---|---|
Return type: | variant object |
function to get the minimum value of all values of this item
Returns: | minimum value |
---|---|
Return type: | variant object |
will store the press-position in the lastClick instance variable
Parameters: | event (QMousePressEvent) – mouse press event |
---|
controles the mouse release event. it will calculate the mouse-move-delta between the press event and the release event, and it will decide depending on the position of the press event if it should call the changeMin, changeMax or move command
Parameters: | event (QMouseReleaseEvent) – mouse release event |
---|
wrapper to call the move lambda-function in the tableRulesDict instance variable
Parameters: | moveDelta (int) – the mouse movement between the last mouse press and the last mouse release in columns |
---|
method will calculate the scene-pixels to the first entry of this item
Returns: | offset-pixels for x-Axis |
---|---|
Return type: | int |
method will calculate the scene-pixels to the row of this item
Returns: | offset-pixels for yAxis |
---|---|
Return type: | int |
reimplementment of QGraphicsItem method is used to paint the item
method will gather all item entries and sort them into groups of blocks. eg:
if there are the entries 1,2,3,6,7,8,10,11,15 the result will be:
dataGroups = [
[1.2.3],
[6.7.8],
[10.11],
[15]
]
Note
the group-list is also stored in the dataGroups instance variable
Returns: | the group-list |
---|---|
Return type: | list of list |
TableBg is derived by QGraphicsItem
This class is used to draw a background to the TableGraph depending on which data is selected and which tableType is checked
reimplementment of QGraphicsItem returns the bbox
Returns: | a rectangle |
---|---|
Return type: | QRectF |
method returns a rectangle describing one cell of the table
Parameters: |
|
---|---|
Returns: | a rectangle |
Return type: | QRectF |
method will create a contect menue with a selection of table-types. this selection is connected to the TableGraph-object and will change the table-type for the entire scene
Parameters: | event (QContextMenuEvent) – context menu event |
---|
function which paints the header of the table
Parameters: | painter (QPainter) – painter object, which draws the item to the scene |
---|---|
Returns: | painter object, which draws the item to the scene |
Return type: | QPainter |
function which paints the title of the table
Parameters: | painter (QPainter) – painter object, which draws the item to the scene |
---|---|
Returns: | painter object, which draws the item to the scene |
Return type: | QPainter |
method wrapps around the ‘all’ lambda function in the tableRulesDict and creates a list of header-data stored in the columns instance variable This way the TableBg-object knows which data is encoded in which column
Returns: | columns instance variable |
---|---|
Return type: | list of variant objects |
method returns the column number where the header-data is data
Parameters: | data (variant object) – data which should be searched for in the header |
---|---|
Returns: | column number |
Return type: | int |
method returns the header-data in column x
Parameters: | column (int) – number of the column |
---|---|
Returns: | header-data in column given by column |
Return type: | variant object |
returns the width and the height of the whole table
Returns: | size of table |
---|---|
Return type: | QSizeF |
DependencyGraph is derived by the NodeGraph
the class defines a node-scene, which lists all dependencies of the parentNode on the left side and all children of the parentNode ion the right side
to change the placement of the nodes, this method was reimplemented
it will place all dependent nodes of the parentNode to the left of the parentNode and all children of the parentNode on the right
Parameters: |
|
---|---|
Returns: | position of the given node |
Return type: | QPointF |
this class is derived by the Node-class it defines a node, but instead painting the asset’s name and version as nodeName it will draw the assigned users