public void paintRoundedBorder(Component c, Graphics g, int x, int y, int w, int h) { SubstanceColorScheme scheme = getColorScheme(c); if (scheme == null) return; SubstanceColorScheme borderScheme = getBorderColorScheme(c);
private SubstanceColorScheme getColorScheme(Component c) { JRootPane rp = c instanceof JRootPane ? (JRootPane) c : SwingUtilities.getRootPane(c); SubstanceSkin skin = SubstanceCoreUtilities.getSkin(c); if (skin == null) return null; DecorationAreaType type = getRootPaneType(rp); return skin.getBackgroundColorScheme(type); }
@Override public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { if (SubstanceCoreUtilities.isRoundedCorners(c)) { paintRoundedBorder(c, g, x, y, w, h); } else { paintSquareBorder(c, g, x, y, w, h); } }
new BorderUIResource(new SubstancePaneBorder()), new SubstancePaneBorder(),
new BorderUIResource(new SubstancePaneBorder()), new SubstancePaneBorder(),
.getBackgroundColorScheme(getRootPaneType(SwingUtilities.getRootPane(c))); Component titlePaneComp = SubstanceLookAndFeel .getTitlePaneComponent(SwingUtilities.windowForComponent(c));
private SubstanceColorScheme getBorderColorScheme(Component c) { JRootPane rp = c instanceof JRootPane ? (JRootPane) c : SwingUtilities.getRootPane(c); SubstanceSkin skin = SubstanceCoreUtilities.getSkin(c); if (skin == null) return null; Component titlePaneComp = SubstanceLookAndFeel .getTitlePaneComponent(SwingUtilities.windowForComponent(c)); return skin.getColorScheme(getRootPaneType(rp), ColorSchemeAssociationKind.BORDER, ComponentState.ENABLED); }