get the icon representing the browser for the grid. If the icon cannot be located, returns
null.

@param cap - Capability
@return String with path to icon image file.  Can be <i>null</i> if no icon
file if available.
352144
private String getConsoleIconPath(DesiredCapabilities cap) {
    String name = consoleIconName(cap);
    String path = "org/openqa/grid/images/";
    InputStream in =
        Thread.currentThread().getContextClassLoader()
            .getResourceAsStream(path + name + ".png");
    if (in == null) {
      return null;
    }
    return "/grid/resources/" + path + name + ".png";
  }
913469
public static BufferedImage createIcon(IconRow icon, float scale,
			IconCache iconCache) {

		BufferedImage iconImage = null;

		if (icon != null) {

			if (iconCache != null) {
				iconImage = iconCache.get(icon.getId());
			}

			if (iconImage == null) {

				try {
					iconImage = icon.getDataImage();
				} catch (IOException e) {
					throw new GeoPackageException(
							"Failed to get the Icon Row image. Id: "
									+ icon.getId() + ", Name: "
									+ icon.getName(), e);
				}

				int dataWidth = iconImage.getWidth();
				int dataHeight = iconImage.getHeight();

				Double iconWidth = icon.getWidth();
				Double iconHeight = icon.getHeight();

				boolean scaleImage = iconWidth != null || iconHeight != null;

				if (!scaleImage && scale != 1.0f) {
					iconWidth = (double) dataWidth;
					iconHeight = (double) dataHeight;
					scaleImage = true;
				}

				if (scaleImage) {

					if (iconWidth == null) {
						iconWidth = dataWidth * (iconHeight / dataHeight);
					} else if (iconHeight == null) {
						iconHeight = dataHeight * (iconWidth / dataWidth);
					}

					int scaledWidth = Math
							.round(scale * iconWidth.floatValue());
					int scaledHeight = Math.round(scale
							* iconHeight.floatValue());

					if (scaledWidth != dataWidth || scaledHeight != dataHeight) {

						Image scaledImage = iconImage.getScaledInstance(
								scaledWidth, scaledHeight, Image.SCALE_SMOOTH);
						iconImage = new BufferedImage(scaledWidth,
								scaledHeight, BufferedImage.TYPE_INT_ARGB);

						Graphics2D graphics = iconImage.createGraphics();
						graphics.drawImage(scaledImage, 0, 0, null);
						graphics.dispose();

					}

				}

				if (iconCache != null) {
					iconCache.put(icon.getId(), iconImage);
				}
			}

		}

		return iconImage;
	}
190080
def icon(self, icontype_or_qfileinfo):
        """"""
        if isinstance(icontype_or_qfileinfo, QFileIconProvider.IconType):
            return super(IconProvider, self).icon(icontype_or_qfileinfo)
        else:
            qfileinfo = icontype_or_qfileinfo
            fname = osp.normpath(to_text_string(qfileinfo.absoluteFilePath()))
            return ima.get_icon_by_extension(fname, scale_factor=1.0)
389419
@Override
    public ImageIcon getImageIconResource( final String       key,
                                           final ImageIcon    defaultValue )
        throws
            UtilException
    {
        String    imagePath = getFormattedPropValue( key );

        if ( imagePath == null )
        {
            return defaultValue;
        }

        return resourceToImageIcon( imagePath );
    }
771194
public static function appIcons() {
    $config = Config::instance();
    $icons_directory = THEME_DIRECTORY.'/'.$config->app_icons_directory;
    $icons_url = THEME_URL.'/'.$config->app_icons_directory;
    if(!file_exists($icons_directory)) return null;
    
    $files = scandir($icons_directory);
    if(!Arr::iterable($files)) return null;
    
    // Icon files should start with one of these, and be delimited by hyphens
    $icon_types = ['apple', 'android', 'favicon'];
    $paths = [];
    
    foreach($files as $file)  {
      if(!preg_match('/\.png$/', $file)) continue;
      
      // Get size from image name
      preg_match('/(\d+x\d+)/', $file, $sizes);
      if(!Arr::iterable($sizes)) continue;
      
      $size = reset($sizes);
      $icon_type = reset(explode('-', $file));
      if(!in_array($icon_type, $icon_types)) continue;
      
      $file_path = $icons_url.'/'.$file;
      $paths[] = View::make('meta/icon-'.$icon_type, [
        'file' => $file_path,
        'size' => $size,
      ]);
    }
    
    $paths[] = View::make('meta/icon-favicon-ico', [
      'file' => $icons_url.'/favicon.ico',
    ]);
    return join('', $paths);
  }
4868
public IconType<WebFragmentDescriptor> getOrCreateIcon()
   {
      List<Node> nodeList = model.get("icon");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new IconTypeImpl<WebFragmentDescriptor>(this, "icon", model, nodeList.get(0));
      }
      return createIcon();
   }
381363
public ImageIcon getIcon() {
        if (confidence == Alert.CONFIDENCE_FALSE_POSITIVE) {
            // Special case - theres no risk - use the green flag
            return DisplayUtils.getScaledIcon(Constant.OK_FLAG_IMAGE_URL);
        }

        switch (risk) {
        case Alert.RISK_INFO:
            return DisplayUtils.getScaledIcon(Constant.INFO_FLAG_IMAGE_URL);
        case Alert.RISK_LOW:
            return DisplayUtils.getScaledIcon(Constant.LOW_FLAG_IMAGE_URL);
        case Alert.RISK_MEDIUM:
            return DisplayUtils.getScaledIcon(Constant.MED_FLAG_IMAGE_URL);
        case Alert.RISK_HIGH:
            return DisplayUtils.getScaledIcon(Constant.HIGH_FLAG_IMAGE_URL);
        }
        return null;
    }
1064116
function fetch_remote_icon_url() {
            $info = $this->fetch_module_info();

            return ( $this->is_api_result_object( $info, 'icon' ) && is_string( $info->icon ) ) ?
                $info->icon :
                '';
        }
865549
public static ImageIcon getImageIcon(String path) {
		java.net.URL imgURL = IconLoader.class.getResource(path);
		if (imgURL != null) {
			return new ImageIcon(imgURL);
		} else {
			return null;
		}
	}
597753
def icon(self):
        
        if isinstance(self._icon, str):
            if QtGui.QIcon.hasThemeIcon(self._icon):
                return QtGui.QIcon.fromTheme(self._icon)
            else:
                return QtGui.QIcon(self._icon)
        elif isinstance(self._icon, tuple):
            return QtGui.QIcon.fromTheme(self._icon[0],
                                         QtGui.QIcon(self._icon[1]))
        elif isinstance(self._icon, QtGui.QIcon):
            return self._icon
        return QtGui.QIcon()
1185585
public Object getIcon(int iIconType)
    {
        if (iIconType == CalendarConstants.END_ICON)
            return m_iconEnd;
        else if (iIconType == CalendarConstants.START_ICON)
            return m_iconStart;
        else
            return null;
    }
70980
private Drawable getActivityIconWithCache(ComponentName component) {
        // First check the icon cache
        String componentIconKey = component.flattenToShortString();
        // Using containsKey() since we also store null values.
        if (mOutsideDrawablesCache.containsKey(componentIconKey)) {
            Drawable.ConstantState cached = mOutsideDrawablesCache.get(componentIconKey);
            return cached == null ? null : cached.newDrawable(mProviderContext.getResources());
        }
        // Then try the activity or application icon
        Drawable drawable = getActivityIcon(component);
        // Stick it in the cache so we don't do this lookup again.
        Drawable.ConstantState toCache = drawable == null ? null : drawable.getConstantState();
        mOutsideDrawablesCache.put(componentIconKey, toCache);
        return drawable;
    }
728427
public function getIcon()
    {
        $data = ArrayData::create([]);

        $iconClass = $this->config()->get('icon');
        if ($iconClass) {
            $data->IconClass = $iconClass;

            // Add versioned states (rendered as a circle over the icon)
            if ($this->hasExtension(Versioned::class)) {
                $data->IsVersioned = true;
                if ($this->isOnDraftOnly()) {
                    $data->VersionState = 'draft';
                    $data->VersionStateTitle = _t(
                        'SilverStripe\\Versioned\\VersionedGridFieldState\\VersionedGridFieldState.ADDEDTODRAFTHELP',
                        'Item has not been published yet'
                    );
                } elseif ($this->isModifiedOnDraft()) {
                    $data->VersionState = 'modified';
                    $data->VersionStateTitle = $data->VersionStateTitle = _t(
                        'SilverStripe\\Versioned\\VersionedGridFieldState\\VersionedGridFieldState.MODIFIEDONDRAFTHELP',
                        'Item has unpublished changes'
                    );
                }
            }

            return $data->renderWith(__CLASS__ . '/PreviewIcon');
        }

        return null;
    }
81621
public Object getIcon(int iIconType)
    {
        if (m_iIconField == -1)
            return null;
        Object data = this.getFieldData(m_iIconField);
        if (data instanceof PortableImage)
            return ((PortableImage)data).getImage();     // Make sure you cache this
        else //if (data instanceof ImageIcon)
            return this.getFieldData(m_iIconField);
        //else
        //    return null;
    }
972175
private Icon getIcon( Severity severity ) {
        if( severity == Severity.ERROR ) {
            return getErrorIcon();
        }
        if( severity == Severity.WARNING ) {
            return getWarningIcon();
        }
        return getInfoIcon();
    }
125749
public ImageIcon retrieveIcon(String location) throws IconProviderException
	{
		try
		{
			URL _url = getUrlProvider().getUrl(location);
			return getIconProvider().retrieveIcon(_url);
		}
		catch (UrlProviderException _exception)
		{
			throw new IconProviderException(_exception);
		}
	}
775383
public int getIconColor(Context ctx) {
        int iconColor;
        if (this.isEnabled()) {
            iconColor = ColorHolder.color(getIconColor(), ctx, R.attr.material_drawer_primary_icon, R.color.material_drawer_primary_icon);
        } else {
            iconColor = ColorHolder.color(getDisabledIconColor(), ctx, R.attr.material_drawer_hint_icon, R.color.material_drawer_hint_icon);
        }
        return iconColor;
    }