Example #1
0
    def __init__(self):
        View.__init__(self)
        gtk.ScrolledWindow.__init__(self)

        history_tree = ExecutionHistoryTreeView()

        reload_button = gtk.Button("Reload history")
        reload_button.set_border_width(constants.BUTTON_BORDER_WIDTH)
        clean_button = gtk.Button("Clean history")
        clean_button.set_border_width(constants.BUTTON_BORDER_WIDTH)
        open_separately_button = gtk.Button("Open separately")
        open_separately_button.set_border_width(constants.BUTTON_BORDER_WIDTH)

        button_box = gtk.HBox()
        button_box.pack_end(reload_button, False, True, 0)
        button_box.pack_end(clean_button, False, True, 0)
        button_box.pack_end(open_separately_button, False, True, 0)

        history_vbox = gtk.VBox()
        history_vbox.pack_end(button_box, False, True, 0)
        history_vbox.pack_end(self, True, True, 0)

        self.add(history_tree)
        self.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        self.show_all()

        self['history_vbox'] = history_vbox
        self['history_view'] = self
        self['history_tree'] = history_tree
        self['reload_button'] = reload_button
        self['clean_button'] = clean_button
        self['open_separately_button'] = open_separately_button
        self.top = 'history_view'
Example #2
0
 def __init__(self, ctrl):
     View.__init__(self, ctrl, self.GLADE_FILE)
     self['notebook_appl'].set_show_tabs(False)
     nb = self['notebook']
     nb.set_show_tabs(False)
     self['button_prev'].set_sensitive(False)
     return
Example #3
0
    def __init__(self):
        View.__init__(self)
        gtk.TreeView.__init__(self)

        foreground = 5

        tvcolumn = gtk.TreeViewColumn('Nr', gtk.CellRendererText(), text=1, foreground=foreground)
        tvcolumn.set_property("sizing", "autosize")
        self.append_column(tvcolumn)

        tvcolumn = gtk.TreeViewColumn('Action', gtk.CellRendererText(), text=2, foreground=foreground)
        tvcolumn.set_property("sizing", "autosize")
        self.append_column(tvcolumn)

        tvcolumn = gtk.TreeViewColumn('Parameters', gtk.CellRendererText(), text=7, foreground=foreground)
        tvcolumn.set_property("sizing", "autosize")
        self.append_column(tvcolumn)

        tvcolumn = gtk.TreeViewColumn('Affects', gtk.CellRendererText(), text=3, foreground=foreground)
        tvcolumn.set_property("sizing", "autosize")
        # tvcolumn.set_min_width(150)
        self.append_column(tvcolumn)

        self['history_treeview'] = self
        self.top = 'history_treeview'
Example #4
0
    def __init__(self):
        View.__init__(self)

        self._lock = threading.Lock()

        self.text_view = gtk.TextView()
        self.text_view.set_property('editable', False)

        self.filtered_buffer = self.create_text_buffer()

        self.text_view.set_buffer(self.filtered_buffer)

        self.text_view.set_border_width(10)

        self._enables = {}
        self._auto_scroll_handler_id = None

        scrollable = gtk.ScrolledWindow()
        scrollable.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        scrollable.set_name('console_scroller')
        scrollable.add(self.text_view)
        self.text_view.show()

        self['scrollable'] = scrollable
        self.top = 'scrollable'
        self.quit_flag = False

        from rafcon.gui.config import global_gui_config
        self.logging_priority = global_gui_config.get_config_value("LOGGING_CONSOLE_GTK_PRIORITY", glib.PRIORITY_LOW)

        self._stored_line_number = None
        self._stored_line_offset = None
        self._stored_text_of_line = None
        self._stored_relative_lines = None
Example #5
0
    def __init__(self):
        View.__init__(self)

        self.inputs_view = LinkageOverviewDataView()
        self.outputs_view = LinkageOverviewDataView()
        self.scope_view = LinkageOverviewDataView()
        self.outcomes_view = LinkageOverviewLogicView()

        self['inputs_scroller'].add(self.inputs_view.get_top_widget())
        self['outputs_scroller'].add(self.outputs_view.get_top_widget())
        self['scoped_scroller'].add(self.scope_view.get_top_widget())
        self['outcomes_scroller'].add(self.outcomes_view.get_top_widget())
        self.inputs_view.scrollbar_widget = self['inputs_scroller']
        self.outputs_view.scrollbar_widget = self['outputs_scroller']
        self.scope_view.scrollbar_widget = self['scoped_scroller']
        self.outcomes_view.scrollbar_widget = self['outcomes_scroller']

        gui_helper_label.set_label_markup(
            self['data_linkage_label'],
            'DATA LINKAGE',
            letter_spacing=constants.LETTER_SPACING_1PT)
        gui_helper_label.set_label_markup(
            self['logical_linkage_label'],
            'LOGICAL LINKAGE',
            letter_spacing=constants.LETTER_SPACING_1PT)
Example #6
0
    def __init__(self):
        View.__init__(self)
        gtk.TreeView.__init__(self)
        self.set_name('state_machine_tree')

        tvcolumn = gtk.TreeViewColumn('Name')
        tvcolumn.set_property("sizing", "autosize")
        # tvcolumn.set_min_width(150)
        self.append_column(tvcolumn)
        cell = gtk.CellRendererText()
        tvcolumn.pack_start(cell, True)
        tvcolumn.add_attribute(cell, 'text', 0)
        tvcolumn.set_sort_column_id(0)

        tvcolumn = gtk.TreeViewColumn('ID')
        tvcolumn.set_property("sizing", "autosize")
        # tvcolumn.set_min_width(150)
        self.append_column(tvcolumn)
        cell = gtk.CellRendererText()
        tvcolumn.pack_start(cell, True)
        tvcolumn.add_attribute(cell, 'text', 1)
        tvcolumn.set_sort_column_id(1)

        tvcolumn = gtk.TreeViewColumn('Type')
        tvcolumn.set_property("sizing", "autosize")
        # tvcolumn.set_min_width(150)
        self.append_column(tvcolumn)
        cell = gtk.CellRendererText()
        tvcolumn.pack_start(cell, True)
        tvcolumn.add_attribute(cell, 'text', 2)
        tvcolumn.set_sort_column_id(2)

        self['state_machine_tree_view'] = self
        self.top = 'state_machine_tree_view'
    def __init__(self, selection_m):
        """View holding the graphical editor

        The purpose of the view is only to hold the graphical editor. The class ob the actual editor with the OpenGL
        functionality is GraphicalEditor
        """
        gobject.GObject.__init__(self)
        View.__init__(self)

        self.v_box = gtk.VBox()
        self.scroller = gtk.ScrolledWindow()
        self.scroller.set_name('graphical_editor_scroller')
        self.editor = ExtendedGtkView(self, selection_m)
        self.editor.modify_bg(gtk.STATE_NORMAL,
                              global_gui_config.gtk_colors['INPUT_BACKGROUND'])
        self.editor.tool = ToolChain(self.editor). \
            append(HoverItemTool()). \
            append(MoveHandleTool()). \
            append(ConnectionCreationTool()). \
            append(ConnectionModificationTool()). \
            append(PanTool()). \
            append(ZoomTool()). \
            append(MoveItemTool()). \
            append(MultiSelectionTool()). \
            append(RightClickTool())
        self.editor.painter = painter.PainterChain(). \
            append(painter.ItemPainter()). \
            append(HoveredItemPainter()). \
            append(painter.FocusedItemPainter()). \
            append(painter.ToolPainter())
        self.scroller.add(self.editor)
        self.v_box.pack_end(self.scroller)

        self['main_frame'] = self.v_box
        self.top = 'main_frame'
Example #8
0
    def __init__(self, top_window):
        View.__init__(self)

        self.win = top_window['main_window']
        self.insert_accelerators = {'new': gtk.accelerator_parse('<control>N'),
                                    'open': gtk.accelerator_parse('<control>O'),
                                    'save': gtk.accelerator_parse('<control>S'),
                                    # 'save_as': gtk.accelerator_parse('<shift><control>S'),  # no default accelerator insert
                                    'quit': gtk.accelerator_parse('<control>Q'),
                                    'cut': gtk.accelerator_parse('<control>X'),
                                    'copy': gtk.accelerator_parse('<control>C'),
                                    'paste': gtk.accelerator_parse('<control>V'),
                                    # 'delete': gtk.accelerator_parse('Delete'),  # no default accelerator insert
                                    # 'undo': gtk.accelerator_parse('<control>Z'),  # no default accelerator insert
                                    # 'redo': gtk.accelerator_parse('<control>Y'),  # no default accelerator insert
                                    }
        self.sub_menu_open_recently = gtk.Menu()
        self['open_recent'].set_submenu(self.sub_menu_open_recently)

        for menu_item_name in self.buttons.iterkeys():
            # set icon
            self.set_menu_item_icon(menu_item_name, self.buttons[menu_item_name])
            # set accelerator if in shortcuts dictionary with menu_item_name == key
            if menu_item_name in global_gui_config.get_config_value('SHORTCUTS'):
                shortcuts = global_gui_config.get_config_value('SHORTCUTS')[menu_item_name]
                if shortcuts:
                    self.set_menu_item_accelerator(menu_item_name, shortcuts[0])
Example #9
0
    def __init__(self):
        """View holding the graphical editor

        The purpose of the view is only to hold the graphical editor. The class ob the actual editor with the OpenGL
        functionality is GraphicalEditor
        """
        View.__init__(self)

        # Configure OpenGL frame buffer.
        # Try to get a double-buffered frame buffer configuration,
        # if not successful then exit program
        display_mode = (gtk.gdkgl.MODE_RGB | gtk.gdkgl.MODE_DEPTH
                        | gtk.gdkgl.MODE_DOUBLE)
        try:
            glconfig = gtk.gdkgl.Config(mode=display_mode)
        except gtk.gdkgl.NoMatches:
            raise SystemExit

        self.v_box = gtk.VBox()
        self.editor = GraphicalEditor(glconfig)
        self.editor.add_events(gtk.gdk.BUTTON_PRESS_MASK
                               | gtk.gdk.BUTTON_RELEASE_MASK
                               | gtk.gdk.BUTTON_MOTION_MASK
                               | gtk.gdk.KEY_PRESS_MASK
                               | gtk.gdk.KEY_RELEASE_MASK
                               | gtk.gdk.POINTER_MOTION_MASK)
        self.editor.set_size_request(0, 0)
        self.editor.set_flags(gtk.CAN_FOCUS)

        self.v_box.pack_end(self.editor)

        self['main_frame'] = self.v_box
        self.top = 'main_frame'
Example #10
0
    def __init__(self):
        View.__init__(self)

        self['new_global_variable_button'].set_border_width(
            constants.BUTTON_BORDER_WIDTH)
        self['delete_global_variable_button'].set_border_width(
            constants.BUTTON_BORDER_WIDTH)
        self['lock_global_variable_button'].set_border_width(
            constants.BUTTON_BORDER_WIDTH)
        self['unlock_global_variable_button'].set_border_width(
            constants.BUTTON_BORDER_WIDTH)
Example #11
0
    def __init__(self):
        View.__init__(self)
        self.notebook = gtk.Notebook()
        self.notebook.set_scrollable(True)
        self.notebook.set_name('states_editor_notebook')
        self.notebook.set_tab_hborder(constants.TAB_BORDER_WIDTH)
        self.notebook.set_tab_vborder(constants.TAB_BORDER_WIDTH)
        self.notebook.show()

        self.notebook.connect("button_press_event", self.button_released)

        self['notebook'] = self.notebook
        self.top = 'notebook'
Example #12
0
    def __init__(self):
        View.__init__(self)
        gtk.TreeView.__init__(self)
        self.set_name("history_tree")

        tvcolumn = gtk.TreeViewColumn('History',
                                      gtk.CellRendererText(),
                                      text=0)
        tvcolumn.set_property("sizing", "autosize")
        self.append_column(tvcolumn)

        self['history_treeview'] = self
        self.top = 'history_treeview'
Example #13
0
    def __init__(self):
        View.__init__(self)

        gui_helper_label.set_label_markup(self['transitions_label'], 'TRANSITIONS',
                                          letter_spacing=constants.LETTER_SPACING_1PT)

        self.transitions_listView = StateTransitionsListView()
        self['transitions_scroller'].add(self.transitions_listView.get_top_widget())
        self.transitions_listView.scrollbar_widget = self['transitions_scroller']

        self['internal_t_checkbutton'].set_border_width(constants.BUTTON_BORDER_WIDTH)
        self['connected_to_t_checkbutton'].set_border_width(constants.BUTTON_BORDER_WIDTH)
        self['add_t_button'].set_border_width(constants.BUTTON_BORDER_WIDTH)
        self['remove_t_button'].set_border_width(constants.BUTTON_BORDER_WIDTH)
Example #14
0
    def __init__(self):
        View.__init__(self)

        self['cpu_monitor'] = Monitor(self.cpu_color)
        self['cpu_monitor'].show()
        self['box_cpu'].pack_start(self['cpu_monitor'])

        self['mem_monitor'] = Monitor(self.mem_color)
        self['mem_monitor'].show()
        self['box_mem'].pack_start(self['mem_monitor'])

        self['button_cpu_prcnt'].set_color(
            Color(*(self['cpu_monitor'].line_color)))
        self['button_mem_prcnt'].set_color(
            Color(*(self['mem_monitor'].line_color)))
Example #15
0
 def __init__(self):
     View.__init__(self)
     self.driveView = DriveView()
     self['vbox_sidebar_left'].pack_start(self.driveView.get_top_widget())
     self['hsep'] = gtk.HSeparator()
     self['hsep'].show_all()
     self['vbox_sidebar_left'].pack_start(self['hsep'])
     self.jsView = JsView()
     self['vbox_sidebar_left'].pack_start(self.jsView.get_top_widget())
     self.videoView = VideoView()
     self['hbox1'].pack_start(self.videoView.get_top_widget())
     self['hbox1'].reorder_child(self.videoView.get_top_widget(), 1)
     self.barView = BarView(self)
     self['vbox_main'].pack_start(self.barView.get_top_widget())
     self['vbox_main'].reorder_child(self.barView.get_top_widget(), 0)
Example #16
0
    def __init__(self):
        View.__init__(self)

        self['cpu_monitor'] = Monitor(self.cpu_color)
        self['cpu_monitor'].show()
        self['box_cpu'].pack_start(self['cpu_monitor'])
    
        self['mem_monitor'] = Monitor(self.mem_color)
        self['mem_monitor'].show()
        self['box_mem'].pack_start(self['mem_monitor'])

        self['button_cpu_prcnt'].set_color(
            Color(*(self['cpu_monitor'].line_color)))
        self['button_mem_prcnt'].set_color(
            Color(*(self['mem_monitor'].line_color)))
Example #17
0
	def __init__(self):
		View.__init__(self)
		self['window'].set_title("Pybber")
		self['window'].show()
		self['window'].set_icon_from_file(path+"/icons/pybber.png")
		self['chatstyle']=gtk.combo_box_new_text()
		self['vbuttonbox3'].add(self['chatstyle'])
		self['chatstyle'].show_all()
		self.createchat()
		self.hid=0
		self.createicon()
		self['stylevarslist']=gtk.combo_box_new_text()
		self['vbuttonbox3'].add(self['stylevarslist'])
		self['stylevarslist'].show_all()
		self['window'].set_role("Pybber")
Example #18
0
    def __init__(self):
        View.__init__(self)
        gtk.TreeView.__init__(self)
        self.set_name('library_tree')
        # self.set_grid_lines(gtk.TREE_VIEW_GRID_LINES_HORIZONTAL)

        tvcolumn_name = gtk.TreeViewColumn('Library Name')
        tvcolumn_name.set_property("sizing", "autosize")
        self.append_column(tvcolumn_name)
        cell_renderer_name = gtk.CellRendererText()
        tvcolumn_name.pack_start(cell_renderer_name, True)
        tvcolumn_name.add_attribute(cell_renderer_name, 'text', 0)

        self['library_tree_view'] = self
        self.top = 'library_tree_view'
 def __init__(self):
     
     """Constructor for GestionacademiaView reads a graphical representation of
     the view from a glade file.
     
     """
     
     # Look for the ui file that describes the ui.
     ui_filename = os.path.join(_config.get_data_path(), 'ui', 'GestionacademiaWindow.ui')
     if not os.path.exists(ui_filename):
         ui_filename = None
     
     # Initialise the view.
     View.__init__(self, builder=ui_filename, top='gestionacademia_window')
     
     return
Example #20
0
    def __init__(self, title):
        View.__init__(self)

        self.top_tool_bar = TopToolBarView()
        self['top_menu_hbox'].remove(self['top_tool_bar_placeholder'])
        self['top_menu_hbox'].pack_end(self.top_tool_bar.get_top_widget(),
                                       expand=True,
                                       fill=True,
                                       padding=0)
        self['top_menu_hbox'].reorder_child(self.top_tool_bar.get_top_widget(),
                                            1)

        self.get_top_widget().set_decorated(False)
        if not ('3.0.101' in os.uname()[2]
                and 'kde' == os.environ.get('DESKTOP_SESSION')):
            self.get_top_widget().set_type_hint(
                gtk.gdk.WINDOW_TYPE_HINT_UTILITY)
Example #21
0
    def __init__(self, parent):
        View.__init__(self)
        manager = gtk.UIManager()
        driveView = parent.driveView

        manager.insert_action_group(parent['actgrp_main'])
        manager.insert_action_group(driveView['actgrp_drive'])
        manager.add_ui_from_file("ui.xml")

        vb = gtk.VBox()
        menubar = manager.get_widget("/menubar")
        toolbar = manager.get_widget("/toolbar")
        vb.pack_start(menubar)
        vb.pack_start(toolbar)
        self['vbox_bars'] = vb
        self.top = 'vbox_bars'
        vb.show_all()
Example #22
0
    def __init__(self, view_class, width=500, height=500, title=None, pos=None):
        View.__init__(self)

        w = gtk.Window()
        if title is None:
            w.set_title(str(view_class))
        else:
            w.set_title(title)
        w.resize(width=width, height=height)
        if pos is not None:
            w.set_position(pos)
        self.widget_view = view_class()
        w.add(self.widget_view.get_top_widget())
        w.show_all()

        self['main_frame'] = self.widget_view
        self.top = 'main_frame'
        self['main_window'] = w
Example #23
0
    def __init__(self):
        View.__init__(self)
        gtk.ScrolledWindow.__init__(self)

        history_tree = HistoryTreeView()
        history_tree.set_name('history_tree')

        undo_button = gtk.Button("Undo")
        undo_button.set_border_width(constants.BUTTON_BORDER_WIDTH)
        redo_button = gtk.Button("Redo")
        redo_button.set_border_width(constants.BUTTON_BORDER_WIDTH)
        reset_button = gtk.Button("Reset")
        reset_button.set_border_width(constants.BUTTON_BORDER_WIDTH)
        branch_checkbox = gtk.CheckButton("B")
        branch_checkbox.set_tooltip_text('Show branches')
        branch_checkbox.set_border_width(constants.BUTTON_BORDER_WIDTH)
        folded_checkbox = gtk.CheckButton("F")
        folded_checkbox.set_tooltip_text('Fold branches')
        folded_checkbox.set_border_width(constants.BUTTON_BORDER_WIDTH)

        button_hbox = gtk.HBox()
        button_hbox.pack_end(folded_checkbox, False, True, 0)
        button_hbox.pack_end(branch_checkbox, False, True, 0)
        button_hbox.pack_end(reset_button, False, True, 0)
        button_hbox.pack_end(redo_button, False, True, 0)
        button_hbox.pack_end(undo_button, False, True, 0)

        history_vbox = gtk.VBox()
        history_vbox.pack_start(self, True, True, 0)
        history_vbox.pack_start(button_hbox, False, True, 0)

        self.add(history_tree)
        self.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        self.show_all()

        self['history_vbox'] = history_vbox
        self['history_view'] = self
        self['history_tree'] = history_tree
        self['undo_button'] = undo_button
        self['redo_button'] = redo_button
        self['reset_button'] = reset_button
        self['branch_checkbox'] = branch_checkbox
        self['folded_checkbox'] = folded_checkbox
        self.top = 'history_view'
Example #24
0
    def __init__(self):
        View.__init__(self)

        gui_helper_label.set_label_markup(
            self['data_flows_label'],
            'DATA FLOWS',
            letter_spacing=constants.LETTER_SPACING_1PT)

        self.data_flows_listView = StateDataFlowsListView()
        self['dataflows_scroller'].add(
            self.data_flows_listView.get_top_widget())
        self.data_flows_listView.scrollbar_widget = self['dataflows_scroller']

        self['internal_d_checkbutton'].set_border_width(
            constants.BUTTON_BORDER_WIDTH)
        self['connected_to_d_checkbutton'].set_border_width(
            constants.BUTTON_BORDER_WIDTH)
        self['add_d_button'].set_border_width(constants.BUTTON_BORDER_WIDTH)
        self['remove_d_button'].set_border_width(constants.BUTTON_BORDER_WIDTH)
Example #25
0
    def __init__(self):
        View.__init__(self)

        button_new = self['button_new']
        button_new.set_label_widget(
            create_label_widget_with_icon(constants.BUTTON_NEW,
                                          _("New state machine")))

        button_refresh = self['button_refresh']
        button_refresh.set_label_widget(
            create_label_widget_with_icon(
                constants.BUTTON_REFR, _("Refresh"),
                "Refresh all libraries and state machines"))

        button_refresh_selected = self['button_refresh_selected']
        button_refresh_selected.set_label_widget(
            create_label_widget_with_icon(constants.BUTTON_REFR,
                                          _("Refresh Selected"),
                                          "Refresh selected state machine"))

        button_open = self['button_open']
        button_open.set_label_widget(
            create_label_widget_with_icon(constants.BUTTON_OPEN,
                                          _("Open state machine")))

        button_save = self['button_save']
        button_save.set_label_widget(
            create_label_widget_with_icon(constants.BUTTON_SAVE,
                                          _("Save state machine")))

        button_refresh_libs = self['button_refresh_libs']
        button_refresh_libs.set_label_widget(
            create_label_widget_with_icon(constants.BUTTON_REFR,
                                          _("Refresh Libraries"),
                                          "Refresh all libraries"))

        button_bake_state_machine = self['button_bake_state_machine']
        button_bake_state_machine.set_label_widget(
            create_label_widget_with_icon(
                constants.BUTTON_BAKE, _("Bake State Machine"),
                "Saves the currently selected state machine and all library folders it refers to"
            ))
Example #26
0
    def __init__(self, status):
        builder = os.path.join("./", "example.glade")
        self.glade_xmlWidgets = []
        View.__init__(self)
        self.db = Database()
        self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
        self.window.set_title("Parking Spots Availability")
        self.window.connect("delete_event", self.delete_event)
        self.window.set_border_width(200)
        self.box1 = gtk.HBox(False, 10)
        #self.window.add(self.box1)
        self.parkingSign = {}

        print status, type(status)
        for i in status:
            self.parkingSign[i] = gtk.DrawingArea()
            self.parkingSign[i].set_size_request(100, 200)
            self.parkingSign[i].modify_bg(gtk.STATE_NORMAL,
                                          statusToColor[status[i]])
            self.parkingSign[i].show()

            label = gtk.Label()
            label.show()
            label.set_text("Parking #" + str(i))
            vbox = gtk.VBox(False, 0)
            vbox.pack_start(label, True, True, 0)
            vbox.pack_start(self.parkingSign[i], True, True, 0)
            vbox.show()
            self.box1.pack_start(vbox)

        self.box1.show()

        self.button = gtk.Button('refresh')
        self.box2 = gtk.VBox(False, 10)
        self.window.add(self.box2)
        self.box2.pack_start(self.button)
        self.box2.pack_start(self.box1)
        self.box2.show()
        self.button.show()
        #self.button.connect('clicked',self.clicked)
        self.window.show()
Example #27
0
    def __init__(self):
        View.__init__(self)
        gtk.IconView.__init__(self)

        self.set_columns(len(self.icon_label))
        self.set_margin(0)
        self.set_spacing(0)
        self.set_row_spacing(0)
        self.set_column_spacing(0)

        liststore = gtk.ListStore(str, str)
        self.set_model(liststore)
        self.set_markup_column(0)
        self.set_tooltip_column(1)

        for state in self.icon_label:
            liststore.append(['<span font_desc="%s %s">&#x%s; ' % (constants.ICON_FONT, constants.FONT_SIZE_NORMAL,
                                                                   constants.BUTTON_ADD) + state + '</span>',
                              "Add/Drag and Drop " + self.tooltips[state]])

        self['state_icon_view'] = self
        self.top = 'state_icon_view'
Example #28
0
    def __init__(self):
        View.__init__(self)

        self.get_top_widget().set_events(gtk.gdk.POINTER_MOTION_MASK
                                         | gtk.gdk.POINTER_MOTION_HINT_MASK
                                         | gtk.gdk.BUTTON_PRESS_MASK)

        close_label = gui_helper_label.create_button_label(
            constants.BUTTON_CLOSE)
        self['close_button'].set_label_widget(close_label)
        self['close_button'].set_tooltip_text("Close RAFCON")

        maximize_label = gui_helper_label.create_button_label(
            constants.BUTTON_EXP)
        self['maximize_button'].set_label_widget(maximize_label)

        self['minimize_button'].set_label('_')
        self['minimize_button'].set_tooltip_text("Minimize main window")

        redock_label = gui_helper_label.create_button_label(
            constants.BUTTON_UNDOCK)
        self['redock_button'].set_label_widget(redock_label)
        self['redock_button'].set_tooltip_text("Re-Dock widget to main window")
Example #29
0
 def __init__(self, parent=None, stand_alone=True):
     
     """Constructor for CursoView reads a graphical representation of
     the view from a glade file.
     
     parent: The name of the window that spawned this one
     stand_alone: If true, this view is a window unto itself. If not,
         it is embedded in another window.
     
     """
     
     # Look for the ui file that describes the ui.
     ui = os.path.join(_config.get_data_path(), 'ui', 'CursoDialog.ui')
     if not os.path.exists(ui):
         ui = None
     
     # Top window/widget check.
     if stand_alone: top_widget = 'curso_dialog'
     else: top_widget = 'sw_scroller'
     
     View.__init__(self, builder=ui, parent=parent, top=top_widget)
     
     return
 def __init__(self, parent=None, stand_alone=True):
     
     """Constructor for PreferencesView reads a graphical representation of
     the view from a glade file.
     
     parent: The name of the window that spawned this one
     
     """
     
     View.__init__(self, parent=parent)
     
     # Look for the ui file that describes the ui.
     ui = os.path.join(_config.get_data_path(), 
                       'ui', 
                       'PreferencesGestionacademiaDialog.ui')
     
     # Top window/widget check.
     if stand_alone: top_widget = 'preferences_gestionacademia_dialog'
     else: top_widget = 'vbox_dialog'
     
     View.__init__(self, builder=ui, parent=parent, top=top_widget)
     
     return
Example #31
0
    def __init__(self):
        View.__init__(self)

        self._lock = threading.Lock()

        ######################################################
        # Logging text view
        ######################################################
        self.logging_console_view = LoggingConsoleView()
        self['console'].pack_start(self.logging_console_view.get_top_widget(),
                                   True, True, 0)
        self.logging_console_view.get_top_widget().show()

        ######################################################
        # initial configuration of the console
        ######################################################
        self['debug_eventbox'].set_border_width(0)

        self['button_follow_logging'].set_active(
            global_gui_config.get_config_value('CONSOLE_FOLLOW_LOGGING', True))
        self['button_show_verbose'].set_active(
            global_gui_config.get_config_value('LOGGING_SHOW_VERBOSE', True))
        self['button_show_debug'].set_active(
            global_gui_config.get_config_value('LOGGING_SHOW_DEBUG', True))
        self['button_show_info'].set_active(
            global_gui_config.get_config_value('LOGGING_SHOW_INFO', True))
        self['button_show_warning'].set_active(
            global_gui_config.get_config_value('LOGGING_SHOW_WARNING', True))
        self['button_show_error'].set_active(
            global_gui_config.get_config_value('LOGGING_SHOW_ERROR', True))

        self['undock_console_button'].set_image(
            gui_helper_label.create_button_label(constants.BUTTON_UNDOCK))
        self['undock_console_button'].set_tooltip_text(
            "Undock debug console widget")
        self['console_hide_button'].set_image(
            gui_helper_label.create_button_label(constants.BUTTON_DOWNA))
Example #32
0
    def __init__(self):

        View.__init__(self)
        # Create a new window
        # self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)

        # self.window.set_title("Execution Log Viewer")

        # self.window.set_default_size(1024, 786)

        # self.window.connect("delete_event", self.delete_event)

        # Setting up the self.grid in which the elements are to be positioned
        self.paned = gtk.HPaned()
        # self.window.add(self.paned)

        # setting up the layout, putting the tree_view in a scrollwindow, and the buttons in a row
        self.scrollable_treelist = gtk.ScrolledWindow()
        # self.scrollable_treelist.set_expand(True)
        self.paned.add1(self.scrollable_treelist)

        # setting up text view
        self.scrollable_textview = gtk.ScrolledWindow()
        self.paned.add2(self.scrollable_textview)

        self.paned.set_position(300)

        self.text_view = gtk.TextView(buffer=None)
        self.scrollable_textview.add(self.text_view)

        self.tree_view = gtk.TreeView()
        self.selection = self.tree_view.get_selection()
        self.scrollable_treelist.add(self.tree_view)

        # create the TreeViewColumn to display the data
        self.tvcolumn = gtk.TreeViewColumn('Execution History')

        # add tvcolumn to tree_view
        self.tree_view.append_column(self.tvcolumn)

        # create a CellRendererText to render the data
        self.cell = gtk.CellRendererText()

        # add the cell to the tvcolumn and allow it to expand
        self.tvcolumn.pack_start(self.cell, True)

        # set the cell "text" attribute to column 0 - retrieve text
        # from that column in treestore
        self.tvcolumn.add_attribute(self.cell, 'text', 0)

        # make it searchable
        self.tree_view.set_search_column(0)

        # Allow sorting on the column
        self.tvcolumn.set_sort_column_id(0)

        # Allow drag and drop reordering of rows
        self.tree_view.set_reorderable(True)

        self.tree_view.show_all()
        self.paned.show_all()

        self['execution_log_paned'] = self.paned
        self['execution_log_tree_view'] = self.tree_view

        self.top = 'execution_log_tree_view'
Example #33
0
    def __init__(self):
        View.__init__(self)

        if os.getenv("RAFCON_START_MINIMIZED", False):
            self.get_top_widget().iconify()

        # Add gui components by removing their corresponding placeholders defined in the glade file first and then
        # adding the widgets.
        self.left_bar_notebooks = [
            self['upper_notebook'], self['lower_notebook']
        ]

        ################################################
        # Undock Buttons
        ################################################
        self['undock_left_bar_button'].set_image(
            gui_helper_label.create_button_label(constants.BUTTON_UNDOCK))
        self['undock_left_bar_button'].set_tooltip_text(
            "Undock left side bar widget")
        self['undock_right_bar_button'].set_image(
            gui_helper_label.create_button_label(constants.BUTTON_UNDOCK))
        self['undock_right_bar_button'].set_tooltip_text(
            "Undock right side bar widget")
        self['collapse_tree_button'].set_image(
            gui_helper_label.create_button_label(constants.BUTTON_COLLAPSE))
        self['collapse_tree_button'].set_tooltip_text(
            "Collapse tree of widget")

        ######################################################
        # Library Tree
        ######################################################
        self.library_tree = LibraryTreeView()
        self.library_tree.show()
        self['libraries_alignment'].add(self.library_tree)

        ######################################################
        # State Icons
        ######################################################
        self.state_icons = StateIconView()
        self.state_icons.show()
        self["state_icons_box"].pack_start(self.state_icons.get_top_widget())

        ######################################################
        # State Machine Tree
        ######################################################
        self.state_machine_tree = StateMachineTreeView()
        self.state_machine_tree.show()
        self['states_tree_alignment'].add(self.state_machine_tree)

        ######################################################
        # Global Variable Manager
        ######################################################
        self.global_var_editor = GlobalVariableEditorView()
        self.global_var_editor.show()
        self['global_variables_alignment'].add(
            self.global_var_editor.get_top_widget())

        ######################################################
        # State Machine History
        ######################################################
        self.state_machine_history = ModificationHistoryView()
        self.state_machine_history.show()
        self['history_alignment'].add(
            self.state_machine_history.get_top_widget())

        ######################################################
        # State Machine Execution History
        ######################################################
        self.execution_history = ExecutionHistoryView()
        self.execution_history.show()
        self['execution_history_alignment'].add(
            self.execution_history.get_top_widget())

        ######################################################
        # rotate all tab labels by 90 degrees and make detachable
        ######################################################
        self.rotate_and_detach_tab_labels()

        self['upper_notebook'].set_current_page(0)
        self['lower_notebook'].set_current_page(0)

        ######################################################
        # State-machines-editor (graphical)
        ######################################################
        self.state_machines_editor = StateMachinesEditorView()
        self.state_machines_editor.show()
        self['graphical_editor_vbox'].pack_start(
            self.state_machines_editor.get_top_widget(), True, True, 0)
        self['graphical_editor_vbox'].reorder_child(
            self.state_machines_editor.get_top_widget(), 0)

        self['graphical_editor_label_event_box'].remove(
            self['graphical_editor_label'])
        self['graphical_editor_label_event_box'].set_border_width(
            constants.GRID_SIZE)
        graphical_editor_label = gui_helper_label.create_label_with_text_and_spacing(
            _('GRAPHICAL EDITOR'),
            font_size=constants.FONT_SIZE_BIG,
            letter_spacing=constants.LETTER_SPACING_1PT)
        graphical_editor_label.set_alignment(0, .5)
        self['graphical_editor_label_event_box'].add(graphical_editor_label)

        ######################################################
        # States-editor
        ######################################################
        self.states_editor = StatesEditorView()
        self['state_editor_eventbox'].add(self.states_editor.get_top_widget())
        self.states_editor.show()

        self['state_editor_label_hbox'].remove(self['state_editor_label'])
        self['state_editor_label_hbox'].set_border_width(constants.GRID_SIZE)
        state_editor_label = gui_helper_label.create_label_with_text_and_spacing(
            _('STATE EDITOR'),
            font_size=constants.FONT_SIZE_BIG,
            letter_spacing=constants.LETTER_SPACING_1PT)
        state_editor_label.set_alignment(0., 0.)
        self['state_editor_label_hbox'].add(state_editor_label)

        ######################################################
        # Debug Console
        ######################################################
        self.debug_console_view = DebugConsoleView()
        self['debug_console_viewport'].add(
            self.debug_console_view.get_top_widget())
        self.debug_console_view.get_top_widget().show()
        # map hide and undock buttons within and debug widget to be usable from main window view with generic naming
        self['undock_console_button'] = self.debug_console_view[
            'undock_console_button']
        self['console_hide_button'] = self.debug_console_view[
            'console_hide_button']
        self['console_container'] = self.debug_console_view[
            'console_container']
        self['console'] = self.debug_console_view['console']

        ##################################################
        # menu bar view
        ##################################################
        self.top_tool_bar = TopToolBarView()
        self.top_tool_bar.show()
        self['top_menu_hbox'].remove(self['top_tool_bar_placeholder'])
        self['top_menu_hbox'].pack_end(self.top_tool_bar.get_top_widget(),
                                       expand=True,
                                       fill=True,
                                       padding=0)
        self['top_menu_hbox'].reorder_child(self.top_tool_bar.get_top_widget(),
                                            1)

        self.menu_bar = MenuBarView(self)
        self.menu_bar.show()
        self['top_menu_hbox'].remove(self['menu_bar_placeholder'])
        self['top_menu_hbox'].pack_start(self.menu_bar.get_top_widget(),
                                         expand=False,
                                         fill=True,
                                         padding=0)
        self['top_menu_hbox'].reorder_child(self.menu_bar.get_top_widget(), 0)

        self.tool_bar = ToolBarView()
        self.tool_bar.show()
        self['top_level_vbox'].remove(self['tool_bar_placeholder'])
        self['top_level_vbox'].pack_start(self.tool_bar.get_top_widget(),
                                          expand=False,
                                          fill=True,
                                          padding=0)
        self['top_level_vbox'].reorder_child(self.tool_bar.get_top_widget(), 1)

        ################################################
        # Hide Buttons
        ################################################
        self['left_bar_hide_button'].set_image(
            gui_helper_label.create_button_label(constants.BUTTON_LEFTA))
        self['right_bar_hide_button'].set_image(
            gui_helper_label.create_button_label(constants.BUTTON_RIGHTA))

        ################################################
        # Return Buttons
        ################################################
        self['left_bar_return_button'].set_image(
            gui_helper_label.create_button_label(constants.BUTTON_RIGHTA))
        self['right_bar_return_button'].set_image(
            gui_helper_label.create_button_label(constants.BUTTON_LEFTA))
        self['console_return_button'].set_image(
            gui_helper_label.create_button_label(constants.BUTTON_UPA))

        # --------------------------------------------------------------------------
        # Edit graphical_editor_shortcuts
        # --------------------------------------------------------------------------

        button_start_shortcut = self['button_start_shortcut']
        button_start_shortcut.set_tooltip_text('Run')
        button_stop_shortcut = self['button_stop_shortcut']
        button_stop_shortcut.set_tooltip_text('Stop')
        button_pause_shortcut = self['button_pause_shortcut']
        button_pause_shortcut.set_tooltip_text('Pause')
        button_start_from_shortcut = self['button_start_from_shortcut']
        button_start_from_shortcut.set_tooltip_text('Run From Selected State')
        button_run_to_shortcut = self['button_run_to_shortcut']
        button_run_to_shortcut.set_tooltip_text(
            'Run Until Selected State (Selected State Excluded)')
        button_step_mode_shortcut = self['button_step_mode_shortcut']
        button_step_mode_shortcut.set_tooltip_text('Enter Step Mode')
        button_step_in_shortcut = self['button_step_in_shortcut']
        button_step_in_shortcut.set_tooltip_text(
            'Step Into (One Level In -> Child-State))')
        button_step_over_shortcut = self['button_step_over_shortcut']
        button_step_over_shortcut.set_tooltip_text(
            'Step Over (the next Sibling-State))')
        button_step_out_shortcut = self['button_step_out_shortcut']
        button_step_out_shortcut.set_tooltip_text(
            'Step Out (One Level Up -> Parent-State)')
        button_step_backward_shortcut = self['button_step_backward_shortcut']
        button_step_backward_shortcut.set_tooltip_text('Step Backward')

        button_start_shortcut.set_label_widget(
            gui_helper_label.create_button_label(constants.BUTTON_START))
        button_stop_shortcut.set_label_widget(
            gui_helper_label.create_button_label(constants.BUTTON_STOP))
        button_pause_shortcut.set_label_widget(
            gui_helper_label.create_button_label(constants.BUTTON_PAUSE))
        button_start_from_shortcut.set_label_widget(
            gui_helper_label.create_button_label(
                constants.BUTTON_START_FROM_SELECTED_STATE))
        button_run_to_shortcut.set_label_widget(
            gui_helper_label.create_button_label(
                constants.BUTTON_RUN_TO_SELECTED_STATE))
        button_step_mode_shortcut.set_label_widget(
            gui_helper_label.create_button_label(constants.BUTTON_STEPM))
        button_step_in_shortcut.set_label_widget(
            gui_helper_label.create_button_label(constants.BUTTON_STEP_INTO))
        button_step_over_shortcut.set_label_widget(
            gui_helper_label.create_button_label(constants.BUTTON_STEP_OVER))
        button_step_out_shortcut.set_label_widget(
            gui_helper_label.create_button_label(constants.BUTTON_STEP_OUT))
        button_step_backward_shortcut.set_label_widget(
            gui_helper_label.create_button_label(constants.BUTTON_BACKW))

        # --------------------------------------------------------------------------

        self.get_top_widget().set_decorated(False)

        self['upper_notebook'].set_tab_hborder(constants.TAB_BORDER_WIDTH * 2)
        self['upper_notebook'].set_tab_vborder(constants.TAB_BORDER_WIDTH * 3)
        if global_gui_config.get_config_value("USE_ICONS_AS_TAB_LABELS", True):
            self['lower_notebook'].set_tab_hborder(
                int(constants.TAB_BORDER_WIDTH * 2 / 1.4))
        else:
            self['lower_notebook'].set_tab_hborder(constants.TAB_BORDER_WIDTH *
                                                   2)
        self['lower_notebook'].set_tab_vborder(constants.TAB_BORDER_WIDTH * 3)

        self.left_bar_window = UndockedWindowView('left_bar_window')
        self.right_bar_window = UndockedWindowView('right_bar_window')
        self.console_window = UndockedWindowView('console_window')
Example #34
0
    def __init__(self):
        View.__init__(self)

        self['properties_widget'].set_border_width(constants.GRID_SIZE * 2)
Example #35
0
 def __init__(self):
     View.__init__(self)
Example #36
0
	def __init__ (self):
		""" Main GUI constructor """
		View.__init__(self, "main_window.glade", "windowMain")
		self.dirBase = self['dirChooserSong'].get_filename ()
Example #37
0
    def __init__(self):
        View.__init__(self)

        self.page_dict = {}
        self.notebook_names = ['main_notebook_1', 'main_notebook_2']

        gui_helper_label.set_label_markup(self['data_ports_label'], 'DATA PORTS',
                                          letter_spacing=constants.LETTER_SPACING_1PT)

        self.properties_view = StateOverviewView()
        self.inputs_view = InputPortsListView()
        self.outputs_view = OutputPortsListView()
        self.scopes_view = ScopedVariablesListView()
        self.outcomes_view = StateOutcomesEditorView()
        self.source_view = SourceEditorView()
        self.transitions_view = StateTransitionsEditorView()
        self.data_flows_view = StateDataFlowsEditorView()
        self.linkage_overview = LinkageOverviewView()
        self.description_view = DescriptionEditorView()
        self.semantic_data_view = SemanticDataEditorView()

        self['properties_viewport'].add(self.properties_view.get_top_widget())
        self['input_ports_scroller'].add(self.inputs_view.get_top_widget())
        self['output_ports_scroller'].add(self.outputs_view.get_top_widget())
        self['scoped_variables_scroller'].add(self.scopes_view.get_top_widget())
        self['outcomes_viewport'].add(self.outcomes_view.get_top_widget())
        self['source_viewport'].add(self.source_view.get_top_widget())
        self['transitions_viewport'].add(self.transitions_view.get_top_widget())
        self['data_flows_viewport'].add(self.data_flows_view.get_top_widget())
        self['linkage_overview_viewport'].add(self.linkage_overview.get_top_widget())
        self['description_viewport'].add(self.description_view.get_top_widget())
        self['semantic_data_viewport'].add(self.semantic_data_view.get_top_widget())

        self.inputs_view.scrollbar_widget = self['input_ports_scroller']
        self.outputs_view.scrollbar_widget = self['output_ports_scroller']
        self.scopes_view.scrollbar_widget = self['scoped_variables_scroller']

        self['description_text_view'] = self.description_view.textview
        self['description_scroller'] = self.description_view.scrollable

        self['main_notebook_1'].set_tab_hborder(constants.TAB_BORDER_WIDTH * 2)
        self['main_notebook_1'].set_tab_vborder(constants.TAB_BORDER_WIDTH * 3)
        self['main_notebook_2'].set_tab_hborder(constants.TAB_BORDER_WIDTH * 2)
        self['main_notebook_2'].set_tab_vborder(constants.TAB_BORDER_WIDTH * 3)
        self['ports_notebook'].set_tab_hborder(constants.TAB_BORDER_WIDTH * 2)
        self['ports_notebook'].set_tab_vborder(constants.TAB_BORDER_WIDTH * 3)
        self.page_dict["Source"] = self['main_notebook_1'].get_nth_page(0)
        self.page_dict["Logical Linkage"] = self['main_notebook_1'].get_nth_page(1)
        self.page_dict["Data Linkage"] = self['main_notebook_1'].get_nth_page(2)
        self.page_dict["Linkage Overview"] = self['main_notebook_2'].get_nth_page(0)
        self.page_dict["Description"] = self['main_notebook_2'].get_nth_page(1)
        self.page_dict["Semantic Data"] = self['main_notebook_2'].get_nth_page(2)
        self['main_notebook_1'].set_current_page(self['main_notebook_1'].page_num(self.page_dict["Source"]))
        self['main_notebook_2'].set_current_page(self['main_notebook_2'].page_num(self.page_dict["Description"]))

        self['add_input_port_button'].set_border_width(constants.BUTTON_BORDER_WIDTH)
        self['remove_input_port_button'].set_border_width(constants.BUTTON_BORDER_WIDTH)
        self['add_output_port_button'].set_border_width(constants.BUTTON_BORDER_WIDTH)
        self['remove_output_port_button'].set_border_width(constants.BUTTON_BORDER_WIDTH)
        self['add_scoped_variable_button'].set_border_width(constants.BUTTON_BORDER_WIDTH)
        self['remove_scoped_variable_button'].set_border_width(constants.BUTTON_BORDER_WIDTH)

        self._scoped_tab_page_number = None
        self._scoped_var_page = None
        self._scoped_var_page_tab_label = None
        self._source_tab_page_number = None
        self._source_page = None
        self._source_page_tab_label = None

        self.set_default_paned_positions()