Loads and draws given.

@return The current IconicsDrawable for chaining.
351983
@NonNull
    public IconicsDrawable icon(@NonNull Character icon, @Nullable Typeface typeface) {
        return iconText(icon.toString(), typeface);
    }
407100
public static Drawable getDrawable(Resources.Theme theme, TypedArray a, TypedValue[] values, int index) {

        if (values != null && theme != null) {
            TypedValue v = values[index];

            if (v.type == TypedValue.TYPE_ATTRIBUTE) {
                TEMP_ARRAY[0] = v.data;
                TypedArray tmp = theme.obtainStyledAttributes(null, TEMP_ARRAY, 0, 0);
                try {
                    return tmp.getDrawable(0);
                } finally {
                    tmp.recycle();
                }
            }
        }

        if (a != null) {
            return LollipopDrawablesCompat.getDrawable(a, index, theme);
        }

        return null;
    }
940588
public Drawable decideIcon(Context ctx, int iconColor, boolean tint, int paddingDp) {
        Drawable icon = getIcon();

        if (mIIcon != null) {
            icon = new IconicsDrawable(ctx, mIIcon).color(iconColor).sizeDp(24).paddingDp(paddingDp);
        } else if (getIconRes() != -1) {
            icon = AppCompatResources.getDrawable(ctx, getIconRes());
        } else if (getUri() != null) {
            try {
                InputStream inputStream = ctx.getContentResolver().openInputStream(getUri());
                icon = Drawable.createFromStream(inputStream, getUri().toString());
            } catch (FileNotFoundException e) {
                //no need to handle this
            }
        }

        //if we got an icon AND we have auto tinting enabled AND it is no IIcon, tint it ;)
        if (icon != null && tint && mIIcon == null) {
            icon = icon.mutate();
            icon.setColorFilter(iconColor, PorterDuff.Mode.SRC_IN);
        }

        return icon;
    }
847194
@NonNull
    public IconicsDrawable contourWidthRes(@DimenRes int sizeResId) {
        return contourWidthPx(mContext.getResources().getDimensionPixelSize(sizeResId));
    }
305256
@NonNull
    public IconicsDrawable backgroundColorListRes(@ColorRes int colorResId) {
        return backgroundColor(ContextCompat.getColorStateList(mContext, colorResId));
    }
1275133
private Drawable getDrawable(Uri uri) {
        try {
            String scheme = uri.getScheme();
            if (ContentResolver.SCHEME_ANDROID_RESOURCE.equals(scheme)) {
                // Load drawables through Resources, to get the source density information
                try {
                    return getDrawableFromResourceUri(uri);
                } catch (Resources.NotFoundException ex) {
                    throw new FileNotFoundException("Resource does not exist: " + uri);
                }
            } else {
                // Let the ContentResolver handle content and file URIs.
                InputStream stream = mProviderContext.getContentResolver().openInputStream(uri);
                if (stream == null) {
                    throw new FileNotFoundException("Failed to open " + uri);
                }
                try {
                    return Drawable.createFromStream(stream, null);
                } finally {
                    try {
                        stream.close();
                    } catch (IOException ex) {
                        Log.e(LOG_TAG, "Error closing icon stream for " + uri, ex);
                    }
                }
            }
        } catch (FileNotFoundException fnfe) {
            Log.w(LOG_TAG, "Icon not found: " + uri + ", " + fnfe.getMessage());
            return null;
        }
    }
492004
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
    private static Drawable getDrawable(Context context, @DrawableRes int drawableResId) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            return context.getDrawable(drawableResId);
        } else {
            return context.getResources().getDrawable(drawableResId);
        }
    }
701320
public static Drawable getDrawableAttr(Context ctx, @AttrRes int drawableAttrId){
        int[] attrs = new int[] { drawableAttrId /* index 0 */};
        TypedArray ta = ctx.obtainStyledAttributes(attrs);
        Drawable drawable = ta.getDrawable(0);
        ta.recycle();
        return drawable;
    }
776198
private void loadSystemParticleImage() {
		AccessController.doPrivileged(new PrivilegedAction() {
            public Object run() {
        		try {
        			if (mask != null) {
        				sprite = new Image(defaultImageName, mask);
        			} else {
        				sprite = new Image(defaultImageName);
        			}
        		} catch (SlickException e) {
        			Log.error(e);
        			defaultImageName = null;
        		}
                return null; // nothing to return
            }
        });
	}
795666
@NonNull
    public IconicsDrawable drawContour(boolean drawContour) {
        if (mDrawContour != drawContour) {
            mDrawContour = drawContour;

            mIconPadding += (mDrawContour ? 1 : -1) * mContourWidth;

            invalidateSelf();
        }
        return this;
    }
769912
@NonNull
    public IconicsDrawable iconOffsetYRes(@DimenRes int sizeResId) {
        return iconOffsetYPx(mContext.getResources().getDimensionPixelSize(sizeResId));
    }
147656
public Image getCurrentFrame() {
		Frame frame = (Frame) frames.get(currentFrame);
		return frame.image;
	}
440631
@Override
    public ImageWrapper render() throws SimpleImageException {
        try {
            ImageWrapper imgWrapper;
            if (inStream == null) {
                throw new SimpleImageException("No input set");
            }

            imgWrapper = ImageReadHelper.read(inStream);

            if (tosRGBColorSpace) {
                for (int i = 0; i < imgWrapper.getNumOfImages(); i++) {
                    PlanarImage img = ImageColorConvertHelper.convert2sRGB(imgWrapper
                            .getAsPlanarImage(i));
                    imgWrapper.setImage(i, img);
                }
            }

            return imgWrapper;
        } catch (Exception e) {
            throw new SimpleImageException(e);
        }
    }
695260
@NonNull
    public IconicsDrawable drawBackgroundContour(boolean drawBackgroundContour) {
        if (mDrawBackgroundContour != drawBackgroundContour) {
            mDrawBackgroundContour = drawBackgroundContour;

            mIconPadding += (mDrawBackgroundContour ? 1 : -1) * mBackgroundContourWidth * 2;

            invalidateSelf();
        }
        return this;
    }
728578
@NonNull
    public IconicsDrawable roundedCornersRxPx(@Dimension(unit = PX) int sizePx) {
        mRoundedCornerRx = sizePx;

        invalidateSelf();
        return this;
    }
39793
public Canvas getViewPanel() {
		VLayout layout = new VLayout(5);
		layout.setPadding(5);

		MapWidget mapWidget = new MapWidget("mapGuwOsm", "appGuw");
		final RibbonBarLayout ribbonBar = new RibbonBarLayout(mapWidget, "appGuw", "guwRibbonBar1");
		ribbonBar.setSize("100%", "94px");

		ToolStrip toolStrip = new ToolStrip();
		toolStrip.setWidth100();
		ToolStripButton btn1 = new ToolStripButton("Toggle group title");
		btn1.addClickHandler(new ClickHandler() {

			public void onClick(ClickEvent event) {
				ribbonBar.setShowGroupTitles(!ribbonBar.isShowGroupTitles());
			}
		});
		toolStrip.addButton(btn1);
		layout.addMember(toolStrip);
		layout.addMember(ribbonBar);
		layout.addMember(mapWidget);
		return layout;
	}
714495
public static Diagram load(String ref) throws SlickException {
		return load(ResourceLoader.getResourceAsStream(ref), false);
	}