/** * Returns the border painter for the specified component. * * @param comp * Component. * @return Border painter for the specified component. * @see SubstanceSkin#getBorderPainter() */ public static SubstanceBorderPainter getBorderPainter(Component comp) { return SubstanceCoreUtilities.getSkin(comp).getBorderPainter(); }
/** * Creates a UI delegate for the specified component. * * @param comp * Component. * @return UI delegate. */ public static ComponentUI createUI(JComponent comp) { SubstanceCoreUtilities.testComponentCreationThreadingViolation(comp); return new SubstanceToolTipUI(); }
/** * Returns the icon for the specified arrow button. * * @param button * Arrow button. * @return Icon for the specified button. */ private Icon getCurrentIcon(JButton button) { Icon icon = SubstanceCoreUtilities .getArrowIcon(button, SubstanceCoreUtilities .getPopupFlyoutOrientation(this.comboBox)); return icon; }
/** * Returns the highlight border painter for the specified component. * * @param comp * Component. * @return Highlight border painter for the specified component. * @see SubstanceSkin#getBorderPainter() * @see SubstanceSkin#getHighlightBorderPainter() */ public static SubstanceBorderPainter getHighlightBorderPainter( Component comp) { SubstanceBorderPainter result = SubstanceCoreUtilities.getSkin(comp) .getHighlightBorderPainter(); if (result != null) return result; return getBorderPainter(comp); }
SubstanceColorScheme borderScheme) { SubstanceFillPainter painter = SubstanceCoreUtilities .getFillPainter(scrollBar); SubstanceButtonShaper shaper = SubstanceCoreUtilities .getButtonShaper(scrollBar); SubstanceBorderPainter borderPainter = SubstanceCoreUtilities .getBorderPainter(scrollBar); HashMapKey key = SubstanceCoreUtilities.getHashKey(width, height, scheme.getDisplayName(), borderScheme.getDisplayName(), painter .getDisplayName(), shaper.getDisplayName(), opaque = SubstanceCoreUtilities.getBlankImage(width, height); painter.paintContourBackground(opaque.createGraphics(), scrollBar, width, height, contour, false, scheme, true);
BufferedImage result = SubstanceCoreUtilities.getBlankImage(width, height); Graphics2D graphics = (Graphics2D) result.getGraphics(); .getIcon("resource/32/login-new32.png"); origIcon = SubstanceCoreUtilities.getThemedIcon(this.loginPanel, origIcon); .getForegroundColor(SubstanceCoreUtilities.getSkin( this.loginPanel).getEnabledColorScheme( DecorationAreaType.HEADER)));
Icon originalIcon = SubstanceCoreUtilities.getOriginalIcon(b, b .getIcon()); Icon themedIcon = (!(b instanceof JRadioButton) && !(b instanceof JCheckBox) && SubstanceCoreUtilities .useThemedDefaultIcon(b)) ? SubstanceCoreUtilities .getThemedIcon(b, originalIcon) : originalIcon;
SubstanceBorderPainter borderPainter = SubstanceCoreUtilities.getBorderPainter(this.slider); int borderThickness = (int) SubstanceSizeUtils.getBorderStrokeWidth(componentFontSize); HashMapKey key = SubstanceCoreUtilities.getHashKey(width, height, radius, borderDelta, borderThickness, fillColorScheme.getDisplayName(), borderScheme.getDisplayName()); trackImage = SubstanceCoreUtilities.getBlankImage(width + 1, height + 1); Graphics2D cacheGraphics = trackImage.createGraphics();
/** * Returns an icon that matches the specified watermark. * * @param watermark * Watermark instance. * @return Icon that matches the specified watermark. */ public static Icon getWatermarkIcon(SubstanceWatermark watermark) { int iSize = SubstanceSizeUtils.getTitlePaneIconSize(); BufferedImage result = SubstanceCoreUtilities.getBlankImage(iSize, iSize); Graphics2D graphics = (Graphics2D) result.getGraphics().create(); graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); watermark .previewWatermark(graphics, SubstanceColorSchemeUtilities.METALLIC_SKIN, 0, 0, iSize, iSize); graphics.dispose(); return new ImageIcon(result); }
@Override public Object createValue(UIDefaults table) { return SubstanceCoreUtilities .getIcon("resource/user-home.png"); } },
public static ColorSchemeFilter getColorSchemeFilter( SubstanceColorScheme scheme, float originalBrightnessFactor) { HashMapKey key = SubstanceCoreUtilities.getHashKey(scheme .getDisplayName(), originalBrightnessFactor); ColorSchemeFilter filter = filters.get(key); if (filter == null) { filter = new ColorSchemeFilter(scheme, originalBrightnessFactor); filters.put(key, filter); } return filter; }
public void paintDecorationArea(Graphics2D graphics, Component comp, DecorationAreaType decorationAreaType, int width, int height, SubstanceSkin skin) { SubstanceColorScheme scheme = skin .getBackgroundColorScheme(decorationAreaType); if (width * height < 100000) { HashMapKey key = SubstanceCoreUtilities.getHashKey(width, height, scheme.getDisplayName()); BufferedImage result = smallImageCache.get(key); if (result == null) { result = SubstanceCoreUtilities.getBlankImage(width, height); this.internalPaint((Graphics2D) result.getGraphics(), comp, width, height, scheme); smallImageCache.put(key, result); } graphics.drawImage(result, 0, 0, null); return; } this.internalPaint(graphics, comp, width, height, scheme); }
if (SubstanceCoreUtilities.isOpaque(c)) { BackgroundPaintingUtils.update(g, c, false); g.setFont(f); Icon icon = SubstanceCoreUtilities.getOriginalIcon(b, getDefaultIcon()); .getFocusRingPadding(SubstanceSizeUtils .getComponentFontSize(button)) / 2; SubstanceCoreUtilities.paintFocus(g2d, button, button, this, null, textRect, 1.0f, focusRingPadding);
.getFillPainter(combo); SubstanceBorderPainter borderPainter = SubstanceCoreUtilities .getBorderPainter(combo); boolean isFlat = SubstanceCoreUtilities.hasFlatAppearance(combo, false); boolean isSpecial = isFlat || !combo.isEnabled(); float extraAlpha = 1.0f;
@Override protected void paintFocus(Graphics g, Color paintColor, int x, int y, int width, int height) { SubstanceCoreUtilities.paintFocus(g, group, group, SubstanceTaskPaneUI.this, new Rectangle(x, y, width - 1, height - 1), label.getBounds(), 1.0f, 0); }
/** * Returns the default file icon. * * @param f * File. * @return File icon. */ public Icon getDefaultIcon(File f) { JFileChooser fileChooser = getFileChooser(); Icon icon = fileChooser.getFileSystemView().getSystemIcon(f); if (SubstanceCoreUtilities.useThemedDefaultIcon(null)) { icon = SubstanceCoreUtilities.getThemedIcon(fileChooser, icon); } return icon; } }
.getIcon("resource/22/dialog-information.png") : SubstanceCoreUtilities.getThemedIcon(this.tipPane, SubstanceCoreUtilities .getIcon("resource/22/dialog-information.png"));
insets.right /= 2; SubstanceFillPainter fillPainter = SubstanceCoreUtilities.getFillPainter(this.slider); SubstanceBorderPainter borderPainter = SubstanceCoreUtilities.getBorderPainter(this.slider); float radius = SubstanceSizeUtils.getClassicButtonCornerRadius(SubstanceSizeUtils.getComponentFontSize(slider)) / 2.0f; int borderDelta = (int) Math.floor(SubstanceSizeUtils.getBorderStrokeWidth(SubstanceSizeUtils.getComponentFontSize(slider)) / 2.0);
@Override protected void addIcon(Container top) { Icon sideIcon = (optionPane == null ? null : optionPane.getIcon()); if (sideIcon == null && optionPane != null) sideIcon = super.getIconForType(optionPane.getMessageType()); if (sideIcon != null) { if (!SubstanceLookAndFeel.isToUseConstantThemesOnDialogs()) { sideIcon = SubstanceCoreUtilities.getThemedIcon(null, sideIcon); } this.substanceIconLabel = new OptionPaneLabel(); this.iconGlowTracker = new IconGlowTracker(substanceIconLabel); this.substanceIconLabel.setIcon(new GlowingIcon(sideIcon, this.iconGlowTracker)); this.substanceIconLabel.setName("OptionPane.iconLabel"); this.substanceIconLabel.setVerticalAlignment(SwingConstants.TOP); top.add(this.substanceIconLabel, BorderLayout.BEFORE_LINE_BEGINS); } }
.getBorderPainter(c); graphics.translate(x, y); int componentFontSize = SubstanceSizeUtils.getComponentFontSize(c);