Changes which image is being displayed depending on GUI selection
166136
private synchronized void changeImageView() {

		JComponent comp;
		if( control.selectedView < 3 ) {
			BufferedImage img;

			switch (control.selectedView) {
				case 0:
					img = disparityOut;
					break;

				case 1:
					img = colorLeft;
					break;

				case 2:
					img = colorRight;
					break;

				default:
					throw new RuntimeException("Unknown option");
			}

			gui.setImage(img);
			gui.setPreferredSize(new Dimension(origLeft.getWidth(), origLeft.getHeight()));
			comp = gui;
		} else {
			if( !computedCloud ) {
				computedCloud = true;
				DisparityToColorPointCloud d2c = new DisparityToColorPointCloud();

				double baseline = calib.getRightToLeft().getT().norm();
				d2c.configure(baseline, rectK,rectR, leftRectToPixel, control.minDisparity,control.maxDisparity);
				d2c.process(activeAlg.getDisparity(),colorLeft);

				CameraPinhole rectifiedPinhole = PerspectiveOps.matrixToPinhole(
						rectK,colorLeft.getWidth(),colorLeft.getHeight(),null);
				pcv.clearPoints();
				pcv.setCameraHFov(PerspectiveOps.computeHFov(rectifiedPinhole));
				pcv.setTranslationStep(5);
				pcv.addCloud(d2c.getCloud(),d2c.getCloudColor());
			}
			comp = pcv.getComponent();
			comp.requestFocusInWindow();
		}
		panel.remove(gui);
		panel.remove(pcv.getComponent());
		panel.add(comp,BorderLayout.CENTER);
		panel.validate();
		comp.repaint();
		processedImage = true;
	}
94067
function() {
				var i, len;
				if (selectedElement != null) {
					switch (selectedElement.tagName) {
					case 'use':
					case 'image':
					case 'foreignObject':
						break;
					case 'g':
					case 'a':
						// Look for common styles
						var gWidth = null;
						var childs = selectedElement.getElementsByTagName('*');
						for (i = 0, len = childs.length; i < len; i++) {
							var swidth = childs[i].getAttribute('stroke-width');

							if (i === 0) {
								gWidth = swidth;
							} else if (gWidth !== swidth) {
								gWidth = null;
							}
						}

						$('#stroke_width').val(gWidth === null ? '' : gWidth);

						paintBox.fill.update(true);
						paintBox.stroke.update(true);

						break;
					default:
						paintBox.fill.update(true);
						paintBox.stroke.update(true);

						$('#stroke_width').val(selectedElement.getAttribute('stroke-width') || 1);
						$('#stroke_style').val(selectedElement.getAttribute('stroke-dasharray') || 'none');

						var attr = selectedElement.getAttribute('stroke-linejoin') || 'miter';

						if ($('#linejoin_' + attr).length != 0) {
							setStrokeOpt($('#linejoin_' + attr)[0]);
						}

						attr = selectedElement.getAttribute('stroke-linecap') || 'butt';

						if ($('#linecap_' + attr).length != 0) {
							setStrokeOpt($('#linecap_' + attr)[0]);
						}
					}
				}

				// All elements including image and group have opacity
				if (selectedElement != null) {
					var opac_perc = ((selectedElement.getAttribute('opacity')||1.0)*100);
					$('#group_opacity').val(opac_perc);
					$('#opac_slider').slider('option', 'value', opac_perc);
					$('#elem_id').val(selectedElement.id);
				}

				updateToolButtonState();
			}
178071
function getWHIgnoreDisplay() {
  for (var _len = arguments.length, args = Array(_len), _key2 = 0; _key2 < _len; _key2++) {
    args[_key2] = arguments[_key2];
  }

  var val = void 0;
  var elem = args[0];
  // in case elem is window
  // elem.offsetWidth === undefined
  if (elem.offsetWidth !== 0) {
    val = getWH.apply(undefined, args);
  } else {
    swap(elem, cssShow, function () {
      val = getWH.apply(undefined, args);
    });
  }
  return val;
}
607692
function() {
    var togglers = $('img.toggler').click(function() {
      var src = $(this).attr('src');
      var idnum = $(this).attr('id').substr(7);
      $('tr.cg-' + idnum).toggle();
      if (src.substr(-9) == 'minus.png')
        $(this).attr('src', src.substr(0, src.length-9) + 'plus.png');
      else
        $(this).attr('src', src.substr(0, src.length-8) + 'minus.png');
    }).css('display', '');
    if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) {
        togglers.click();
    }
  }
232904
def on_source_directory_chooser_clicked(self):
        """"""

        title = self.tr('Set the source directory for script and scenario')
        self.choose_directory(self.source_directory, title)
1323034
def switch_showfilter_icon(self, toggled):
        
        at = QtCore.Qt.DownArrow if toggled else QtCore.Qt.RightArrow
        self.showfilter_tb.setArrowType(at)
1317769
def set_display(self, index=None):
        """"""
        # pylint: disable=no-member
        if index:
            image = self.microbit.Image.STD_IMAGES[index]
        else:
            image = self.default_image
        self.microbit.display.show(image)
1018217
def OnLinkBitmap(self, event):
        """"""

        # Get file name
        wildcard = "*"
        message = _("Select bitmap for current cell")
        style = wx.OPEN | wx.CHANGE_DIR
        filepath, __ = \
            self.grid.interfaces.get_filepath_findex_from_user(wildcard,
                                                               message, style)
        try:
            bmp = wx.Bitmap(filepath)
        except TypeError:
            return

        if bmp.Size == (-1, -1):
            # Bitmap could not be read
            return

        code = "wx.Bitmap(r'{filepath}')".format(filepath=filepath)

        key = self.grid.actions.cursor
        self.grid.actions.set_code(key, code)
788050
private void changeGuiActive( final boolean error , final boolean reverse ) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				control.setActiveGui(error,reverse);
			}
		});
	}
893153
function _onMakeImage() {
			this._elImage.src = this._elCanvas.toDataURL("image/png");
			this._elImage.style.display = "block";
			this._elCanvas.style.display = "none";			
		}
78891
def switchDisplay(self, display):
        
        if display in self.displays:
            self.setWidget(self.displays[display])
            self._current = display
        else:
            raise Exception("Undefined display type "+ display)
62773
def toggleSelection(self, index, comp):
        """"""
        self.model.toggleSelection(index.row(), comp)
337366
def optsChanged(self, param, opts):
        """"""
        # print "opts changed:", opts
        ParameterItem.optsChanged(self, param, opts)
        w = self.widget
        if 'readonly' in opts:
            self.updateDefaultBtn()
            if isinstance(w, (QtWidgets.QCheckBox, ColorButton)):
                w.setEnabled(not opts['readonly'])

        # If widget is a SpinBox, pass options straight through
        if isinstance(self.widget, SpinBox):
            if 'units' in opts and 'suffix' not in opts:
                opts['suffix'] = opts['units']
            w.setOpts(**opts)
            self.updateDisplayLabel()
215734
def item_selection_changed(self):
        """"""
        row = self.current_row()
        if self.count() and row >= 0:
            if '</b></big><br>' in self.list.currentItem().text() and row == 0:
                self.next_row()
            if self.mode == self.FILE_MODE:
                try:
                    stack_index = self.paths.index(self.filtered_path[row])
                    self.plugin = self.widgets[stack_index][1]
                    self.goto_line(self.line_number)
                    try:
                        self.plugin.switch_to_plugin()
                        self.raise_()
                    except AttributeError:
                        # The widget using the fileswitcher is not a plugin
                        pass
                    self.edit.setFocus()
                except ValueError:
                    pass
            else:
                line_number = self.filtered_symbol_lines[row]
                self.goto_line(line_number)
549834
private void selectDistributionSetValue() {
        selectedDefaultDisSetType = (Long) combobox.getValue();
        if (!selectedDefaultDisSetType.equals(currentDefaultDisSetType)) {
            changeIcon.setVisible(true);
            notifyConfigurationChanged();
        } else {
            changeIcon.setVisible(false);
        }
    }
1235866
public void onChange(Widget widget) {

        if (widget == m_tbHexColor) {
            try {
                CmsColor color = new CmsColor();
                color.setHex(m_tbHexColor.getText());
                m_tbHue.setText(Integer.toString(color.getHue()));
                m_tbSaturation.setText(Integer.toString(color.getSaturation()));
                m_tbBrightness.setText(Integer.toString(color.getValue()));
                m_tbRed.setText(Integer.toString(color.getRed()));
                m_tbGreen.setText(Integer.toString(color.getGreen()));
                m_tbBlue.setText(Integer.toString(color.getBlue()));
                m_tbHexColor.setText(color.getHex());
                setPreview(color.getHex());
            } catch (Exception e) {
                // do something.
            }
        }

        if ((widget == m_tbRed) || (widget == m_tbGreen) || (widget == m_tbBlue)) {
            // Don't allow this value to overflow or underflow
            try {
                if (Integer.parseInt(((TextBox)widget).getText()) > 255) {
                    ((TextBox)widget).setText("255");
                }
                if (Integer.parseInt(((TextBox)widget).getText()) < 0) {
                    ((TextBox)widget).setText("0");
                }
            } catch (Exception e) {
                // do something.
            }

            m_red = Integer.parseInt(m_tbRed.getText());
            m_green = Integer.parseInt(m_tbGreen.getText());
            m_blue = Integer.parseInt(m_tbBlue.getText());
            m_hue = Integer.parseInt(m_tbHue.getText());
            m_saturation = Integer.parseInt(m_tbSaturation.getText());
            m_brightness = Integer.parseInt(m_tbBrightness.getText());

            try {
                CmsColor color = new CmsColor();
                color.setRGB(m_red, m_green, m_blue);
                m_tbHue.setText(Integer.toString(color.getHue()));
                m_tbSaturation.setText(Integer.toString(color.getSaturation()));
                m_tbBrightness.setText(Integer.toString(color.getValue()));
                m_tbHexColor.setText(color.getHex());
                setPreview(color.getHex());
            } catch (Exception e) {
                // do something.
            }
        } else if ((widget == m_tbHue) || (widget == m_tbSaturation) || (widget == m_tbBrightness)) {
            try {
                if (Integer.parseInt(m_tbHue.getText()) > 359) {
                    m_tbHue.setText("359");
                }

                if (Integer.parseInt(m_tbSaturation.getText()) > 100) {
                    m_tbSaturation.setText("100");
                }

                if (Integer.parseInt(m_tbBrightness.getText()) > 100) {
                    m_tbBrightness.setText("100");
                }
            } catch (Exception e) {
                // do something.
            }

            m_red = Integer.parseInt(m_tbRed.getText());
            m_green = Integer.parseInt(m_tbGreen.getText());
            m_blue = Integer.parseInt(m_tbBlue.getText());
            m_hue = Integer.parseInt(m_tbHue.getText());
            m_saturation = Integer.parseInt(m_tbSaturation.getText());
            m_brightness = Integer.parseInt(m_tbBrightness.getText());

            // Figure out colors
            try {
                CmsColor color = new CmsColor();
                color.setHSV(m_hue, m_saturation, m_brightness);
                m_tbRed.setText(Integer.toString(color.getRed()));
                m_tbGreen.setText(Integer.toString(color.getGreen()));
                m_tbBlue.setText(Integer.toString(color.getBlue()));
                m_tbHexColor.setText(color.getHex());
                setPreview(color.getHex());
            } catch (Exception e) {
                // do something.
            }
        }

        // Let the sliders know something's changed
        updateSliders();
    }
452786
public void updateIconChoice() {
		iconsPanel.clear();
		icons.clear();
		Set<String> urlSet = new LinkedHashSet<String>(hrefsChoiceList);
		for (String url : urlSet) {
			ClickableIconImage clickImage = getClickableIconImage(url);
			icons.put(url, clickImage);
			iconsPanel.add(clickImage);
		}
		setSelectedIconUrl(defaultIconUrl);
	}