예제 #1
0
 def _newAppStyleSheetFormation(self):
   '''
   Return a new formation that covers all DocumentElement types.
   
   This also defines what can appear in an editing dialog.
   (Although an editing dialog can prune this.)
   
   Configures what Formations the app supports.
   An app need not support all the Formations the framework does.
   EG an app need not support opacity even though the framework does.
   
   Default values of Formations defined by the Framework.
   The app does not necessarily need to define defaults if the framework does.
   If the framework defaults change with new versions, the app defaults will also.
   
   Must create a new formation, since caller may edit it.
   '''
   formation = Formation( name='Application Style Sheet', selector = newAllSelector() )
   
   '''
   Configure instrumentFormations.  
   Less selective.  If user edits, affects many DEType formations.
   Optional: if not defined, the app does not allow user to edit.
   E.G. if opacity is not here, user can not edit opacity of whole document in one place.
   '''
   for instrumentFormationClass in self._allSharedInstrumentFormationClasses():
     formation.append(instrumentFormationClass(parentSelector=newAllSelector()))
   
   '''
   Configure DEType formations.
   Not optional: each DocumentElement type that the app can draw must be represented here.
   '''
   for shapeFormationClass in self._allDocumentElementTypeFormationClasses():
     formation.append(shapeFormationClass())
   
   return formation
예제 #2
0
    def _newAppStyleSheetFormation(self):
        '''
    Return a new formation that covers all DocumentElement types.
    
    This also defines what can appear in an editing dialog.
    (Although an editing dialog can prune this.)
    
    Configures what Formations the app supports.
    An app need not support all the Formations the framework does.
    EG an app need not support opacity even though the framework does.
    
    Default values of Formations defined by the Framework.
    The app does not necessarily need to define defaults if the framework does.
    If the framework defaults change with new versions, the app defaults will also.
    
    Must create a new formation, since caller may edit it.
    '''
        formation = Formation(name='Application Style Sheet',
                              selector=newAllSelector())
        '''
    Configure instrumentFormations.  
    Less selective.  If user edits, affects many DEType formations.
    Optional: if not defined, the app does not allow user to edit.
    E.G. if opacity is not here, user can not edit opacity of whole document in one place.
    '''
        for instrumentFormationClass in self._allSharedInstrumentFormationClasses(
        ):
            formation.append(
                instrumentFormationClass(parentSelector=newAllSelector()))
        '''
    Configure DEType formations.
    Not optional: each DocumentElement type that the app can draw must be represented here.
    '''
        for shapeFormationClass in self._allDocumentElementTypeFormationClasses(
        ):
            formation.append(shapeFormationClass())

        return formation
예제 #3
0
 def __init__(self, name):
     Formation.__init__(self, name, selector=DETypeSelector(name))
예제 #4
0
 def __init__(self, name):
   Formation.__init__(self, name, selector=DETypeSelector(name))
예제 #5
0
 def __init__(self, name, parentSelector, role=""):
   Formation.__init__(self, name, selector=instrumentSelector(parentSelector, name), role=role)
예제 #6
0
 def __init__(self, name, parentSelector, role=""):
     Formation.__init__(self,
                        name,
                        selector=instrumentSelector(parentSelector, name),
                        role=role)