Get the style paint from cache, or create and cache it

@param style
style row
@param drawType
draw type
@return paint
556000
private Paint getStylePaint(StyleRow style, FeatureDrawType drawType) {

		Paint paint = featurePaintCache.getPaint(style, drawType);

		if (paint == null) {

			mil.nga.geopackage.style.Color color = null;
			Float strokeWidth = null;

			switch (drawType) {
			case CIRCLE:
				color = style.getColorOrDefault();
				break;
			case STROKE:
				color = style.getColorOrDefault();
				strokeWidth = this.scale * (float) style.getWidthOrDefault();
				break;
			case FILL:
				color = style.getFillColor();
				strokeWidth = this.scale * (float) style.getWidthOrDefault();
				break;
			default:
				throw new GeoPackageException("Unsupported Draw Type: "
						+ drawType);
			}

			Paint stylePaint = new Paint();
			stylePaint.setColor(new Color(color.getColorWithAlpha(), true));
			if (strokeWidth != null) {
				stylePaint.setStrokeWidth(strokeWidth);
			}

			synchronized (featurePaintCache) {

				paint = featurePaintCache.getPaint(style, drawType);

				if (paint == null) {
					featurePaintCache.setPaint(style, drawType, stylePaint);
					paint = stylePaint;
				}

			}
		}

		return paint;
	}
360614
public static String decode(Style style) {
		if (style != null) {
			if (style instanceof ShapeStyle) {
				return decode((ShapeStyle) style);
			} else if (style instanceof FontStyle) {
				return decode((FontStyle) style);
			} else if (style instanceof PictureStyle) {
				return decode((PictureStyle) style);
			}
		}
		return "";
	}
111214
public static StyleWrapper createStyleFromGraphic( File graphicsPath ) throws IOException {
        String name = graphicsPath.getName();
        ExternalGraphic exGraphic = null;
        if (name.toLowerCase().endsWith(".png")) {
            exGraphic = sf.createExternalGraphic(graphicsPath.toURI().toURL(), "image/png");
        } else if (name.toLowerCase().endsWith(".svg")) {
            exGraphic = sf.createExternalGraphic(graphicsPath.toURI().toURL(), "image/svg+xml");
        } else if (name.toLowerCase().endsWith(".sld")) {
            StyledLayerDescriptor sld = readStyle(graphicsPath);
            Style style = SldUtilities.getDefaultStyle(sld);
            return new StyleWrapper(style);
        }

        if (exGraphic == null) {
            throw new IOException("Style could not be created!");
        }

        Graphic gr = sf.createDefaultGraphic();
        gr.graphicalSymbols().clear();
        gr.graphicalSymbols().add(exGraphic);
        Expression size = ff.literal(20);
        gr.setSize(size);

        Rule rule = sf.createRule();
        PointSymbolizer pointSymbolizer = sf.createPointSymbolizer(gr, null);
        rule.symbolizers().add(pointSymbolizer);

        FeatureTypeStyle featureTypeStyle = sf.createFeatureTypeStyle();
        featureTypeStyle.rules().add(rule);

        Style namedStyle = sf.createStyle();
        namedStyle.featureTypeStyles().add(featureTypeStyle);
        namedStyle.setName(FilenameUtils.removeExtension(name));

        return new StyleWrapper(namedStyle);
    }
1065546
@SuppressWarnings("unchecked")
    @Nonnull
    public final java.util.Optional<Style> getStyle(final String styleName) {
        final String styleRef = this.styles.get(styleName);
        Optional<Style> style;
        if (styleRef != null) {
            style = (Optional<Style>) this.styleParser
                    .loadStyle(getConfiguration(), this.httpRequestFactory, styleRef);
        } else {
            style = Optional.empty();
        }
        return or(style, this.configuration.getStyle(styleName));
    }
167145
public static int getCurrentStyleInt(Element element, Style style) {

        String currentStyle = getCurrentStyle(element, style);
        return CmsClientStringUtil.parseInt(currentStyle);
    }
835653
@Nonnull
    public final Style getDefaultStyle(@Nonnull final String geometryType) {
        String normalizedGeomName = GEOMETRY_NAME_ALIASES.get(geometryType.toLowerCase());
        if (normalizedGeomName == null) {
            normalizedGeomName = geometryType.toLowerCase();
        }
        Style style = this.defaultStyle.get(normalizedGeomName.toLowerCase());
        if (style == null) {
            style = this.namedStyles.get(normalizedGeomName.toLowerCase());
        }

        if (style == null) {
            StyleBuilder builder = new StyleBuilder();
            final Symbolizer symbolizer;
            if (isPointType(normalizedGeomName)) {
                symbolizer = builder.createPointSymbolizer();
            } else if (isLineType(normalizedGeomName)) {
                symbolizer = builder.createLineSymbolizer(Color.black, 2);
            } else if (isPolygonType(normalizedGeomName)) {
                symbolizer = builder.createPolygonSymbolizer(Color.lightGray, Color.black, 2);
            } else if (normalizedGeomName.equalsIgnoreCase(Constants.Style.Raster.NAME)) {
                symbolizer = builder.createRasterSymbolizer();
            } else if (normalizedGeomName.startsWith(Constants.Style.OverviewMap.NAME)) {
                symbolizer = createMapOverviewStyle(normalizedGeomName, builder);
            } else {
                final Style geomStyle = this.defaultStyle.get(Geometry.class.getSimpleName().toLowerCase());
                if (geomStyle != null) {
                    return geomStyle;
                } else {
                    symbolizer = builder.createPointSymbolizer();
                }
            }
            style = builder.createStyle(symbolizer);
        }
        return style;
    }
1163314
protected void paint(IDrawVisitor drawVisitor, IRenderingElement diagram) {
        if (diagram == null) return;

        // cache the diagram for quick-redraw
        this.cachedDiagram = diagram;

        fontManager.setFontName(rendererModel.getParameter(FontName.class).getValue());
        fontManager.setFontStyle(rendererModel.getParameter(UsedFontStyle.class).getValue());

        drawVisitor.setFontManager(this.fontManager);
        drawVisitor.setTransform(this.transform);
        drawVisitor.setRendererModel(this.rendererModel);
        diagram.accept(drawVisitor);
    }
142244
public static boolean setStyle(PolylineOptions polylineOptions, StyleRow style, float density) {

        if (style != null) {

            Color color = style.getColorOrDefault();
            polylineOptions.color(color.getColorWithAlpha());

            double width = style.getWidthOrDefault();
            polylineOptions.width((float) width * density);

        }

        return style != null;
    }
1365997
public Paint getRootPaneInteriorPaint(Shape s, Which type) {
        return createVerticalGradient(s, getRootPaneInteriorColors(type));
    }
1319742
private static FontStyle intToFontStyle(int style) {
        switch (style) {
        case java.awt.Font.PLAIN:
            return FontStyle.PLAIN;
        case java.awt.Font.BOLD:
            return FontStyle.BOLD;
        case java.awt.Font.ITALIC:
            return FontStyle.ITALIC;
        case java.awt.Font.BOLD + java.awt.Font.ITALIC:
            return FontStyle.BOLD_ITALIC;
        default:
            return FontStyle.PLAIN;
        }
    }
501841
public static FastDateFormat getDateTimeInstance(final int dateStyle, final int timeStyle) {
		return cache.getDateTimeInstance(dateStyle, timeStyle, null, null);
	}
1128776
@Api
	public void setTargetMaxExtentRectangleStyle(ShapeStyle targetMaxExtentRectangleStyle) {
		this.targetMaxExtentRectangleStyle = targetMaxExtentRectangleStyle;
		if (targetMaxExtentRectangle != null) {
			targetMaxExtentRectangle.setStyle(targetMaxExtentRectangleStyle);
			if (drawTargetMaxExtent) {
				render(targetMaxExtentRectangle, RenderGroup.SCREEN, RenderStatus.UPDATE);
			}
		}
	}
551178
function draw (type) { // TODO: use type
        if (cache !== null) {
            return new Promise((resolve) => {
                resolve(cache);
            });
        }
        return new Promise((resolve, reject) => {
            const images = [];

            // Wait for resourse loading
            onLoadPromise.then(() => {
                RED.nodes.import(flow);
                const workspaceIds = Object.keys(RED.workspaces.tabs());
                drawWorkspacesWithIds(workspaceIds).catch((err) => { console.error(err); });
            });
            
            function drawWorkspacesWithIds (ids) {
                const id = ids.pop();
                if (!id) {
                    return;
                } else {
                    RED.workspaces.show(id);
                    const el = RED.view.redraw(true);
                    const unmute = mute();
                    return svgSaver.svgAsDataUri(el).then(function (uri) {
                        unmute();
                        images.push(uri);
                        const promise = drawWorkspacesWithIds(ids);
                        if (promise) {
                            promise.catch((err) => { reject(err); });
                        } else {
                            resolve(images);
                        }
                    });
                }
            }
        }).then((results) => cache = results);
    }
1134792
public JFreeChartRender setGridPaint(Color color) {
        getPlot().setRangeGridlinePaint(color);
        getPlot().setDomainGridlinePaint(color);
        return this;
    }
1241055
public fontStyleTypes getStyleType() {
        fontStyleTypes styleType = fontStyleTypes.PLAIN;
        if ( mTextView.getTypeface().getStyle() == Typeface.BOLD) styleType = fontStyleTypes.BOLD;
        else if ( mTextView.getTypeface().getStyle() == Typeface.ITALIC) styleType = fontStyleTypes.ITALIC;
        else if ( mTextView.getTypeface().getStyle() == Typeface.BOLD_ITALIC) styleType = fontStyleTypes.BOLDITALIC;
        return styleType;
    }
993065
public boolean addStylesFontFaceContainerStyle(final FontFaceContainerStyle ffcStyle) {
        final FontFace fontFace = ffcStyle.getFontFace();
        if (fontFace != null) {
            this.fontFaces.add(fontFace);
        }
        return this.addStylesStyle(ffcStyle);
    }
1020640
@Override
    protected void paintComponent(Graphics g) {
    	if (type == TYPE_PLAIN) {
	    	point.updateWeight(RunVisualizer.getCurrentTimestamp(), decayRate);
	        if (point.weight() < decayThreshold) {
	            getParent().remove(this);
	            return;
	        }
        }

        Color color = getColor();
      //Color errcolor = getErrorColor();
        //if (errcolor == null) {
        //    errcolor = color;
            panel_size = POINTSIZE;
        //} else {
        //    panel_size = POINTSIZE + 2;
        //}
        
        updateLocation();
        
        /*g.setColor(errcolor);
        g.drawOval(0, 0, panel_size, panel_size);
        g.setColor(color);
        g.fillOval(0, 0, panel_size, panel_size);*/
        
        if (type == TYPE_PLAIN) {
        	g.setColor(color);
        	if (point.isNoise()) {
        		g.setFont(g.getFont().deriveFont(9.0f));
        		g.drawChars(new char[] {'x'}, 0, 1, 0, panel_size);
        	} else {
		        g.drawOval(0, 0, panel_size, panel_size);
		        g.setColor(color);
		        g.fillOval(0, 0, panel_size, panel_size);
        	}
        } else if (type == TYPE_CLUSTERED) {
        	g.setColor(color);
        	g.drawOval(0, 0, panel_size, panel_size);
        }

        setToolTipText(point.getInfo(x_dim, y_dim));
    }