CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Static Public Attributes | Private Attributes
Vispa.Views.PropertyView.PropertyView Class Reference
Inheritance diagram for Vispa.Views.PropertyView.PropertyView:
Vispa.Views.AbstractView.AbstractView Vispa.Share.ObjectHolder.ObjectHolder

Public Member Functions

def __init__
 
def addCategory
 
def addProperty
 
def append
 
def appendAddRow
 
def cancel
 
def clear
 
def itemDoubleClickedSlot
 
def lastRow
 
def propertyWidgetFromProperty
 
def propertyWidgets
 
def readOnly
 
def removeProperty
 
def resizeEvent
 
def sectionResized
 
def setDataAccessor
 
def setReadOnly
 
def setShowAddDeleteButton
 
def showAddDeleteButton
 
def updateContent
 
def updatePropertyHeight
 
def useRelativePaths
 
def valueChanged
 
- Public Member Functions inherited from Vispa.Views.AbstractView.AbstractView
def __init__
 
def cancel
 
def isBusy
 
def restoreSelection
 
def select
 
def selection
 
def updateContent
 
- Public Member Functions inherited from Vispa.Share.ObjectHolder.ObjectHolder
def __init__
 
def allDataObjectChildren
 
def appendObject
 
def applyFilter
 
def clearObjects
 
def dataAccessor
 
def dataObject
 
def dataObjects
 
def dataObjectsCount
 
def numberDataObjectChildren
 
def removeObject
 
def setDataAccessor
 
def setDataObject
 
def setDataObjects
 
def setExclusiveMode
 
def setFilter
 

Public Attributes

 updateIni
 

Static Public Attributes

string LABEL = "&Property View"
 
tuple propertyWidgetFromProperty = staticmethod(propertyWidgetFromProperty)
 
- Static Public Attributes inherited from Vispa.Views.AbstractView.AbstractView
string LABEL = "&Abstract View"
 

Private Attributes

 _currentCategoryName
 
 _ignoreValueChangeFlag
 
 _operationId
 
 _readOnly
 
 _relativePath
 
 _showAddDeleteButtonFlag
 
 _updatingFlag
 

Detailed Description

Shows properties of an object in a QTableWidget using the DataAccessor.

The view can be used readonly ('setReadOnly') or for editing.
On editing the signals 'valueChanged', 'propertyDeleted', 'propertyAdded' are emitted.

Definition at line 43 of file PropertyView.py.

Constructor & Destructor Documentation

def Vispa.Views.PropertyView.PropertyView.__init__ (   self,
  parent = None,
  name = None 
)
Constructor 

Definition at line 52 of file PropertyView.py.

52 
53  def __init__(self, parent=None, name=None):
54  """ Constructor """
55  #logging.debug(self.__class__.__name__ + ": __init__()")
56  AbstractView.__init__(self)
57  QTableWidget.__init__(self, parent)
58 
59  self._operationId = 0
61  self.updateIni = False
63  self._relativePath=None
64  self.setSortingEnabled(False)
65  self.verticalHeader().hide()
66  self.setSelectionMode(QTableWidget.NoSelection)
67  self.clear() # sets header
68 
69  self._readOnly = False
70  self._showAddDeleteButtonFlag = False
71 
72  self.connect(self.horizontalHeader(), SIGNAL("sectionResized(int,int,int)"), self.sectionResized)
73  self.connect(self, SIGNAL("itemDoubleClicked(QTableWidgetItem *)"), self.itemDoubleClickedSlot)

Member Function Documentation

def Vispa.Views.PropertyView.PropertyView.addCategory (   self,
  name 
)
Add a category row to the tabel which consists of two gray LabelItems.

Definition at line 138 of file PropertyView.py.

References SiPixelConfigWriter.lastRow, Vispa.Views.PropertyView.PropertyView.lastRow(), FWCaloRecHitDigitSetProxyBuilder.setItem(), FWGenParticleLegoProxyBuilder.setItem(), FWTrackingParticleProxyBuilder.setItem(), FWTrackProxyBuilderFF.setItem(), FWVertexProxyBuilder.setItem(), FWDetailViewBase.setItem(), FWJetProxyBuilder.setItem(), and FWProxyBuilderBase.setItem().

139  def addCategory(self, name):
140  """ Add a category row to the tabel which consists of two gray LabelItems.
141  """
142  self.insertRow(self.lastRow()+1)
143  self.setItem(self.lastRow(), 0, LabelItem(name, Qt.lightGray))
144  self.setItem(self.lastRow(), 1, LabelItem("", Qt.lightGray))
145  self.verticalHeader().resizeSection(self.rowCount() - 1, Property.DEFAULT_HEIGHT)
146  return name
def Vispa.Views.PropertyView.PropertyView.addProperty (   self,
  bool = False 
)
This function adds a property.

The DataAcessor is called to add the property.

Definition at line 336 of file PropertyView.py.

References Vispa.Views.PropertyView.PropertyView._currentCategoryName, Vispa.Views.PropertyView.PropertyView._relativePath, python.seqvaluedict.seqdict.append(), cond::IOVEditor.append(), Vispa.Views.PropertyView.PropertyView.append(), svgfig.SVG.append(), Vispa.Share.ObjectHolder.ObjectHolder.dataAccessor(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.dataAccessor(), Vispa.Share.ObjectHolder.ObjectHolder.dataObject(), edm::ELlog4cplus.emit(), Vispa.Views.PropertyView.PropertyView.propertyWidgetFromProperty, and edm::service::ELcollected.sender.

Referenced by Vispa.Views.PropertyView.PropertyView.appendAddRow().

337  def addProperty(self, bool=False):
338  """ This function adds a property.
339 
340  The DataAcessor is called to add the property.
341  """
342  type=str(self.sender()._typelist.currentText())
343  name=str(self.sender()._lineedit.text().toAscii())
344  if type in ["String","File"]:
345  value=""
346  elif type in ["Integer","Double"]:
347  value=0
348  elif type in ["FileVector"]:
349  value=()
350  elif type in ["Boolean"]:
351  value=False
352  if name==None or name=="":
353  QCoreApplication.instance().infoMessage("Please specify name of property.")
354  return
355  if self.dataAccessor():
356  if self.dataAccessor().addProperty(self.dataObject(), name, value, type):
357  property=self.propertyWidgetFromProperty((type,name,value,None,False,True), self._currentCategoryName)
358  if property:
359  self.append(property)
360  if isinstance(property,(FileProperty,FileVectorProperty)):
361  property.useRelativePaths(self._relativePath)
362  self.sender()._lineedit.setText("")
363  property.setFocus()
364  self.emit(SIGNAL('propertyAdded'),property.name())
def Vispa.Views.PropertyView.PropertyView.append (   self,
  property 
)
Adds a property to the PropertyView and returns it.

Definition at line 110 of file PropertyView.py.

References Vispa.Views.PropertyView.PropertyView._readOnly, Vispa.Views.PropertyView.PropertyView._showAddDeleteButtonFlag, options.ConnectionL1TMenu.connect, ConnectionManager.connect(), RPCDBCom.connect(), TestBase.connect(), HCALConfigDB.connect(), ReadBase.connect(), l1t::DataManager.connect(), cond::Logger.connect(), DTTTrigProd.DTTTrigProd.connect, DTNoiseCalibration.DTNoiseCalibration.connect, DTTTrigValid.DTTTrigValid.connect, DTResidualCalibration.DTResidualCalibration.connect, DTTTrigResidualCorr.DTTTrigResidualCorr.connect, DTDQMHarvesting.DTDQMHarvesting.connect, DTVDriftSegmentCalibration.DTVDriftSegmentCalibration.connect, DTVDriftMeanTimerCalibration.DTVDriftMeanTimerCalibration.connect, ShallowTree::BranchConnector.connect(), ora::ConnectionPool.connect(), DTDQMValidation.DTDQMValidation.connect, ora::DatabaseSession.connect(), edm::ServiceToken.connect(), ShallowTree::TypedBranchConnector< T >.connect(), ora::Database.connect(), SimActivityRegistry.connect(), sim_act::Signaler< BeginOfEvent >.connect(), sim_act::Signaler< DDDWorld >.connect(), sim_act::Signaler< T >.connect(), sim_act::Signaler< G4Step >.connect(), sim_act::Signaler< EndOfEvent >.connect(), sim_act::Signaler< BeginOfRun >.connect(), sim_act::Signaler< BeginOfTrack >.connect(), sim_act::Signaler< BeginOfJob >.connect(), sim_act::Signaler< EndOfRun >.connect(), sim_act::Signaler< EndOfTrack >.connect(), L1TOMDSHelper.connect(), PFCandConnector.connect(), DDTOBRodAlgo.connect, KalmanAlignmentMetricsCalculator.connect(), smproxy::EventRetriever< RegInfo, QueueCollectionPtr >.connect(), edm::serviceregistry::ServicesManager.connect(), l1t::OMDSReader.connect(), PFRootEventManager.connect(), cond::service::PoolDBOutputService.connect(), edm::ActivityRegistry.connect(), SiPixelConfigWriter.lastRow, Vispa.Views.PropertyView.PropertyView.lastRow(), ora::Properties.removeProperty(), Vispa.Share.BasicDataAccessor.BasicDataAccessor.removeProperty(), Vispa.Views.PropertyView.PropertyView.removeProperty(), FWCaloRecHitDigitSetProxyBuilder.setItem(), FWGenParticleLegoProxyBuilder.setItem(), FWTrackingParticleProxyBuilder.setItem(), FWTrackProxyBuilderFF.setItem(), FWVertexProxyBuilder.setItem(), FWDetailViewBase.setItem(), FWJetProxyBuilder.setItem(), FWProxyBuilderBase.setItem(), and Vispa.Views.PropertyView.PropertyView.updatePropertyHeight().

Referenced by Vispa.Views.PropertyView.PropertyView.addProperty(), and BeautifulSoup.Tag.setString().

111  def append(self, property):
112  """ Adds a property to the PropertyView and returns it.
113  """
114  property.setPropertyView(self)
115  if self._readOnly:
116  property.setReadOnly(True)
117  self.insertRow(self.lastRow()+1)
118  self.setItem(self.lastRow(), 0, LabelItem(property))
119  if not self._readOnly and self._showAddDeleteButtonFlag and property.deletable():
120  widget=ClosableProperty(property)
121  self.connect(widget.closeButton(), SIGNAL('clicked(bool)'), self.removeProperty)
122  self.setCellWidget(self.lastRow(), 1, widget)
123  else:
124  self.setCellWidget(self.lastRow(), 1, property)
125  self.updatePropertyHeight(property)
126  self.connect(property, SIGNAL('updatePropertyHeight'), self.updatePropertyHeight)
127  return property
def Vispa.Views.PropertyView.PropertyView.appendAddRow (   self)
Append a row with a field to add new properties.

Definition at line 198 of file PropertyView.py.

References Vispa.Share.BasicDataAccessor.BasicDataAccessor.addProperty(), Vispa.Views.PropertyView.PropertyView.addProperty(), options.ConnectionL1TMenu.connect, ConnectionManager.connect(), RPCDBCom.connect(), HCALConfigDB.connect(), TestBase.connect(), ReadBase.connect(), l1t::DataManager.connect(), cond::Logger.connect(), DTNoiseCalibration.DTNoiseCalibration.connect, DTTTrigProd.DTTTrigProd.connect, DTTTrigValid.DTTTrigValid.connect, DTResidualCalibration.DTResidualCalibration.connect, DTTTrigResidualCorr.DTTTrigResidualCorr.connect, DTDQMHarvesting.DTDQMHarvesting.connect, ora::ConnectionPool.connect(), DTVDriftMeanTimerCalibration.DTVDriftMeanTimerCalibration.connect, DTVDriftSegmentCalibration.DTVDriftSegmentCalibration.connect, ShallowTree::BranchConnector.connect(), DTDQMValidation.DTDQMValidation.connect, ora::DatabaseSession.connect(), edm::ServiceToken.connect(), ShallowTree::TypedBranchConnector< T >.connect(), SimActivityRegistry.connect(), ora::Database.connect(), sim_act::Signaler< BeginOfJob >.connect(), sim_act::Signaler< EndOfTrack >.connect(), sim_act::Signaler< BeginOfRun >.connect(), sim_act::Signaler< EndOfEvent >.connect(), sim_act::Signaler< BeginOfEvent >.connect(), sim_act::Signaler< BeginOfTrack >.connect(), sim_act::Signaler< DDDWorld >.connect(), sim_act::Signaler< T >.connect(), sim_act::Signaler< EndOfRun >.connect(), sim_act::Signaler< G4Step >.connect(), L1TOMDSHelper.connect(), PFCandConnector.connect(), DDTOBRodAlgo.connect, KalmanAlignmentMetricsCalculator.connect(), smproxy::EventRetriever< RegInfo, QueueCollectionPtr >.connect(), edm::serviceregistry::ServicesManager.connect(), l1t::OMDSReader.connect(), PFRootEventManager.connect(), cond::service::PoolDBOutputService.connect(), edm::ActivityRegistry.connect(), SiPixelConfigWriter.lastRow, and Vispa.Views.PropertyView.PropertyView.lastRow().

199  def appendAddRow(self):
200  """ Append a row with a field to add new properties.
201  """
202  self.insertRow(self.lastRow()+1)
203  lineedit=QLineEdit()
204  lineedit.setFrame(False)
205  lineedit.setContentsMargins(0, 0, 0, 0)
206  self.setCellWidget(self.lastRow(), 0, lineedit)
207  widget=QWidget()
208  widget.setContentsMargins(0, 0, 0, 0)
209  widget.setLayout(QHBoxLayout())
210  widget.layout().setSpacing(0)
211  widget.layout().setContentsMargins(0, 0, 0, 0)
212  typelist=ComboBoxReturn()
213  types=["String","Boolean","Integer","Double","File","FileVector"]
214  for type in types:
215  typelist.addItem(type)
216  widget.layout().addWidget(typelist)
217  addButton=QToolButton()
218  addButton.setText("+")
219  widget.layout().addWidget(addButton)
220  self.setCellWidget(self.lastRow(), 1, widget)
221  self.verticalHeader().resizeSection(self.lastRow(), Property.DEFAULT_HEIGHT)
222  self.connect(addButton, SIGNAL('clicked(bool)'), self.addProperty)
223  self.connect(lineedit, SIGNAL('returnPressed()'), self.addProperty)
224  self.connect(typelist, SIGNAL('returnPressed()'), self.addProperty)
225  addButton._lineedit=lineedit
226  addButton._typelist=typelist
227  lineedit._lineedit=lineedit
228  lineedit._typelist=typelist
229  typelist._lineedit=lineedit
230  typelist._typelist=typelist
def Vispa.Views.PropertyView.PropertyView.cancel (   self)
Stop all running operations.

Definition at line 74 of file PropertyView.py.

References Vispa.Views.BoxDecayView.BoxDecayView._operationId, Vispa.Views.LineDecayView.LineDecayView._operationId, and Vispa.Views.PropertyView.PropertyView._operationId.

74 
75  def cancel(self):
76  """ Stop all running operations.
77  """
78  self._operationId += 1
def Vispa.Views.PropertyView.PropertyView.clear (   self)
Clear the table and set the header label.

Definition at line 79 of file PropertyView.py.

Referenced by Vispa.Views.WidgetView.WidgetView.closeEvent(), Vispa.Views.BoxDecayView.BoxDecayView.closeEvent(), Vispa.Views.LineDecayView.LineDecayView.setDataObjects(), Vispa.Views.WidgetView.WidgetView.setDataObjects(), Vispa.Views.TreeView.TreeView.updateContent(), Vispa.Views.TableView.TableView.updateContent(), Vispa.Views.BoxDecayView.BoxDecayView.updateContent(), and Vispa.Views.PropertyView.PropertyView.updateContent().

79 
80  def clear(self):
81  """ Clear the table and set the header label.
82  """
83  QTableWidget.clear(self)
84  self.setRowCount(0)
85  self.setColumnCount(2)
86  self.setHorizontalHeaderLabels(['Property', 'Value'])
def Vispa.Views.PropertyView.PropertyView.itemDoubleClickedSlot (   self,
  item 
)
Slot for itemClicked() signal.

Calls items's property's doubleClicked().

Definition at line 365 of file PropertyView.py.

366  def itemDoubleClickedSlot(self, item):
367  """ Slot for itemClicked() signal.
368 
369  Calls items's property's doubleClicked().
370  """
371  #logging.debug(self.__class__.__name__ + ": itemDoubleClickedSlot()")
372  if item.property():
373  item.property().labelDoubleClicked()
def Vispa.Views.PropertyView.PropertyView.lastRow (   self)
Return the last row holding a property.

The row with the add new property field is not counted.

Definition at line 128 of file PropertyView.py.

References Vispa.Views.PropertyView.PropertyView._readOnly, Vispa.Views.PropertyView.PropertyView._showAddDeleteButtonFlag, and Vispa.Views.PropertyView.PropertyView._updatingFlag.

Referenced by Vispa.Views.PropertyView.PropertyView.addCategory(), Vispa.Views.PropertyView.PropertyView.append(), and Vispa.Views.PropertyView.PropertyView.appendAddRow().

129  def lastRow(self):
130  """ Return the last row holding a property.
131 
132  The row with the add new property field is not counted.
133  """
134  if not self._readOnly and self._showAddDeleteButtonFlag and not self._updatingFlag>0:
135  return self.rowCount() - 2
136  else:
137  return self.rowCount() - 1
def Vispa.Views.PropertyView.PropertyView.propertyWidgetFromProperty (   property,
  categoryName = None 
)
Create a property widget from a property tuple.

This function is static in order to be used by other view, e.g. TableView.

Definition at line 265 of file PropertyView.py.

References Vispa.Views.PropertyView.PropertyView.propertyWidgetFromProperty.

266  def propertyWidgetFromProperty(property, categoryName=None):
267  """ Create a property widget from a property tuple.
268 
269  This function is static in order to be used by other view, e.g. TableView.
270  """
271  propertyWidget=None
272  if property[0] == "String":
273  propertyWidget=StringProperty(property[1], property[2], categoryName)
274  elif property[0] == "MultilineString":
275  propertyWidget=StringProperty(property[1], property[2], categoryName, True)
276  elif property[0] == "File":
277  propertyWidget=FileProperty(property[1], property[2], categoryName)
278  elif property[0] == "FileVector":
279  propertyWidget=FileVectorProperty(property[1], property[2], categoryName)
280  elif property[0] == "Boolean":
281  propertyWidget = BooleanProperty(property[1], property[2], categoryName)
282  elif property[0] == "Integer":
283  propertyWidget=IntegerProperty(property[1], property[2], categoryName)
284  elif property[0] == "Double":
285  propertyWidget=DoubleProperty(property[1], property[2], categoryName)
286  elif property[0] == "DropDown":
287  propertyWidget=DropDownProperty(property[1], property[2], property[6], categoryName)
288  else:
289  logging.error(__name__+": propertyWidgetFromProperty() - Unknown property type "+str(property[0]))
290  return None
291  if len(property) > 3 and property[3]:
292  propertyWidget.setUserInfo(property[3])
293  if len(property) > 4 and property[4]:
294  propertyWidget.setReadOnly(True)
295  if len(property) > 5 and property[5]:
296  propertyWidget.setDeletable(True)
return propertyWidget
def Vispa.Views.PropertyView.PropertyView.propertyWidgets (   self)
Return all property widgets in the right column.

Closable as well as normal properties are returned.

Definition at line 87 of file PropertyView.py.

Referenced by Vispa.Views.PropertyView.PropertyView.removeProperty(), Vispa.Views.PropertyView.PropertyView.setReadOnly(), and Vispa.Views.PropertyView.PropertyView.updatePropertyHeight().

87 
88  def propertyWidgets(self):
89  """ Return all property widgets in the right column.
90 
91  Closable as well as normal properties are returned.
92  """
93  widgets=[]
94  for i in range(self.rowCount()):
95  widget=self.cellWidget(i,1)
96  if isinstance(widget,Property):
97  widgets+=[(widget,i)]
98  elif hasattr(widget,"closableProperty"):
99  widgets+=[(widget.closableProperty(),i)]
100  return widgets
def Vispa.Views.PropertyView.PropertyView.readOnly (   self)

Definition at line 158 of file PropertyView.py.

References Vispa.Views.PropertyView.PropertyView._readOnly.

159  def readOnly(self):
160  return self._readOnly
def Vispa.Views.PropertyView.PropertyView.removeProperty (   self,
  bool = False 
)
This function deletes a property.

The DataAcessor is called to handle the property remove.

Definition at line 322 of file PropertyView.py.

References Vispa.Share.ObjectHolder.ObjectHolder.dataAccessor(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.dataAccessor(), Vispa.Share.ObjectHolder.ObjectHolder.dataObject(), edm::ELlog4cplus.emit(), dbtoconf.parent, Vispa.Views.PropertyView.PropertyView.propertyWidgets(), and edm::service::ELcollected.sender.

Referenced by Vispa.Views.PropertyView.PropertyView.append().

323  def removeProperty(self, bool=False):
324  """ This function deletes a property.
325 
326  The DataAcessor is called to handle the property remove.
327  """
328  property=self.sender().parent()._property
329  name=property.name()
330  if self.dataAccessor():
331  if self.dataAccessor().removeProperty(self.dataObject(), property.name()):
332  for p,i in self.propertyWidgets():
333  if p==property:
334  self.removeRow(i)
335  self.emit(SIGNAL('propertyDeleted'),name)
list parent
Definition: dbtoconf.py:74
def Vispa.Views.PropertyView.PropertyView.resizeEvent (   self,
  event 
)
Resize columns when table size is changed.

Definition at line 167 of file PropertyView.py.

References Vispa.Views.PropertyView.PropertyView.updateIni, TmModule.width, Random_struct.width, OpenBounds.width(), GifDisplay.width, SimpleDiskBounds.width(), Range< OAxisY_t >.width(), Range< OAxisX_t >.width(), Range< OAxis_t >.width(), PhysicsTools::Calibration::Range< Axis_t >.width(), FourPointPlaneBounds.width(), PhysicsTools::Calibration::Range< float >.width(), PhysicsTools::Calibration::Range< AxisY_t >.width(), PhysicsTools::Calibration::Range< AxisX_t >.width(), GeneralTrapezoidalPlaneBounds.width(), RectangularPlaneBounds.width(), DiskSectorBounds.width(), SiStripClusterInfo.width(), funct::GammaZInterference.width, GeneralNSurfaceDelimitedBounds.width(), RooCB.width, Bounds.width(), SimpleCylinderBounds.width(), funct::BreitWigner.width, reco::helper::CastorJetIDHelper.width(), DDTIDAxialCableAlgo.width, DDTECAxialCableAlgo.width, TrapezoidalPlaneBounds.width(), reco::CastorJetID.width, AlignableSurface.width(), DDI::Division.width(), FWCheckedTextTableCellRenderer.width(), function::ZMuStandaloneFunction.width, lhef::SimpleMatrix< Delta >.width, btag::SimpleMatrix< T >.width, btag::SimpleMatrix< Delta >.width, lhef::SimpleMatrix< T >.width, function::ZMuMuFunction.width, FWColumnLabelCellRenderer.width(), function::ZMuMuScaledFunction.width, function::ZMuTrackFunction.width, function::ZMuTrackScaledFunction.width, function::ZMuStandaloneScaledFunction.width, function::ZMuTrackScaledNormalBack.width, FWCollectionSummaryModelCellRenderer.width(), SimpleConeBounds.width(), produceOfflineValidationTex.PageLayout.width, FWFramedTextTableCellRenderer.width(), FWTextTableCellRenderer.width(), FWTableCellRendererBase.width(), ProcNormalize::Map.width, reco::CastorCluster.width(), tablePrinter.width, RooDoubleCB.width, reco::CastorEgamma.width(), reco::CastorJet.width(), ProcLikelihood::SplinePDF.width, FWTextTreeCellRenderer.width(), timing.width(), SiStripMonitorCluster::ClusterProperties.width, FWGeometryTableManagerBase::ColorBoxRenderer.width(), RooRelBW.width, DDDivision.width(), python.rootplot.utilities.Hist.width, dqmTnP::VoigtianPlusExponentialFitter.width, svgfig.Plot.width, svgfig.Frame.width, Vispa.Gui.VispaWidget.VispaWidget.width(), svgfig.Dots.width, and Vispa.Main.Application.Application.writeIni().

168  def resizeEvent(self, event):
169  """ Resize columns when table size is changed.
170  """
171  if event != None:
172  QTableWidget.resizeEvent(self, event)
173  space = self.width() - 4
174  if self.verticalScrollBar().isVisible():
175  space -= self.verticalScrollBar().width()
176  space -= self.columnWidth(0)
177  self.setColumnWidth(1, space)
178  if self.updateIni:
179  self.writeIni()
def Vispa.Views.PropertyView.PropertyView.sectionResized (   self,
  index,
  old,
  new 
)

Definition at line 180 of file PropertyView.py.

References Vispa.Views.PropertyView.PropertyView.updateIni, TmModule.width, Random_struct.width, OpenBounds.width(), GifDisplay.width, SimpleDiskBounds.width(), Range< OAxisY_t >.width(), Range< OAxisX_t >.width(), Range< OAxis_t >.width(), PhysicsTools::Calibration::Range< Axis_t >.width(), FourPointPlaneBounds.width(), PhysicsTools::Calibration::Range< float >.width(), PhysicsTools::Calibration::Range< AxisY_t >.width(), PhysicsTools::Calibration::Range< AxisX_t >.width(), GeneralTrapezoidalPlaneBounds.width(), RectangularPlaneBounds.width(), DiskSectorBounds.width(), SiStripClusterInfo.width(), funct::GammaZInterference.width, GeneralNSurfaceDelimitedBounds.width(), RooCB.width, Bounds.width(), SimpleCylinderBounds.width(), funct::BreitWigner.width, reco::helper::CastorJetIDHelper.width(), DDTIDAxialCableAlgo.width, DDTECAxialCableAlgo.width, TrapezoidalPlaneBounds.width(), reco::CastorJetID.width, AlignableSurface.width(), DDI::Division.width(), FWCheckedTextTableCellRenderer.width(), function::ZMuStandaloneFunction.width, lhef::SimpleMatrix< Delta >.width, btag::SimpleMatrix< T >.width, btag::SimpleMatrix< Delta >.width, lhef::SimpleMatrix< T >.width, function::ZMuMuFunction.width, FWColumnLabelCellRenderer.width(), function::ZMuMuScaledFunction.width, function::ZMuTrackFunction.width, function::ZMuTrackScaledFunction.width, function::ZMuStandaloneScaledFunction.width, function::ZMuTrackScaledNormalBack.width, FWCollectionSummaryModelCellRenderer.width(), SimpleConeBounds.width(), produceOfflineValidationTex.PageLayout.width, FWFramedTextTableCellRenderer.width(), FWTextTableCellRenderer.width(), FWTableCellRendererBase.width(), ProcNormalize::Map.width, reco::CastorCluster.width(), tablePrinter.width, RooDoubleCB.width, reco::CastorEgamma.width(), reco::CastorJet.width(), ProcLikelihood::SplinePDF.width, FWTextTreeCellRenderer.width(), timing.width(), SiStripMonitorCluster::ClusterProperties.width, FWGeometryTableManagerBase::ColorBoxRenderer.width(), RooRelBW.width, DDDivision.width(), python.rootplot.utilities.Hist.width, dqmTnP::VoigtianPlusExponentialFitter.width, svgfig.Plot.width, svgfig.Frame.width, Vispa.Gui.VispaWidget.VispaWidget.width(), svgfig.Dots.width, and Vispa.Main.Application.Application.writeIni().

181  def sectionResized(self,index,old,new):
182  space = self.width() - 4
183  if self.verticalScrollBar().isVisible():
184  space -= self.verticalScrollBar().width()
185  space -= self.columnWidth(0)
186  self.setColumnWidth(1, space)
187  if self.updateIni:
188  self.writeIni()
def Vispa.Views.PropertyView.PropertyView.setDataAccessor (   self,
  accessor 
)
Sets the DataAccessor from which the object properties are read.

You need to call updateContent() in order to make the changes visible.

Definition at line 189 of file PropertyView.py.

190  def setDataAccessor(self, accessor):
191  """ Sets the DataAccessor from which the object properties are read.
192 
193  You need to call updateContent() in order to make the changes visible.
194  """
195  if not isinstance(accessor, BasicDataAccessor):
196  raise TypeError(__name__ + " requires data accessor of type BasicDataAccessor.")
197  AbstractView.setDataAccessor(self, accessor)
def Vispa.Views.PropertyView.PropertyView.setReadOnly (   self,
  readOnly 
)
Sets all properties in the PropertyView to read-only.

After calling this function all properties that are added are set to read-only as well.

Definition at line 147 of file PropertyView.py.

References Vispa.Views.PropertyView.PropertyView._readOnly, and Vispa.Views.PropertyView.PropertyView.propertyWidgets().

148  def setReadOnly(self, readOnly):
149  """ Sets all properties in the PropertyView to read-only.
150 
151  After calling this function all properties that are added are set to read-only as well.
152  """
153  #logging.debug('PropertyView: setReadOnly()')
154  self._readOnly = readOnly
155  for property,i in self.propertyWidgets():
156  if property:
157  property.setReadOnly(self._readOnly)
def Vispa.Views.PropertyView.PropertyView.setShowAddDeleteButton (   self,
  show 
)

Definition at line 161 of file PropertyView.py.

References Vispa.Views.PropertyView.PropertyView._showAddDeleteButtonFlag.

162  def setShowAddDeleteButton(self,show):
163  self._showAddDeleteButtonFlag=show
def Vispa.Views.PropertyView.PropertyView.showAddDeleteButton (   self)

Definition at line 164 of file PropertyView.py.

References Vispa.Views.PropertyView.PropertyView._showAddDeleteButtonFlag.

165  def showAddDeleteButton(self):
166  return self._showAddDeleteButtonFlag
def Vispa.Views.PropertyView.PropertyView.updateContent (   self)
Fill the properties of an object in the PropertyView using the DataAccessor.

Definition at line 231 of file PropertyView.py.

References Vispa.Views.PropertyView.PropertyView._updatingFlag, Vispa.Gui.TextDialog.TextDialog.cancel, Vispa.Views.AbstractView.AbstractView.cancel(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.cancel(), Vispa.Main.TabController.TabController.cancel(), Vispa.Main.Application.Application.cancel(), EopVariables.clear(), CastorCalibrationsSet.clear(), TkOffTreeVariables.clear(), StringMap.clear(), ecaldqm::MESetChannel.clear(), ora::MultiRecordSelectOperation.clear(), HcalCalibrationsSet.clear(), HcalCalibrationWidthsSet.clear(), edm::reftobase::RefVectorHolderBase.clear(), cond::PayloadRef< DataT >.clear(), Overlayer.clear(), CastorCalibrationWidthsSet.clear(), NumberOfDevices.clear(), ora::TransactionCache.clear(), ora::DataElement.clear(), Vispa.Plugins.EdmBrowser.EventContentView.EventContentView.clear(), ora::MultiIndexDataTrie.clear(), ora::Sequences.clear(), edm::BranchChildren.clear(), ora::RelationalDeleter.clear(), WebPage.clear(), Vispa.Share.FindAlgorithm.FindAlgorithm.clear(), edm::reftobase::BaseVectorHolder< T >.clear(), edm::reftobase::RefVectorHolder< REFV >.clear(), CSCALCTDigi.clear(), CSCCLCTDigi.clear(), CSCCorrelatedLCTDigi.clear(), helper::ClusterStorer.clear(), edm::reftobase::IndirectVectorHolder< T >.clear(), OpticalAlignMeasurementInfo.clear(), ClusterCollectionFP420.clear(), RecoCollectionFP420.clear(), TrackCollectionFP420.clear(), reco::PattRecoTree< ScaleType, Cluster >.clear(), KalmanAlignmentDataCollector.clear(), ClhepEvaluator.clear(), python.seqvaluedict.seqdict.clear(), ora::ContainerUpdateTable.clear(), DigiCollectionFP420.clear(), ora::NamedSequence.clear(), ora::PoolDbCache.clear(), ExprEvalInterface.clear(), cond::SequenceManager.clear(), AlignmentParameterSelector.clear(), SegmentToTrackAssociator.clear(), edm::reftobase::VectorHolder< T, REFVECTOR >.clear(), pos::PixelROCStatus.clear(), evf::ShmOutputModuleRegistry.clear(), evf::FUShmDqmCell.clear(), FWFromSliceSelector.clear(), edm::OrphanHandleBase.clear(), SiPixelPerformanceSummary.clear(), CondIter< DataT >.clear(), ora::RelationalBuffer.clear(), edm::WorkerRegistry.clear(), BlockWipedAllocator.clear(), HLTPerformanceInfo::Module.clear(), KalmanAlignmentMetricsCalculator.clear(), edm::ScheduleItems.clear(), evf::FUShmRawCell.clear(), ora::IArrayHandler.clear(), edm::RefToBaseVector< T >.clear(), CSCTriggerContainer< T >.clear(), evf::ServiceWebRegistry.clear(), ora::Handle< T >.clear(), MuonResidualsFromTrack.clear(), edm::detail::NamedEventSelector.clear(), ora::SequenceManager.clear(), evf::ModuleWebRegistry.clear(), OpticalAlignParam.clear(), edm::StreamedProduct.clear(), ora::PVectorReader.clear(), SiStripDelay.clear(), egHLT::OffEvt.clear(), ME_MAP.clear(), ora::CArrayHandler.clear(), edm::HandleBase.clear(), edm::TrieFactory< T >.clear(), SiStripQuality.clear(), stor::DQMTopLevelFolder::Record.clear(), evf::FUShmRecoCell.clear(), ora::IRelationalReader.clear(), edm::Association< C >.clear(), ora::STLContainerHandler.clear(), DTTFFEDReader.clear(), stor::FragmentStore.clear(), edm::DetSet< T >.clear(), edm::RefVectorBase< T >.clear(), DDBase< N, C >.clear(), ecaldqm::MESet.clear(), ora::QueryableVectorReader.clear(), SiPixelCalibDigiProducer.clear(), ora::MappingDatabase.clear(), edm::ProcessHistory.clear(), edm::AssociationMap< Tag >.clear(), ora::PVectorHandler.clear(), DDI::Store< N, I, K >.clear(), Vispa.Views.PropertyView.PropertyView.clear(), edm::PtrVectorBase.clear(), ora::PrimitiveReader.clear(), stor::ExpirableQueue< T, Policy >.clear(), stor::DQMEventStore< EventType, ConnectionType, StateMachineType >.clear(), DDValue.clear(), ora::OraReferenceReader.clear(), edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >.clear(), HLTPerformanceInfo::Path.clear(), edm::detail::CachedProducts.clear(), ora::BlobReader.clear(), l1t::IntervalManager< TimeType, PayloadType >.clear(), ora::UniqueRefReader.clear(), FBaseSimEvent.clear(), ora::OraPtrReader.clear(), ora::InlineCArrayReader.clear(), ora::CArrayReader.clear(), evf::FUResourceQueue.clear(), OpticalAlignInfo.clear(), CSCDCCExaminer.clear(), ora::ObjectReader.clear(), CondBasicIter.clear(), DTCCBConfig.clear(), ora::STLContainerReader.clear(), DTLVStatus.clear(), ora::NamedRefReader.clear(), FWGeometry.clear(), DTTPGParameters.clear(), DTT0.clear(), DTRangeT0.clear(), DDXMLElement.clear(), edm::EventSetup.clear(), ora::SpecialSTLContainerHandler.clear(), DTHVStatus.clear(), CastorCTDCHeader.clear(), Vispa.Plugins.EdmBrowser.EventContentDataAccessor.EventContentDataAccessor.clear(), AlignmentParameterSelector::PXBDetIdRanges.clear(), BlockWipedPool.clear(), DTReadOutMapping.clear(), HcalDCCHeader.clear(), edm::TrieNode< T >.clear(), edm::Handle< GenericObject >.clear(), stor::InitMsgCollection.clear(), edm::RefVector< C, T, F >.clear(), AlignmentParameterSelector::PXFDetIdRanges.clear(), edm::OwnArray< T, MAX_SIZE, P >.clear(), reco::FlavorHistoryEvent.clear(), evf::FUResourceTable.clear(), edm::OwnVector< T, P >.clear(), DTTtrig.clear(), DTPerformance.clear(), edm::Handle< FWGenericObject >.clear(), DTStatusFlag.clear(), AlignmentParameterSelector::TIBDetIdRanges.clear(), evf::IPCMethod.clear(), HLTPerformanceInfo.clear(), DTDeadFlag.clear(), edm::ValueMap< T >.clear(), AlignmentParameterSelector::TIDDetIdRanges.clear(), pos::PixelFEDCard.clear(), ora::SelectOperation.clear(), AlignmentParameterSelector::TOBDetIdRanges.clear(), DTMtime.clear(), AlignmentParameterSelector::TECDetIdRanges.clear(), ora::PVector< Tp >.clear(), graph< N, E >.clear(), smproxy::DataRetrieverMonitorCollection::EventTypeMqMap.clear(), edm::Trie< T >.clear(), ora::QueryableVector< Tp >.clear(), stor::ConcurrentQueue< T, EnqPolicy >.clear(), BeautifulSoup.Tag.clear(), Vispa.Share.ObjectHolder.ObjectHolder.dataAccessor(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.dataAccessor(), and Vispa.Share.ObjectHolder.ObjectHolder.dataObject().

232  def updateContent(self):
233  """ Fill the properties of an object in the PropertyView using the DataAccessor.
234  """
235  #logging.debug('PropertyView: updateContent()')
236  self.cancel()
237  if self.dataAccessor() == None:
238  return False
239  self._updatingFlag+=1
240  self.clear()
241  if self.dataObject()==None:
242  self._updatingFlag-=1
243  return True
244  self._ignoreValueChangeFlag = True # prevent infinite loop
245  operationId = self._operationId
246  # do not use threads here since this may lead to crashes
247  for property in self.dataAccessor().properties(self.dataObject()):
248  if property[0] == "Category":
249  self._currentCategoryName = self.addCategory(property[1])
250  else:
251  propertyWidget=PropertyView.propertyWidgetFromProperty(property, self._currentCategoryName)
252  if propertyWidget:
253  self.append(propertyWidget)
254  if isinstance(propertyWidget,(FileProperty,FileVectorProperty)):
255  propertyWidget.useRelativePaths(self._relativePath)
256  if isinstance(propertyWidget,QCheckBox):
257  propertyWidget.setChecked(property[2],False) # strange, QCheckBox forgets its state on append in Qt 4.4.4
258  if not self._readOnly and self._showAddDeleteButtonFlag:
259  self.appendAddRow()
260  self.resizeEvent(None)
261  self._ignoreValueChangeFlag = False
262  self._updatingFlag-=1
263  return self._operationId==operationId
def Vispa.Views.PropertyView.PropertyView.updatePropertyHeight (   self,
  property 
)
Update the height of the column that holds a certain property.

Definition at line 101 of file PropertyView.py.

References Vispa.Views.PropertyView.PropertyView.propertyWidgets().

Referenced by Vispa.Views.PropertyView.PropertyView.append().

102  def updatePropertyHeight(self,property):
103  """ Update the height of the column that holds a certain property.
104  """
105  #logging.debug(self.__class__.__name__ + ": updatePropertyHeight()")
106  for widget,i in self.propertyWidgets():
107  if widget==property:
108  self.verticalHeader().resizeSection(i, property.properyHeight())
109  return
def Vispa.Views.PropertyView.PropertyView.useRelativePaths (   self,
  path 
)

Definition at line 374 of file PropertyView.py.

References Vispa.Views.PropertyView.PropertyView._relativePath.

375  def useRelativePaths(self,path):
376  self._relativePath=path
def Vispa.Views.PropertyView.PropertyView.valueChanged (   self,
  property 
)
This function is called when a property a changed.

The DataAcessor is called to handle the property change.

Definition at line 299 of file PropertyView.py.

References Vispa.Views.PropertyView.PropertyView._ignoreValueChangeFlag, Vispa.Share.ObjectHolder.ObjectHolder.dataAccessor(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.dataAccessor(), Vispa.Share.ObjectHolder.ObjectHolder.dataObject(), edm::ELlog4cplus.emit(), python.multivaluedict.MyUserList.parent, FSimVertex.parent(), reco::PattRecoNode< Cluster >.parent(), DDI::Division.parent(), EmDQMReco::FourVectorMonitorElements.parent, graphwalker< N, E >.parent(), graphwalker< ReferenceCountingPointer, ReferenceCountingPointer >.parent(), graphwalker< DDLogicalPart, DDPosData * >.parent(), OpticalObject.parent(), DDLSAX2FileHandler.parent(), edm::DocFormatHelper.parent(), FWPSetTableManager::PSetData.parent, DDFilteredView.parent(), confdb.HLTProcess.parent, DDExpandedView.parent(), DDDivision.parent(), stor::TriggerSelector::TreeElement.parent(), DDXMLElement.parent(), argparse.HelpFormatter._Section.parent, python.rootplot.argparse.HelpFormatter._Section.parent, globcontrol.parent, TiXmlNode.parent, and Vispa.Views.LineDecayView.DecayObject.parent().

Referenced by Vispa.Views.PropertyView.BooleanProperty.__init__(), Vispa.Views.PropertyView.StringProperty.buttonClicked(), Vispa.Views.PropertyView.TextEditWithButtonProperty.createLineEdit(), Vispa.Views.PropertyView.TextEditWithButtonProperty.createTextEdit(), Vispa.Views.PropertyView.BooleanProperty.setChecked(), Vispa.Views.PropertyView.BooleanProperty.setReadOnly(), Vispa.Views.PropertyView.DropDownProperty.setReadOnly(), Vispa.Views.PropertyView.TextEditWithButtonProperty.setReadOnly(), and Vispa.Views.PropertyView.IntegerProperty.setValue().

300  def valueChanged(self, property):
301  """ This function is called when a property a changed.
302 
303  The DataAcessor is called to handle the property change.
304  """
305  if self.dataAccessor() and not self._ignoreValueChangeFlag:
306  bad=False
307  newvalue = property.value()
308  oldValue = self.dataAccessor().propertyValue(self.dataObject(), property.name())
309  if newvalue != oldValue:
310  if isinstance(newvalue,ValueError):
311  result=str(newvalue)
312  else:
313  result=self.dataAccessor().setProperty(self.dataObject(), property.name(), newvalue, property.categoryName())
314  if result==True:
315  self.emit(SIGNAL('valueChanged'),property.name(), newvalue, oldValue, property.categoryName())
316  else:
317  print "valueChanged() result = ", result, type(result)
318  property.setToolTip(result)
319  QMessageBox.critical(self.parent(), 'Error', result)
320  bad=True
321  property.setHighlighted(bad)

Member Data Documentation

Vispa.Views.PropertyView.PropertyView._currentCategoryName
private

Definition at line 61 of file PropertyView.py.

Referenced by Vispa.Views.PropertyView.PropertyView.addProperty().

Vispa.Views.PropertyView.PropertyView._ignoreValueChangeFlag
private

Definition at line 243 of file PropertyView.py.

Referenced by Vispa.Views.PropertyView.PropertyView.valueChanged().

Vispa.Views.PropertyView.PropertyView._operationId
private

Definition at line 58 of file PropertyView.py.

Referenced by Vispa.Views.TreeView.TreeView.cancel(), Vispa.Views.TableView.TableView.cancel(), Vispa.Views.PropertyView.PropertyView.cancel(), Vispa.Views.RootCanvasView.RootCanvasView.cancel(), Vispa.Views.RootCanvasView.RootCanvasView.updateContent(), Vispa.Views.TreeView.TreeView.updateContent(), and Vispa.Views.TableView.TableView.updateContent().

Vispa.Views.PropertyView.PropertyView._readOnly
private

Definition at line 68 of file PropertyView.py.

Referenced by Vispa.Views.PropertyView.PropertyView.append(), Vispa.Views.PropertyView.TextEditWithButtonProperty.enterEvent(), Vispa.Views.PropertyView.PropertyView.lastRow(), Vispa.Views.PropertyView.TextEditWithButtonProperty.leaveEvent(), Vispa.Views.PropertyView.PropertyView.readOnly(), Vispa.Views.PropertyView.TextEditWithButtonProperty.readOnly(), Vispa.Views.PropertyView.PropertyView.setReadOnly(), and Vispa.Views.PropertyView.TextEditWithButtonProperty.setReadOnly().

Vispa.Views.PropertyView.PropertyView._relativePath
private

Definition at line 62 of file PropertyView.py.

Referenced by Vispa.Views.PropertyView.PropertyView.addProperty(), Vispa.Views.PropertyView.FileProperty.buttonClicked(), Vispa.Views.PropertyView.FileVectorProperty.buttonClicked(), and Vispa.Views.PropertyView.PropertyView.useRelativePaths().

Vispa.Views.PropertyView.PropertyView._showAddDeleteButtonFlag
private

Definition at line 69 of file PropertyView.py.

Referenced by Vispa.Views.PropertyView.PropertyView.append(), Vispa.Views.PropertyView.PropertyView.lastRow(), Vispa.Views.PropertyView.PropertyView.setShowAddDeleteButton(), and Vispa.Views.PropertyView.PropertyView.showAddDeleteButton().

Vispa.Views.PropertyView.PropertyView._updatingFlag
private

Definition at line 59 of file PropertyView.py.

Referenced by Vispa.Views.WidgetView.WidgetView.deselectAllWidgets(), Vispa.Views.WidgetView.WidgetView.isBusy(), Vispa.Views.TreeView.TreeView.isBusy(), Vispa.Views.RootCanvasView.RootCanvasView.isBusy(), Vispa.Views.TableView.TableView.isBusy(), Vispa.Views.PropertyView.FileVectorProperty.isBusy(), Vispa.Plugins.ConfigEditor.CodeTableView.CodeTableView.itemClicked(), Vispa.Views.TreeView.TreeView.itemSelectionChanged(), Vispa.Views.TableView.TableView.itemSelectionChanged(), Vispa.Views.PropertyView.PropertyView.lastRow(), Vispa.Views.WidgetView.WidgetView.restoreSelection(), Vispa.Views.TreeView.TreeView.restoreSelection(), Vispa.Views.TableView.TableView.restoreSelection(), Vispa.Views.WidgetView.WidgetView.select(), Vispa.Views.TreeView.TreeView.select(), Vispa.Views.TableView.TableView.select(), Vispa.Views.RootCanvasView.RootCanvasView.updateContent(), Vispa.Views.TreeView.TreeView.updateContent(), Vispa.Views.LineDecayView.LineDecayView.updateContent(), Vispa.Views.TableView.TableView.updateContent(), Vispa.Views.BoxDecayView.BoxDecayView.updateContent(), Vispa.Views.PropertyView.PropertyView.updateContent(), and Vispa.Views.WidgetView.WidgetView.widgetSelected().

string Vispa.Views.PropertyView.PropertyView.LABEL = "&Property View"
static

Definition at line 50 of file PropertyView.py.

tuple Vispa.Views.PropertyView.PropertyView.propertyWidgetFromProperty = staticmethod(propertyWidgetFromProperty)
static

Definition at line 297 of file PropertyView.py.

Referenced by Vispa.Views.PropertyView.PropertyView.addProperty(), and Vispa.Views.PropertyView.PropertyView.propertyWidgetFromProperty().

Vispa.Views.PropertyView.PropertyView.updateIni

Definition at line 60 of file PropertyView.py.

Referenced by Vispa.Views.PropertyView.PropertyView.resizeEvent(), and Vispa.Views.PropertyView.PropertyView.sectionResized().