Beispiel #1
0
 def xAxis(self, leftCol, topRow, rowBelow, tupleFacts, xFilters, childrenFirst, renderNow, atTop):
     parentRow = rowBelow
     noDescendants = True
     rightCol = leftCol
     widthToSpanParent = 0
     sideBorder = not xFilters
     if atTop and sideBorder and childrenFirst:
         gridBorder(self.gridColHdr, self.dataFirstCol, 1, LEFTBORDER, rowspan=self.dataFirstRow)
     for xAxisChildObj in tupleFacts:
         isItem = xAxisChildObj.isItem
         noDescendants = False
         rightCol, row, width, leafNode = self.xAxis(leftCol, topRow + 1, rowBelow, xAxisChildObj.modelTupleFacts, xFilters, # nested items before totals
                                                     childrenFirst, childrenFirst, False)
         if row - 1 < parentRow:
             parentRow = row - 1
         #if not leafNode: 
         #    rightCol -= 1
         widthToSpanParent += width
         label = xAxisChildObj.concept.label(lang=self.lang)
         if childrenFirst:
             thisCol = rightCol
             sideBorder = RIGHTBORDER
         else:
             thisCol = leftCol
             sideBorder = LEFTBORDER
         if renderNow:
             columnspan = (rightCol - leftCol + (1 if isItem else 0))
             gridBorder(self.gridColHdr, leftCol, topRow, TOPBORDER, columnspan=columnspan)
             gridBorder(self.gridColHdr, leftCol, topRow, 
                        sideBorder, columnspan=columnspan,
                        rowspan=(rowBelow - topRow + 1) )
             gridHdr(self.gridColHdr, leftCol, topRow, 
                     label if label else "         ", 
                     anchor="center",
                     columnspan=(rightCol - leftCol + (1 if isItem else 0)),
                     rowspan=(row - topRow + 1) if leafNode else 1,
                     wraplength=width,
                     objectId=xAxisChildObj.objectId(),
                     onClick=self.onClick)
             if isItem:
                 gridBorder(self.gridColHdr, thisCol, self.dataFirstRow - 1, BOTTOMBORDER)
                 xFilters.append(xAxisChildObj.concept,
                                  )
         if isItem:
             rightCol += 1
         if renderNow and not childrenFirst:
             self.xAxis(leftCol + (1 if isItem else 0), topRow + 1, rowBelow, xAxisChildObj.modelTupleFacts, xFilters, childrenFirst, True, False) # render on this pass
         leftCol = rightCol
     if atTop and sideBorder and not childrenFirst:
         gridBorder(self.gridColHdr, rightCol - 1, 1, RIGHTBORDER, rowspan=self.dataFirstRow)
     return (rightCol, parentRow, widthToSpanParent, noDescendants)
Beispiel #2
0
 def xAxis(self, leftCol, topRow, rowBelow, tupleFacts, xFilters, childrenFirst, renderNow, atTop):
     parentRow = rowBelow
     noDescendants = True
     rightCol = leftCol
     widthToSpanParent = 0
     sideBorder = not xFilters
     if atTop and sideBorder and childrenFirst:
         gridBorder(self.gridColHdr, self.dataFirstCol, 1, LEFTBORDER, rowspan=self.dataFirstRow)
     for xAxisChildObj in tupleFacts:
         isItem = xAxisChildObj.isItem
         noDescendants = False
         rightCol, row, width, leafNode = self.xAxis(leftCol, topRow + 1, rowBelow, xAxisChildObj.modelTupleFacts, xFilters, # nested items before totals
                                                     childrenFirst, childrenFirst, False)
         if row - 1 < parentRow:
             parentRow = row - 1
         #if not leafNode: 
         #    rightCol -= 1
         widthToSpanParent += width
         label = xAxisChildObj.concept.label(lang=self.lang)
         if childrenFirst:
             thisCol = rightCol
             sideBorder = RIGHTBORDER
         else:
             thisCol = leftCol
             sideBorder = LEFTBORDER
         if renderNow:
             columnspan = (rightCol - leftCol + (1 if isItem else 0))
             gridBorder(self.gridColHdr, leftCol, topRow, TOPBORDER, columnspan=columnspan)
             gridBorder(self.gridColHdr, leftCol, topRow, 
                        sideBorder, columnspan=columnspan,
                        rowspan=(rowBelow - topRow + 1) )
             gridHdr(self.gridColHdr, leftCol, topRow, 
                     label if label else "         ", 
                     anchor="center",
                     columnspan=(rightCol - leftCol + (1 if isItem else 0)),
                     rowspan=(row - topRow + 1) if leafNode else 1,
                     wraplength=width,
                     objectId=xAxisChildObj.objectId(),
                     onClick=self.onClick)
             if isItem:
                 gridBorder(self.gridColHdr, thisCol, self.dataFirstRow - 1, BOTTOMBORDER)
                 xFilters.append(xAxisChildObj.concept,
                                  )
         if isItem:
             rightCol += 1
         if renderNow and not childrenFirst:
             self.xAxis(leftCol + (1 if isItem else 0), topRow + 1, rowBelow, xAxisChildObj.modelTupleFacts, xFilters, childrenFirst, True, False) # render on this pass
         leftCol = rightCol
     if atTop and sideBorder and not childrenFirst:
         gridBorder(self.gridColHdr, rightCol - 1, 1, RIGHTBORDER, rowspan=self.dataFirstRow)
     return (rightCol, parentRow, widthToSpanParent, noDescendants)
    def zAxis(self, row, zAxisObj, zFilters):
        for axisMbrRel in self.axisMbrRelSet.fromModelObject(zAxisObj):
            zAxisObj = axisMbrRel.toModelObject
            zFilters.append((self.inheritedPrimaryItemQname(zAxisObj),
                             self.inheritedExplicitDims(zAxisObj),
                             zAxisObj.genLabel(lang=self.lang)))
            priorZfilter = len(zFilters)
            self.zAxis(None, zAxisObj, zFilters)
            if row is not None:
                gridBorder(self.gridColHdr, self.dataFirstCol, row, TOPBORDER, columnspan=2)
                gridBorder(self.gridColHdr, self.dataFirstCol, row, LEFTBORDER)
                gridBorder(self.gridColHdr, self.dataFirstCol, row, RIGHTBORDER, columnspan=2)
                gridHdr(self.gridColHdr, self.dataFirstCol, row,
                        zAxisObj.genLabel(lang=self.lang), 
                        anchor="w", columnspan=2,
                        wraplength=200,
                        objectId=zAxisObj.objectId(),
                        onClick=self.onClick)
                nextZfilter = len(zFilters)
                if nextZfilter > priorZfilter:    # no combo box choices nested
                    self.combobox = gridCombobox(
                                 self.gridColHdr, self.dataFirstCol + 2, row,
                                 values=[zFilter[2] for zFilter in zFilters[priorZfilter:nextZfilter]],
                                 selectindex=self.zFilterIndex,
                                 comboboxselected=self.comboBoxSelected)
                    gridBorder(self.gridColHdr, self.dataFirstCol + 2, row, RIGHTBORDER)
                    row += 1

        if not zFilters:
            zFilters.append( (None,set()) )  # allow empty set operations
Beispiel #4
0
 def zAxis(self, row):
     if row is not None:
         gridBorder(self.gridColHdr, self.dataFirstCol, row, TOPBORDER, columnspan=2)
         gridBorder(self.gridColHdr, self.dataFirstCol, row, LEFTBORDER)
         gridBorder(self.gridColHdr, self.dataFirstCol, row, RIGHTBORDER, columnspan=2)
         gridHdr(self.gridColHdr, self.dataFirstCol, row,
                 "Link role (schedule)", 
                 anchor="w", columnspan=2,
                 wraplength=200,
                 objectId="zAxisLabel",
                 onClick=self.onClick)
         self.combobox = gridCombobox(
                      self.gridColHdr, self.dataFirstCol + 2, row,
                      values=[definition for definition,linkrole in self.definedLinkroles],
                      selectindex=self.zFilterIndex,
                      comboboxselected=self.comboBoxSelected)
         gridBorder(self.gridColHdr, self.dataFirstCol + 2, row, RIGHTBORDER)
         row += 1
Beispiel #5
0
 def zAxis(self, row):
     if row is not None:
         gridBorder(self.gridColHdr, self.dataFirstCol, row, TOPBORDER, columnspan=2)
         gridBorder(self.gridColHdr, self.dataFirstCol, row, LEFTBORDER)
         gridBorder(self.gridColHdr, self.dataFirstCol, row, RIGHTBORDER, columnspan=2)
         gridHdr(self.gridColHdr, self.dataFirstCol, row,
                 "Link role (schedule)", 
                 anchor="w", columnspan=2,
                 wraplength=200,
                 objectId="zAxisLabel",
                 onClick=self.onClick)
         self.combobox = gridCombobox(
                      self.gridColHdr, self.dataFirstCol + 2, row,
                      values=[definition for definition,linkrole in self.definedLinkroles],
                      selectindex=self.zFilterIndex,
                      comboboxselected=self.comboBoxSelected)
         gridBorder(self.gridColHdr, self.dataFirstCol + 2, row, RIGHTBORDER)
         row += 1
    def zAxis(self, row, zAxisObj, zFilters):
        priorZfilter = len(zFilters)
        
        for axisMbrRel in self.axisMbrRelSet.fromModelObject(zAxisObj):
            zAxisObj = axisMbrRel.toModelObject
            zFilters.append((inheritedPrimaryItemQname(self, zAxisObj),
                             inheritedExplicitDims(self, zAxisObj),
                             zAxisObj.genLabel(lang=self.lang),
                             zAxisObj.objectId()))
            self.zAxis(None, zAxisObj, zFilters)
            
        if row is not None:
            nextZfilter = len(zFilters)
            gridBorder(self.gridColHdr, self.dataFirstCol, row, TOPBORDER, columnspan=2)
            gridBorder(self.gridColHdr, self.dataFirstCol, row, LEFTBORDER)
            gridBorder(self.gridColHdr, self.dataFirstCol, row, RIGHTBORDER, columnspan=2)
            if nextZfilter > priorZfilter + 1:  # combo box, use header on zAxis
                label = axisMbrRel.fromModelObject.genLabel(lang=self.lang)
            else: # no combo box, use label on coord
                label = zAxisObj.genLabel(lang=self.lang)
            hdr = gridHdr(self.gridColHdr, self.dataFirstCol, row,
                          label, 
                          anchor="w", columnspan=2,
                          wraplength=200, # in screen units
                          objectId=zAxisObj.objectId(),
                          onClick=self.onClick)
            if nextZfilter > priorZfilter + 1:    # multiple choices, use combo box
                zIndex = row - 1
                selectIndex = self.zComboBoxIndex[zIndex]
                combobox = gridCombobox(
                             self.gridColHdr, self.dataFirstCol + 2, row,
                             values=[zFilter[2] for zFilter in zFilters[priorZfilter:nextZfilter]],
                             selectindex=selectIndex,
                             columnspan=2,
                             comboboxselected=self.comboBoxSelected)
                combobox.zIndex = zIndex
                zFilterIndex = priorZfilter + selectIndex
                self.zFilterIndex[zIndex] = zFilterIndex
                combobox.objectId = hdr.objectId = zFilters[zFilterIndex][3]
                gridBorder(self.gridColHdr, self.dataFirstCol + 3, row, RIGHTBORDER)
                row += 1

        if not zFilters:
            zFilters.append( (None,set()) )  # allow empty set operations
Beispiel #7
0
    def zAxis(self, row, zAxisObj, zFilters):
        for axisMbrRel in self.axisMbrRelSet.fromModelObject(zAxisObj):
            zAxisObj = axisMbrRel.toModelObject
            zFilters.append(
                (
                    self.inheritedPrimaryItemQname(zAxisObj),
                    self.inheritedExplicitDims(zAxisObj),
                    zAxisObj.genLabel(lang=self.lang),
                )
            )
            priorZfilter = len(zFilters)
            self.zAxis(None, zAxisObj, zFilters)
            if row is not None:
                gridBorder(self.gridColHdr, self.dataFirstCol, row, TOPBORDER, columnspan=2)
                gridBorder(self.gridColHdr, self.dataFirstCol, row, LEFTBORDER)
                gridBorder(self.gridColHdr, self.dataFirstCol, row, RIGHTBORDER, columnspan=2)
                gridHdr(
                    self.gridColHdr,
                    self.dataFirstCol,
                    row,
                    zAxisObj.genLabel(lang=self.lang),
                    anchor="w",
                    columnspan=2,
                    wraplength=200,
                    objectId=zAxisObj.objectId(),
                    onClick=self.onClick,
                )
                nextZfilter = len(zFilters)
                if nextZfilter > priorZfilter:  # no combo box choices nested
                    self.combobox = gridCombobox(
                        self.gridColHdr,
                        self.dataFirstCol + 2,
                        row,
                        values=[zFilter[2] for zFilter in zFilters[priorZfilter:nextZfilter]],
                        selectindex=self.zFilterIndex,
                        comboboxselected=self.comboBoxSelected,
                    )
                    gridBorder(self.gridColHdr, self.dataFirstCol + 2, row, RIGHTBORDER)
                    row += 1

        if not zFilters:
            zFilters.append((None, set()))  # allow empty set operations
Beispiel #8
0
 def zAxis(self, row, zStructuralNode, zAspects, clearZchoices):
     if zStructuralNode is not None:
         gridBorder(self.gridColHdr, self.dataFirstCol, row, TOPBORDER, columnspan=2)
         gridBorder(self.gridColHdr, self.dataFirstCol, row, LEFTBORDER)
         gridBorder(self.gridColHdr, self.dataFirstCol, row, RIGHTBORDER, columnspan=2)
         label = zStructuralNode.header(lang=self.lang)
         hdr = gridHdr(self.gridColHdr, self.dataFirstCol, row,
                       label, 
                       anchor="w", columnspan=2,
                       wraplength=200, # in screen units
                       objectId=zStructuralNode.objectId(),
                       onClick=self.onClick)
 
         if zStructuralNode.choiceStructuralNodes: # combo box
             valueHeaders = [''.ljust(zChoiceStructuralNode.indent * 4) + # indent if nested choices 
                             (zChoiceStructuralNode.header(lang=self.lang) or '')
                             for zChoiceStructuralNode in zStructuralNode.choiceStructuralNodes]
             combobox = gridCombobox(
                          self.gridColHdr, self.dataFirstCol + 2, row,
                          values=valueHeaders,
                          selectindex=zStructuralNode.choiceNodeIndex,
                          columnspan=2,
                          comboboxselected=self.onComboBoxSelected)
             combobox.zStructuralNode = zStructuralNode
             combobox.zChoiceOrdIndex = row - 1
             combobox.objectId = hdr.objectId = zStructuralNode.objectId()
             gridBorder(self.gridColHdr, self.dataFirstCol + 3, row, RIGHTBORDER)
 
         if zStructuralNode.childStructuralNodes:
             for zStructuralNode in zStructuralNode.childStructuralNodes:
                 self.zAxis(row + 1, zStructuralNode, zAspects, clearZchoices)
         else: # nested-nost element, aspects process inheritance
             for aspect in aspectModels[self.aspectModel]:
                 for ruleAspect in aspectRuleAspects.get(aspect, (aspect,)):
                     if zStructuralNode.hasAspect(ruleAspect): #implies inheriting from other z axes
                         if ruleAspect == Aspect.DIMENSIONS:
                             for dim in (zStructuralNode.aspectValue(Aspect.DIMENSIONS) or emptyList):
                                 zAspects[dim].add(zStructuralNode)
                         else:
                             zAspects[ruleAspect].add(zStructuralNode)
    def yAxis(self, leftCol, row, yParentStructuralNode, childrenFirst,
              renderNow, atLeft):
        if yParentStructuralNode is not None:
            nestedBottomRow = row
            if atLeft:
                gridBorder(
                    self.gridRowHdr,
                    self.rowHdrCols +
                    len(self.rowHdrNonStdRoles
                        ),  # was: self.rowHdrDocCol + self.rowHdrCodeCol, 
                    self.dataFirstRow,
                    RIGHTBORDER,
                    rowspan=self.dataRows)
                gridBorder(self.gridRowHdr,
                           1,
                           self.dataFirstRow + self.dataRows - 1,
                           BOTTOMBORDER,
                           columnspan=(
                               self.rowHdrCols + len(self.rowHdrNonStdRoles)
                           ))  # was: self.rowHdrDocCol + self.rowHdrCodeCol))
            for yStructuralNode in yParentStructuralNode.childStructuralNodes:
                if not yStructuralNode.isRollUp:
                    nestRow, nextRow = self.yAxis(
                        leftCol + 1,
                        row,
                        yStructuralNode,  # nested items before totals
                        childrenFirst,
                        childrenFirst,
                        False)

                    isAbstract = (
                        yStructuralNode.isAbstract or
                        (yStructuralNode.childStructuralNodes
                         and not isinstance(
                             yStructuralNode.definitionNode,
                             (ModelClosedDefinitionNode, ModelEuAxisCoord))))
                    isNonAbstract = not isAbstract
                    label = yStructuralNode.header(
                        lang=self.lang,
                        returnGenLabel=isinstance(
                            yStructuralNode.definitionNode,
                            (ModelClosedDefinitionNode, ModelEuAxisCoord)))
                    topRow = row
                    if childrenFirst and isNonAbstract:
                        row = nextRow
                    if renderNow:
                        columnspan = self.rowHdrCols - leftCol + 1 if isNonAbstract or nextRow == row else None
                        gridBorder(self.gridRowHdr,
                                   leftCol,
                                   topRow,
                                   LEFTBORDER,
                                   rowspan=(nestRow - topRow + 1))
                        gridBorder(
                            self.gridRowHdr,
                            leftCol,
                            topRow,
                            TOPBORDER,
                            columnspan=(1 if childrenFirst and nextRow > row
                                        else columnspan))
                        if childrenFirst and row > topRow:
                            gridBorder(self.gridRowHdr,
                                       leftCol + 1,
                                       row,
                                       TOPBORDER,
                                       columnspan=(self.rowHdrCols - leftCol))
                        depth = yStructuralNode.depth
                        gridHdr(
                            self.gridRowHdr,
                            leftCol,
                            row,
                            label if label is not None else "         ",
                            anchor=("w" if isNonAbstract or nestRow == row else
                                    "center"),
                            columnspan=columnspan,
                            rowspan=(nestRow - row if isAbstract else None),
                            # wraplength is in screen units
                            wraplength=(self.rowHdrColWidth[depth] if
                                        isAbstract else self.rowHdrWrapLength -
                                        sum(self.rowHdrColWidth[0:depth])),
                            #minwidth=self.rowHdrColWidth[leftCol],
                            minwidth=(16 if isNonAbstract and nextRow > topRow
                                      else None),
                            objectId=yStructuralNode.objectId(),
                            onClick=self.onClick)
                        if isNonAbstract:
                            for i, role in enumerate(self.rowHdrNonStdRoles):
                                isCode = "code" in role
                                docCol = self.dataFirstCol - len(
                                    self.rowHdrNonStdRoles) + i
                                gridBorder(self.gridRowHdr, docCol, row,
                                           TOPBORDER)
                                gridBorder(self.gridRowHdr, docCol, row,
                                           LEFTBORDER)
                                gridHdr(
                                    self.gridRowHdr,
                                    docCol,
                                    row,
                                    yStructuralNode.header(role=role,
                                                           lang=self.lang),
                                    anchor="c" if isCode else "w",
                                    wraplength=40
                                    if isCode else 100,  # screen units
                                    objectId=yStructuralNode.objectId(),
                                    onClick=self.onClick)
                            ''' was:
                            if self.rowHdrDocCol:
                                docCol = self.dataFirstCol - 1 - self.rowHdrCodeCol
                                gridBorder(self.gridRowHdr, docCol, row, TOPBORDER)
                                gridBorder(self.gridRowHdr, docCol, row, LEFTBORDER)
                                gridHdr(self.gridRowHdr, docCol, row, 
                                        yStructuralNode.header(role="http://www.xbrl.org/2008/role/documentation",
                                                             lang=self.lang), 
                                        anchor="w",
                                        wraplength=100, # screen units
                                        objectId=yStructuralNode.objectId(),
                                        onClick=self.onClick)
                            if self.rowHdrCodeCol:
                                codeCol = self.dataFirstCol - 1
                                gridBorder(self.gridRowHdr, codeCol, row, TOPBORDER)
                                gridBorder(self.gridRowHdr, codeCol, row, LEFTBORDER)
                                gridHdr(self.gridRowHdr, codeCol, row, 
                                        yStructuralNode.header(role="http://www.eurofiling.info/role/2010/coordinate-code"),
                                        anchor="center",
                                        wraplength=40, # screen units
                                        objectId=yStructuralNode.objectId(),
                                        onClick=self.onClick)
                            # gridBorder(self.gridRowHdr, leftCol, self.dataFirstRow - 1, BOTTOMBORDER)
                            '''
                    if isNonAbstract:
                        row += 1
                    elif childrenFirst:
                        row = nextRow
                    if nestRow > nestedBottomRow:
                        nestedBottomRow = nestRow + (isNonAbstract
                                                     and not childrenFirst)
                    if row > nestedBottomRow:
                        nestedBottomRow = row
                    #if renderNow and not childrenFirst:
                    #    dummy, row = self.yAxis(leftCol + 1, row, yStructuralNode, childrenFirst, True, False) # render on this pass
                    if not childrenFirst:
                        dummy, row = self.yAxis(leftCol + 1, row,
                                                yStructuralNode, childrenFirst,
                                                renderNow,
                                                False)  # render on this pass
            return (nestedBottomRow, row)
 def xAxis(self, leftCol, topRow, rowBelow, xParentStructuralNode,
           xStructuralNodes, childrenFirst, renderNow, atTop):
     if xParentStructuralNode is not None:
         parentRow = rowBelow
         noDescendants = True
         rightCol = leftCol
         widthToSpanParent = 0
         sideBorder = not xStructuralNodes
         if atTop and sideBorder and childrenFirst:
             gridBorder(self.gridColHdr,
                        self.dataFirstCol,
                        1,
                        LEFTBORDER,
                        rowspan=self.dataFirstRow)
         for xStructuralNode in xParentStructuralNode.childStructuralNodes:
             if not xStructuralNode.isRollUp:
                 noDescendants = False
                 rightCol, row, width, leafNode = self.xAxis(
                     leftCol,
                     topRow + 1,
                     rowBelow,
                     xStructuralNode,
                     xStructuralNodes,  # nested items before totals
                     childrenFirst,
                     childrenFirst,
                     False)
                 if row - 1 < parentRow:
                     parentRow = row - 1
                 #if not leafNode:
                 #    rightCol -= 1
                 nonAbstract = not xStructuralNode.isAbstract
                 if nonAbstract:
                     width += 100  # width for this label, in screen units
                 widthToSpanParent += width
                 label = xStructuralNode.header(
                     lang=self.lang,
                     returnGenLabel=isinstance(
                         xStructuralNode.definitionNode,
                         (ModelClosedDefinitionNode, ModelEuAxisCoord)))
                 if childrenFirst:
                     thisCol = rightCol
                     sideBorder = RIGHTBORDER
                 else:
                     thisCol = leftCol
                     sideBorder = LEFTBORDER
                 if renderNow:
                     columnspan = (rightCol - leftCol +
                                   (1 if nonAbstract else 0))
                     gridBorder(self.gridColHdr,
                                leftCol,
                                topRow,
                                TOPBORDER,
                                columnspan=columnspan)
                     gridBorder(self.gridColHdr,
                                leftCol,
                                topRow,
                                sideBorder,
                                columnspan=columnspan,
                                rowspan=(rowBelow - topRow + 1))
                     gridHdr(
                         self.gridColHdr,
                         leftCol,
                         topRow,
                         label if label else "         ",
                         anchor="center",
                         columnspan=(rightCol - leftCol +
                                     (1 if nonAbstract else 0)),
                         rowspan=(row - topRow + 1) if leafNode else 1,
                         wraplength=width,  # screen units
                         objectId=xStructuralNode.objectId(),
                         onClick=self.onClick)
                     if nonAbstract:
                         for i, role in enumerate(self.colHdrNonStdRoles):
                             gridBorder(
                                 self.gridColHdr, thisCol,
                                 self.dataFirstRow -
                                 len(self.colHdrNonStdRoles) + i, TOPBORDER)
                             gridBorder(
                                 self.gridColHdr, thisCol,
                                 self.dataFirstRow -
                                 len(self.colHdrNonStdRoles) + i,
                                 sideBorder)
                             gridHdr(
                                 self.gridColHdr,
                                 thisCol,
                                 self.dataFirstRow -
                                 len(self.colHdrNonStdRoles) + i,
                                 xStructuralNode.header(role=role,
                                                        lang=self.lang),
                                 anchor="center",
                                 wraplength=100,  # screen units
                                 objectId=xStructuralNode.objectId(),
                                 onClick=self.onClick)
                         ''' was
                         if self.colHdrDocRow:
                             gridBorder(self.gridColHdr, thisCol, self.dataFirstRow - 1 - self.rowHdrCodeCol, TOPBORDER)
                             gridBorder(self.gridColHdr, thisCol, self.dataFirstRow - 1 - self.rowHdrCodeCol, sideBorder)
                             gridHdr(self.gridColHdr, thisCol, self.dataFirstRow - 1 - self.rowHdrCodeCol, 
                                     xStructuralNode.header(role="http://www.xbrl.org/2008/role/documentation",
                                                            lang=self.lang), 
                                     anchor="center",
                                     wraplength=100, # screen units
                                     objectId=xStructuralNode.objectId(),
                                     onClick=self.onClick)
                         if self.colHdrCodeRow:
                             gridBorder(self.gridColHdr, thisCol, self.dataFirstRow - 1, TOPBORDER)
                             gridBorder(self.gridColHdr, thisCol, self.dataFirstRow - 1, sideBorder)
                             gridHdr(self.gridColHdr, thisCol, self.dataFirstRow - 1, 
                                     xStructuralNode.header(role="http://www.eurofiling.info/role/2010/coordinate-code"),
                                     anchor="center",
                                     wraplength=100, # screen units
                                     objectId=xStructuralNode.objectId(),
                                     onClick=self.onClick)
                         '''
                         gridBorder(self.gridColHdr, thisCol,
                                    self.dataFirstRow - 1, BOTTOMBORDER)
                         xStructuralNodes.append(xStructuralNode)
                 if nonAbstract:
                     rightCol += 1
                 if renderNow and not childrenFirst:
                     self.xAxis(leftCol + (1 if nonAbstract else 0),
                                topRow + 1, rowBelow, xStructuralNode,
                                xStructuralNodes, childrenFirst, True,
                                False)  # render on this pass
                 leftCol = rightCol
         if atTop and sideBorder and not childrenFirst:
             gridBorder(self.gridColHdr,
                        rightCol - 1,
                        1,
                        RIGHTBORDER,
                        rowspan=self.dataFirstRow)
         return (rightCol, parentRow, widthToSpanParent, noDescendants)
    def zAxis(self, row, zStructuralNode, zAspects, clearZchoices):
        if zStructuralNode is not None:
            gridBorder(self.gridColHdr,
                       self.dataFirstCol,
                       row,
                       TOPBORDER,
                       columnspan=2)
            gridBorder(self.gridColHdr, self.dataFirstCol, row, LEFTBORDER)
            gridBorder(self.gridColHdr,
                       self.dataFirstCol,
                       row,
                       RIGHTBORDER,
                       columnspan=2)
            label = zStructuralNode.header(lang=self.lang)
            hdr = gridHdr(
                self.gridColHdr,
                self.dataFirstCol,
                row,
                label,
                anchor="w",
                columnspan=2,
                wraplength=200,  # in screen units
                objectId=zStructuralNode.objectId(),
                onClick=self.onClick)

            if zStructuralNode.choiceStructuralNodes:  # combo box
                valueHeaders = [
                    ''.ljust(zChoiceStructuralNode.indent * 4)
                    +  # indent if nested choices 
                    (zChoiceStructuralNode.header(lang=self.lang) or '')
                    for zChoiceStructuralNode in
                    zStructuralNode.choiceStructuralNodes
                ]
                combobox = gridCombobox(
                    self.gridColHdr,
                    self.dataFirstCol + 2,
                    row,
                    values=valueHeaders,
                    selectindex=zStructuralNode.choiceNodeIndex,
                    columnspan=2,
                    comboboxselected=self.onComboBoxSelected)
                combobox.zStructuralNode = zStructuralNode
                combobox.zChoiceOrdIndex = row - 1
                combobox.objectId = hdr.objectId = zStructuralNode.objectId()
                gridBorder(self.gridColHdr, self.dataFirstCol + 3, row,
                           RIGHTBORDER)

            if zStructuralNode.childStructuralNodes:
                for zStructuralNode in zStructuralNode.childStructuralNodes:
                    self.zAxis(row + 1, zStructuralNode, zAspects,
                               clearZchoices)
            else:  # nested-nost element, aspects process inheritance
                for aspect in aspectModels[self.aspectModel]:
                    for ruleAspect in aspectRuleAspects.get(
                            aspect, (aspect, )):
                        if zStructuralNode.hasAspect(
                                ruleAspect
                        ):  #implies inheriting from other z axes
                            if ruleAspect == Aspect.DIMENSIONS:
                                for dim in (zStructuralNode.aspectValue(
                                        Aspect.DIMENSIONS) or emptyList):
                                    zAspects[dim].add(zStructuralNode)
                            else:
                                zAspects[ruleAspect].add(zStructuralNode)
Beispiel #12
0
 def yAxis(self, leftCol, row, yAxisParentObj, childrenFirst, renderNow, atLeft):
     nestedBottomRow = row
     if atLeft:
         gridBorder(self.gridRowHdr, self.rowHdrCols + self.rowHdrDocCol + self.rowHdrCodeCol, 
                    self.dataFirstRow, 
                    RIGHTBORDER, 
                    rowspan=self.dataRows)
         gridBorder(self.gridRowHdr, 1, self.dataFirstRow + self.dataRows - 1, 
                    BOTTOMBORDER, 
                    columnspan=(self.rowHdrCols + self.rowHdrDocCol + self.rowHdrCodeCol))
     for axisMbrRel in self.axisMbrRelSet.fromModelObject(yAxisParentObj):
         yAxisHdrObj = axisMbrRel.toModelObject
         nestRow, nextRow = self.yAxis(leftCol + 1, row, yAxisHdrObj,  # nested items before totals
                                 childrenFirst, childrenFirst, False)
         
         isNonAbstract = yAxisHdrObj.abstract == "false"
         isAbstract = not isNonAbstract
         label = yAxisHdrObj.genLabel(lang=self.lang)
         topRow = row
         if childrenFirst and isNonAbstract:
             row = nextRow
         if renderNow:
             columnspan = self.rowHdrCols - leftCol + 1 if isNonAbstract or nextRow == row else None
             gridBorder(self.gridRowHdr, leftCol, topRow, LEFTBORDER, 
                        rowspan=(nestRow - topRow + 1) )
             gridBorder(self.gridRowHdr, leftCol, topRow, TOPBORDER, 
                        columnspan=(1 if childrenFirst and nextRow > row else columnspan))
             if childrenFirst and row > topRow:
                 gridBorder(self.gridRowHdr, leftCol + 1, row, TOPBORDER, 
                            columnspan=(self.rowHdrCols - leftCol))
             gridHdr(self.gridRowHdr, leftCol, row, 
                     label if label else "         ", 
                     anchor=("w" if isNonAbstract or nestRow == row else "center"),
                     columnspan=columnspan,
                     rowspan=(nestRow - row if isAbstract else None),
                     # wraplength is in screen units
                     wraplength=(self.rowHdrColWidth[leftCol] if isAbstract else
                                 self.rowHdrWrapLength -
                                   sum(self.rowHdrColWidth[i] for i in range(leftCol))),
                     minwidth=(16 if isNonAbstract and nextRow > topRow else None),
                     objectId=yAxisHdrObj.objectId(),
                     onClick=self.onClick)
             if isNonAbstract:
                 if self.rowHdrDocCol:
                     docCol = self.dataFirstCol - 1 - self.rowHdrCodeCol
                     gridBorder(self.gridRowHdr, docCol, row, TOPBORDER)
                     gridBorder(self.gridRowHdr, docCol, row, LEFTBORDER)
                     gridHdr(self.gridRowHdr, docCol, row, 
                             yAxisHdrObj.genLabel(role="http://www.xbrl.org/2008/role/documentation",
                                                  lang=self.lang), 
                             anchor="w",
                             wraplength=100, # screen units
                             objectId=yAxisHdrObj.objectId(),
                             onClick=self.onClick)
                 if self.rowHdrCodeCol:
                     codeCol = self.dataFirstCol - 1
                     gridBorder(self.gridRowHdr, codeCol, row, TOPBORDER)
                     gridBorder(self.gridRowHdr, codeCol, row, LEFTBORDER)
                     gridHdr(self.gridRowHdr, codeCol, row, 
                             yAxisHdrObj.genLabel(role="http://www.eurofiling.info/role/2010/coordinate-code"),
                             anchor="center",
                             wraplength=40, # screen units
                             objectId=yAxisHdrObj.objectId(),
                             onClick=self.onClick)
                 # gridBorder(self.gridRowHdr, leftCol, self.dataFirstRow - 1, BOTTOMBORDER)
         if isNonAbstract:
             row += 1
         elif childrenFirst:
             row = nextRow
         if nestRow > nestedBottomRow:
             nestedBottomRow = nestRow + (not childrenFirst)
         if row > nestedBottomRow:
             nestedBottomRow = row
         #if renderNow and not childrenFirst:
         #    dummy, row = self.yAxis(leftCol + 1, row, yAxisHdrObj, childrenFirst, True, False) # render on this pass
         if not childrenFirst:
             dummy, row = self.yAxis(leftCol + 1, row, yAxisHdrObj, childrenFirst, renderNow, False) # render on this pass
     return (nestedBottomRow, row)
Beispiel #13
0
 def xAxis(self, leftCol, topRow, rowBelow, xAxisParentObj, xFilters, childrenFirst, renderNow, atTop):
     parentRow = rowBelow
     noDescendants = True
     rightCol = leftCol
     widthToSpanParent = 0
     sideBorder = not xFilters
     if atTop and sideBorder and childrenFirst:
         gridBorder(self.gridColHdr, self.dataFirstCol, 1, LEFTBORDER, rowspan=self.dataFirstRow)
     for axisMbrRel in self.axisMbrRelSet.fromModelObject(xAxisParentObj):
         noDescendants = False
         xAxisHdrObj = axisMbrRel.toModelObject
         rightCol, row, width, leafNode = self.xAxis(leftCol, topRow + 1, rowBelow, xAxisHdrObj, xFilters, # nested items before totals
                                                     childrenFirst, childrenFirst, False)
         if row - 1 < parentRow:
             parentRow = row - 1
         #if not leafNode: 
         #    rightCol -= 1
         nonAbstract = xAxisHdrObj.abstract == "false"
         if nonAbstract:
             width += 100 # width for this label, in screen units
         widthToSpanParent += width
         label = xAxisHdrObj.genLabel(lang=self.lang)
         if childrenFirst:
             thisCol = rightCol
             sideBorder = RIGHTBORDER
         else:
             thisCol = leftCol
             sideBorder = LEFTBORDER
         if renderNow:
             columnspan = (rightCol - leftCol + (1 if nonAbstract else 0))
             gridBorder(self.gridColHdr, leftCol, topRow, TOPBORDER, columnspan=columnspan)
             gridBorder(self.gridColHdr, leftCol, topRow, 
                        sideBorder, columnspan=columnspan,
                        rowspan=(rowBelow - topRow + 1) )
             gridHdr(self.gridColHdr, leftCol, topRow, 
                     label if label else "         ", 
                     anchor="center",
                     columnspan=(rightCol - leftCol + (1 if nonAbstract else 0)),
                     rowspan=(row - topRow + 1) if leafNode else 1,
                     wraplength=width, # screen units
                     objectId=xAxisHdrObj.objectId(),
                     onClick=self.onClick)
             if nonAbstract:
                 if self.colHdrDocRow:
                     gridBorder(self.gridColHdr, thisCol, self.dataFirstRow - 1 - self.rowHdrCodeCol, TOPBORDER)
                     gridBorder(self.gridColHdr, thisCol, self.dataFirstRow - 1 - self.rowHdrCodeCol, sideBorder)
                     gridHdr(self.gridColHdr, thisCol, self.dataFirstRow - 1 - self.rowHdrCodeCol, 
                             xAxisHdrObj.genLabel(role="http://www.xbrl.org/2008/role/documentation",
                                                    lang=self.lang), 
                             anchor="center",
                             wraplength=100, # screen units
                             objectId=xAxisHdrObj.objectId(),
                             onClick=self.onClick)
                 if self.colHdrCodeRow:
                     gridBorder(self.gridColHdr, thisCol, self.dataFirstRow - 1, TOPBORDER)
                     gridBorder(self.gridColHdr, thisCol, self.dataFirstRow - 1, sideBorder)
                     gridHdr(self.gridColHdr, thisCol, self.dataFirstRow - 1, 
                             xAxisHdrObj.genLabel(role="http://www.eurofiling.info/role/2010/coordinate-code"),
                             anchor="center",
                             wraplength=100, # screen units
                             objectId=xAxisHdrObj.objectId(),
                             onClick=self.onClick)
                 gridBorder(self.gridColHdr, thisCol, self.dataFirstRow - 1, BOTTOMBORDER)
                 xFilters.append((inheritedPrimaryItemQname(self, xAxisHdrObj),
                                  inheritedExplicitDims(self, xAxisHdrObj)))
         if nonAbstract:
             rightCol += 1
         if renderNow and not childrenFirst:
             self.xAxis(leftCol + (1 if nonAbstract else 0), topRow + 1, rowBelow, xAxisHdrObj, xFilters, childrenFirst, True, False) # render on this pass
         leftCol = rightCol
     if atTop and sideBorder and not childrenFirst:
         gridBorder(self.gridColHdr, rightCol - 1, 1, RIGHTBORDER, rowspan=self.dataFirstRow)
     return (rightCol, parentRow, widthToSpanParent, noDescendants)
Beispiel #14
0
    def yAxis(self, leftCol, row, yAxisParentObj, childrenFirst, renderNow,
              atLeft):
        nestedBottomRow = row
        if atLeft:
            gridBorder(self.gridRowHdr,
                       self.rowHdrCols + self.rowHdrDocCol +
                       self.rowHdrCodeCol,
                       self.dataFirstRow,
                       RIGHTBORDER,
                       rowspan=self.dataRows)
            gridBorder(self.gridRowHdr,
                       1,
                       self.dataFirstRow + self.dataRows - 1,
                       BOTTOMBORDER,
                       columnspan=(self.rowHdrCols + self.rowHdrDocCol +
                                   self.rowHdrCodeCol))
        for axisMbrRel in self.axisMbrRelSet.fromModelObject(yAxisParentObj):
            yAxisHdrObj = axisMbrRel.toModelObject
            nestRow, nextRow = self.yAxis(
                leftCol + 1,
                row,
                yAxisHdrObj,  # nested items before totals
                childrenFirst,
                childrenFirst,
                False)

            isNonAbstract = yAxisHdrObj.abstract == "false"
            isAbstract = not isNonAbstract
            label = yAxisHdrObj.genLabel(lang=self.lang)
            topRow = row
            if childrenFirst and isNonAbstract:
                row = nextRow
            if renderNow:
                columnspan = self.rowHdrCols - leftCol + 1 if isNonAbstract or nextRow == row else None
                gridBorder(self.gridRowHdr,
                           leftCol,
                           topRow,
                           LEFTBORDER,
                           rowspan=(nestRow - topRow + 1))
                gridBorder(self.gridRowHdr,
                           leftCol,
                           topRow,
                           TOPBORDER,
                           columnspan=(1 if childrenFirst and nextRow > row
                                       else columnspan))
                if childrenFirst and row > topRow:
                    gridBorder(self.gridRowHdr,
                               leftCol + 1,
                               row,
                               TOPBORDER,
                               columnspan=(self.rowHdrCols - leftCol))
                gridHdr(
                    self.gridRowHdr,
                    leftCol,
                    row,
                    label if label else "         ",
                    anchor=("w"
                            if isNonAbstract or nestRow == row else "center"),
                    columnspan=columnspan,
                    rowspan=(nestRow - row if isAbstract else None),
                    # wraplength is in screen units
                    wraplength=(self.rowHdrColWidth[leftCol]
                                if isAbstract else self.rowHdrWrapLength -
                                sum(self.rowHdrColWidth[i]
                                    for i in range(leftCol))),
                    minwidth=(16
                              if isNonAbstract and nextRow > topRow else None),
                    objectId=yAxisHdrObj.objectId(),
                    onClick=self.onClick)
                if isNonAbstract:
                    if self.rowHdrDocCol:
                        docCol = self.dataFirstCol - 1 - self.rowHdrCodeCol
                        gridBorder(self.gridRowHdr, docCol, row, TOPBORDER)
                        gridBorder(self.gridRowHdr, docCol, row, LEFTBORDER)
                        gridHdr(
                            self.gridRowHdr,
                            docCol,
                            row,
                            yAxisHdrObj.genLabel(
                                role=
                                "http://www.xbrl.org/2008/role/documentation",
                                lang=self.lang),
                            anchor="w",
                            wraplength=100,  # screen units
                            objectId=yAxisHdrObj.objectId(),
                            onClick=self.onClick)
                    if self.rowHdrCodeCol:
                        codeCol = self.dataFirstCol - 1
                        gridBorder(self.gridRowHdr, codeCol, row, TOPBORDER)
                        gridBorder(self.gridRowHdr, codeCol, row, LEFTBORDER)
                        gridHdr(
                            self.gridRowHdr,
                            codeCol,
                            row,
                            yAxisHdrObj.genLabel(
                                role=
                                "http://www.eurofiling.info/role/2010/coordinate-code"
                            ),
                            anchor="center",
                            wraplength=40,  # screen units
                            objectId=yAxisHdrObj.objectId(),
                            onClick=self.onClick)
                    # gridBorder(self.gridRowHdr, leftCol, self.dataFirstRow - 1, BOTTOMBORDER)
            if isNonAbstract:
                row += 1
            elif childrenFirst:
                row = nextRow
            if nestRow > nestedBottomRow:
                nestedBottomRow = nestRow + (not childrenFirst)
            if row > nestedBottomRow:
                nestedBottomRow = row
            #if renderNow and not childrenFirst:
            #    dummy, row = self.yAxis(leftCol + 1, row, yAxisHdrObj, childrenFirst, True, False) # render on this pass
            if not childrenFirst:
                dummy, row = self.yAxis(leftCol + 1, row, yAxisHdrObj,
                                        childrenFirst, renderNow,
                                        False)  # render on this pass
        return (nestedBottomRow, row)
Beispiel #15
0
    def zAxis(self, row, zAxisObj, zFilters):
        priorZfilter = len(zFilters)

        for axisMbrRel in self.axisMbrRelSet.fromModelObject(zAxisObj):
            zAxisObj = axisMbrRel.toModelObject
            zFilters.append(
                (inheritedPrimaryItemQname(self, zAxisObj),
                 inheritedExplicitDims(self, zAxisObj),
                 zAxisObj.genLabel(lang=self.lang), zAxisObj.objectId()))
            self.zAxis(None, zAxisObj, zFilters)

        if row is not None:
            nextZfilter = len(zFilters)
            gridBorder(self.gridColHdr,
                       self.dataFirstCol,
                       row,
                       TOPBORDER,
                       columnspan=2)
            gridBorder(self.gridColHdr, self.dataFirstCol, row, LEFTBORDER)
            gridBorder(self.gridColHdr,
                       self.dataFirstCol,
                       row,
                       RIGHTBORDER,
                       columnspan=2)
            if nextZfilter > priorZfilter + 1:  # combo box, use header on zAxis
                label = axisMbrRel.fromModelObject.genLabel(lang=self.lang)
            else:  # no combo box, use label on coord
                label = zAxisObj.genLabel(lang=self.lang)
            hdr = gridHdr(
                self.gridColHdr,
                self.dataFirstCol,
                row,
                label,
                anchor="w",
                columnspan=2,
                wraplength=200,  # in screen units
                objectId=zAxisObj.objectId(),
                onClick=self.onClick)
            if nextZfilter > priorZfilter + 1:  # multiple choices, use combo box
                zIndex = row - 1
                selectIndex = self.zComboBoxIndex[zIndex]
                combobox = gridCombobox(
                    self.gridColHdr,
                    self.dataFirstCol + 2,
                    row,
                    values=[
                        zFilter[2]
                        for zFilter in zFilters[priorZfilter:nextZfilter]
                    ],
                    selectindex=selectIndex,
                    columnspan=2,
                    comboboxselected=self.comboBoxSelected)
                combobox.zIndex = zIndex
                zFilterIndex = priorZfilter + selectIndex
                self.zFilterIndex[zIndex] = zFilterIndex
                combobox.objectId = hdr.objectId = zFilters[zFilterIndex][3]
                gridBorder(self.gridColHdr, self.dataFirstCol + 3, row,
                           RIGHTBORDER)
                row += 1

        if not zFilters:
            zFilters.append((None, set()))  # allow empty set operations
Beispiel #16
0
 def xAxis(self, leftCol, topRow, rowBelow, xParentStructuralNode, xStructuralNodes, childrenFirst, renderNow, atTop):
     if xParentStructuralNode is not None:
         parentRow = rowBelow
         noDescendants = True
         rightCol = leftCol
         widthToSpanParent = 0
         sideBorder = not xStructuralNodes
         if atTop and sideBorder and childrenFirst:
             gridBorder(self.gridColHdr, self.dataFirstCol, 1, LEFTBORDER, rowspan=self.dataFirstRow)
         for xStructuralNode in xParentStructuralNode.childStructuralNodes:
             if not xStructuralNode.isRollUp:
                 noDescendants = False
                 rightCol, row, width, leafNode = self.xAxis(leftCol, topRow + 1, rowBelow, xStructuralNode, xStructuralNodes, # nested items before totals
                                                             childrenFirst, childrenFirst, False)
                 if row - 1 < parentRow:
                     parentRow = row - 1
                 #if not leafNode: 
                 #    rightCol -= 1
                 nonAbstract = not xStructuralNode.isAbstract
                 if nonAbstract:
                     width += 100 # width for this label, in screen units
                 widthToSpanParent += width
                 label = xStructuralNode.header(lang=self.lang,
                                                returnGenLabel=isinstance(xStructuralNode.definitionNode, (ModelClosedDefinitionNode, ModelEuAxisCoord)))
                 if childrenFirst:
                     thisCol = rightCol
                     sideBorder = RIGHTBORDER
                 else:
                     thisCol = leftCol
                     sideBorder = LEFTBORDER
                 if renderNow:
                     columnspan = (rightCol - leftCol + (1 if nonAbstract else 0))
                     gridBorder(self.gridColHdr, leftCol, topRow, TOPBORDER, columnspan=columnspan)
                     gridBorder(self.gridColHdr, leftCol, topRow, 
                                sideBorder, columnspan=columnspan,
                                rowspan=(rowBelow - topRow + 1) )
                     gridHdr(self.gridColHdr, leftCol, topRow, 
                             label if label else "         ", 
                             anchor="center",
                             columnspan=(rightCol - leftCol + (1 if nonAbstract else 0)),
                             rowspan=(row - topRow + 1) if leafNode else 1,
                             wraplength=width, # screen units
                             objectId=xStructuralNode.objectId(),
                             onClick=self.onClick)
                     if nonAbstract:
                         for i, role in enumerate(self.colHdrNonStdRoles):
                             gridBorder(self.gridColHdr, thisCol, self.dataFirstRow - len(self.colHdrNonStdRoles) + i, TOPBORDER)
                             gridBorder(self.gridColHdr, thisCol, self.dataFirstRow - len(self.colHdrNonStdRoles) + i, sideBorder)
                             gridHdr(self.gridColHdr, thisCol, self.dataFirstRow - len(self.colHdrNonStdRoles) + i, 
                                     xStructuralNode.header(role=role, lang=self.lang), 
                                     anchor="center",
                                     wraplength=100, # screen units
                                     objectId=xStructuralNode.objectId(),
                                     onClick=self.onClick)
                         ''' was
                         if self.colHdrDocRow:
                             gridBorder(self.gridColHdr, thisCol, self.dataFirstRow - 1 - self.rowHdrCodeCol, TOPBORDER)
                             gridBorder(self.gridColHdr, thisCol, self.dataFirstRow - 1 - self.rowHdrCodeCol, sideBorder)
                             gridHdr(self.gridColHdr, thisCol, self.dataFirstRow - 1 - self.rowHdrCodeCol, 
                                     xStructuralNode.header(role="http://www.xbrl.org/2008/role/documentation",
                                                            lang=self.lang), 
                                     anchor="center",
                                     wraplength=100, # screen units
                                     objectId=xStructuralNode.objectId(),
                                     onClick=self.onClick)
                         if self.colHdrCodeRow:
                             gridBorder(self.gridColHdr, thisCol, self.dataFirstRow - 1, TOPBORDER)
                             gridBorder(self.gridColHdr, thisCol, self.dataFirstRow - 1, sideBorder)
                             gridHdr(self.gridColHdr, thisCol, self.dataFirstRow - 1, 
                                     xStructuralNode.header(role="http://www.eurofiling.info/role/2010/coordinate-code"),
                                     anchor="center",
                                     wraplength=100, # screen units
                                     objectId=xStructuralNode.objectId(),
                                     onClick=self.onClick)
                         '''
                         gridBorder(self.gridColHdr, thisCol, self.dataFirstRow - 1, BOTTOMBORDER)
                         xStructuralNodes.append(xStructuralNode)
                 if nonAbstract:
                     rightCol += 1
                 if renderNow and not childrenFirst:
                     self.xAxis(leftCol + (1 if nonAbstract else 0), topRow + 1, rowBelow, xStructuralNode, xStructuralNodes, childrenFirst, True, False) # render on this pass
                 leftCol = rightCol
         if atTop and sideBorder and not childrenFirst:
             gridBorder(self.gridColHdr, rightCol - 1, 1, RIGHTBORDER, rowspan=self.dataFirstRow)
         return (rightCol, parentRow, widthToSpanParent, noDescendants)
Beispiel #17
0
 def yAxis(self, row, indent, yAxisParentObj, atLeft, childrenFirst):
     col = 0
     isEntirelyAbstract = True
     for axisMbrRel in self.axisMbrRelSet.fromModelObject(yAxisParentObj):
         yAxisHdrObj = axisMbrRel.toModelObject
         if yAxisHdrObj.abstract == "false":
             isEntirelyAbstract= False
             break
     for axisMbrRel in self.axisMbrRelSet.fromModelObject(yAxisParentObj):
         yAxisHdrObj = axisMbrRel.toModelObject
         if childrenFirst:
             row = self.yAxis(row, 
                              indent + (0 if isEntirelyAbstract else 20), 
                              yAxisHdrObj, atLeft and col == 0, 
                              childrenFirst)
         if yAxisHdrObj.abstract == "false":
             gridBorder(self.gridRowHdr, 1, row, TOPBORDER)
             gridBorder(self.gridRowHdr, 1, row, LEFTBORDER)
             gridHdr(self.gridRowHdr, 1, row, 
                     yAxisHdrObj.genLabel(lang=self.lang), 
                     anchor="w",
                     padding=(indent,0,0,0) if indent is not None else None,
                     wraplength=200,
                     objectId=yAxisHdrObj.objectId(),
                     onClick=self.onClick)
             col = 2
             if self.rowHdrDocRow:
                 gridBorder(self.gridRowHdr, col, row, TOPBORDER)
                 gridBorder(self.gridRowHdr, col, row, LEFTBORDER)
                 gridHdr(self.gridRowHdr, col, row, 
                         yAxisHdrObj.genLabel(role="http://www.xbrl.org/2008/role/documentation",
                                                lang=self.lang), 
                         anchor="w",
                         wraplength=100,
                         objectId=yAxisHdrObj.objectId(),
                         onClick=self.onClick)
                 col += 1
             if self.rowHdrCodeRow:
                 gridBorder(self.gridRowHdr, col, row, TOPBORDER)
                 gridBorder(self.gridRowHdr, col, row, LEFTBORDER)
                 gridHdr(self.gridRowHdr, col, row, 
                         yAxisHdrObj.genLabel(role="http://www.eurofiling.info/role/2010/coordinate-code"),
                         anchor="w",
                         wraplength=40,
                         objectId=yAxisHdrObj.objectId(),
                         onClick=self.onClick)
                 col += 1
             gridBorder(self.gridRowHdr, col - 1, row, RIGHTBORDER)
             row += 1
         if not childrenFirst:
             row = self.yAxis(row, 
                              indent + (0 if isEntirelyAbstract else 20), 
                              yAxisHdrObj, atLeft and col == 0, 
                              childrenFirst)
     if atLeft and col > 0:
         gridBorder(self.gridRowHdr, 1, row, BOTTOMBORDER, columnspan=col)
     return row
Beispiel #18
0
 def xAxis(self, leftCol, topRow, rowBelow, xAxisParentObj, xFilters, childrenFirst, renderNow, atTop):
     parentRow = rowBelow
     noDescendants = True
     rightCol = leftCol
     widthToSpanParent = 0
     sideBorder = not xFilters
     if atTop and sideBorder and childrenFirst:
         gridBorder(self.gridColHdr, self.dataFirstCol, 1, LEFTBORDER, rowspan=self.dataFirstRow)
     for axisMbrRel in self.axisMbrRelSet.fromModelObject(xAxisParentObj):
         noDescendants = False
         xAxisHdrObj = axisMbrRel.toModelObject
         rightCol, row, width, leafNode = self.xAxis(leftCol, topRow + 1, rowBelow, xAxisHdrObj, xFilters, # nested items before totals
                                                     childrenFirst, childrenFirst, False)
         if row - 1 < parentRow:
             parentRow = row - 1
         #if not leafNode: 
         #    rightCol -= 1
         nonAbstract = xAxisHdrObj.abstract == "false"
         if nonAbstract:
             width += 100 # width for this label
         widthToSpanParent += width
         label = xAxisHdrObj.genLabel(lang=self.lang)
         if childrenFirst:
             thisCol = rightCol
             sideBorder = RIGHTBORDER
         else:
             thisCol = leftCol
             sideBorder = LEFTBORDER
         if renderNow:
             columnspan = (rightCol - leftCol + (1 if nonAbstract else 0))
             gridBorder(self.gridColHdr, leftCol, topRow, TOPBORDER, columnspan=columnspan)
             gridBorder(self.gridColHdr, leftCol, topRow, 
                        sideBorder, columnspan=columnspan,
                        rowspan=(rowBelow - topRow + 1) )
             gridHdr(self.gridColHdr, leftCol, topRow, 
                     label if label else "         ", 
                     anchor="center",
                     columnspan=(rightCol - leftCol + (1 if nonAbstract else 0)),
                     rowspan=(row - topRow + 1) if leafNode else 1,
                     wraplength=width,
                     objectId=xAxisHdrObj.objectId(),
                     onClick=self.onClick)
             if nonAbstract:
                 if self.colHdrDocRow:
                     gridBorder(self.gridColHdr, thisCol, self.dataFirstRow - 1 - self.rowHdrCodeRow, TOPBORDER)
                     gridBorder(self.gridColHdr, thisCol, self.dataFirstRow - 1 - self.rowHdrCodeRow, sideBorder)
                     gridHdr(self.gridColHdr, thisCol, self.dataFirstRow - 1 - self.rowHdrCodeRow, 
                             xAxisHdrObj.genLabel(role="http://www.xbrl.org/2008/role/documentation",
                                                    lang=self.lang), 
                             anchor="center",
                             wraplength=100,
                             objectId=xAxisHdrObj.objectId(),
                             onClick=self.onClick)
                 if self.colHdrCodeRow:
                     gridBorder(self.gridColHdr, thisCol, self.dataFirstRow - 1, TOPBORDER)
                     gridBorder(self.gridColHdr, thisCol, self.dataFirstRow - 1, sideBorder)
                     gridHdr(self.gridColHdr, thisCol, self.dataFirstRow - 1, 
                             xAxisHdrObj.genLabel(role="http://www.eurofiling.info/role/2010/coordinate-code"),
                             anchor="w",
                             wraplength=100,
                             objectId=xAxisHdrObj.objectId(),
                             onClick=self.onClick)
                 gridBorder(self.gridColHdr, thisCol, self.dataFirstRow - 1, BOTTOMBORDER)
                 xFilters.append((self.inheritedPrimaryItemQname(xAxisHdrObj),
                                  self.inheritedExplicitDims(xAxisHdrObj)))
         if nonAbstract:
             rightCol += 1
         if renderNow and not childrenFirst:
             self.xAxis(leftCol + (1 if nonAbstract else 0), topRow + 1, rowBelow, xAxisHdrObj, xFilters, childrenFirst, True, False) # render on this pass
         leftCol = rightCol
     if atTop and sideBorder and not childrenFirst:
         gridBorder(self.gridColHdr, rightCol - 1, 1, RIGHTBORDER, rowspan=self.dataFirstRow)
     return (rightCol, parentRow, widthToSpanParent, noDescendants)
Beispiel #19
0
 def yAxis(self, row, indent, yAxisParentObj, atLeft, childrenFirst):
     col = 0
     isEntirelyAbstract = True
     for axisMbrRel in self.axisMbrRelSet.fromModelObject(yAxisParentObj):
         yAxisHdrObj = axisMbrRel.toModelObject
         if yAxisHdrObj.abstract == "false":
             isEntirelyAbstract = False
             break
     for axisMbrRel in self.axisMbrRelSet.fromModelObject(yAxisParentObj):
         yAxisHdrObj = axisMbrRel.toModelObject
         if childrenFirst:
             row = self.yAxis(
                 row, indent + (0 if isEntirelyAbstract else 20), yAxisHdrObj, atLeft and col == 0, childrenFirst
             )
         if yAxisHdrObj.abstract == "false":
             gridBorder(self.gridRowHdr, 1, row, TOPBORDER)
             gridBorder(self.gridRowHdr, 1, row, LEFTBORDER)
             gridHdr(
                 self.gridRowHdr,
                 1,
                 row,
                 yAxisHdrObj.genLabel(lang=self.lang),
                 anchor="w",
                 padding=(indent, 0, 0, 0) if indent is not None else None,
                 wraplength=200,
                 objectId=yAxisHdrObj.objectId(),
                 onClick=self.onClick,
             )
             col = 2
             if self.rowHdrDocRow:
                 gridBorder(self.gridRowHdr, col, row, TOPBORDER)
                 gridBorder(self.gridRowHdr, col, row, LEFTBORDER)
                 gridHdr(
                     self.gridRowHdr,
                     col,
                     row,
                     yAxisHdrObj.genLabel(role="http://www.xbrl.org/2008/role/documentation", lang=self.lang),
                     anchor="w",
                     wraplength=100,
                     objectId=yAxisHdrObj.objectId(),
                     onClick=self.onClick,
                 )
                 col += 1
             if self.rowHdrCodeRow:
                 gridBorder(self.gridRowHdr, col, row, TOPBORDER)
                 gridBorder(self.gridRowHdr, col, row, LEFTBORDER)
                 gridHdr(
                     self.gridRowHdr,
                     col,
                     row,
                     yAxisHdrObj.genLabel(role="http://www.eurofiling.info/role/2010/coordinate-code"),
                     anchor="w",
                     wraplength=40,
                     objectId=yAxisHdrObj.objectId(),
                     onClick=self.onClick,
                 )
                 col += 1
             gridBorder(self.gridRowHdr, col - 1, row, RIGHTBORDER)
             row += 1
         if not childrenFirst:
             row = self.yAxis(
                 row, indent + (0 if isEntirelyAbstract else 20), yAxisHdrObj, atLeft and col == 0, childrenFirst
             )
     if atLeft and col > 0:
         gridBorder(self.gridRowHdr, 1, row, BOTTOMBORDER, columnspan=col)
     return row
Beispiel #20
0
 def yAxis(self, leftCol, row, yParentStructuralNode, childrenFirst, renderNow, atLeft):
     if yParentStructuralNode is not None:
         nestedBottomRow = row
         if atLeft:
             gridBorder(self.gridRowHdr, self.rowHdrCols + len(self.rowHdrNonStdRoles), # was: self.rowHdrDocCol + self.rowHdrCodeCol, 
                        self.dataFirstRow, 
                        RIGHTBORDER, 
                        rowspan=self.dataRows)
             gridBorder(self.gridRowHdr, 1, self.dataFirstRow + self.dataRows - 1, 
                        BOTTOMBORDER, 
                        columnspan=(self.rowHdrCols + len(self.rowHdrNonStdRoles))) # was: self.rowHdrDocCol + self.rowHdrCodeCol))
         for yStructuralNode in yParentStructuralNode.childStructuralNodes:
             if not yStructuralNode.isRollUp:
                 nestRow, nextRow = self.yAxis(leftCol + 1, row, yStructuralNode,  # nested items before totals
                                         childrenFirst, childrenFirst, False)
                 
                 isAbstract = (yStructuralNode.isAbstract or 
                               (yStructuralNode.childStructuralNodes and
                                not isinstance(yStructuralNode.definitionNode, (ModelClosedDefinitionNode, ModelEuAxisCoord))))
                 isNonAbstract = not isAbstract
                 label = yStructuralNode.header(lang=self.lang,
                                                returnGenLabel=isinstance(yStructuralNode.definitionNode, (ModelClosedDefinitionNode, ModelEuAxisCoord)))
                 topRow = row
                 if childrenFirst and isNonAbstract:
                     row = nextRow
                 if renderNow:
                     columnspan = self.rowHdrCols - leftCol + 1 if isNonAbstract or nextRow == row else None
                     gridBorder(self.gridRowHdr, leftCol, topRow, LEFTBORDER, 
                                rowspan=(nestRow - topRow + 1) )
                     gridBorder(self.gridRowHdr, leftCol, topRow, TOPBORDER, 
                                columnspan=(1 if childrenFirst and nextRow > row else columnspan))
                     if childrenFirst and row > topRow:
                         gridBorder(self.gridRowHdr, leftCol + 1, row, TOPBORDER, 
                                    columnspan=(self.rowHdrCols - leftCol))
                     depth = yStructuralNode.depth
                     gridHdr(self.gridRowHdr, leftCol, row, 
                             label if label is not None else "         ", 
                             anchor=("w" if isNonAbstract or nestRow == row else "center"),
                             columnspan=columnspan,
                             rowspan=(nestRow - row if isAbstract else None),
                             # wraplength is in screen units
                             wraplength=(self.rowHdrColWidth[depth] if isAbstract else
                                         self.rowHdrWrapLength - sum(self.rowHdrColWidth[0:depth])),
                             #minwidth=self.rowHdrColWidth[leftCol],
                             minwidth=(16 if isNonAbstract and nextRow > topRow else None),
                             objectId=yStructuralNode.objectId(),
                             onClick=self.onClick)
                     if isNonAbstract:
                         for i, role in enumerate(self.rowHdrNonStdRoles):
                             isCode = "code" in role
                             docCol = self.dataFirstCol - len(self.rowHdrNonStdRoles) + i
                             gridBorder(self.gridRowHdr, docCol, row, TOPBORDER)
                             gridBorder(self.gridRowHdr, docCol, row, LEFTBORDER)
                             gridHdr(self.gridRowHdr, docCol, row, 
                                     yStructuralNode.header(role=role, lang=self.lang), 
                                     anchor="c" if isCode else "w",
                                     wraplength=40 if isCode else 100, # screen units
                                     objectId=yStructuralNode.objectId(),
                                     onClick=self.onClick)
                         ''' was:
                         if self.rowHdrDocCol:
                             docCol = self.dataFirstCol - 1 - self.rowHdrCodeCol
                             gridBorder(self.gridRowHdr, docCol, row, TOPBORDER)
                             gridBorder(self.gridRowHdr, docCol, row, LEFTBORDER)
                             gridHdr(self.gridRowHdr, docCol, row, 
                                     yStructuralNode.header(role="http://www.xbrl.org/2008/role/documentation",
                                                          lang=self.lang), 
                                     anchor="w",
                                     wraplength=100, # screen units
                                     objectId=yStructuralNode.objectId(),
                                     onClick=self.onClick)
                         if self.rowHdrCodeCol:
                             codeCol = self.dataFirstCol - 1
                             gridBorder(self.gridRowHdr, codeCol, row, TOPBORDER)
                             gridBorder(self.gridRowHdr, codeCol, row, LEFTBORDER)
                             gridHdr(self.gridRowHdr, codeCol, row, 
                                     yStructuralNode.header(role="http://www.eurofiling.info/role/2010/coordinate-code"),
                                     anchor="center",
                                     wraplength=40, # screen units
                                     objectId=yStructuralNode.objectId(),
                                     onClick=self.onClick)
                         # gridBorder(self.gridRowHdr, leftCol, self.dataFirstRow - 1, BOTTOMBORDER)
                         '''
                 if isNonAbstract:
                     row += 1
                 elif childrenFirst:
                     row = nextRow
                 if nestRow > nestedBottomRow:
                     nestedBottomRow = nestRow + (isNonAbstract and not childrenFirst)
                 if row > nestedBottomRow:
                     nestedBottomRow = row
                 #if renderNow and not childrenFirst:
                 #    dummy, row = self.yAxis(leftCol + 1, row, yStructuralNode, childrenFirst, True, False) # render on this pass
                 if not childrenFirst:
                     dummy, row = self.yAxis(leftCol + 1, row, yStructuralNode, childrenFirst, renderNow, False) # render on this pass
         return (nestedBottomRow, row)
Beispiel #21
0
 def xAxis(self, leftCol, topRow, rowBelow, xParentOrdCntx, xOrdCntxs, childrenFirst, renderNow, atTop):
     parentRow = rowBelow
     noDescendants = True
     rightCol = leftCol
     widthToSpanParent = 0
     sideBorder = not xOrdCntxs
     if atTop and sideBorder and childrenFirst:
         gridBorder(self.gridColHdr, self.dataFirstCol, 1, LEFTBORDER, rowspan=self.dataFirstRow)
     for xOrdCntx in xParentOrdCntx.subOrdinateContexts:
         noDescendants = False
         rightCol, row, width, leafNode = self.xAxis(leftCol, topRow + 1, rowBelow, xOrdCntx, xOrdCntxs, # nested items before totals
                                                     childrenFirst, childrenFirst, False)
         if row - 1 < parentRow:
             parentRow = row - 1
         #if not leafNode: 
         #    rightCol -= 1
         nonAbstract = not xOrdCntx.isAbstract
         if nonAbstract:
             width += 100 # width for this label, in screen units
         widthToSpanParent += width
         label = xOrdCntx.header(lang=self.lang)
         if childrenFirst:
             thisCol = rightCol
             sideBorder = RIGHTBORDER
         else:
             thisCol = leftCol
             sideBorder = LEFTBORDER
         if renderNow:
             columnspan = (rightCol - leftCol + (1 if nonAbstract else 0))
             gridBorder(self.gridColHdr, leftCol, topRow, TOPBORDER, columnspan=columnspan)
             gridBorder(self.gridColHdr, leftCol, topRow, 
                        sideBorder, columnspan=columnspan,
                        rowspan=(rowBelow - topRow + 1) )
             gridHdr(self.gridColHdr, leftCol, topRow, 
                     label if label else "         ", 
                     anchor="center",
                     columnspan=(rightCol - leftCol + (1 if nonAbstract else 0)),
                     rowspan=(row - topRow + 1) if leafNode else 1,
                     wraplength=width, # screen units
                     objectId=xOrdCntx.objectId(),
                     onClick=self.onClick)
             if nonAbstract:
                 if self.colHdrDocRow:
                     gridBorder(self.gridColHdr, thisCol, self.dataFirstRow - 1 - self.rowHdrCodeCol, TOPBORDER)
                     gridBorder(self.gridColHdr, thisCol, self.dataFirstRow - 1 - self.rowHdrCodeCol, sideBorder)
                     gridHdr(self.gridColHdr, thisCol, self.dataFirstRow - 1 - self.rowHdrCodeCol, 
                             xOrdCntx.header(role="http://www.xbrl.org/2008/role/documentation",
                                                    lang=self.lang), 
                             anchor="center",
                             wraplength=100, # screen units
                             objectId=xOrdCntx.objectId(),
                             onClick=self.onClick)
                 if self.colHdrCodeRow:
                     gridBorder(self.gridColHdr, thisCol, self.dataFirstRow - 1, TOPBORDER)
                     gridBorder(self.gridColHdr, thisCol, self.dataFirstRow - 1, sideBorder)
                     gridHdr(self.gridColHdr, thisCol, self.dataFirstRow - 1, 
                             xOrdCntx.header(role="http://www.eurofiling.info/role/2010/coordinate-code"),
                             anchor="center",
                             wraplength=100, # screen units
                             objectId=xOrdCntx.objectId(),
                             onClick=self.onClick)
                 gridBorder(self.gridColHdr, thisCol, self.dataFirstRow - 1, BOTTOMBORDER)
                 xOrdCntxs.append(xOrdCntx)
         if nonAbstract:
             rightCol += 1
         if renderNow and not childrenFirst:
             self.xAxis(leftCol + (1 if nonAbstract else 0), topRow + 1, rowBelow, xOrdCntx, xOrdCntxs, childrenFirst, True, False) # render on this pass
         leftCol = rightCol
     if atTop and sideBorder and not childrenFirst:
         gridBorder(self.gridColHdr, rightCol - 1, 1, RIGHTBORDER, rowspan=self.dataFirstRow)
     return (rightCol, parentRow, widthToSpanParent, noDescendants)