Package schrodinger :: Package application :: Package matsci :: Module mswidgets :: Class MultiStageArea
[hide private]
[frames] | no frames]

Class MultiStageArea

PyQt4.QtGui.QScrollArea --+
                          |
                         MultiStageArea

A scrollable frame meant to hold multiple stages. See the MatSci Desmond Multistage Simulation Workflow as one example.

Instance Methods [hide private]
 
__init__(self, layout=None, append_button=True, append_stretch=True, stage_class=StageFrame)
Create a MultiStageArea instance
StageFrame
addStage(self, copy_stage=None, stage_type=None, **kwargs)
Add a new stage
int
getStageIndex(self, stage)
Return which stage number this is
 
moveStageUp(self, stage)
Shift the given stage up one stage
 
moveStageDown(self, stage)
Shift the given stage down one stage
 
moveStage(self, current, new)
Move the a stage
 
copyStage(self, stage)
Create a copy of stage and add it directly below stage
 
deleteStage(self, stage, update=True)
Delete a stage
 
updateStageLabels(self, start_at=0)
Update stage labels - usually due to a change in stage numbering
 
reset(self)
Reset the stage area
Method Details [hide private]

__init__(self, layout=None, append_button=True, append_stretch=True, stage_class=StageFrame)
(Constructor)

 

Create a MultiStageArea instance

Parameters:
  • layout (QBoxLayout) - The layout to place this Area into
  • append_button (bool) - Whether to add an "Append Stage" button to a Horizontal layout below the scrolling area
  • append_button (bool) - Whether to add a QSpacer to the layout containing the append button. Use False if additional widgets will be added after creating the area.
  • stage_class (StageFrame) - The class used to create new stages
  • append_stretch (bool)

addStage(self, copy_stage=None, stage_type=None, **kwargs)

 

Add a new stage

Parameters:
  • copy_stage (StageFrame) - The stage to copy. The default is None, which will create a new default stage.
  • stage_type - What type of stage to add. Must be dealt with in the StageFrame subclass
Returns: StageFrame
The newly created stage

Note: All other keyword arguments are passed to the stage class

getStageIndex(self, stage)

 

Return which stage number this is

Parameters:
  • stage (StageFrame) - Returns the index for this stage in the stage list
Returns: int
The stage number (starting at 0)

moveStageUp(self, stage)

 

Shift the given stage up one stage

Parameters:
  • stage (StageFrame) - The stage to move up

moveStageDown(self, stage)

 

Shift the given stage down one stage

Parameters:
  • stage (StageFrame) - The stage to move down

moveStage(self, current, new)

 

Move the a stage

Parameters:
  • current (int) - The current position of the stage
  • new (int) - The desired new position of the stage

copyStage(self, stage)

 

Create a copy of stage and add it directly below stage

Parameters:
  • stage (StageFrame) - The stage to copy

deleteStage(self, stage, update=True)

 

Delete a stage

Parameters:
  • stage (StageFrame) - The stage to be deleted
  • update (bool) - True if stage labels should be updated, False if not (use False if all stages are being deleted)

updateStageLabels(self, start_at=0)

 

Update stage labels - usually due to a change in stage numbering

Parameters:
  • start_at (int) - All stages from this stage to the end of the stage list will be updated