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 Member Functions | Private Attributes
Vispa.Gui.ConnectableWidget.ConnectableWidget Class Reference
Inheritance diagram for Vispa.Gui.ConnectableWidget.ConnectableWidget:
Vispa.Gui.VispaWidget.VispaWidget Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner Vispa.Gui.ZoomableWidget.ZoomableWidget Vispa.Gui.Zoomable.Zoomable Vispa.Gui.WidgetContainer.WidgetContainer Vispa.Views.BoxDecayView.BoxDecayContainer Vispa.Views.LineDecayView.LineDecayContainer

Public Member Functions

def __init__
 
def addMenuEntry
 
def addSinkPort
 
def addSourcePort
 
def arrangePorts
 
def attachedConnections
 
def centerSinglePortVertically
 
def defineDistances
 
def deleteLater
 
def dragWidget
 
def drawBody
 
def drawPortLines
 
def drawPortNames
 
def dropArea
 
def dropAreaPort
 
def getEffectivePortHeight
 
def getPortsHeight
 
def leaveEvent
 
def menu
 
def mouseMoveEvent
 
def mousePressEvent
 
def mouseReleaseEvent
 
def move
 
def port
 
def portExists
 
def ports
 
def positionizeMenuWidget
 
def rearangeContent
 
def removeMenu
 
def removeMenuEntry
 
def removePort
 
def removePorts
 
def select
 
def setPortNamesPosition
 
def setShowPortLines
 
def setShowPortNames
 
def setZoom
 
def showMenu
 
def sinkPort
 
def sinkPorts
 
def sizeHint
 
def sourcePort
 
def sourcePorts
 
def updateAttachedConnections
 
- Public Member Functions inherited from Vispa.Gui.VispaWidget.VispaWidget
def __init__
 
def autosize
 
def autosizeEnabled
 
def bodyWidget
 
def boundingRect
 
def colorHeaderBackgroundEnabled
 
def contentRect
 
def defineArrowBackgroundShape
 
def defineCircleBackgroundShape
 
def defineDistances
 
def defineRectBackgroundShape
 
def defineRoundRectBackgroundShape
 
def delete
 
def distances
 
def dragReferencePoint
 
def dragWidget
 
def drawBody
 
def drawHeaderBackground
 
def drawImage
 
def drawTextField
 
def drawTitle
 
def enableAutopositionizeWhenZooming
 
def enableAutosizing
 
def enableBackgroundGradient
 
def enableColorHeaderBackground
 
def getDistance
 
def height
 
def imageRectF
 
def imageSizeF
 
def isDeletable
 
def isDragable
 
def isSelectable
 
def isSelected
 
def isTitlePoint
 
def isUseBackgroundGradientEnabled
 
def keyPressEvent
 
def mouseDoubleClickEvent
 
def mouseMoveEvent
 
def mousePressEvent
 
def mouseReleaseEvent
 
def move
 
def noRearangeContent
 
def paint
 
def paintEvent
 
def penColor
 
def previousDragPosition
 
def rearangeContent
 
def resetMouseDragOffset
 
def resize
 
def scale
 
def scheduleCalculateDistances
 
def scheduleRearangeContent
 
def select
 
def setArrowShape
 
def setBodyWidget
 
def setColors
 
def setDeletable
 
def setDragable
 
def setDragReferencePoint
 
def setImage
 
def setMaximumSize
 
def setMinimumSize
 
def setPreviousDragPosition
 
def setSelectable
 
def setShape
 
def setText
 
def setTextFieldAutosizeFont
 
def setTextFieldAutotruncateText
 
def setTitle
 
def setZoom
 
def showEvent
 
def sizeHint
 
def text
 
def textField
 
def textFieldIsSet
 
def title
 
def titleField
 
def titleIsSet
 
def unzoomedX
 
def unzoomedY
 
def width
 
- Public Member Functions inherited from Vispa.Gui.ZoomableWidget.ZoomableWidget
def __init__
 
def exportImage
 
def setZoom
 
- Public Member Functions inherited from Vispa.Gui.Zoomable.Zoomable
def __init__
 
def decrementZoom
 
def incrementZoom
 
def setZoom
 
def zoom
 
def zoomFactor
 
- Public Member Functions inherited from Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner
def deselectAllWidgets
 
def enableMultiSelect
 
def initWidgetMovement
 
def keyPressEvent
 
def lastMovedWidgets
 
def mouseMoveEvent
 
def mousePressEvent
 
def mouseReleaseEvent
 
def multiSelectEnabled
 
def selectedWidgets
 
def widgetAboutToDelete
 
def widgetDoubleClicked
 
def widgetDragged
 
def widgetSelected
 

Public Attributes

 PORT_LINES_TARGET_X
 
 PORT_LINES_TARGET_Y
 
- Public Attributes inherited from Vispa.Gui.VispaWidget.VispaWidget
 fillColor1
 
 fillColor2
 
 framePenColor
 
 HEIGHT
 
 WIDTH
 

Static Public Attributes

string BACKGROUND_SHAPE = 'ROUNDRECT'
 
string NO_VALID_PORT_NAMES_POSITION_MESSAGE = "No valid position for port names was set."
 
int PORT_LINES_TARGET_X = -1
 
int PORT_LINES_TARGET_Y = -1
 
int PORT_NAMES_ABOVE_PORTS = 1
 
int PORT_NAMES_NEXT_TO_PORTS = 0
 
 PORT_NAMES_POSITION = PORT_NAMES_NEXT_TO_PORTS
 
 SHOW_PORT_LINES = False
 
 SHOW_PORT_NAMES = False
 
- Static Public Attributes inherited from Vispa.Gui.VispaWidget.VispaWidget
 ARROW_SHAPE = None
 
int ARROW_SHAPE_BOTTOM = 2
 
int ARROW_SHAPE_LEFT = 1
 
int ARROW_SHAPE_RIGHT = 3
 
int ARROW_SHAPE_TOP = 0
 
int ARROW_SIZE = 30
 
 AUTOPOSITIONIZE_WHEN_ZOOMING_FLAG = True
 
 AUTOSIZE = False
 
 AUTOSIZE_KEEP_ASPECT_RATIO = True
 
string BACKGROUND_SHAPE = 'RECT'
 
int BOTTOM_MARGIN = 5
 
 COLOR_HEADER_BACKGROUND_FLAG = True
 
tuple FILL_COLOR1 = QColor(188, 215, 241)
 
tuple FILL_COLOR2 = QColor(242, 230, 242)
 
 FOCUSPOLICY = Qt.StrongFocus
 
int HEIGHT = 80
 
int HORIZONTAL_INNER_MARGIN = 5
 
int LEFT_MARGIN = 5
 
int MINIMUM_HEIGHT = 0
 
int MINIMUM_WIDTH = 30
 
tuple PEN_COLOR = QColor(128, 186, 224)
 
int RIGHT_MARGIN = 5
 
int ROUNDRECT_RADIUS = 30
 
tuple SELECT_COLOR = QColor('darkblue')
 
 SELECTABLE_FLAG = True
 
int SELECTED_FRAME_WIDTH = 2
 
 TEXTFIELD_AUTOSIZE_FONT_FLAG = False
 
 TEXTFIELD_AUTOTRUNCATE_TEXT_FLAG = False
 
 TEXTFIELD_FLAGS = Qt.TextWordWrap
 
int TEXTFIELD_FONTSIZE = 12
 
int TEXTFIELD_FONTSIZE_MAX = 20
 
int TEXTFIELD_FONTSIZE_MIN = 2
 
tuple TITLE_COLOR = QColor(Qt.white)
 
int TITLEFIELD_FONTSIZE = 12
 
int TOP_MARGIN = 5
 
 USE_BACKGROUND_GRADIENT_FLAG = True
 
int VERTICAL_INNTER_MARGIN = 5
 
int WIDTH = 100
 

Private Member Functions

def _addPort
 
def _getMaxPortTitleWidth
 
def _getMaxSinkTitleWidth
 
def _getMaxSourceTitleWidth
 

Private Attributes

 _menuWidget
 
 _portNamesPosition
 
 _ports
 
 _showPortLines
 
 _showPortNames
 

Detailed Description

Widget which can be connection by PortConnections to other selectable widgets.

Supports showing source and sink ports.
The widget is owner of PortWidgets.

Definition at line 11 of file ConnectableWidget.py.

Constructor & Destructor Documentation

def Vispa.Gui.ConnectableWidget.ConnectableWidget.__init__ (   self,
  parent = None,
  name = None 
)
Constructor.

Definition at line 34 of file ConnectableWidget.py.

34 
35  def __init__(self, parent=None, name=None):
36  """ Constructor.
37  """
38  self._ports = []
39  self._showPortNames = False
40  self._portNamesPosition = None
41  self._showPortLines = False
42  self._menuWidget = None
43  VispaWidget.__init__(self, parent)
47 
48  if name:
49  self.setTitle(name)

Member Function Documentation

def Vispa.Gui.ConnectableWidget.ConnectableWidget._addPort (   self,
  port,
  description = None 
)
private

Definition at line 237 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._ports, and Vispa.Gui.VispaWidget.VispaWidget.scheduleRearangeContent().

Referenced by Vispa.Gui.ConnectableWidget.ConnectableWidget.addSinkPort(), and Vispa.Gui.ConnectableWidget.ConnectableWidget.addSourcePort().

238  def _addPort(self, port, description=None):
239  self._ports.append(port)
240  port.show()
241  if description:
242  self._ports[len(self._ports) - 1].setDescription(description)
def Vispa.Gui.ConnectableWidget.ConnectableWidget._getMaxPortTitleWidth (   self,
  type 
)
private

Definition at line 322 of file ConnectableWidget.py.

References max(), Vispa.Gui.ConnectableWidget.ConnectableWidget.sinkPorts(), and Vispa.Gui.ConnectableWidget.ConnectableWidget.sourcePorts().

Referenced by Vispa.Gui.ConnectableWidget.ConnectableWidget._getMaxSinkTitleWidth(), and Vispa.Gui.ConnectableWidget.ConnectableWidget._getMaxSourceTitleWidth().

323  def _getMaxPortTitleWidth(self, type):
324  if type == 'sink':
325  ports = self.sinkPorts()
326  elif type == 'source':
327  ports = self.sourcePorts()
328  else:
329  return 0
330 
331  if len(ports) < 1:
332  return 0
333  return max([port.titleField().getWidth() for port in ports])
const T & max(const T &a, const T &b)
def Vispa.Gui.ConnectableWidget.ConnectableWidget._getMaxSinkTitleWidth (   self)
private

Definition at line 334 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._getMaxPortTitleWidth().

Referenced by Vispa.Gui.ConnectableWidget.ConnectableWidget.defineDistances(), and Vispa.Gui.ConnectableWidget.ConnectableWidget.sizeHint().

335  def _getMaxSinkTitleWidth(self):
336  return self._getMaxPortTitleWidth('sink')
def Vispa.Gui.ConnectableWidget.ConnectableWidget._getMaxSourceTitleWidth (   self)
private

Definition at line 337 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._getMaxPortTitleWidth().

Referenced by Vispa.Gui.ConnectableWidget.ConnectableWidget.sizeHint().

338  def _getMaxSourceTitleWidth(self):
339  return self._getMaxPortTitleWidth('source')
def Vispa.Gui.ConnectableWidget.ConnectableWidget.addMenuEntry (   self,
  name,
  slot = None 
)

Definition at line 511 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._menuWidget, python.multivaluedict.MyUserList.parent, FSimVertex.parent(), reco::PattRecoNode< Cluster >.parent(), DDI::Division.parent(), EmDQMReco::FourVectorMonitorElements.parent, graphwalker< ReferenceCountingPointer, ReferenceCountingPointer >.parent(), graphwalker< DDLogicalPart, DDPosData * >.parent(), graphwalker< N, E >.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.Gui.WidgetContainer.WidgetContainer.setShowCollapseMenu().

512  def addMenuEntry(self, name, slot=None):
513  if not self._menuWidget:
514  self._menuWidget = MenuWidget(self.parent(), self)
515  self.setMouseTracking(True)
516  return self._menuWidget.addEntry(name, slot)
def Vispa.Gui.ConnectableWidget.ConnectableWidget.addSinkPort (   self,
  name,
  description = None 
)
Adds sink port with name and optional description text.

Definition at line 223 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._addPort().

224  def addSinkPort(self, name, description=None):
225  """ Adds sink port with name and optional description text.
226  """
227  port=SinkPort(self, name)
228  self._addPort(port, description)
229  return port
def Vispa.Gui.ConnectableWidget.ConnectableWidget.addSourcePort (   self,
  name,
  description = None 
)
Adds source port with name and optional description text.

Definition at line 230 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._addPort().

231  def addSourcePort(self, name, description=None):
232  """ Adds source port with name and optional description text.
233  """
234  port=SourcePort(self, name)
235  self._addPort(port, description)
236  return port
def Vispa.Gui.ConnectableWidget.ConnectableWidget.arrangePorts (   self,
  filter = None 
)
Sets positions of set ports depending on zoom factor.

If filter is set it may be 'sink' or 'source'.

Definition at line 374 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._ports, ValidateGeometry.getDistance(), Vispa.Gui.VispaWidget.VispaWidget.getDistance(), and Vispa.Gui.ConnectableWidget.ConnectableWidget.getEffectivePortHeight().

Referenced by Vispa.Gui.ConnectableWidget.ConnectableWidget.rearangeContent(), and Vispa.Gui.ConnectableWidget.ConnectableWidget.sizeHint().

375  def arrangePorts(self, filter=None):
376  """ Sets positions of set ports depending on zoom factor.
377 
378  If filter is set it may be 'sink' or 'source'.
379  """
380  if filter and (filter != "sink" and filter != "source"):
381  filter = None
382  sinkCounter = 0
383  sourceCounter = 0
384 
385  sinkX = self.getDistance('firstSinkX')
386  sinkY = self.getDistance('firstSinkY')
387  sourceX = self.getDistance('firstSourceX')
388  sourceY = self.getDistance('firstSourceY')
389 
390  for port in self._ports:
391  if port.portType() == 'sink' and (not filter or filter == "sink"):
392  sinkCounter += 1
393  port.move(sinkX, sinkY)
394  sinkY -= self.getDistance('topMargin') + self.getEffectivePortHeight(port) #+ PortWidget.HEIGHT * self.scale()
395 
396  elif port.portType() == 'source' and (not filter or filter == "source"):
397  sourceCounter += 1
398  port.move(sourceX, sourceY)
399  sourceY -= self.getDistance('topMargin') + self.getEffectivePortHeight(port) # + PortWidget.HEIGHT * self.scale()
def Vispa.Gui.ConnectableWidget.ConnectableWidget.attachedConnections (   self)

Definition at line 557 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._ports.

558  def attachedConnections(self):
559  connections = []
560  for port in self._ports:
561  connections += port.attachedConnections()
562  return connections
def Vispa.Gui.ConnectableWidget.ConnectableWidget.centerSinglePortVertically (   self,
  ports,
  portX 
)
Centers port vertically within body part (widget without title) of ModuleWidget.

ports can either be the list of source or sink ports of ModuleWidget.
portX specifies the designated x coordinate to be adjustable for sinks and sources.

Definition at line 362 of file ConnectableWidget.py.

References ValidateGeometry.getDistance(), Vispa.Gui.VispaWidget.VispaWidget.getDistance(), cscdqm::StripClusterFitData.height(), GifDisplay.height, FedTimingAnalysis.height(), lhef::SimpleMatrix< T >.height, btag::SimpleMatrix< T >.height, produceOfflineValidationTex.PageLayout.height, FWTextTableCellRenderer.height(), FWFramedTextTableCellRenderer.height(), ApvTimingAnalysis.height(), FWTableCellRendererBase.height(), FWGeometryTableManagerBase::ColorBoxRenderer.height(), svgfig.Plot.height, svgfig.Frame.height, Vispa.Gui.VispaWidget.VispaWidget.height(), svgfig.Dots.height, and Vispa.Gui.ConnectableWidget.ConnectableWidget.move().

363  def centerSinglePortVertically(self, ports, portX):
364  """ Centers port vertically within body part (widget without title) of ModuleWidget.
365 
366  ports can either be the list of source or sink ports of ModuleWidget.
367  portX specifies the designated x coordinate to be adjustable for sinks and sources.
368  """
369  if len(ports) != 1 or not isinstance(ports[0], PortWidget):
370  logging.warning(self.__class__.__name__ + ": centerSinglePortVertically() - This method was designed for plugins with one port. Falling back to default arrangement.")
371  return False
372  ports[0].move(portX, (self.height() + self.getDistance("titleFieldHeight")) * 0.5)
373  return True
def Vispa.Gui.ConnectableWidget.ConnectableWidget.defineDistances (   self,
  keepDefaultRatio = False 
)
Extends distances of VispaWidget by the additionally needed distances for displaying ports.

Definition at line 155 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._getMaxSinkTitleWidth(), Vispa.Gui.ConnectableWidget.ConnectableWidget._showPortNames, Vispa.Gui.VispaWidget.VispaWidget.distances(), Vispa.Gui.ConnectableWidget.ConnectableWidget.sinkPorts(), and Vispa.Gui.VispaWidget.VispaWidget.textFieldIsSet().

Referenced by Vispa.Gui.VispaWidget.VispaWidget.getDistance().

156  def defineDistances(self, keepDefaultRatio=False):
157  """ Extends distances of VispaWidget by the additionally needed distances for displaying ports.
158  """
159  #if scale == None:
160  # scale = self.scale()
161  scale = 1.0
162 
163  if not VispaWidget.defineDistances(self, keepDefaultRatio):
164  return False
165  if len(self.sinkPorts()) > 0:
166  self.distances()['textFieldX'] += PortWidget.WIDTH * scale + self.distances()['leftMargin']
167  self.distances()['textFieldRight'] = self.distances()['textFieldX'] + self.distances()['textFieldWidth']
168  if self._showPortNames:
169  self.distances()['textFieldX'] += self._getMaxSinkTitleWidth() + self.distances()['leftMargin']
170  self.distances()['textFieldRight'] += self._getMaxSinkTitleWidth() + self.distances()['leftMargin']
171 
172  firstPortY = self.distances()['height'] - self.distances()['bottomMargin'] - PortWidget.HEIGHT * scale
173  self.distances()['firstSinkX'] = self.distances()['leftMargin']
174  self.distances()['firstSinkY'] = firstPortY
175 
176  if self.textFieldIsSet():
177  self.distances()['firstSourceX'] = self.distances()['textFieldRight'] + self.distances()['leftMargin']
178  #else:
179  self.distances()['firstSourceX'] = self.distances()['width'] - self.distances()['leftMargin'] - PortWidget.WIDTH * scale
180  self.distances()['firstSourceY'] = firstPortY
181 
182  return True
183 
184 # def scaleChanged(self):
185 # """ Arranges ports when scale has changed.
186 # """
187 # VispaWidget.scaleChanged(self)
188 # self.arrangePorts()
def Vispa.Gui.ConnectableWidget.ConnectableWidget.deleteLater (   self)

Definition at line 244 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._menuWidget, Vispa.Gui.ConnectableWidget.ConnectableWidget._ports, and Vispa.Gui.ConnectableWidget.ConnectableWidget.removeMenu().

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.delete(), and Vispa.Gui.VispaWidget.VispaWidget.delete().

245  def deleteLater(self):
246  if self._menuWidget:
247  self.removeMenu()
248  for port in self._ports:
249  port.deleteAttachedConnections()
250  VispaWidget.deleteLater(self)
def Vispa.Gui.ConnectableWidget.ConnectableWidget.dragWidget (   self,
  pPos 
)

Definition at line 538 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget.positionizeMenuWidget().

Referenced by Vispa.Gui.VispaWidget.VispaWidget.mouseMoveEvent().

539  def dragWidget(self, pPos):
540  VispaWidget.dragWidget(self, pPos)
541  self.positionizeMenuWidget()
def Vispa.Gui.ConnectableWidget.ConnectableWidget.drawBody (   self,
  painter 
)
Takes care of painting widget content on given painter.

Definition at line 400 of file ConnectableWidget.py.

References Vispa.Gui.VispaWidget.VispaWidget.drawImage(), Vispa.Gui.ConnectableWidget.ConnectableWidget.drawPortLines(), Vispa.Gui.ConnectableWidget.ConnectableWidget.drawPortNames(), Vispa.Gui.PortWidget.PortWidget.drawTextField(), and Vispa.Gui.VispaWidget.VispaWidget.drawTextField().

Referenced by Vispa.Gui.VispaWidget.VispaWidget.paint().

401  def drawBody(self, painter):
402  """ Takes care of painting widget content on given painter.
403  """
404  self.drawPortLines(painter)
405  self.drawTextField(painter)
406  self.drawImage(painter)
407  self.drawPortNames(painter)
def Vispa.Gui.ConnectableWidget.ConnectableWidget.drawPortLines (   self,
  painter 
)
Draws lines from every port to a common point.

See setShowPortLines().

Definition at line 441 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._showPortLines.

Referenced by Vispa.Gui.ConnectableWidget.ConnectableWidget.drawBody().

442  def drawPortLines(self, painter):
443  """ Draws lines from every port to a common point.
444 
445  See setShowPortLines().
446  """
447  if not self._showPortLines:
448  return
449 
450  if self.PORT_LINES_TARGET_X == -1 and self.PORT_LINES_TARGET_Y == -1:
451  targetPoint = QPoint(self.width(), self.height() + self.getDistance("titleFieldBottom")) * 0.5
452  else:
453  targetPoint = QPoint(self.PORT_LINES_TARGET_X, self.PORT_LINES_TARGET_Y) * self.scale()
454 
455  painter.setPen(QPen(QColor('black')))
456  painter.pen().setWidth(1)
457 
458  for port in self.ports():
459  painter.drawLine(port.connectionPoint("widget"), targetPoint)
def Vispa.Gui.ConnectableWidget.ConnectableWidget.drawPortNames (   self,
  painter 
)
Paints port names next to PortWidget.

See setShowPortNames().

Definition at line 408 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._portNamesPosition, Vispa.Gui.ConnectableWidget.ConnectableWidget._showPortNames, ValidateGeometry.getDistance(), Vispa.Gui.VispaWidget.VispaWidget.getDistance(), Vispa.Gui.ConnectableWidget.ConnectableWidget.NO_VALID_PORT_NAMES_POSITION_MESSAGE, Vispa.Gui.VispaWidget.VispaWidget.paint(), Vispa.Gui.ConnectableWidget.ConnectableWidget.PORT_NAMES_ABOVE_PORTS, Vispa.Gui.ConnectableWidget.ConnectableWidget.PORT_NAMES_NEXT_TO_PORTS, CaloMeanResponse.scale, LocalError.scale(), CaloSamples.scale(), DQMRivetClient::ScaleFactorOption.scale, python.rootplot.rootmath.Target.scale, reco::PattRecoPeak< Real >.scale(), python.rootplot.tree2hists.RootTree.scale, MuonErrorMatrix.scale, Vispa.Gui.VispaWidget.VispaWidget.scale(), Vispa.Gui.ConnectableWidget.ConnectableWidget.sinkPorts(), Vispa.Gui.ConnectableWidget.ConnectableWidget.sourcePorts(), TmModule.width, Random_struct.width, OpenBounds.width(), GifDisplay.width, SimpleDiskBounds.width(), PhysicsTools::Calibration::Range< Axis_t >.width(), GeneralTrapezoidalPlaneBounds.width(), RectangularPlaneBounds.width(), funct::GammaZInterference.width, RooCB.width, GeneralNSurfaceDelimitedBounds.width(), Bounds.width(), SimpleCylinderBounds.width(), funct::BreitWigner.width, DDTIDAxialCableAlgo.width, DDTECAxialCableAlgo.width, TrapezoidalPlaneBounds.width(), reco::CastorJetID.width, AlignableSurface.width(), DDI::Division.width(), FWCheckedTextTableCellRenderer.width(), function::ZMuStandaloneFunction.width, function::ZMuMuFunction.width, FWColumnLabelCellRenderer.width(), btag::SimpleMatrix< T >.width, lhef::SimpleMatrix< T >.width, function::ZMuTrackFunction.width, function::ZMuMuScaledFunction.width, function::ZMuStandaloneScaledFunction.width, function::ZMuTrackScaledFunction.width, function::ZMuTrackScaledNormalBack.width, FWCollectionSummaryModelCellRenderer.width(), SimpleConeBounds.width(), produceOfflineValidationTex.PageLayout.width, FWTextTableCellRenderer.width(), FWFramedTextTableCellRenderer.width(), FWTableCellRendererBase.width(), ProcNormalize::Map.width, reco::CastorCluster.width(), RooDoubleCB.width, reco::CastorJet.width(), reco::CastorEgamma.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(), and svgfig.Dots.width.

Referenced by Vispa.Gui.ConnectableWidget.ConnectableWidget.drawBody().

409  def drawPortNames(self, painter):
410  """ Paints port names next to PortWidget.
411 
412  See setShowPortNames().
413  """
414  if not self._showPortNames:
415  return
416 
417  # factor should be 0.5, but text height is calculated to big
418  titleHeightFactor = 0.4
419 
421  for port in self.sinkPorts():
422  if port.titleField():
423  port.titleField().paint(painter, port.x() + self.getDistance('rightMargin') + port.width(), port.y() - titleHeightFactor * port.getDistance('titleFieldHeight'), self.scale())
424 
425  for port in self.sourcePorts():
426  if port.titleField():
427  #logging.debug(self.__class__.__name__ +": drawPortNames() - "+ port.name() +", "+ str(port.titleField()._autoscaleFlag))
428  port.titleField().paint(painter, port.x() - port.getDistance('titleFieldWidth') - self.getDistance('rightMargin'), port.y() - titleHeightFactor * port.getDistance('titleFieldHeight'), self.scale())
429  elif self._portNamesPosition == self.PORT_NAMES_ABOVE_PORTS:
430  painter.pen().setWidth(2)
431  for port in self.sinkPorts():
432  if port.titleField():
433  port.titleField().paint(painter, self.getDistance('firstSinkX'), port.y() - titleHeightFactor * port.getDistance('titleFieldHeight') - port.height(), self.scale())
434 
435  for port in self.sourcePorts():
436  if port.titleField():
437  #logging.debug(self.__class__.__name__ +": drawPortNames() - "+ port.name() +", "+ str(port.titleField()._autoscaleFlag))
438  port.titleField().paint(painter, self.width() - port.getDistance('titleFieldWidth')- port.width()*0.5, port.y() - titleHeightFactor * port.getDistance('titleFieldHeight') - port.height(), self.scale())
439  else:
440  logging.waring(self.__class__.__name__ +": drawPortNames() - "+ self.NO_VALID_PORT_NAMES_POSITION_MESSAGE)
def Vispa.Gui.ConnectableWidget.ConnectableWidget.dropArea (   self,
  port 
)
A drop area is a QRect in which the ConnectableWidget accepts dropping of PortWidgets to create connections.

The area is greater than the port itself to make dropping easier.

Definition at line 460 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._showPortNames, ValidateGeometry.getDistance(), and Vispa.Gui.VispaWidget.VispaWidget.getDistance().

Referenced by Vispa.Gui.ConnectableWidget.ConnectableWidget.dropAreaPort().

461  def dropArea(self, port):
462  """ A drop area is a QRect in which the ConnectableWidget accepts dropping of PortWidgets to create connections.
463 
464  The area is greater than the port itself to make dropping easier.
465  """
466  if self._showPortNames:
467  return port.frameGeometry().united(port.titleField().getDrawRect())
468  topMargin = self.getDistance("topMargin")
469  topMarginHalf = 0.5 * topMargin
470  frameGeometry = port.frameGeometry()
471  return QRect(frameGeometry.x() - topMarginHalf,
472  frameGeometry.y() - topMarginHalf,
473  frameGeometry.width() + topMargin,
474  frameGeometry.height() + topMargin)
def Vispa.Gui.ConnectableWidget.ConnectableWidget.dropAreaPort (   self,
  position 
)
If a port's drop area is associated with position the port is returned.

If there is no drop area associated with the position None is returned.
See dropArea().

Definition at line 475 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._ports, edm.contains(), and Vispa.Gui.ConnectableWidget.ConnectableWidget.dropArea().

Referenced by Vispa.Gui.ConnectableWidget.ConnectableWidget.mousePressEvent().

476  def dropAreaPort(self, position):
477  """ If a port's drop area is associated with position the port is returned.
478 
479  If there is no drop area associated with the position None is returned.
480  See dropArea().
481  """
482  for port in self._ports:
483  if self.dropArea(port).contains(position):
484  return port
485  return None
bool contains(EventRange const &lh, EventID const &rh)
Definition: EventRange.cc:38
def Vispa.Gui.ConnectableWidget.ConnectableWidget.getEffectivePortHeight (   self,
  port 
)
Returns the bigger value of the source height and the height of the port name text field.

Definition at line 340 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._portNamesPosition, Vispa.Gui.ConnectableWidget.ConnectableWidget._showPortNames, max(), Vispa.Gui.ConnectableWidget.ConnectableWidget.NO_VALID_PORT_NAMES_POSITION_MESSAGE, Vispa.Gui.ConnectableWidget.ConnectableWidget.PORT_NAMES_ABOVE_PORTS, Vispa.Gui.ConnectableWidget.ConnectableWidget.PORT_NAMES_NEXT_TO_PORTS, CaloMeanResponse.scale, LocalError.scale(), CaloSamples.scale(), DQMRivetClient::ScaleFactorOption.scale, python.rootplot.rootmath.Target.scale, reco::PattRecoPeak< Real >.scale(), python.rootplot.tree2hists.RootTree.scale, MuonErrorMatrix.scale, and Vispa.Gui.VispaWidget.VispaWidget.scale().

Referenced by Vispa.Gui.ConnectableWidget.ConnectableWidget.arrangePorts(), and Vispa.Gui.ConnectableWidget.ConnectableWidget.getPortsHeight().

341  def getEffectivePortHeight(self, port):
342  """ Returns the bigger value of the source height and the height of the port name text field.
343  """
344  portHeight = port.height()
345  if not self._showPortNames:
346  return portHeight
347 
348  titleHeight = port.titleField().getHeight() * self.scale()
349 
351  return max(portHeight, titleHeight)
352  elif self._portNamesPosition == self.PORT_NAMES_ABOVE_PORTS:
353  return portHeight + titleHeight
354  logging.waring(self.__class__.__name__ +": getEffectivePortHeight() - "+ self.NO_VALID_PORT_NAMES_POSITION_MESSAGE)
355  return 0
const T & max(const T &a, const T &b)
def Vispa.Gui.ConnectableWidget.ConnectableWidget.getPortsHeight (   self,
  portType 
)
Returns height of all ports of given type.

portType can either be 'sink" or 'source'.

Definition at line 73 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget.getEffectivePortHeight(), Vispa.Gui.ConnectableWidget.ConnectableWidget.sinkPorts(), Vispa.Gui.ConnectableWidget.ConnectableWidget.sourcePorts(), and detailsBasic3DVector.y.

Referenced by Vispa.Gui.ConnectableWidget.ConnectableWidget.sizeHint().

73 
74  def getPortsHeight(self, portType):
75  """ Returns height of all ports of given type.
76 
77  portType can either be 'sink" or 'source'.
78  """
79  if portType == "sink":
80  ports = self.sinkPorts()
81  elif portType == "source":
82  ports = self.sourcePorts()
83  else:
84  return 0
85 
86  if len(ports) > 1:
87  return ports[0].y() - ports[len(ports) -1].y() + 0.5 * self.getEffectivePortHeight(ports[len(ports) -1])
88  elif len(ports) == 1:
89  return self.getEffectivePortHeight(ports[0])
90  else:
91  return 0
def Vispa.Gui.ConnectableWidget.ConnectableWidget.leaveEvent (   self,
  event 
)

Definition at line 499 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._menuWidget, python.DBCopy.DBCopy.cursor, TiXmlParsingData.cursor, TrackingRecHitLessFromGlobalPosition.geometry, HcalDigiTester.geometry, CSCLayer.geometry(), TrackingRecHitTranslator.geometry, SortHitsByGlobalPosition.geometry, SeedGeneratorForCRack.geometry, SeedGeneratorForCosmics.geometry, SiClusterTranslator.geometry, SortHitPointersByGlobalPosition.geometry, cms::CosmicTrackFinder.geometry, EcalDeadCellTriggerPrimitiveFilter.geometry, CaloHitRespoNew.geometry(), HcalSimHitsValidation.geometry, EcalHitResponse.geometry(), SiTrackerGaussianSmearingRecHitConverter.geometry, CaloMiscalibMapEcal.geometry, EcalDeadCellDeltaRFilter.geometry, CosmicTrajectoryBuilder.geometry, Numbers.geometry, CRackTrajectoryBuilder.geometry, HcalRecHitsAnalyzer.geometry, HcalRecHitsValidation.geometry, DetIdSelector.isSelected(), FWGUISubviewArea.isSelected(), FWEventItem::ModelInfo.isSelected(), Vispa.Gui.PortConnection.PointToPointConnection.isSelected(), Vispa.Gui.VispaWidget.VispaWidget.isSelected(), python.multivaluedict.MyUserList.parent, FSimVertex.parent(), reco::PattRecoNode< Cluster >.parent(), DDI::Division.parent(), EmDQMReco::FourVectorMonitorElements.parent, graphwalker< ReferenceCountingPointer, ReferenceCountingPointer >.parent(), graphwalker< DDLogicalPart, DDPosData * >.parent(), graphwalker< N, E >.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().

500  def leaveEvent(self, event):
501  #logging.debug("%s: leaveEvent()" % self.__class__.__name__)
502  parentCursorPos = self.parent().mapFromGlobal(self.cursor().pos())
503  bottomRight = self.geometry().bottomRight()
504  if ( (not self.isSelected() or (self._menuWidget and self._menuWidget.cursorHasEntered())) \
505  and (self._menuWidget and self.parent().childAt(parentCursorPos) != self._menuWidget) ) \
506  or (self._menuWidget and ( parentCursorPos.x() > bottomRight.x() or parentCursorPos.y() > bottomRight.y())):
507  self._menuWidget.hide()
def Vispa.Gui.ConnectableWidget.ConnectableWidget.menu (   self)

Definition at line 508 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._menuWidget.

Referenced by Vispa.Gui.WidgetContainer.WidgetContainer.mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer.mouseMoveEvent(), Vispa.Gui.WidgetContainer.WidgetContainer.showMenu(), and Vispa.Gui.WidgetContainer.WidgetContainer.toggleCollapse().

509  def menu(self):
510  return self._menuWidget
def Vispa.Gui.ConnectableWidget.ConnectableWidget.mouseMoveEvent (   self,
  event 
)

Definition at line 486 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._menuWidget, Vispa.Gui.ConnectableWidget.ConnectableWidget.positionizeMenuWidget(), and Vispa.Gui.ConnectableWidget.ConnectableWidget.showMenu().

487  def mouseMoveEvent(self, event):
488  if bool(event.buttons() & Qt.LeftButton):
489  VispaWidget.mouseMoveEvent(self, event)
490  elif self._menuWidget:
491  self.positionizeMenuWidget()
492 
493  self.showMenu()
def Vispa.Gui.ConnectableWidget.ConnectableWidget.mousePressEvent (   self,
  event 
)
Makes sure event is forwarded to both base classes.

If position of event is within the dropArea of a port a QMouseEvent is sent to the port. See dropArea().

Definition at line 195 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget.dropAreaPort().

196  def mousePressEvent(self, event):
197  """ Makes sure event is forwarded to both base classes.
198 
199  If position of event is within the dropArea of a port a QMouseEvent is sent to the port. See dropArea().
200  """
201  dropAreaPort = self.dropAreaPort(event.pos())
202  if dropAreaPort and dropAreaPort.isDragable():
203  dropAreaPort.grabMouse()
204  newEvent = QMouseEvent(event.type(), dropAreaPort.mapFromParent(event.pos()), event.button(), event.buttons(), event.modifiers())
205  QCoreApplication.instance().sendEvent(dropAreaPort, newEvent)
206  else:
207  VispaWidgetOwner.mousePressEvent(self, event)
208  VispaWidget.mousePressEvent(self, event)
def Vispa.Gui.ConnectableWidget.ConnectableWidget.mouseReleaseEvent (   self,
  event 
)
Calls realeseMouse() to make sure the widget does not grab the mouse.

Necessary because ConnectableWidgetOwner.propagateEventUnderConnectionWidget() may call grabMouse() on this widget.

Definition at line 209 of file ConnectableWidget.py.

210  def mouseReleaseEvent(self, event):
211  """ Calls realeseMouse() to make sure the widget does not grab the mouse.
212 
213  Necessary because ConnectableWidgetOwner.propagateEventUnderConnectionWidget() may call grabMouse() on this widget.
214  """
215  #logging.debug(self.__class__.__name__ +": mouseReleaseEvent()")
216  self.releaseMouse()
217  VispaWidget.mouseReleaseEvent(self, event)
def Vispa.Gui.ConnectableWidget.ConnectableWidget.move (   self,
  target 
)

Definition at line 547 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._menuWidget, and Vispa.Gui.ConnectableWidget.ConnectableWidget.updateAttachedConnections().

Referenced by Vispa.Gui.WidgetContainer.WidgetContainer.autosize(), Vispa.Gui.ConnectableWidget.ConnectableWidget.centerSinglePortVertically(), Vispa.Gui.VispaWidget.VispaWidget.dragWidget(), Vispa.Views.LineDecayView.LineDecayContainer.mouseMoveEvent(), Vispa.Gui.VispaWidget.VispaWidget.setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection.updateConnection().

548  def move(self, *target):
549  VispaWidget.move(self, *target)
550  if self._menuWidget:
551  self._menuWidget.hide()
def Vispa.Gui.ConnectableWidget.ConnectableWidget.port (   self,
  name,
  type 
)
Returns port with given name and of given type.

Definition at line 312 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._ports.

Referenced by Vispa.Gui.ConnectableWidget.ConnectableWidget.sinkPort(), and Vispa.Gui.ConnectableWidget.ConnectableWidget.sourcePort().

313  def port(self, name, type):
314  """ Returns port with given name and of given type.
315  """
316  if name == None:
317  return None
318  for port in self._ports:
319  if port.portType() == type and port.name() == name:
320  return port
321  return None
def Vispa.Gui.ConnectableWidget.ConnectableWidget.portExists (   self,
  name,
  description = None 
)

Definition at line 261 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._ports.

262  def portExists(self, name, description=None):
263  for port in self._ports:
264  if port.name() == name and port.description() == description:
265  return True
266  return False
def Vispa.Gui.ConnectableWidget.ConnectableWidget.ports (   self)
Returns list containing all source and sink port widgets.

Definition at line 218 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._ports.

219  def ports(self):
220  """ Returns list containing all source and sink port widgets.
221  """
222  return self._ports
def Vispa.Gui.ConnectableWidget.ConnectableWidget.positionizeMenuWidget (   self)

Definition at line 530 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._menuWidget, Vispa.Gui.VispaWidget.VispaWidget.getDistance(), max(), python.multivaluedict.MyUserList.parent, FSimVertex.parent(), reco::PattRecoNode< Cluster >.parent(), DDI::Division.parent(), EmDQMReco::FourVectorMonitorElements.parent, graphwalker< ReferenceCountingPointer, ReferenceCountingPointer >.parent(), graphwalker< DDLogicalPart, DDPosData * >.parent(), graphwalker< N, E >.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, Vispa.Views.LineDecayView.DecayObject.parent(), TmModule.width, Random_struct.width, OpenBounds.width(), GifDisplay.width, SimpleDiskBounds.width(), PhysicsTools::Calibration::Range< Axis_t >.width(), GeneralTrapezoidalPlaneBounds.width(), RectangularPlaneBounds.width(), funct::GammaZInterference.width, RooCB.width, GeneralNSurfaceDelimitedBounds.width(), Bounds.width(), SimpleCylinderBounds.width(), funct::BreitWigner.width, DDTIDAxialCableAlgo.width, DDTECAxialCableAlgo.width, TrapezoidalPlaneBounds.width(), reco::CastorJetID.width, AlignableSurface.width(), DDI::Division.width(), function::ZMuStandaloneFunction.width, FWCheckedTextTableCellRenderer.width(), btag::SimpleMatrix< T >.width, function::ZMuMuFunction.width, lhef::SimpleMatrix< T >.width, FWColumnLabelCellRenderer.width(), function::ZMuMuScaledFunction.width, function::ZMuTrackFunction.width, function::ZMuStandaloneScaledFunction.width, function::ZMuTrackScaledFunction.width, function::ZMuTrackScaledNormalBack.width, FWCollectionSummaryModelCellRenderer.width(), SimpleConeBounds.width(), produceOfflineValidationTex.PageLayout.width, FWFramedTextTableCellRenderer.width(), FWTextTableCellRenderer.width(), FWTableCellRendererBase.width(), ProcNormalize::Map.width, reco::CastorCluster.width(), RooDoubleCB.width, reco::CastorJet.width(), reco::CastorEgamma.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, Quad.x, RPFlatParams::EP.x, reco::MuonRPCHitMatch.x, gen::PdfInfo.x, EnergyDepositUnit.x(), reco::MuonChamberMatch.x, SimplePixel.x, AmplitudeSegmentFP420.x(), lumiregperbunch.bsmeas.x, TkLayerMap::XYbin.x, QuantileCalculator::point.x, SignalPoint.x(), TwoBodyDecayParameters.x, reco::MuonMETCorrectionData.x(), cmsmath::MinimizerContext.x, Geom::Polar2Cartesian< T >.x(), SiStripFineDelayTOF.x(), EnergySegmentFP420.x(), RooCB.x, BinomialProbHelper.x(), HFShowerPhoton.x(), ClusterShape.x, EcalTBHodoscopeRecInfoAlgo::BeamTrack.x, reco::MuonSegmentMatch.x, SiPixelCluster::Pixel.x, RHStopTracer::StopPoint.x, VerticalInterpHistPdf.x(), BeamSpotFakeConditions.x, PGlobalSimHit::Vtx.x, RooPower.x, QcdLowPtDQM::Pixel.x(), TotemTestHistoClass::Hit.x, PV2DBase< float, PointTag, LocalTag >.x(), PV2DBase< T, VectorTag, FrameTag >.x(), PV2DBase< float, VectorTag, GlobalTag >.x(), PV2DBase< T, PointTag, FrameTag >.x(), PV2DBase< double, PointTag, LocalTag >.x(), Point2DBase< Scalar, LocalTag >.x(), Point2DBase< U, FrameTag >.x(), Vector2DBase< U, FrameTag >.x(), Point2DBase< T, Frame >.x(), Vector2DBase< U, Frame >.x(), Vector2DBase< T, Frame >.x(), Point2DBase< U, Frame >.x(), Point2DBase< T, FrameTag >.x(), Vector2DBase< T, FrameTag >.x(), PV2DBase< T, PVType, FrameType >.x(), mathSSE::Rot3< Scalar >.x(), mathSSE::Rot3< double >.x(), mathSSE::Rot3< float >.x(), mathSSE::Rot3< align::Scalar >.x(), Rot3< T >.x(), mathSSE::Rot3< T >.x(), HcalForwardAnalysis::Photon.x, Geom::Cylindrical2Cartesian< T >.x(), ParabolaFit::Point.x, BeamSpotOnline.x(), VertexType.x, MuScleFitMuon.x(), RooCMSShape.x, Pixinfo.x, RooDoubleCB.x, funct::GaussLegendreIntegrator.x, Basic2DVector< double >.x(), Basic2DVector< float >.x(), Basic2DVector< TmpType >.x(), Hit.x, Basic2DVector< U >.x(), reco::CastorCell.x(), Basic2DVector< T >.x(), PV3DBase< float, VectorTag, LocalTag >.x(), PV3DBase< float, PointTag, LocalTag >.x(), PV3DBase< Scalar, VectorTag, GlobalTag >.x(), PV3DBase< T, PointTag, GlobalTag >.x(), PV3DBase< T, VectorTag, FrameTag >.x(), PV3DBase< Scalar, PointTag, GlobalTag >.x(), PV3DBase< T, PointTag, FrameTag >.x(), PV3DBase< float, PointTag, GlobalTag >.x(), PV3DBase< align::Scalar, PointTag, GlobalTag >.x(), PV3DBase< long double, PointTag, GlobalTag >.x(), Point3DBase< U, LocalTag >.x(), Vector3DBase< U, LocalTag >.x(), Point3DBase< U, GlobalTag >.x(), Vector3DBase< U, GlobalTag >.x(), Point3DBase< U, FrameTag >.x(), Vector3DBase< U, FrameTag >.x(), Point3DBase< T, Frame >.x(), Vector3DBase< U, Frame >.x(), Vector3DBase< T, Frame >.x(), Point3DBase< U, Frame >.x(), Vector3DBase< T, FrameTag >.x(), PV3DBase< T, PVType, FrameType >.x(), Clust.x, PrimaryVertexAnalyzer::simPrimaryVertex.x, python.rootplot.utilities.Hist2D.x, reco::BeamSpot.x(), Geom::Spherical2Cartesian< T >.x(), Basic3DVector< long double >.x(), QcdLowPtDQM::Vertex.x(), PixelUnpackingRegions::Module.x, SiPixelCluster.x(), Rechit.x, reco::CastorEgamma.x(), reco::CastorJet.x(), MoveFlatParamsToDB.x, HcalForwardAnalysis.x, RooFermi.x, hit.x, Basic3DVector< Scalar >.x(), Basic3DVector< float >.x(), Basic3DVector< align::Scalar >.x(), Basic3DVector< U >.x(), Basic3DVector< double >.x(), Basic3DVector< T >.x(), stAPVGain.x, Geom::Cartesian2Cartesian3D< T >.x(), reco::Vertex.x(), reco::CastorTower.x(), reco::CastorCluster.x(), cmsmath::OneDimMinimizer.x(), GaussianSumUtilities1D::FinderState.x, PrimaryVertexAnalyzer4PU::simPrimaryVertex.x, VertexClassifier::GeneratedPrimaryVertex.x, RooRelBW.x, funct::GaussIntegrator.x, SiPixelDigitizerAlgorithm::EnergyDepositUnit.x(), XHistogram::position.x, mathSSE::Rot2< double >.x(), Rot2< T >.x(), mathSSE::Rot2< T >.x(), MuonGeometryArrange::MGACollection.x, python.rootplot.utilities.Hist.x, PrimaryVertexAnalyzer4PU::SimEvent.x, TrackClassifier::GeneratedPrimaryVertex.x, SiPixelDigitizerAlgorithm::SignalPoint.x(), reco::CaloCluster.x(), lhef::HEPEUP::FiveVector.x, EPOS::EPOS_Wrapper.x(), BeamSpotOnlineRaw_v4.x, RooLevelledExp.x, RawParticle.x(), MuScleFitUtils.x, perftools::detail::Hist.x, TkRotation< Scalar >.x(), TkRotation< double >.x(), TkRotation< float >.x(), TkRotation< align::Scalar >.x(), TkRotation< U >.x(), TkRotation< T >.x(), hitfit::Fourvec_Event.x(), TkRotation2D< double >.x(), TkRotation2D< T >.x(), PDF.x, svgfig.Plot.x, svgfig.Frame.x, Vispa.Views.LineDecayView.DecayNode.x(), PMuonSimHit::Vtx.x, PTrackerSimHit::Vtx.x, svgfig.Text.x, svgfig.TextGlobal.x, svgfig.VLine.x, Quad.y, RPFlatParams::EP.y, reco::MuonChamberMatch.y, EnergyDepositUnit.y(), TkLayerMap::XYbin.y, SimplePixel.y, AmplitudeSegmentFP420.y(), lumiregperbunch.bsmeas.y, SignalPoint.y(), TwoBodyDecayParameters.y, reco::MuonMETCorrectionData.y(), Geom::Polar2Cartesian< T >.y(), SiStripFineDelayTOF.y(), EnergySegmentFP420.y(), HFShowerPhoton.y(), ClusterShape.y, reco::MuonSegmentMatch.y, SiPixelCluster::Pixel.y, RHStopTracer::StopPoint.y, BeamSpotFakeConditions.y, PGlobalSimHit::Vtx.y, QcdLowPtDQM::Pixel.y(), TotemTestHistoClass::Hit.y, PV2DBase< double, PointTag, LocalTag >.y(), Point2DBase< U, FrameTag >.y(), Vector2DBase< T, Frame >.y(), PV2DBase< T, PVType, FrameType >.y(), Vector2DBase< U, FrameTag >.y(), Point2DBase< U, Frame >.y(), PV2DBase< float, PointTag, LocalTag >.y(), Point2DBase< Scalar, LocalTag >.y(), PV2DBase< T, PointTag, FrameTag >.y(), Vector2DBase< U, Frame >.y(), PV2DBase< T, VectorTag, FrameTag >.y(), Point2DBase< T, Frame >.y(), PV2DBase< float, VectorTag, GlobalTag >.y(), Vector2DBase< T, FrameTag >.y(), Point2DBase< T, FrameTag >.y(), Rot3< T >.y(), mathSSE::Rot3< T >.y(), mathSSE::Rot3< align::Scalar >.y(), mathSSE::Rot3< double >.y(), mathSSE::Rot3< Scalar >.y(), mathSSE::Rot3< float >.y(), HcalForwardAnalysis::Photon.y, ParabolaFit::Point.y, Geom::Cylindrical2Cartesian< T >.y(), BeamSpotOnline.y(), VertexType.y, MuScleFitMuon.y(), Pixinfo.y, Hit.y, Vector3DBase< U, GlobalTag >.y(), Vector3DBase< T, FrameTag >.y(), Vector3DBase< U, Frame >.y(), PV3DBase< Scalar, VectorTag, GlobalTag >.y(), Vector3DBase< T, Frame >.y(), PV3DBase< T, PointTag, FrameTag >.y(), Point3DBase< U, LocalTag >.y(), PV3DBase< T, PVType, FrameType >.y(), Point3DBase< U, GlobalTag >.y(), PV3DBase< float, PointTag, GlobalTag >.y(), Point3DBase< U, Frame >.y(), Vector3DBase< U, FrameTag >.y(), Vector3DBase< U, LocalTag >.y(), Point3DBase< T, Frame >.y(), PV3DBase< float, VectorTag, LocalTag >.y(), PV3DBase< Scalar, PointTag, GlobalTag >.y(), PV3DBase< T, PointTag, GlobalTag >.y(), PV3DBase< float, PointTag, LocalTag >.y(), PV3DBase< align::Scalar, PointTag, GlobalTag >.y(), PV3DBase< long double, PointTag, GlobalTag >.y(), PV3DBase< T, VectorTag, FrameTag >.y(), Point3DBase< U, FrameTag >.y(), Basic2DVector< T >.y(), Basic2DVector< U >.y(), Basic2DVector< float >.y(), Basic2DVector< TmpType >.y(), reco::CastorCell.y(), Basic2DVector< double >.y(), PrimaryVertexAnalyzer::simPrimaryVertex.y, Clust.y, python.rootplot.utilities.Hist2D.y, reco::BeamSpot.y(), Geom::Spherical2Cartesian< T >.y(), QcdLowPtDQM::Vertex.y(), Basic3DVector< long double >.y(), PixelUnpackingRegions::Module.y, Rechit.y, reco::CastorEgamma.y(), reco::CastorJet.y(), ProtoJet.y(), HcalForwardAnalysis.y, MoveFlatParamsToDB.y, SiPixelCluster.y(), hit.y, Basic3DVector< align::Scalar >.y(), Geom::Cartesian2Cartesian3D< T >.y(), stAPVGain.y, Basic3DVector< Scalar >.y(), Basic3DVector< T >.y(), Basic3DVector< U >.y(), Basic3DVector< double >.y(), Basic3DVector< float >.y(), reco::Vertex.y(), reco::CastorTower.y(), reco::Particle.y(), reco::CastorCluster.y(), PrimaryVertexAnalyzer4PU::simPrimaryVertex.y, reco::Candidate.y(), GaussianSumUtilities1D::FinderState.y, VertexClassifier::GeneratedPrimaryVertex.y, SiPixelDigitizerAlgorithm::EnergyDepositUnit.y(), XHistogram::position.y, reco::LeafRefCandidateT< T >.y(), LeafRefCandidateT< T >.y(), mathSSE::Rot2< double >.y(), Rot2< T >.y(), mathSSE::Rot2< T >.y(), MuonGeometryArrange::MGACollection.y, python.rootplot.utilities.Hist.y, PrimaryVertexAnalyzer4PU::SimEvent.y, TrackClassifier::GeneratedPrimaryVertex.y, python.rootplot.root2matplotlib.Hist.y, CandidateWithRef< Ref >.y(), reco::LeafCandidate.y(), SiPixelDigitizerAlgorithm::SignalPoint.y(), reco::CaloCluster.y(), EPOS::EPOS_Wrapper.y(), BeamSpotOnlineRaw_v4.y, ParticleBase.y(), RawParticle.y(), TkRotation< float >.y(), TkRotation< U >.y(), TkRotation< T >.y(), TkRotation< Scalar >.y(), TkRotation< align::Scalar >.y(), TkRotation< double >.y(), Exhume::CrossSection.y, TkRotation2D< T >.y(), TkRotation2D< double >.y(), svgfig.Plot.y, svgfig.Frame.y, Vispa.Views.LineDecayView.DecayNode.y(), PMuonSimHit::Vtx.y, svgfig.Curve.Sample.y, PTrackerSimHit::Vtx.y, svgfig.Text.y, svgfig.TextGlobal.y, and svgfig.HLine.y.

Referenced by Vispa.Gui.ConnectableWidget.ConnectableWidget.dragWidget(), Vispa.Gui.WidgetContainer.WidgetContainer.mouseMoveEvent(), Vispa.Gui.ConnectableWidget.ConnectableWidget.mouseMoveEvent(), and Vispa.Views.LineDecayView.LineDecayContainer.mouseMoveEvent().

531  def positionizeMenuWidget(self):
532  if self._menuWidget:
533  headerOffset = 0
534  if isinstance(self.parent(), VispaWidget):
535  headerOffset = self.parent().getDistance("titleFieldBottom")
536  self._menuWidget.move(max(0, self.x() - 0.5* (self._menuWidget.width() - self.width())),
537  max(0, headerOffset, self.y() - self._menuWidget.height() +1))
const T & max(const T &a, const T &b)
def Vispa.Gui.ConnectableWidget.ConnectableWidget.rearangeContent (   self)
Arranges ports after content is rearranged by VispaWidget.

Definition at line 356 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget.arrangePorts().

Referenced by Vispa.Gui.VispaWidget.VispaWidget.defineDistances(), and Vispa.Gui.VispaWidget.VispaWidget.showEvent().

357  def rearangeContent(self):
358  """ Arranges ports after content is rearranged by VispaWidget.
359  """
360  VispaWidget.rearangeContent(self)
361  self.arrangePorts() # has to be after rearangeContent(), prevents infinite loop (..getDistance())
def Vispa.Gui.ConnectableWidget.ConnectableWidget.removeMenu (   self)

Definition at line 524 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._menuWidget.

Referenced by Vispa.Gui.ConnectableWidget.ConnectableWidget.deleteLater(), and Vispa.Gui.ConnectableWidget.ConnectableWidget.removeMenuEntry().

525  def removeMenu(self):
526  self._menuWidget.hide()
527  self._menuWidget.setParent(None)
528  self._menuWidget.deleteLater()
529  self._menuWidget = None
def Vispa.Gui.ConnectableWidget.ConnectableWidget.removeMenuEntry (   self,
  entry 
)

Definition at line 517 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._menuWidget, and Vispa.Gui.ConnectableWidget.ConnectableWidget.removeMenu().

Referenced by Vispa.Gui.WidgetContainer.WidgetContainer.setShowCollapseMenu().

518  def removeMenuEntry(self, entry):
519  if not self._menuWidget:
520  return
521  self._menuWidget.removeEntry(entry)
522  if self._menuWidget.len() == 0:
523  self.removeMenu()
def Vispa.Gui.ConnectableWidget.ConnectableWidget.removePort (   self,
  port 
)
Removes given port if it is port of this widget.

Definition at line 251 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._ports, and Vispa.Gui.VispaWidget.VispaWidget.scheduleRearangeContent().

252  def removePort(self, port):
253  """ Removes given port if it is port of this widget.
254  """
255  if port in self._ports:
256  port.deleteAttachedConnections()
257  self._ports.remove(port)
258  port.setParent(None)
259  port.deleteLater()
def Vispa.Gui.ConnectableWidget.ConnectableWidget.removePorts (   self,
  filter = None 
)
Remove registered ports.

If filter is "sink" only sinks are removed, if it is "source" only sources are removed, otherwise all ports are removed.

Definition at line 267 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._ports, Vispa.Gui.VispaWidget.VispaWidget.scheduleRearangeContent(), DDDWorldObserver< Event >.update(), SaveSimTrack.update(), PixelTrackFilter.update(), PTStatistics.update(), KillSecondariesRunAction.update(), KillSecondariesTrackAction.update(), HIPixelTrackFilter.update(), HIProtoTrackFilter.update(), KalmanAlignmentMetricsUpdator.update(), PrintTrackNumberAction.update(), GenericMVAComputerCache.update(), reco::KalmanGhostTrackUpdater.update(), DDG4ProductionCuts.update(), SimpleMetricsUpdator.update(), HICMuonUpdator.update(), MSLayersAtAngle.update(), TrajectoryStateUpdator.update(), MultiMetricsUpdator.update(), FastFedCablingTask.update(), LagrangeChildUpdator.update(), VertexTrackUpdator< N >.update(), DummyVertexTrackUpdator< N >.update(), VpspScanTask.update(), ErrorCorrelation.update(), ApvTimingTask.update(), DaqScopeModeTask.update(), FedTimingTask.update(), DummyMetricsUpdator.update(), PedestalsTask.update(), GsfMultiStateUpdator.update(), OptoScanTask.update(), MonopoleSteppingAction.update(), ApvTimingHistosUsingDb.update(), NoiseHistosUsingDb.update(), OptoScanHistosUsingDb.update(), PedestalsHistosUsingDb.update(), PedsFullNoiseHistosUsingDb.update(), PedsOnlyHistosUsingDb.update(), VpspScanHistosUsingDb.update(), CalibrationScanTask.update(), CalibrationTask.update(), LatencyTask.update(), FineDelayTask.update(), CurrentAlignmentKFUpdator.update(), RHStopTracer.update(), FastFedCablingHistosUsingDb.update(), PrintSensitive.update(), FedCablingTask.update(), SamplingHistosUsingDb.update(), TkPixelMeasurementDet.update(), PedsOnlyTask.update(), EcalUnpackerWorkerBase.update(), KFStrip1DUpdator.update(), KFStripUpdator.update(), LatencyHistosUsingDb.update(), CheckOverlap.update(), NoiseTask.update(), CalibrationHistosUsingDb.update(), KFSwitchingUpdator.update(), ChildUpdator.update(), PedsFullNoiseTask.update(), CountProcessesAction.update(), PrintGeomInfoAction.update(), PrintMaterialBudgetInfo.update(), FineDelayHistosUsingDb.update(), progressbar.Widget.update(), MeasurementTracker.update(), ora::PVectorUpdater.update(), KinematicConstrainedVertexUpdator.update(), PhysicsTools::MVAComputerCache.update(), MaterialBudgetHcal.update(), StoreSecondary.update(), BinomialProbability.update(), ESUnpackerWorker.update(), OnDemandMeasurementTracker.update(), TrackingMaterialProducer.update(), GraphPath< N, E >.update(), MuonServiceProxy.update(), MaterialBudgetForward.update(), EcalUnpackerWorker.update(), GflashG4Watcher.update(), EcalSimHitsValidProducer.update(), funct::Master< F >.update(), CheckSecondary.update(), Observer< T >.update(), KFSwitching1DUpdator.update(), pat::CandidateSummaryTable::Record.update(), Observer< const DDDWorld * >.update(), Observer< const BeginOfTrack * >.update(), Observer< const G4Step * >.update(), Observer< const EndOfRun * >.update(), Observer< const EndOfTrack * >.update(), Observer< const BeginOfJob * >.update(), Observer< const BeginOfEvent * >.update(), Observer< const EndOfEvent * >.update(), Observer< const BeginOfRun * >.update(), Observer< const Event * >.update(), Observer< const T * >.update(), KFUpdator.update(), HLTMonBTagClient.update(), KalmanVertexTrackUpdator< 5 >.update(), KalmanVertexTrackUpdator< N >.update(), HcaluLUTTPGCoder.update(), CaloTrkProcessing.update(), HcalTestAnalysis.update(), pos::PixelConfig.update(), TkStripMeasurementDet.update(), ora::IRelationalUpdater.update(), jptJetAnalysis::TrackPropagatorToCalo.update(), FWJobMetadataManager.update(), BasicMultiTrajectoryState.update(), KalmanAlignmentUserVariables.update(), TrackingVerboseAction.update(), PhysicsTools::TreeReader.update(), MaterialBudgetAction.update(), ora::QueryableVectorUpdater.update(), FiberSD.update(), SingleParticleEvent.update(), KalmanVertexUpdator< 5 >.update(), reco::GhostTrackFitter::PredictionUpdater.update(), KalmanVertexUpdator< N >.update(), SimG4HcalValidation.update(), SiStripPartition.update(), fwlite::RecordWriter.update(), KinematicConstrainedVertexUpdatorT< nTrk, nConstraint >.update(), simwatcher::BeginOfTrackCounter.update(), FWParameterSetterBase.update(), MuonTrajectoryUpdator.update(), progressbar.Timer.update(), TotemTestGem.update(), PLTSensitiveDetector.update(), DQMOldReceiver.update(), TkAccumulatingSensitiveDetector.update(), MuonUpdatorAtVertex.update(), ora::OraPtrUpdater.update(), jptJetAnalysis::StripSignalOverNoiseCalculator.update(), LaserAlignmentSimulation.update(), HcalTB02Analysis.update(), ora::PrimitiveUpdater.update(), ora::UniqueRefUpdater.update(), ora::CArrayUpdater.update(), ora::OraReferenceUpdater.update(), HcalTB06Analysis.update(), ApvAnalysisFactory.update(), BTagPerformanceAnalyzerOnData.update, TotemSD.update(), ora::ObjectUpdater.update(), progressbar.WidgetHFill.update(), ora::BlobUpdater.update(), HcalForwardAnalysis.update(), MuonSensitiveDetector.update(), MeasurementTrackerImpl.update(), StMeasurementDetSet.update(), SimTracer.update(), ora::InlineCArrayUpdater.update(), HcalTB04Analysis.update(), sistrip::RawToDigiUnpacker.update(), DTVDriftCalibration::cellInfo.update(), DAClusterizerInZ.update(), DTSegmentUpdator.update(), ora::STLContainerUpdater.update(), DynamicTruncation.update(), sim_act::Signaler< EndOfRun >.update(), sim_act::Signaler< BeginOfTrack >.update(), sim_act::Signaler< G4Step >.update(), sim_act::Signaler< BeginOfEvent >.update(), sim_act::Signaler< EndOfTrack >.update(), sim_act::Signaler< BeginOfRun >.update(), EcalTBH4Trigger.update(), sim_act::Signaler< T >.update(), sim_act::Signaler< BeginOfJob >.update(), sim_act::Signaler< DDDWorld >.update(), sim_act::Signaler< EndOfEvent >.update(), DoCastorAnalysis.update(), ora::NamedRefUpdater.update(), ZdcTestAnalysis.update(), CastorTestAnalysis.update(), CaloSD.update(), BTagPerformanceAnalyzerMC.update, BscSD.update(), edm::service::SimpleMemoryCheck.update(), edm::BMixingModule.update(), PhysicsTools::MVAModuleHelper< Record, Object, Filler >::Value.update(), ora::Container.update(), BetafuncEvtVtxGenerator.update(), PhysicsTools::TreeReader::Value.update(), progressbar.Bar.update(), FP420SD.update(), progressbar.BouncingBar.update(), HLTScalersClient::CountLSFifo_t.update(), GaussianSumUtilities1D.update(), CastorShowerLibraryMaker.update(), MonitorElement.update(), ora::Database.update(), StandAloneMuonFilter.update(), DTRecSegment2D.update(), DQMNet::Peer.update, CommissioningTask.update(), FWPSetTableManager.update(), progressbar.FormatLabel.update(), DQMNet::AutoPeer.update, G4StepStatistics.update(), FWLiteESRecordWriterAnalyzer.update(), python.seqvaluedict.seqdict.update(), FP420Test.update(), Folder.update(), BscTest.update(), TrajectoryStateOnSurface.update(), BasicTrajectoryState.update(), progressbar.ProgressBar.update(), edmNew::DetSetVector< T >.update(), DetSetVector< SiPixelCluster >.update(), DetSetVector< T >.update(), const_iterator.update(), DetSetVector< SiStripCluster >.update(), DetSetVector< ClusterType >.update(), and evf::iDie::lsStat.update().

268  def removePorts(self, filter=None):
269  """ Remove registered ports.
270 
271  If filter is "sink" only sinks are removed, if it is "source" only sources are removed, otherwise all ports are removed.
272  """
273  if filter and (filter != "sink" and filter != "source"):
274  filter = None
275 
276  parentIsWidgetOwner = False
277  ports = self._ports[:]
278  for port in ports:
279  if not filter or port.portType() == filter:
280  port.deleteAttachedConnections()
281  self._ports.remove(port)
282  port.setParent(None)
283  port.deleteLater()
285  self.update()
def Vispa.Gui.ConnectableWidget.ConnectableWidget.select (   self,
  sel = True,
  multiSelect = False 
)

Definition at line 542 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._menuWidget.

Referenced by Vispa.Views.LineDecayView.LineDecayContainer.createObject(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.find(), Vispa.Views.LineDecayView.LineDecayContainer.mousePressEvent(), Vispa.Gui.PortConnection.PointToPointConnection.mousePressEvent(), Vispa.Gui.VispaWidget.VispaWidget.mousePressEvent(), and Vispa.Views.AbstractView.AbstractView.restoreSelection().

543  def select(self, sel=True, multiSelect=False):
544  VispaWidget.select(self, sel, multiSelect)
545  if not sel and self._menuWidget:
546  self._menuWidget.hide()
def Vispa.Gui.ConnectableWidget.ConnectableWidget.setPortNamesPosition (   self,
  position 
)
Sets position where port names will be shown.

Possible values are self.PORT_NAMES_NEXT_TO_PORTS and self.PORT_NAMES_ABOVE_PORTS.

Definition at line 58 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._portNamesPosition.

58 
59  def setPortNamesPosition(self, position):
60  """ Sets position where port names will be shown.
61 
62  Possible values are self.PORT_NAMES_NEXT_TO_PORTS and self.PORT_NAMES_ABOVE_PORTS.
63  """
64  self._portNamesPosition = position
def Vispa.Gui.ConnectableWidget.ConnectableWidget.setShowPortLines (   self,
  show 
)
If True lines from all ports to a specific target point are drawn.

The target point is defined by PORT_LINES_TARGET_X and PORT_LINES_TARGET_Y.
If both of these values are -1 the target point is set to the widget's centre.

Definition at line 65 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._showPortLines.

65 
66  def setShowPortLines(self, show):
67  """ If True lines from all ports to a specific target point are drawn.
68 
69  The target point is defined by PORT_LINES_TARGET_X and PORT_LINES_TARGET_Y.
70  If both of these values are -1 the target point is set to the widget's centre.
71  """
72  self._showPortLines = show
def Vispa.Gui.ConnectableWidget.ConnectableWidget.setShowPortNames (   self,
  show 
)
If True the port name's will be drawn.

The port names wont be on the port itself.
Instead they will appear next to the port icons on the ConnectableWidget.

Definition at line 50 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._showPortNames.

50 
51  def setShowPortNames(self, show):
52  """ If True the port name's will be drawn.
53 
54  The port names wont be on the port itself.
55  Instead they will appear next to the port icons on the ConnectableWidget.
56  """
57  self._showPortNames = show
def Vispa.Gui.ConnectableWidget.ConnectableWidget.setZoom (   self,
  zoom 
)
Arranges ports when zoom has changed.

Definition at line 189 of file ConnectableWidget.py.

Referenced by Vispa.Gui.Zoomable.Zoomable.decrementZoom(), Vispa.Gui.Zoomable.Zoomable.incrementZoom(), Vispa.Main.TabController.TabController.zoomAll(), Vispa.Main.TabController.TabController.zoomDialog(), Vispa.Main.TabController.TabController.zoomHundred(), and Vispa.Main.TabController.TabController.zoomUser().

190  def setZoom(self, zoom):
191  """ Arranges ports when zoom has changed.
192  """
193  VispaWidget.setZoom(self, zoom)
194  #self.arrangePorts()
def Vispa.Gui.ConnectableWidget.ConnectableWidget.showMenu (   self)

Definition at line 494 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._menuWidget.

Referenced by Vispa.Gui.WidgetContainer.WidgetContainer.mouseMoveEvent(), Vispa.Gui.ConnectableWidget.ConnectableWidget.mouseMoveEvent(), and Vispa.Views.LineDecayView.LineDecayContainer.mouseMoveEvent().

495  def showMenu(self):
496  if self._menuWidget:
497  self._menuWidget.show()
498  self._menuWidget.raise_()
def Vispa.Gui.ConnectableWidget.ConnectableWidget.sinkPort (   self,
  name 
)
Returns sink port with given name or None if no such port is found.

Definition at line 302 of file ConnectableWidget.py.

References DTCtcp.port, EcalTPGParamReaderFromDB.port, EcalDBConnection.port, DQMNet::AutoPeer.port, and Vispa.Gui.ConnectableWidget.ConnectableWidget.port().

303  def sinkPort(self, name):
304  """ Returns sink port with given name or None if no such port is found.
305  """
306  return self.port(name, 'sink')
def Vispa.Gui.ConnectableWidget.ConnectableWidget.sinkPorts (   self)
Returns list of all sink ports set.

Definition at line 286 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._ports, and alcazmumu_cfi.filter.

Referenced by Vispa.Gui.ConnectableWidget.ConnectableWidget._getMaxPortTitleWidth(), Vispa.Gui.ConnectableWidget.ConnectableWidget.defineDistances(), Vispa.Gui.ConnectableWidget.ConnectableWidget.drawPortNames(), Vispa.Gui.ConnectableWidget.ConnectableWidget.getPortsHeight(), and Vispa.Gui.ConnectableWidget.ConnectableWidget.sizeHint().

287  def sinkPorts(self):
288  """ Returns list of all sink ports set.
289  """
290  return [port for port in self._ports if port.portType() == "sink"]
291  def isSink(port):
292  return port.portType() == 'sink'
293  return filter(isSink, self._ports)
def Vispa.Gui.ConnectableWidget.ConnectableWidget.sizeHint (   self)
Returns size needed to draw widget's content.

Definition at line 92 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._getMaxSinkTitleWidth(), Vispa.Gui.ConnectableWidget.ConnectableWidget._getMaxSourceTitleWidth(), Vispa.Gui.ConnectableWidget.ConnectableWidget._portNamesPosition, Vispa.Gui.ConnectableWidget.ConnectableWidget._showPortNames, Vispa.Gui.ConnectableWidget.ConnectableWidget.arrangePorts(), ValidateGeometry.getDistance(), Vispa.Gui.VispaWidget.VispaWidget.getDistance(), Vispa.Gui.ConnectableWidget.ConnectableWidget.getPortsHeight(), Vispa.Gui.VispaWidget.VispaWidget.imageSizeF(), max(), Vispa.Gui.ConnectableWidget.ConnectableWidget.NO_VALID_PORT_NAMES_POSITION_MESSAGE, Vispa.Gui.ConnectableWidget.ConnectableWidget.PORT_NAMES_ABOVE_PORTS, Vispa.Gui.ConnectableWidget.ConnectableWidget.PORT_NAMES_NEXT_TO_PORTS, CaloMeanResponse.scale, LocalError.scale(), CaloSamples.scale(), DQMRivetClient::ScaleFactorOption.scale, python.rootplot.rootmath.Target.scale, reco::PattRecoPeak< Real >.scale(), python.rootplot.tree2hists.RootTree.scale, MuonErrorMatrix.scale, Vispa.Gui.VispaWidget.VispaWidget.scale(), Vispa.Gui.ConnectableWidget.ConnectableWidget.sinkPorts(), Vispa.Gui.ConnectableWidget.ConnectableWidget.sourcePorts(), Vispa.Gui.VispaWidget.VispaWidget.textField(), Vispa.Gui.VispaWidget.VispaWidget.textFieldIsSet(), and Vispa.Gui.VispaWidget.VispaWidget.titleIsSet().

Referenced by Vispa.Gui.VispaWidget.VispaWidget.autosize().

92 
93  def sizeHint(self):
94  """ Returns size needed to draw widget's content.
95  """
96  #logging.debug(self.__class__.__name__ + ": sizeHint()")
97  # arrangePorts() needed because it will be called in rearnangeContent() after sizeHint()
98  self.arrangePorts()
99 
100  neededWidth = self.getDistance('leftMargin', 1) + self.getDistance('rightMargin', 1)
101  neededHeight = self.getDistance('topMargin', 1) + self.getDistance('bottomMargin', 1)
102  imageSizeF = self.imageSizeF()
103 
104  # width
105  titleWidth = 0
106  if self.titleIsSet():
107  titleWidth = self.getDistance('titleFieldWidth', 1)
108 
109  bodyWidth = 0
110  sinkPortsWidth = 0
111  sourcePortsWidth = 0
112  if len(self.sinkPorts()) > 0:
113  sinkPortsWidth = self.getDistance('leftMargin', 1) + PortWidget.WIDTH
114  if len(self.sourcePorts()) > 0:
115  sourcePortsWidth = self.getDistance('rightMargin', 1) + PortWidget.WIDTH
116 
117  if self._showPortNames:
118  maxSinkTitleWidth = self._getMaxSinkTitleWidth()
119  maxSourceTitleWidth = self._getMaxSourceTitleWidth()
121  bodyWidth += maxSinkTitleWidth + self.getDistance('rightMargin', 1) + maxSourceTitleWidth
122  elif self._portNamesPosition == self.PORT_NAMES_ABOVE_PORTS:
123  if maxSinkTitleWidth > PortWidget.WIDTH:
124  sinkPortsWidth = 0#self.getDistance('leftMargin', 1)
125  if maxSourceTitleWidth > PortWidget.WIDTH:
126  sourcePortsWidth = 0#self.getDistance('rightMargin', 1)
127  #bodyWidth += maxSinkTitleWidth + self.getDistance('rightMargin', 1) + maxSourceTitleWidth
128  bodyWidth += maxSinkTitleWidth + maxSourceTitleWidth
129  else:
130  logging.waring(self.__class__.__name__ +": sizeHint() - "+ self.NO_VALID_PORT_NAMES_POSITION_MESSAGE)
131  bodyWidth += sinkPortsWidth + sourcePortsWidth
132 
133  if self.textFieldIsSet():
134  bodyWidth += self.getDistance('textFieldWidth', 1)
135  bodyWidth = max(imageSizeF.width() + self.getDistance("leftMargin", 1) + self.getDistance("rightMargin", 1), bodyWidth)
136 
137  neededWidth += max(titleWidth, bodyWidth)
138 
139  # height
140  if self.titleIsSet():
141  neededHeight += self.getDistance('titleFieldHeight', 1)
142 
143  sinkPortsHeight = self.getPortsHeight("sink") / self.scale()
144  sourcePortsHeight = self.getPortsHeight("source") / self.scale()
145  textFieldHeight = 0
146  if self.textFieldIsSet():
147  textFieldHeight += self.textField().getHeight()
148  neededHeight += max(sinkPortsHeight, sourcePortsHeight, textFieldHeight, imageSizeF.height())
149  if bodyWidth != 0:
150  neededHeight += self.getDistance('bottomMargin', 1) # gap between header and body
151  if self._showPortNames and (len(self.sinkPorts()) > 1 or len(self.sourcePorts()) > 1):
152  neededHeight += self.getDistance('bottomMargin', 1) # additional gap for port names
153 
154  return QSize(neededWidth, neededHeight)
const T & max(const T &a, const T &b)
def Vispa.Gui.ConnectableWidget.ConnectableWidget.sourcePort (   self,
  name 
)
Returns source port with given name or None if no such port is found.

Definition at line 307 of file ConnectableWidget.py.

References DTCtcp.port, EcalTPGParamReaderFromDB.port, EcalDBConnection.port, DQMNet::AutoPeer.port, and Vispa.Gui.ConnectableWidget.ConnectableWidget.port().

308  def sourcePort(self, name):
309  """ Returns source port with given name or None if no such port is found.
310  """
311  return self.port(name, 'source')
def Vispa.Gui.ConnectableWidget.ConnectableWidget.sourcePorts (   self)
Returns list of all source ports set.

Definition at line 294 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._ports, and alcazmumu_cfi.filter.

Referenced by Vispa.Gui.ConnectableWidget.ConnectableWidget._getMaxPortTitleWidth(), Vispa.Gui.ConnectableWidget.ConnectableWidget.drawPortNames(), Vispa.Gui.ConnectableWidget.ConnectableWidget.getPortsHeight(), and Vispa.Gui.ConnectableWidget.ConnectableWidget.sizeHint().

295  def sourcePorts(self):
296  """ Returns list of all source ports set.
297  """
298  return [port for port in self._ports if port.portType() == "source"]
299  def isSource(port):
300  return port.portType() == 'source'
301  return filter(isSource, self._ports)
def Vispa.Gui.ConnectableWidget.ConnectableWidget.updateAttachedConnections (   self)

Definition at line 553 of file ConnectableWidget.py.

References Vispa.Gui.ConnectableWidget.ConnectableWidget._ports.

Referenced by Vispa.Gui.ConnectableWidget.ConnectableWidget.move().

554  def updateAttachedConnections(self):
555  for port in self._ports:
556  port.updateAttachedConnections()

Member Data Documentation

Vispa.Gui.ConnectableWidget.ConnectableWidget._menuWidget
private

Definition at line 41 of file ConnectableWidget.py.

Referenced by Vispa.Gui.ConnectableWidget.ConnectableWidget.addMenuEntry(), Vispa.Gui.ConnectableWidget.ConnectableWidget.deleteLater(), Vispa.Gui.ConnectableWidget.ConnectableWidget.leaveEvent(), Vispa.Gui.ConnectableWidget.ConnectableWidget.menu(), Vispa.Gui.ConnectableWidget.ConnectableWidget.mouseMoveEvent(), Vispa.Gui.ConnectableWidget.ConnectableWidget.move(), Vispa.Gui.ConnectableWidget.ConnectableWidget.positionizeMenuWidget(), Vispa.Gui.ConnectableWidget.ConnectableWidget.removeMenu(), Vispa.Gui.ConnectableWidget.ConnectableWidget.removeMenuEntry(), Vispa.Gui.ConnectableWidget.ConnectableWidget.select(), and Vispa.Gui.ConnectableWidget.ConnectableWidget.showMenu().

Vispa.Gui.ConnectableWidget.ConnectableWidget._portNamesPosition
private

Definition at line 39 of file ConnectableWidget.py.

Referenced by Vispa.Gui.ConnectableWidget.ConnectableWidget.drawPortNames(), Vispa.Gui.ConnectableWidget.ConnectableWidget.getEffectivePortHeight(), Vispa.Gui.ConnectableWidget.ConnectableWidget.setPortNamesPosition(), and Vispa.Gui.ConnectableWidget.ConnectableWidget.sizeHint().

Vispa.Gui.ConnectableWidget.ConnectableWidget._ports
private

Definition at line 37 of file ConnectableWidget.py.

Referenced by Vispa.Gui.ConnectableWidget.ConnectableWidget._addPort(), Vispa.Gui.ConnectableWidget.ConnectableWidget.arrangePorts(), Vispa.Gui.ConnectableWidget.ConnectableWidget.attachedConnections(), Vispa.Gui.ConnectableWidget.ConnectableWidget.deleteLater(), Vispa.Gui.ConnectableWidget.ConnectableWidget.dropAreaPort(), Vispa.Gui.ConnectableWidget.ConnectableWidget.port(), Vispa.Gui.ConnectableWidget.ConnectableWidget.portExists(), Vispa.Gui.ConnectableWidget.ConnectableWidget.ports(), Vispa.Gui.ConnectableWidget.ConnectableWidget.removePort(), Vispa.Gui.ConnectableWidget.ConnectableWidget.removePorts(), Vispa.Gui.ConnectableWidget.ConnectableWidget.sinkPorts(), Vispa.Gui.ConnectableWidget.ConnectableWidget.sourcePorts(), and Vispa.Gui.ConnectableWidget.ConnectableWidget.updateAttachedConnections().

Vispa.Gui.ConnectableWidget.ConnectableWidget._showPortLines
private

Definition at line 40 of file ConnectableWidget.py.

Referenced by Vispa.Gui.ConnectableWidget.ConnectableWidget.drawPortLines(), and Vispa.Gui.ConnectableWidget.ConnectableWidget.setShowPortLines().

Vispa.Gui.ConnectableWidget.ConnectableWidget._showPortNames
private

Definition at line 38 of file ConnectableWidget.py.

Referenced by Vispa.Gui.ConnectableWidget.ConnectableWidget.defineDistances(), Vispa.Gui.ConnectableWidget.ConnectableWidget.drawPortNames(), Vispa.Gui.ConnectableWidget.ConnectableWidget.dropArea(), Vispa.Gui.ConnectableWidget.ConnectableWidget.getEffectivePortHeight(), Vispa.Gui.ConnectableWidget.ConnectableWidget.setShowPortNames(), and Vispa.Gui.ConnectableWidget.ConnectableWidget.sizeHint().

string Vispa.Gui.ConnectableWidget.ConnectableWidget.BACKGROUND_SHAPE = 'ROUNDRECT'
static

Definition at line 18 of file ConnectableWidget.py.

string Vispa.Gui.ConnectableWidget.ConnectableWidget.NO_VALID_PORT_NAMES_POSITION_MESSAGE = "No valid position for port names was set."
static

Definition at line 29 of file ConnectableWidget.py.

Referenced by Vispa.Gui.ConnectableWidget.ConnectableWidget.drawPortNames(), Vispa.Gui.ConnectableWidget.ConnectableWidget.getEffectivePortHeight(), and Vispa.Gui.ConnectableWidget.ConnectableWidget.sizeHint().

int Vispa.Gui.ConnectableWidget.ConnectableWidget.PORT_LINES_TARGET_X = -1
static

Definition at line 31 of file ConnectableWidget.py.

Vispa.Gui.ConnectableWidget.ConnectableWidget.PORT_LINES_TARGET_X

Definition at line 449 of file ConnectableWidget.py.

int Vispa.Gui.ConnectableWidget.ConnectableWidget.PORT_LINES_TARGET_Y = -1
static

Definition at line 32 of file ConnectableWidget.py.

Vispa.Gui.ConnectableWidget.ConnectableWidget.PORT_LINES_TARGET_Y

Definition at line 449 of file ConnectableWidget.py.

int Vispa.Gui.ConnectableWidget.ConnectableWidget.PORT_NAMES_ABOVE_PORTS = 1
static

Definition at line 24 of file ConnectableWidget.py.

Referenced by Vispa.Gui.ConnectableWidget.ConnectableWidget.drawPortNames(), Vispa.Gui.ConnectableWidget.ConnectableWidget.getEffectivePortHeight(), and Vispa.Gui.ConnectableWidget.ConnectableWidget.sizeHint().

int Vispa.Gui.ConnectableWidget.ConnectableWidget.PORT_NAMES_NEXT_TO_PORTS = 0
static

Definition at line 23 of file ConnectableWidget.py.

Referenced by Vispa.Gui.ConnectableWidget.ConnectableWidget.drawPortNames(), Vispa.Gui.ConnectableWidget.ConnectableWidget.getEffectivePortHeight(), and Vispa.Gui.ConnectableWidget.ConnectableWidget.sizeHint().

Vispa.Gui.ConnectableWidget.ConnectableWidget.PORT_NAMES_POSITION = PORT_NAMES_NEXT_TO_PORTS
static

Definition at line 27 of file ConnectableWidget.py.

Vispa.Gui.ConnectableWidget.ConnectableWidget.SHOW_PORT_LINES = False
static

Definition at line 20 of file ConnectableWidget.py.

Vispa.Gui.ConnectableWidget.ConnectableWidget.SHOW_PORT_NAMES = False
static

Definition at line 19 of file ConnectableWidget.py.