# `TaurusJDrawSynopticsView`

digraph inheritance10b66bb1b8 { bgcolor=transparent; rankdir=UD; ratio=compress; size="8.0, 12.0"; "BaseConfigurableClass" [URL="taurus.qt.qtcore.configuration-BaseConfigurableClass.html#taurus.qt.qtcore.configuration.BaseConfigurableClass",color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,target="_top",tooltip="A base class defining the API for configurable objects."]; "Logger" [URL="taurus-Logger.html#taurus.Logger",color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,target="_top",tooltip="The taurus logger class. All taurus pertinent classes should inherit"]; "QAbstractScrollArea" [color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="QAbstractScrollArea(parent: QWidget|None = None)"]; "QFrame" -> "QAbstractScrollArea" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QFrame" [color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="QFrame(parent: QWidget|None = None, flags: Qt.WindowFlags|Qt.WindowType = Qt.WindowFlags())"]; "QWidget" -> "QFrame" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QGraphicsView" [color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="QGraphicsView(parent: QWidget|None = None)"]; "QAbstractScrollArea" -> "QGraphicsView" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QObject" [color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="QObject(parent: QObject|None = None)"]; "wrapper" -> "QObject" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QPaintDevice" [color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="QPaintDevice()"]; "simplewrapper" -> "QPaintDevice" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QWidget" [color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="QWidget(parent: QWidget|None = None, flags: Qt.WindowFlags|Qt.WindowType = Qt.WindowFlags())"]; "QObject" -> "QWidget" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QPaintDevice" -> "QWidget" [arrowsize=0.5,style="setlinewidth(0.5)"]; "TaurusBaseComponent" [URL="taurus.qt.qtgui.base-TaurusBaseComponent.html#taurus.qt.qtgui.base.TaurusBaseComponent",color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,target="_top",tooltip="A generic Taurus component."]; "TaurusListener" -> "TaurusBaseComponent" [arrowsize=0.5,style="setlinewidth(0.5)"]; "BaseConfigurableClass" -> "TaurusBaseComponent" [arrowsize=0.5,style="setlinewidth(0.5)"]; "TaurusBaseWidget" [URL="taurus.qt.qtgui.base-TaurusBaseWidget.html#taurus.qt.qtgui.base.TaurusBaseWidget",color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,target="_top",tooltip="The base class for all Qt Taurus widgets."]; "TaurusBaseComponent" -> "TaurusBaseWidget" [arrowsize=0.5,style="setlinewidth(0.5)"]; "TaurusJDrawSynopticsView" [URL="#taurus.qt.qtgui.graphic.TaurusJDrawSynopticsView",color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,target="_top",tooltip="Taurus Class that visualizes Synoptics drawn with the JDraw tool (by"]; "QGraphicsView" -> "TaurusJDrawSynopticsView" [arrowsize=0.5,style="setlinewidth(0.5)"]; "TaurusBaseWidget" -> "TaurusJDrawSynopticsView" [arrowsize=0.5,style="setlinewidth(0.5)"]; "TaurusListener" [URL="taurus.core.tauruslistener-TaurusListener.html#taurus.core.tauruslistener.TaurusListener",color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,target="_top",tooltip="TaurusListener Interface"]; "Logger" -> "TaurusListener" [arrowsize=0.5,style="setlinewidth(0.5)"]; "simplewrapper" [color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded]; "wrapper" [color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded]; "simplewrapper" -> "wrapper" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

class TaurusJDrawSynopticsView(parent=None, designMode=False, updateMode=None, alias=None, resizable=True, panelClass=None)

  Taurus Class that visualizes Synoptics drawn with the JDraw tool (by ESRF). It is equivalent to ATK Synoptic Player (Java).

  After initialization call setModel(‘/your/file.jdw’) to parse the synoptic file and connect to controlled objects.

  Arguments to TaurusJDrawSynopticsView() creator are:

  > - designMode; used by Qt Designer

  > - updateMode; controls Qt Viewport refresh (disabled by default)

  > - alias; a dictionary of name replacements to be applied on graphical objects

  > - resizable: whether to allow resizing or not

  > - panelClass: class object, class name or shell command to be shown when an object is clicked (None will show default panel, ‘’ or ‘noPanel’ will disable it)

  TaurusJDrawSynopticsView and TaurusGraphicsScene signals/slots

  External events:

      Slot selectGraphicItem(const QString &) displays a selection
      mark around the TaurusGraphicsItem that matches the argument passed.

  Mouse Left-button events:

      Signal graphicItemSelected(QString) is triggered, passing the
      selected TaurusGraphicsItem.name() as argument.

  Mouse Right-button events:

      TaurusGraphicsItem.setContextMenu([(ActionName,ActionMethod(device_name))]
      allows to configure custom context menus for graphic items using a list
      of tuples. Empty tuples will insert separators in the menu.

  Import from `taurus.qt.qtgui.graphic` as:

      from taurus.qt.qtgui.graphic import TaurusJDrawSynopticsView

  closeEvent(self, a0: QCloseEvent | None)
  classmethod defaultPanelClass()

    This method assigns the Class used to open new object panels on double-click (TaurusDevicePanel by default) If an string is used it can be either a Taurus class or an OS launcher

  defineStyle()
  emitColors()

    emit signal which is used to refresh the tree and colors of icons depend of the current status in jdrawSynoptic

  fitting(ADJUST_FRAME=False)

    Parent size is the size of the bigger panel (desn’t keep ratio) Rect size never changes (fixed by the graphics objects) Size and SizeHint move one around the other

    the method works well until an object is clicked, then the whole reference changes and doesn’t work again.

  getFramed()
  getGraphicsFactory(delayed=False)
  getModel(**kwargs)

    Returns the model name for this component.

    Parameters:

      key (object) – the model key. Defaults to first element of .modelKeys

    Returns:

      the model name.

    Return type:

      str

  getModelMimeData()

    Used for drag events

  classmethod getQtDesignerPluginInfo()

    Returns pertinent information in order to be able to build a valid QtDesigner widget plugin.

    The dictionary returned by this method should contain at least the following keys and values:

    - ‘module’ : a string representing the full python module name (ex.: ‘taurus.qt.qtgui.base’)

    - ‘icon’ : a string representing valid resource icon (ex.: ‘designer:combobox.png’)

    - ‘container’a bool telling if this widget is a container widget or

        not.

    This default implementation returns the following dictionary:

        { 'group'     : 'Taurus [Unclassified]',
          'icon'      : 'logos:taurus.png',
          'container' : False }

    Returns:

      a map with pertinent designer information

    Return type:

      dict

  getSelectionStyle()
  getSelectionStyleName()
  get_device_list()
  get_item_colors(emit=False)
  get_item_list()
  get_sizes()
  graphicItemSelected

    int = …, arguments: Sequence = …) -> PYQT_SIGNAL

    types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

    Type:

      pyqtSignal(*types, name

    Type:

      str = …, revision

  graphicSceneClicked

    int = …, arguments: Sequence = …) -> PYQT_SIGNAL

    types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

    Type:

      pyqtSignal(*types, name

    Type:

      str = …, revision

  isReadOnly()

    Determines if this component is read-only or not in the sense that the user can interact with it. Default implementation returns True.

    Override when necessary.

    Returns:

      whether or not this component is read-only

    Return type:

      bool

  itemsChanged

    int = …, arguments: Sequence = …) -> PYQT_SIGNAL

    types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

    Type:

      pyqtSignal(*types, name

    Type:

      str = …, revision

  model
    pyqtProperty(type, fget=None, fset=None, freset=None, fdel=None, doc=None,

      designable=True, scriptable=True, stored=True, user=False, constant=False, final=False, notify=None, revision=0) -> property attribute

    type is the type of the property. It is either a type object or a string that is the name of a C++ type. freset is a function for resetting an attribute to its default value. designable sets the DESIGNABLE flag (the default is True for writable properties and False otherwise). scriptable sets the SCRIPTABLE flag. stored sets the STORED flag. user sets the USER flag. constant sets the CONSTANT flag. final sets the FINAL flag. notify is the NOTIFY signal. revision is the REVISION. The other parameters are the same as those required by the standard Python property type. Properties defined using pyqtProperty behave as both Python and Qt properties. Decorators can be used to define new properties or to modify existing ones.

  modelsChanged

    int = …, arguments: Sequence = …) -> PYQT_SIGNAL

    types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

    Type:

      pyqtSignal(*types, name

    Type:

      str = …, revision

  mousePressEvent(event)

    Records last event position to use it for DragEvents

  openJDraw()
  panelClass()
  refreshModel()
  repaint(self)
  repaint(self, x: int, y: int, w: int, h: int)
  repaint(self, a0: QRect)
  repaint(self, a0: QRegion)
  resetSelectionStyle()
  resizable()
  resizeEvent(event)

    It has been needed to reimplent size policies

  selectGraphicItem(item_name)
  selectionStyle
    pyqtProperty(type, fget=None, fset=None, freset=None, fdel=None, doc=None,

      designable=True, scriptable=True, stored=True, user=False, constant=False, final=False, notify=None, revision=0) -> property attribute

    type is the type of the property. It is either a type object or a string that is the name of a C++ type. freset is a function for resetting an attribute to its default value. designable sets the DESIGNABLE flag (the default is True for writable properties and False otherwise). scriptable sets the SCRIPTABLE flag. stored sets the STORED flag. user sets the USER flag. constant sets the CONSTANT flag. final sets the FINAL flag. notify is the NOTIFY signal. revision is the REVISION. The other parameters are the same as those required by the standard Python property type. Properties defined using pyqtProperty behave as both Python and Qt properties. Decorators can be used to define new properties or to modify existing ones.

  setAlias(alias)

    Assigning a dictionary like {‘Tag’:’Value’} with tags to be replaced in object names while parsing.

  classmethod setDefaultPanelClass(other)

    This method returns the Class used to open new object panels on double-click (TaurusDevicePanel by default)

  setModel(model, alias=None, delayed=False, trace=False, **kwargs)

    Sets/unsets the model name for the given key. If key is MLIST, a model is set for each name in the model sequence, new model keys are automatically added to the object’s `modelList` attribute and the corresponding models are attached using those keys. The new keys are of the form `(MLIST, i)` where `i` is the index of the corresponding model name in the model sequence.

    Parameters:

      - model (str (or sequence of str if key is MLIST)) – the new model name. If key is MLIST, model is expected to be a sequence of model names.

      - key (object) – the model key. Defaults to first element of .modelKeys

  setModels()

    This method triggers item.setModel(item._name) in all internal items.

  setPanelClass(widget)
  setResizable(resizable)
  setSelectionStyle(selectionStyle)
  update(self)
  update(self, a0: QRect)
  update(self, a0: QRegion)
  update(self, ax: int, ay: int, aw: int, ah: int)
  updateStyle()

    Updates the widget style. Default implementation just calls QWidget.update()

    Override when necessary.