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 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; }
/** * Retrieves round icon for slider in {@link SubstanceSliderUI}. * * @param size * The size of the icon to retrieve. * @return Round icon for slider in {@link SubstanceSliderUI}. */ public static Icon getSliderRoundIcon(int size) { HashMapKey key = SubstanceCoreUtilities.getHashKey(size); if (SubstanceIconFactory.sliderRoundIcons.get(key) == null) { Icon icon = new SliderRoundIcon(size); SubstanceIconFactory.sliderRoundIcons.put(key, icon); } return SubstanceIconFactory.sliderRoundIcons.get(key); }
/** * Retrieves round icon for slider in {@link SubstanceSliderUI}. * * @param size * The size of the icon to retrieve. * @return Round icon for slider in {@link SubstanceSliderUI}. */ public static Icon getSliderRoundIcon(int size) { HashMapKey key = SubstanceCoreUtilities.getHashKey(size); if (SubstanceIconFactory.sliderRoundIcons.get(key) == null) { Icon icon = new SliderRoundIcon(size); SubstanceIconFactory.sliderRoundIcons.put(key, icon); } return SubstanceIconFactory.sliderRoundIcons.get(key); }
/** * Retrieves icon for horizontal slider in {@link SubstanceSliderUI}. * * @param size * The size of the icon to retrieve. * @param isMirrorred * Indication whether the icon should be mirrored. * @return Icon for horizontal slider in {@link SubstanceSliderUI}. */ public static Icon getSliderHorizontalIcon(int size, boolean isMirrorred) { HashMapKey key = SubstanceCoreUtilities.getHashKey(size, isMirrorred); if (SubstanceIconFactory.sliderHorizontalIcons.get(key) == null) { Icon icon = new SliderHorizontalIcon(size, isMirrorred); SubstanceIconFactory.sliderHorizontalIcons.put(key, icon); } return SubstanceIconFactory.sliderHorizontalIcons.get(key); }
/** * Retrieves icon for vertical slider in {@link SubstanceSliderUI}. * * @param size * The size of the icon to retrieve. * @param isMirrorred * Indication whether the icon should be mirrored. * @return Icon for vertical slider in {@link SubstanceSliderUI}. */ public static Icon getSliderVerticalIcon(int size, boolean isMirrorred) { HashMapKey key = SubstanceCoreUtilities.getHashKey(size, isMirrorred); if (SubstanceIconFactory.sliderVerticalIcons.get(key) == null) { Icon icon = new SliderVerticalIcon(size, isMirrorred); SubstanceIconFactory.sliderVerticalIcons.put(key, icon); } return SubstanceIconFactory.sliderVerticalIcons.get(key); }
/** * Retrieves icon for vertical slider in {@link SubstanceSliderUI}. * * @param size * The size of the icon to retrieve. * @param isMirrorred * Indication whether the icon should be mirrored. * @return Icon for vertical slider in {@link SubstanceSliderUI}. */ public static Icon getSliderVerticalIcon(int size, boolean isMirrorred) { HashMapKey key = SubstanceCoreUtilities.getHashKey(size, isMirrorred); if (SubstanceIconFactory.sliderVerticalIcons.get(key) == null) { Icon icon = new SliderVerticalIcon(size, isMirrorred); SubstanceIconFactory.sliderVerticalIcons.put(key, icon); } return SubstanceIconFactory.sliderVerticalIcons.get(key); }
/** * Retrieves icon for horizontal slider in {@link SubstanceSliderUI}. * * @param size * The size of the icon to retrieve. * @param isMirrorred * Indication whether the icon should be mirrored. * @return Icon for horizontal slider in {@link SubstanceSliderUI}. */ public static Icon getSliderHorizontalIcon(int size, boolean isMirrorred) { HashMapKey key = SubstanceCoreUtilities.getHashKey(size, isMirrorred); if (SubstanceIconFactory.sliderHorizontalIcons.get(key) == null) { Icon icon = new SliderHorizontalIcon(size, isMirrorred); SubstanceIconFactory.sliderHorizontalIcons.put(key, icon); } return SubstanceIconFactory.sliderHorizontalIcons.get(key); }
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); }
@Override 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); }
public static Icon getTreeIcon(JTree tree, boolean isCollapsed) { int fontSize = SubstanceSizeUtils.getComponentFontSize(tree); int size = SubstanceSizeUtils.getTreeIconSize(fontSize); HashMapKey key = SubstanceCoreUtilities.getHashKey(size, isCollapsed); if (SubstanceIconFactory.treeIcons.get(key) == null) { Icon icon = new TreeIcon(size, isCollapsed); SubstanceIconFactory.treeIcons.put(key, icon); } return SubstanceIconFactory.treeIcons.get(key); }
/** * Retrieves a transformed color scheme. * * @param orig * Original color scheme. * @return Transformed color scheme. */ private SubstanceColorScheme getShiftScheme(SubstanceColorScheme orig) { HashMapKey key = SubstanceCoreUtilities.getHashKey(orig .getDisplayName(), this.getDisplayName(), this.transform); SubstanceColorScheme result = transformMap.get(key); if (result == null) { result = this.transform.transform(orig); transformMap.put(key, result); } return result; }
public static Icon getTreeIcon(JTree tree, boolean isCollapsed) { int fontSize = SubstanceSizeUtils.getComponentFontSize(tree); int size = SubstanceSizeUtils.getTreeIconSize(fontSize); HashMapKey key = SubstanceCoreUtilities.getHashKey(size, isCollapsed); if (SubstanceIconFactory.treeIcons.get(key) == null) { Icon icon = new TreeIcon(size, isCollapsed); SubstanceIconFactory.treeIcons.put(key, icon); } return SubstanceIconFactory.treeIcons.get(key); }
/** * Retrieves a transformed color scheme. * * @param orig * Original color scheme. * @return Transformed color scheme. */ private SubstanceColorScheme getShiftScheme(SubstanceColorScheme orig) { HashMapKey key = SubstanceCoreUtilities.getHashKey(orig .getDisplayName(), this.getDisplayName(), this.transform); SubstanceColorScheme result = transformMap.get(key); if (result == null) { result = this.transform.transform(orig); transformMap.put(key, result); } return result; }
/** * Retrieves a transformed color scheme. * * @param orig * Original color scheme. * @return Transformed color scheme. */ private SubstanceColorScheme getShiftScheme(SubstanceColorScheme orig) { HashMapKey key = SubstanceCoreUtilities.getHashKey(orig .getDisplayName(), this.getDisplayName(), this.transform); SubstanceColorScheme result = transformMap.get(key); if (result == null) { result = this.transform.transform(orig); transformMap.put(key, result); } return result; }
/** * Retrieves a transformed color scheme. * * @param orig * Original color scheme. * @return Transformed color scheme. */ private SubstanceColorScheme getShiftScheme(SubstanceColorScheme orig) { HashMapKey key = SubstanceCoreUtilities.getHashKey(orig .getDisplayName(), this.getDisplayName(), this.transform); SubstanceColorScheme result = transformMap.get(key); if (result == null) { result = this.transform.transform(orig); transformMap.put(key, result); } return result; }
/** * Retrieves icon that matches the specified state of the slider thumb. * * @return Icon that matches the specified state of the slider thumb. */ private static Icon getIcon(JTree tree, boolean isCollapsed) { ComponentState state = ((tree == null) || tree.isEnabled()) ? ComponentState.ENABLED : ComponentState.DISABLED_UNSELECTED; SubstanceColorScheme fillScheme = SubstanceColorSchemeUtilities .getColorScheme(tree, state); SubstanceColorScheme borderScheme = SubstanceColorSchemeUtilities .getColorScheme(tree, ColorSchemeAssociationKind.BORDER, state); int fontSize = SubstanceSizeUtils.getComponentFontSize(tree); HashMapKey key = SubstanceCoreUtilities.getHashKey(fontSize, fillScheme.getDisplayName(), borderScheme.getDisplayName(), isCollapsed); Icon result = TreeIcon.icons.get(key); if (result != null) return result; result = new ImageIcon(SubstanceImageCreator.getTreeIcon(tree, fillScheme, borderScheme, isCollapsed)); TreeIcon.icons.put(key, result); return result; }
@Override public GeneralPath getButtonOutline(AbstractButton button, Insets insets, int width, int height, boolean isInner) { Set<SubstanceConstants.Side> straightSides = SubstanceCoreUtilities .getSides(button, SubstanceLookAndFeel.BUTTON_SIDE_PROPERTY); float radius = this.getCornerRadius(button, insets); if (isInner) { radius -= (int) SubstanceSizeUtils .getBorderStrokeWidth(SubstanceSizeUtils .getComponentFontSize(button)); if (radius < 0.0f) radius = 0.0f; } HashMapKey key = SubstanceCoreUtilities.getHashKey(width, height, straightSides, radius, insets); GeneralPath result = contours.get(key); if (result != null) { return result; } result = SubstanceOutlineUtilities.getBaseOutline(width, height, radius, straightSides, insets); contours.put(key, result); return result; }
@Override public GeneralPath getButtonOutline(AbstractButton button, Insets insets, int width, int height, boolean isInner) { Set<SubstanceConstants.Side> straightSides = SubstanceCoreUtilities .getSides(button, SubstanceLookAndFeel.BUTTON_SIDE_PROPERTY); float radius = this.getCornerRadius(button, insets); if (isInner) { radius -= (int) SubstanceSizeUtils .getBorderStrokeWidth(SubstanceSizeUtils .getComponentFontSize(button)); if (radius < 0.0f) radius = 0.0f; } HashMapKey key = SubstanceCoreUtilities.getHashKey(width, height, straightSides, radius, insets); GeneralPath result = contours.get(key); if (result != null) { return result; } result = SubstanceOutlineUtilities.getBaseOutline(width, height, radius, straightSides, insets); contours.put(key, result); return result; }
@Override public GeneralPath getButtonOutline(AbstractButton button, Insets insets, int width, int height, boolean isInner) { Set<SubstanceConstants.Side> straightSides = SubstanceCoreUtilities .getSides(button, SubstanceLookAndFeel.BUTTON_SIDE_PROPERTY); float radius = this.getCornerRadius(button, insets); if (isInner) { radius -= (int) SubstanceSizeUtils .getBorderStrokeWidth(SubstanceSizeUtils .getComponentFontSize(button)); if (radius < 0.0f) radius = 0.0f; } HashMapKey key = SubstanceCoreUtilities.getHashKey(width, height, straightSides, radius, insets); GeneralPath result = contours.get(key); if (result != null) { return result; } result = SubstanceOutlineUtilities.getBaseOutline(width, height, radius, straightSides, insets); contours.put(key, result); return result; }