org.pushingpixels.substance.api.shaper.ClassicButtonShaper Java Examples
The following examples show how to use
org.pushingpixels.substance.api.shaper.ClassicButtonShaper.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SubstanceSpinnerButton.java From radiance with BSD 3-Clause "New" or "Revised" License | 6 votes |
/** * Simple constructor. * * @param spinner * The owner spinner. * @param orientation * The orientation of the spinner icon arrow. */ public SubstanceSpinnerButton(JSpinner spinner, final int orientation) { this.setEnabled(spinner.isEnabled()); this.setFocusable(false); this.setRequestFocusEnabled(false); super.setBorder(new SpinnerButtonBorder(ClassicButtonShaper.class) { public Insets getBorderInsets(Component c) { int extraPadding = SubstanceSizeUtils .getExtraPadding(SubstanceSizeUtils.getComponentFontSize(c)); // Bring the icons closer together instead of // having them centered in the spinner buttons int delta = SubstanceSizeUtils.getAdjustedSize( SubstanceSizeUtils.getComponentFontSize(c), 3, 3, 1, false); int deltaTop = (orientation == SwingConstants.NORTH) ? delta : 0; int deltaBottom = (orientation == SwingConstants.NORTH) ? 0 : delta; return new Insets(extraPadding + deltaTop, extraPadding, extraPadding + deltaBottom, extraPadding); } }); SubstanceCoreUtilities.markButtonAsFlat(this); SubstanceCortex.ComponentScope.setButtonStraightSides(this, EnumSet.allOf(Side.class)); }
Example #2
Source File: SubstanceTabbedPaneUI.java From radiance with BSD 3-Clause "New" or "Revised" License | 6 votes |
/** * Returns extra width for the specified tab. * * @param tabPlacement * Tab placement. * @param tabIndex * Tab index. * @return Extra width for the specified tab. */ protected int getTabExtraWidth(int tabPlacement, int tabIndex) { int extraWidth = 0; SubstanceButtonShaper shaper = SubstanceCoreUtilities.getButtonShaper(this.tabPane); if (shaper instanceof ClassicButtonShaper) extraWidth = (int) (2.0 * SubstanceSizeUtils.getClassicButtonCornerRadius( SubstanceSizeUtils.getComponentFontSize(this.tabPane))); else extraWidth = super.calculateTabHeight(tabPlacement, tabIndex, this.getFontMetrics().getHeight()) / 3; if (SubstanceCoreUtilities.hasCloseButton(this.tabPane, tabIndex) && this.tabPane.isEnabledAt(tabIndex)) { extraWidth += (4 + SubstanceCoreUtilities.getCloseButtonSize(this.tabPane, tabIndex)); } // System.out.println(tabPane.getTitleAt(tabIndex) + ":" + extraWidth); return extraWidth; }
Example #3
Source File: GreenMagicSkin.java From radiance with BSD 3-Clause "New" or "Revised" License | 5 votes |
/** * Creates a new <code>Green Magic</code> skin. */ public GreenMagicSkin() { SubstanceColorScheme activeScheme = new AquaColorScheme().blendWith( new BottleGreenColorScheme(), 0.5).saturate(0.7); SubstanceColorScheme defaultScheme = new AquaColorScheme().blendWith( new LimeGreenColorScheme(), 0.5).tone(0.1).saturate(-0.2); SubstanceColorScheme disabledScheme = new SaturatedColorScheme( defaultScheme, -0.3) { Color foreColor = new Color(91, 165, 129); @Override public Color getForegroundColor() { return foreColor; } }; SubstanceColorSchemeBundle defaultSchemeBundle = new SubstanceColorSchemeBundle( activeScheme, defaultScheme, disabledScheme); this.registerDecorationAreaSchemeBundle(defaultSchemeBundle, DecorationAreaType.NONE); this.buttonShaper = new ClassicButtonShaper(); this.watermark = new SubstanceCopperplateEngravingWatermark(); this.fillPainter = new GlassFillPainter(); this.decorationPainter = new Glass3DDecorationPainter(); this.borderPainter = new ClassicBorderPainter(); this.highlightPainter = new ClassicHighlightPainter(); }
Example #4
Source File: FieldOfWheatSkin.java From radiance with BSD 3-Clause "New" or "Revised" License | 5 votes |
/** * Creates a new <code>Field of Wheat</code> skin. */ public FieldOfWheatSkin() { SubstanceColorScheme activeScheme = new AquaColorScheme().saturate(0.1); SubstanceColorScheme defaultScheme = new BrownColorScheme(); SubstanceColorScheme disabledScheme = new SaturatedColorScheme( new BrownColorScheme().blendWith(new SunGlareColorScheme(), 0.3), -0.2) { Color foreColor = new Color(181, 122, 26); @Override public Color getForegroundColor() { return foreColor; } }; SubstanceColorSchemeBundle defaultSchemeBundle = new SubstanceColorSchemeBundle( activeScheme, defaultScheme, disabledScheme); this.registerDecorationAreaSchemeBundle(defaultSchemeBundle, DecorationAreaType.NONE); this.watermarkScheme = new SunGlareColorScheme().tone(0.8); this.buttonShaper = new ClassicButtonShaper(); this.watermark = new SubstanceBinaryWatermark(); this.fillPainter = new GlassFillPainter(); this.decorationPainter = new Glass3DDecorationPainter(); this.borderPainter = new ClassicBorderPainter(); this.highlightPainter = new ClassicHighlightPainter(); }
Example #5
Source File: SubstanceCommandButtonUI.java From radiance with BSD 3-Clause "New" or "Revised" License | 5 votes |
@Override protected void installDefaults() { super.installDefaults(); SubstanceCortex.ComponentScope.setButtonShaper(this.commandButton, ClassicButtonShaper.INSTANCE); this.commandButton.setOpaque(false); }
Example #6
Source File: SaharaSkin.java From radiance with BSD 3-Clause "New" or "Revised" License | 5 votes |
/** * Creates a new <code>Sahara</code> skin. */ public SaharaSkin() { SubstanceColorScheme activeScheme = new DesertSandColorScheme(); SubstanceColorScheme enabledScheme = new MetallicColorScheme(); SubstanceSkin.ColorSchemes kitchenSinkSchemes = SubstanceSkin.getColorSchemes( this.getClass().getClassLoader().getResourceAsStream( "org/pushingpixels/substance/api/skin/kitchen-sink.colorschemes")); SubstanceColorSchemeBundle defaultSchemeBundle = new SubstanceColorSchemeBundle( activeScheme, enabledScheme, kitchenSinkSchemes.get("Gray Disabled")); defaultSchemeBundle.registerHighlightColorScheme( new OliveColorScheme().shift(Color.white, 0.2f, Color.black, 0.0f).named("Sahara Highlight")); this.registerDecorationAreaSchemeBundle(defaultSchemeBundle, DecorationAreaType.NONE); this.registerAsDecorationArea(activeScheme, DecorationAreaType.PRIMARY_TITLE_PANE, DecorationAreaType.SECONDARY_TITLE_PANE, DecorationAreaType.HEADER); // add an overlay painter to paint a drop shadow along the top // edge of toolbars this.addOverlayPainter(TopShadowOverlayPainter.getInstance(100), DecorationAreaType.TOOLBAR); // add an overlay painter to paint separator lines along the bottom // edges of title panes and menu bars BottomLineOverlayPainter bottomLineOverlayPainter = new BottomLineOverlayPainter( ColorSchemeSingleColorQuery.MID); this.addOverlayPainter(bottomLineOverlayPainter, DecorationAreaType.HEADER); this.buttonShaper = new ClassicButtonShaper(); this.fillPainter = new ClassicFillPainter(); this.borderPainter = new ClassicBorderPainter(); this.decorationPainter = new MatteDecorationPainter(); this.highlightPainter = new ClassicHighlightPainter(); }
Example #7
Source File: ModerateSkin.java From radiance with BSD 3-Clause "New" or "Revised" License | 5 votes |
/** * Creates a new <code>Moderate</code> skin. */ public ModerateSkin() { SubstanceColorScheme activeScheme = new SteelBlueColorScheme(); SubstanceColorScheme enabledScheme = new MetallicColorScheme(); SubstanceSkin.ColorSchemes kitchenSinkSchemes = SubstanceSkin.getColorSchemes( this.getClass().getClassLoader().getResourceAsStream( "org/pushingpixels/substance/api/skin/kitchen-sink.colorschemes")); SubstanceColorSchemeBundle defaultSchemeBundle = new SubstanceColorSchemeBundle( activeScheme, enabledScheme, kitchenSinkSchemes.get("Gray Disabled")); SubstanceColorScheme highlightColorScheme = kitchenSinkSchemes.get("Moderate Highlight"); defaultSchemeBundle.registerHighlightColorScheme(highlightColorScheme); this.registerDecorationAreaSchemeBundle(defaultSchemeBundle, DecorationAreaType.NONE); SubstanceColorSchemeBundle headerSchemeBundle = new SubstanceColorSchemeBundle( activeScheme.saturate(0.2), activeScheme, kitchenSinkSchemes.get("Gray Disabled")); this.registerDecorationAreaSchemeBundle(headerSchemeBundle, DecorationAreaType.PRIMARY_TITLE_PANE, DecorationAreaType.SECONDARY_TITLE_PANE, DecorationAreaType.HEADER); this.registerAsDecorationArea(kitchenSinkSchemes.get("LightGray General Background"), DecorationAreaType.GENERAL); // add an overlay painter to paint a drop shadow along the top // edge of toolbars this.addOverlayPainter(TopShadowOverlayPainter.getInstance(100), DecorationAreaType.TOOLBAR); // add an overlay painter to paint separator lines along the bottom // edges of title panes and menu bars BottomLineOverlayPainter bottomLineOverlayPainter = new BottomLineOverlayPainter( ColorSchemeSingleColorQuery.MID); this.addOverlayPainter(bottomLineOverlayPainter, DecorationAreaType.HEADER); this.buttonShaper = new ClassicButtonShaper(); this.fillPainter = new GlassFillPainter(); this.decorationPainter = new MatteDecorationPainter(); this.borderPainter = new ClassicBorderPainter(); this.highlightPainter = new ClassicHighlightPainter(); }
Example #8
Source File: MangoSkin.java From radiance with BSD 3-Clause "New" or "Revised" License | 5 votes |
/** * Creates a new <code>Mango</code> skin. */ public MangoSkin() { SubstanceColorScheme activeScheme = new MixColorScheme("Mango Active", new SunGlareColorScheme(), new BarbyPinkColorScheme()) .saturate(0.2); SubstanceColorScheme defaultScheme = new AquaColorScheme().blendWith( new LimeGreenColorScheme(), 0.5).tone(0.1).saturate(-0.2); SubstanceColorScheme disabledScheme = new SaturatedColorScheme( defaultScheme, -0.3) { Color foreColor = new Color(91, 165, 129); @Override public Color getForegroundColor() { return foreColor; } }; SubstanceColorSchemeBundle defaultSchemeBundle = new SubstanceColorSchemeBundle( activeScheme, defaultScheme, disabledScheme); this.registerDecorationAreaSchemeBundle(defaultSchemeBundle, DecorationAreaType.NONE); this.buttonShaper = new ClassicButtonShaper(); this.watermark = new SubstanceMarbleVeinWatermark(); this.borderPainter = new ClassicBorderPainter(); this.highlightPainter = new ClassicHighlightPainter(); this.fillPainter = new MixDelegateFillPainter("Mixed Standard", new StandardFillPainter()); this.decorationPainter = new Glass3DDecorationPainter(); }
Example #9
Source File: CremeAccentedSkin.java From radiance with BSD 3-Clause "New" or "Revised" License | 5 votes |
/** * Creates a new accented <code>Creme</code> skin. */ protected CremeAccentedSkin(AccentBuilder accentBuilder) { super(accentBuilder); ColorSchemes kitchenSinkSchemes = SubstanceSkin.getColorSchemes( this.getClass().getClassLoader().getResourceAsStream( "org/pushingpixels/substance/api/skin/kitchen-sink.colorschemes")); SubstanceColorScheme enabledScheme = new CremeColorScheme(); SubstanceColorScheme disabledScheme = kitchenSinkSchemes.get("Creme Disabled"); SubstanceColorSchemeBundle defaultSchemeBundle = new SubstanceColorSchemeBundle( this.getActiveControlsAccent(), enabledScheme, disabledScheme); defaultSchemeBundle.registerHighlightColorScheme(this.getHighlightsAccent()); this.registerDecorationAreaSchemeBundle(defaultSchemeBundle, DecorationAreaType.NONE); this.registerAsDecorationArea(enabledScheme, DecorationAreaType.PRIMARY_TITLE_PANE, DecorationAreaType.SECONDARY_TITLE_PANE, DecorationAreaType.HEADER, DecorationAreaType.FOOTER, DecorationAreaType.GENERAL, DecorationAreaType.TOOLBAR); // Add overlay painters to paint drop shadows along the bottom edges of toolbars this.addOverlayPainter(BottomShadowOverlayPainter.getInstance(40), DecorationAreaType.TOOLBAR); // add an overlay painter to paint a dark line along the bottom edge of toolbars SubstanceOverlayPainter toolbarBottomLineOverlayPainter = new BottomLineOverlayPainter( SchemeBaseColors::getMidColor); this.addOverlayPainter(toolbarBottomLineOverlayPainter, DecorationAreaType.TOOLBAR); this.buttonShaper = new ClassicButtonShaper(); this.fillPainter = new MatteFillPainter(); this.decorationPainter = new ArcDecorationPainter(); this.highlightPainter = new ClassicHighlightPainter(); this.borderPainter = new CompositeBorderPainter("Creme", new ClassicBorderPainter(), new DelegateBorderPainter( "Creme Inner", new ClassicBorderPainter(), (SubstanceColorScheme scheme) -> scheme.tint(0.9f))); }
Example #10
Source File: SampleMenuFactory.java From radiance with BSD 3-Clause "New" or "Revised" License | 5 votes |
public CustomSkin() { SubstanceColorScheme activeScheme = new OrangeColorScheme().shade(0.2).invert(); SubstanceColorScheme enabledScheme = new MetallicColorScheme(); SubstanceColorScheme disabledScheme = new LightGrayColorScheme(); SubstanceColorSchemeBundle defaultSchemeBundle = new SubstanceColorSchemeBundle( activeScheme, enabledScheme, disabledScheme); defaultSchemeBundle.registerHighlightAlpha(0.6f, ComponentState.ROLLOVER_UNSELECTED); defaultSchemeBundle.registerHighlightAlpha(0.8f, ComponentState.SELECTED); defaultSchemeBundle.registerHighlightAlpha(0.95f, ComponentState.ROLLOVER_SELECTED); defaultSchemeBundle.registerHighlightAlpha(0.8f, ComponentState.ARMED, ComponentState.ROLLOVER_ARMED); defaultSchemeBundle.registerHighlightColorScheme(activeScheme, ComponentState.ROLLOVER_SELECTED, ComponentState.ROLLOVER_UNSELECTED, ComponentState.SELECTED, ComponentState.ARMED, ComponentState.ROLLOVER_ARMED); this.registerDecorationAreaSchemeBundle(defaultSchemeBundle, DecorationAreaType.NONE); SubstanceColorSchemeBundle headerSchemeBundle = new SubstanceColorSchemeBundle( activeScheme.saturate(0.3), activeScheme, disabledScheme); this.registerDecorationAreaSchemeBundle(headerSchemeBundle, activeScheme.saturate(0.3), DecorationAreaType.PRIMARY_TITLE_PANE, DecorationAreaType.SECONDARY_TITLE_PANE, DecorationAreaType.HEADER); this.borderPainter = new ClassicBorderPainter(); this.fillPainter = new GlassFillPainter(); this.buttonShaper = new ClassicButtonShaper(); this.decorationPainter = new ArcDecorationPainter(); this.highlightPainter = new GlassHighlightPainter(); this.tabFadeStart = 1.0f; this.tabFadeEnd = 1.0f; }
Example #11
Source File: FindingNemoSkin.java From radiance with BSD 3-Clause "New" or "Revised" License | 5 votes |
/** * Creates a new <code>Finding Nemo</code> skin. */ public FindingNemoSkin() { SubstanceColorScheme activeScheme = new MixColorScheme( "Finding Nemo Active", new PurpleColorScheme(), new BarbyPinkColorScheme()).saturate(0.5); SubstanceColorScheme defaultScheme = new MixColorScheme( "Finding Nemo Default", new AquaColorScheme(), new BottleGreenColorScheme()).saturate(0.3).tint(0.2); SubstanceColorScheme disabledScheme = new SaturatedColorScheme( defaultScheme, -0.3) { Color foreColor = new Color(70, 158, 210); @Override public Color getForegroundColor() { return foreColor; } }; SubstanceColorSchemeBundle defaultSchemeBundle = new SubstanceColorSchemeBundle( activeScheme, defaultScheme, disabledScheme); this.registerDecorationAreaSchemeBundle(defaultSchemeBundle, DecorationAreaType.NONE); this.buttonShaper = new ClassicButtonShaper(); this.watermark = new SubstanceMazeWatermark(); this.fillPainter = new MixDelegateFillPainter("Mixed Glass", new GlassFillPainter()); this.decorationPainter = new Glass3DDecorationPainter(); this.borderPainter = new ClassicBorderPainter(); this.highlightPainter = new ClassicHighlightPainter(); }
Example #12
Source File: SubstanceTabbedPaneUI.java From radiance with BSD 3-Clause "New" or "Revised" License | 4 votes |
/** * Retrieves tab background. */ private static BufferedImage getTabBackground(JTabbedPane tabPane, int width, int height, SubstanceColorScheme fillScheme, SubstanceColorScheme borderScheme, boolean paintOnlyBorder) { SubstanceFillPainter fillPainter = SubstanceCoreUtilities.getFillPainter(tabPane); SubstanceBorderPainter borderPainter = SubstanceCoreUtilities.getBorderPainter(tabPane); SubstanceButtonShaper shaper = SubstanceCoreUtilities.getButtonShaper(tabPane); float borderDelta = 2.0f * SubstanceSizeUtils.getBorderStrokeWidth(); float borderInsets = SubstanceSizeUtils.getBorderStrokeWidth() / 2.0f; int dy = (int) (2 + borderDelta); Set<Side> straightSides = EnumSet.of(Side.BOTTOM); float cornerRadius = height / 3.0f; if (shaper instanceof ClassicButtonShaper) { cornerRadius = SubstanceSizeUtils .getClassicButtonCornerRadius(SubstanceSizeUtils.getComponentFontSize(tabPane)); width -= 1; } Shape contour = SubstanceOutlineUtilities.getBaseOutline(width, height + dy, cornerRadius, straightSides, borderInsets); BufferedImage result = SubstanceCoreUtilities.getBlankImage(width, height); Graphics2D resGraphics = result.createGraphics(); if (!paintOnlyBorder) { fillPainter.paintContourBackground(resGraphics, tabPane, width, height + dy, contour, false, fillScheme, true); } float borderThickness = SubstanceSizeUtils.getBorderStrokeWidth(); Shape contourInner = borderPainter.isPaintingInnerContour() ? SubstanceOutlineUtilities.getBaseOutline(width, height + dy, cornerRadius - borderThickness, straightSides, borderThickness + borderInsets) : null; borderPainter.paintBorder(resGraphics, tabPane, width, height + dy, contour, contourInner, borderScheme); resGraphics.dispose(); return result; }
Example #13
Source File: MagmaSkin.java From radiance with BSD 3-Clause "New" or "Revised" License | 4 votes |
/** * Creates a new <code>Magma</code> skin. */ public MagmaSkin() { SubstanceColorScheme shiftRed = new ShiftColorScheme( new SunsetColorScheme(), Color.red, 0.3); SubstanceColorScheme defaultScheme = new CharcoalColorScheme(); SubstanceColorScheme activeScheme = shiftRed.saturate(0.4).named( "Magma Active"); SubstanceColorScheme disabledScheme = new ShadeColorScheme( new CharcoalColorScheme(), 0.5) { Color foreColor = new Color(104, 93, 90); @Override public Color getForegroundColor() { return this.foreColor; } }.named("Magma Disabled"); SubstanceColorSchemeBundle defaultSchemeBundle = new SubstanceColorSchemeBundle( activeScheme, defaultScheme, disabledScheme); defaultSchemeBundle.registerColorScheme(new CharcoalColorScheme(), ColorSchemeAssociationKind.BORDER, ComponentState .getActiveStates()); defaultSchemeBundle.registerColorScheme(activeScheme, ColorSchemeAssociationKind.MARK, ComponentState .getActiveStates()); defaultSchemeBundle.registerAlpha(0.7f, ComponentState.DISABLED_UNSELECTED, ComponentState.DISABLED_SELECTED); defaultSchemeBundle.registerColorScheme(disabledScheme, ComponentState.DISABLED_UNSELECTED, ComponentState.DISABLED_SELECTED); defaultSchemeBundle.registerHighlightAlpha(0.7f, ComponentState.ROLLOVER_UNSELECTED); defaultSchemeBundle.registerHighlightAlpha(0.7f, ComponentState.SELECTED); defaultSchemeBundle.registerHighlightAlpha(0.9f, ComponentState.ROLLOVER_SELECTED); defaultSchemeBundle.registerHighlightAlpha(0.7f, ComponentState.ARMED, ComponentState.ROLLOVER_ARMED); defaultSchemeBundle.registerHighlightColorScheme(activeScheme, ComponentState.SELECTED, ComponentState.ROLLOVER_SELECTED); defaultSchemeBundle.registerHighlightColorScheme(activeScheme.saturate(-0.2), ComponentState.ROLLOVER_UNSELECTED, ComponentState.ARMED, ComponentState.ROLLOVER_ARMED); this.registerDecorationAreaSchemeBundle(defaultSchemeBundle, DecorationAreaType.NONE); this.registerAsDecorationArea(defaultScheme, DecorationAreaType.PRIMARY_TITLE_PANE, DecorationAreaType.SECONDARY_TITLE_PANE, DecorationAreaType.HEADER, DecorationAreaType.FOOTER, DecorationAreaType.GENERAL, DecorationAreaType.TOOLBAR); this.setTabFadeStart(1.0); this.setTabFadeEnd(1.0); this.watermarkScheme = defaultScheme.shade(0.5); this.buttonShaper = new ClassicButtonShaper(); this.fillPainter = new GlassFillPainter(); this.decorationPainter = new ArcDecorationPainter(); this.watermark = new SubstancePlanktonWatermark(); this.borderPainter = new GlassBorderPainter(); this.highlightPainter = new ClassicHighlightPainter(); }
Example #14
Source File: StreetlightsSkin.java From radiance with BSD 3-Clause "New" or "Revised" License | 4 votes |
/** * Creates a new <code>Streetlights</code> skin. */ public StreetlightsSkin() { SubstanceColorScheme activeScheme = new SunsetColorScheme().saturate(0.4); // dark green theme by shifting charcoal SubstanceColorScheme deepGreenScheme = new CharcoalColorScheme().hueShift(0.35); // default theme is ebony blended with the dark green SubstanceColorScheme defaultScheme = new EbonyColorScheme().blendWith(deepGreenScheme, 0.85); // disabled theme is shaded dark green SubstanceColorScheme disabledScheme = deepGreenScheme.shade(0.4); // default scheme bundle SubstanceColorSchemeBundle defaultSchemeBundle = new SubstanceColorSchemeBundle( activeScheme, defaultScheme, disabledScheme); // use charcoal for borders on active states defaultSchemeBundle.registerColorScheme(new CharcoalColorScheme(), ColorSchemeAssociationKind.BORDER, ComponentState.getActiveStates()); // and 60% alpha on disabled controls defaultSchemeBundle.registerAlpha(0.6f, ComponentState.DISABLED_UNSELECTED, ComponentState.DISABLED_SELECTED); defaultSchemeBundle.registerColorScheme(disabledScheme, ComponentState.DISABLED_UNSELECTED, ComponentState.DISABLED_SELECTED); this.registerDecorationAreaSchemeBundle(defaultSchemeBundle, DecorationAreaType.NONE); // mark title panes and headers as decoration areas this.registerAsDecorationArea(defaultScheme, DecorationAreaType.PRIMARY_TITLE_PANE, DecorationAreaType.SECONDARY_TITLE_PANE, DecorationAreaType.HEADER); // set dark green as watermark scheme this.watermarkScheme = new BottleGreenColorScheme().shiftBackground( new Color(0, 50, 0), 0.7); this.setTabFadeStart(1.0); this.setTabFadeEnd(1.0); // additional skin settings this.buttonShaper = new ClassicButtonShaper(); this.watermark = new SubstanceMetalWallWatermark(); this.borderPainter = new GlassBorderPainter(); this.highlightPainter = new ClassicHighlightPainter(); this.fillPainter = new GlassFillPainter(); this.decorationPainter = new ArcDecorationPainter(); }
Example #15
Source File: SubstanceTabbedPaneUI.java From radiance with BSD 3-Clause "New" or "Revised" License | 4 votes |
@Override protected void paintContentBorderTopEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { TabContentPaneBorderKind kind = SubstanceCoreUtilities.getContentBorderKind(this.tabPane); boolean isDouble = (kind == TabContentPaneBorderKind.DOUBLE_FULL) || (kind == TabContentPaneBorderKind.DOUBLE_PLACEMENT); boolean isPlacement = (kind == TabContentPaneBorderKind.SINGLE_PLACEMENT) || (kind == TabContentPaneBorderKind.DOUBLE_PLACEMENT); if (isPlacement) { if (tabPlacement != SwingConstants.TOP) return; } Rectangle selRect = selectedIndex < 0 ? null : this.getTabBounds(selectedIndex, this.calcRect); Graphics2D g2d = (Graphics2D) g.create(); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE); float strokeWidth = SubstanceSizeUtils.getBorderStrokeWidth(); int joinKind = BasicStroke.JOIN_ROUND; int capKind = BasicStroke.CAP_BUTT; g2d.setStroke(new BasicStroke(strokeWidth, capKind, joinKind)); int offset = (int) (strokeWidth / 2.0); int ribbonDelta = (int) Math.ceil(strokeWidth + 1.5f); boolean isUnbroken = (tabPlacement != TOP || selectedIndex < 0 || (selRect.y + selRect.height + 1 < y) || (selRect.x < x || selRect.x > x + w)); x += offset; y += offset; w -= 2 * offset; // h -= 2 * offset; // Draw unbroken line if tabs are not on TOP, OR // selected tab is not in run adjacent to content, OR // selected tab is not visible (SCROLL_TAB_LAYOUT) SubstanceColorScheme borderScheme = SubstanceColorSchemeUtilities.getColorScheme( this.tabPane, selectedIndex, ColorSchemeAssociationKind.TAB_BORDER, ComponentState.SELECTED); Color darkShadowColor = SubstanceColorUtilities.getMidBorderColor(borderScheme); if (isUnbroken) { g2d.setColor(this.highlight); g2d.drawLine(x, y, x + w, y); } else { // Break line to show visual connection to selected tab SubstanceButtonShaper shaper = SubstanceCoreUtilities.getButtonShaper(this.tabPane); int delta = (shaper instanceof ClassicButtonShaper) ? 1 : 0; float borderInsets = SubstanceSizeUtils.getBorderStrokeWidth() / 2.0f; GeneralPath topOutline = new GeneralPath(); topOutline.moveTo(x, y); topOutline.lineTo(selRect.x + borderInsets, y); int bumpHeight = super.calculateTabHeight(tabPlacement, 0, SubstanceSizeUtils.getComponentFontSize(this.tabPane)) / 2; topOutline.lineTo(selRect.x + borderInsets, y - bumpHeight); if (selRect.x + selRect.width < x + w) { float selectionEndX = selRect.x + selRect.width - delta - 1 - borderInsets; topOutline.lineTo(selectionEndX, y - bumpHeight); topOutline.lineTo(selectionEndX, y); topOutline.lineTo(x + w, y); } g2d.setPaint(new GradientPaint(x, y, darkShadowColor, x, y - bumpHeight, SubstanceColorUtilities.getAlphaColor(darkShadowColor, 0))); g2d.draw(topOutline); } if (isDouble) { if (tabPlacement == TOP) { g2d.setColor(darkShadowColor); g2d.drawLine(x, y + ribbonDelta, x + w, y + ribbonDelta); } if (tabPlacement == LEFT) { g2d.setPaint(new GradientPaint(x, y, darkShadowColor, x + 4 * ribbonDelta, y, this.highlight)); g2d.drawLine(x, y, x + 4 * ribbonDelta, y); } if (tabPlacement == RIGHT) { g2d.setPaint(new GradientPaint(x + w - 1 - 4 * ribbonDelta, y, this.highlight, x + w - 1, y, darkShadowColor)); g2d.drawLine(x + w - 1 - 4 * ribbonDelta, y, x + w - 1, y); } } g2d.dispose(); }
Example #16
Source File: SubstanceTabbedPaneUI.java From radiance with BSD 3-Clause "New" or "Revised" License | 4 votes |
@Override protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { TabContentPaneBorderKind kind = SubstanceCoreUtilities.getContentBorderKind(this.tabPane); boolean isDouble = (kind == TabContentPaneBorderKind.DOUBLE_FULL) || (kind == TabContentPaneBorderKind.DOUBLE_PLACEMENT); boolean isPlacement = (kind == TabContentPaneBorderKind.SINGLE_PLACEMENT) || (kind == TabContentPaneBorderKind.DOUBLE_PLACEMENT); if (isPlacement) { if (tabPlacement != SwingConstants.RIGHT) return; } int ribbonDelta = (int) (SubstanceSizeUtils.getBorderStrokeWidth() + 1.5f); Rectangle selRect = selectedIndex < 0 ? null : this.getTabBounds(selectedIndex, this.calcRect); Graphics2D g2d = (Graphics2D) g.create(); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE); float strokeWidth = SubstanceSizeUtils.getBorderStrokeWidth(); int joinKind = BasicStroke.JOIN_ROUND; int capKind = BasicStroke.CAP_BUTT; g2d.setStroke(new BasicStroke(strokeWidth, capKind, joinKind)); int offset = (int) (strokeWidth / 2.0); boolean isUnbroken = (tabPlacement != RIGHT || selectedIndex < 0 || (selRect.x - 1 > w) || (selRect.y < y || selRect.y > y + h)); x += offset; y += offset; w -= 2 * offset; h -= 2 * offset; // Draw unbroken line if tabs are not on RIGHT, OR // selected tab is not in run adjacent to content, OR // selected tab is not visible (SCROLL_TAB_LAYOUT) SubstanceColorScheme borderScheme = SubstanceColorSchemeUtilities.getColorScheme( this.tabPane, selectedIndex, ColorSchemeAssociationKind.TAB_BORDER, ComponentState.SELECTED); Color darkShadowColor = SubstanceColorUtilities.getMidBorderColor(borderScheme); if (isUnbroken) { g2d.setColor(this.highlight); g2d.drawLine(x + w - 1, y, x + w - 1, y + h); } else { // Break line to show visual connection to selected tab SubstanceButtonShaper shaper = SubstanceCoreUtilities.getButtonShaper(this.tabPane); int delta = (shaper instanceof ClassicButtonShaper) ? 1 : 0; float borderInsets = SubstanceSizeUtils.getBorderStrokeWidth() / 2.0f; GeneralPath rightOutline = new GeneralPath(); rightOutline.moveTo(x + w - 1, y); rightOutline.lineTo(x + w - 1, selRect.y + borderInsets); int bumpWidth = super.calculateTabHeight(tabPlacement, 0, SubstanceSizeUtils.getComponentFontSize(this.tabPane)) / 2; rightOutline.lineTo(x + w - 1 + bumpWidth, selRect.y + borderInsets); if (selRect.y + selRect.height < y + h) { float selectionEndY = selRect.y + selRect.height - delta - 1 - borderInsets; rightOutline.lineTo(x + w - 1 + bumpWidth, selectionEndY); rightOutline.lineTo(x + w - 1, selectionEndY); rightOutline.lineTo(x + w - 1, y + h); } g2d.setPaint(new GradientPaint(x + w - 1, y, darkShadowColor, x + w - 1 + bumpWidth, y, SubstanceColorUtilities.getAlphaColor(darkShadowColor, 0))); g2d.draw(rightOutline); } if (isDouble) { if (tabPlacement == RIGHT) { g2d.setColor(this.highlight); // g2d.drawLine(x + w - 2 - ribbonDelta, y + 1, x + w - 2 - // ribbonDelta, y + h - 1); g2d.setColor(darkShadowColor); g2d.drawLine(x + w - 1 - ribbonDelta, y, x + w - 1 - ribbonDelta, y + h); } if (tabPlacement == TOP) { g2d.setPaint(new GradientPaint(x + w - 1, y, darkShadowColor, x + w - 1, y + 4 * ribbonDelta, this.highlight)); g2d.drawLine(x + w - 1, y, x + w - 1, y + 4 * ribbonDelta); } if (tabPlacement == BOTTOM) { g2d.setPaint(new GradientPaint(x + w - 1, y + h - 1 - 4 * ribbonDelta, this.highlight, x + w - 1, y + h - 1, darkShadowColor)); g2d.drawLine(x + w - 1, y + h - 1 - 4 * ribbonDelta, x + w - 1, y + h - 1); } } g2d.dispose(); }
Example #17
Source File: SubstanceTabbedPaneUI.java From radiance with BSD 3-Clause "New" or "Revised" License | 4 votes |
@Override protected void paintContentBorderLeftEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { TabContentPaneBorderKind kind = SubstanceCoreUtilities.getContentBorderKind(this.tabPane); boolean isDouble = (kind == TabContentPaneBorderKind.DOUBLE_FULL) || (kind == TabContentPaneBorderKind.DOUBLE_PLACEMENT); boolean isPlacement = (kind == TabContentPaneBorderKind.SINGLE_PLACEMENT) || (kind == TabContentPaneBorderKind.DOUBLE_PLACEMENT); if (isPlacement) { if (tabPlacement != SwingConstants.LEFT) return; } int ribbonDelta = (int) (SubstanceSizeUtils.getBorderStrokeWidth() + 1.5f); Rectangle selRect = selectedIndex < 0 ? null : this.getTabBounds(selectedIndex, this.calcRect); Graphics2D g2d = (Graphics2D) g.create(); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE); float strokeWidth = SubstanceSizeUtils.getBorderStrokeWidth(); int joinKind = BasicStroke.JOIN_ROUND; int capKind = BasicStroke.CAP_BUTT; g2d.setStroke(new BasicStroke(strokeWidth, capKind, joinKind)); int offset = (int) (strokeWidth / 2.0); boolean isUnbroken = (tabPlacement != LEFT || selectedIndex < 0 || (selRect.x + selRect.width + 1 < x) || (selRect.y < y || selRect.y > y + h)); x += offset; y += offset; // w -= 2 * offset; h -= 2 * offset; // Draw unbroken line if tabs are not on LEFT, OR // selected tab is not in run adjacent to content, OR // selected tab is not visible (SCROLL_TAB_LAYOUT) SubstanceColorScheme borderScheme = SubstanceColorSchemeUtilities.getColorScheme( this.tabPane, selectedIndex, ColorSchemeAssociationKind.TAB_BORDER, ComponentState.SELECTED); Color darkShadowColor = SubstanceColorUtilities.getMidBorderColor(borderScheme); if (isUnbroken) { g2d.setColor(this.highlight); g2d.drawLine(x, y, x, y + h); } else { // Break line to show visual connection to selected tab SubstanceButtonShaper shaper = SubstanceCoreUtilities.getButtonShaper(this.tabPane); int delta = (shaper instanceof ClassicButtonShaper) ? 1 : 0; float borderInsets = SubstanceSizeUtils.getBorderStrokeWidth() / 2.0f; GeneralPath leftOutline = new GeneralPath(); leftOutline.moveTo(x, y); leftOutline.lineTo(x, selRect.y + borderInsets + delta + 1); int bumpWidth = super.calculateTabHeight(tabPlacement, 0, SubstanceSizeUtils.getComponentFontSize(this.tabPane)) / 2; leftOutline.lineTo(x - bumpWidth, selRect.y + borderInsets + delta + 1); if (selRect.y + selRect.height < y + h) { float selectionEndY = selRect.y + selRect.height - borderInsets; leftOutline.lineTo(x - bumpWidth, selectionEndY); leftOutline.lineTo(x, selectionEndY); leftOutline.lineTo(x, y + h); } g2d.setPaint(new GradientPaint(x, y, darkShadowColor, x - bumpWidth, y, SubstanceColorUtilities.getAlphaColor(darkShadowColor, 0))); g2d.draw(leftOutline); } if (isDouble) { if (tabPlacement == LEFT) { g2d.setColor(darkShadowColor); g2d.drawLine(x + ribbonDelta, y, x + ribbonDelta, y + h); // g2d.setColor(this.highlight); // g2d.drawLine(x + 1 + ribbonDelta, y + 1, x + 1 + ribbonDelta, // y + // h - 1); } if (tabPlacement == TOP) { g2d.setPaint(new GradientPaint(x, y, darkShadowColor, x, y + 4 * ribbonDelta, this.highlight)); g2d.drawLine(x, y, x, y + 4 * ribbonDelta); } if (tabPlacement == BOTTOM) { g2d.setPaint(new GradientPaint(x, y + h - 1 - 4 * ribbonDelta, this.highlight, x, y + h - 1, darkShadowColor)); g2d.drawLine(x, y + h - 1 - 4 * ribbonDelta, x, y + h - 1); } } g2d.dispose(); }
Example #18
Source File: SubstanceTabbedPaneUI.java From radiance with BSD 3-Clause "New" or "Revised" License | 4 votes |
@Override protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { TabContentPaneBorderKind kind = SubstanceCoreUtilities.getContentBorderKind(this.tabPane); boolean isDouble = (kind == TabContentPaneBorderKind.DOUBLE_FULL) || (kind == TabContentPaneBorderKind.DOUBLE_PLACEMENT); boolean isPlacement = (kind == TabContentPaneBorderKind.SINGLE_PLACEMENT) || (kind == TabContentPaneBorderKind.DOUBLE_PLACEMENT); if (isPlacement) { if (tabPlacement != SwingConstants.BOTTOM) return; } Rectangle selRect = selectedIndex < 0 ? null : this.getTabBounds(selectedIndex, this.calcRect); Graphics2D g2d = (Graphics2D) g.create(); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE); float strokeWidth = SubstanceSizeUtils.getBorderStrokeWidth(); int joinKind = BasicStroke.JOIN_ROUND; int capKind = BasicStroke.CAP_BUTT; g2d.setStroke(new BasicStroke(strokeWidth, capKind, joinKind)); int offset = (int) (strokeWidth / 2.0); int ribbonDelta = (int) Math.ceil(strokeWidth + 1.5f); boolean isUnbroken = (tabPlacement != BOTTOM || selectedIndex < 0 || (selRect.y - 1 > h) || (selRect.x < x || selRect.x > x + w)); x += offset; y += offset; w -= 2 * offset; h -= 2 * offset; // Draw unbroken line if tabs are not on BOTTOM, OR // selected tab is not in run adjacent to content, OR // selected tab is not visible (SCROLL_TAB_LAYOUT) SubstanceColorScheme borderScheme = SubstanceColorSchemeUtilities.getColorScheme( this.tabPane, selectedIndex, ColorSchemeAssociationKind.TAB_BORDER, ComponentState.SELECTED); Color darkShadowColor = SubstanceColorUtilities.getMidBorderColor(borderScheme); if (isUnbroken) { g2d.setColor(this.highlight); g2d.drawLine(x, y + h - 1, x + w, y + h - 1); } else { // Break line to show visual connection to selected tab SubstanceButtonShaper shaper = SubstanceCoreUtilities.getButtonShaper(this.tabPane); int delta = (shaper instanceof ClassicButtonShaper) ? 1 : 0; float borderInsets = SubstanceSizeUtils.getBorderStrokeWidth() / 2.0f; GeneralPath bottomOutline = new GeneralPath(); bottomOutline.moveTo(x, y + h - 1); bottomOutline.lineTo(selRect.x + borderInsets, y + h - 1); int bumpHeight = super.calculateTabHeight(tabPlacement, 0, SubstanceSizeUtils.getComponentFontSize(this.tabPane)) / 2; bottomOutline.lineTo(selRect.x + borderInsets, y + h + bumpHeight); if (selRect.x + selRect.width < x + w) { float selectionEndX = selRect.x + selRect.width - delta - 1 - borderInsets; bottomOutline.lineTo(selectionEndX, y + h - 1 + bumpHeight); bottomOutline.lineTo(selectionEndX, y + h - 1); bottomOutline.lineTo(x + w, y + h - 1); } g2d.setPaint(new GradientPaint(x, y + h - 1, darkShadowColor, x, y + h - 1 + bumpHeight, SubstanceColorUtilities.getAlphaColor(darkShadowColor, 0))); g2d.draw(bottomOutline); } if (isDouble) { if (tabPlacement == BOTTOM) { g2d.setColor(this.highlight); g2d.setColor(darkShadowColor); g2d.drawLine(x, y + h - 1 - ribbonDelta, x + w, y + h - 1 - ribbonDelta); } if (tabPlacement == LEFT) { g2d.setPaint(new GradientPaint(x, y + h - 1, darkShadowColor, x + 4 * ribbonDelta, y + h - 1, this.highlight)); g2d.drawLine(x, y + h - 1, x + 4 * ribbonDelta, y + h - 1); } if (tabPlacement == RIGHT) { g2d.setPaint(new GradientPaint(x + w - 1 - 4 * ribbonDelta, y + h - 1, this.highlight, x + w - 1, y + h - 1, darkShadowColor)); g2d.drawLine(x + w - 1 - 4 * ribbonDelta, y + h - 1, x + w - 1, y + h - 1); } } g2d.dispose(); }
Example #19
Source File: ComboBoxBackgroundDelegate.java From radiance with BSD 3-Clause "New" or "Revised" License | 4 votes |
public static BufferedImage getFullAlphaBackground(JComboBox combo, ButtonModel model, SubstanceFillPainter fillPainter, SubstanceBorderPainter borderPainter, int width, int height) { TransitionAwareUI transitionAwareUI = (TransitionAwareUI) combo.getUI(); StateTransitionTracker.ModelStateInfo modelStateInfo = transitionAwareUI .getTransitionTracker().getModelStateInfo(); ComponentState currState = modelStateInfo.getCurrModelState(); Map<ComponentState, StateTransitionTracker.StateContributionInfo> activeStates = modelStateInfo .getStateContributionMap(); ClassicButtonShaper shaper = ClassicButtonShaper.INSTANCE; int comboFontSize = SubstanceSizeUtils.getComponentFontSize(combo); float radius = SubstanceSizeUtils.getClassicButtonCornerRadius(comboFontSize); SubstanceColorScheme baseFillScheme = SubstanceColorSchemeUtilities.getColorScheme(combo, currState); SubstanceColorScheme baseBorderScheme = SubstanceColorSchemeUtilities.getColorScheme(combo, ColorSchemeAssociationKind.BORDER, currState); HashMapKey keyBase = SubstanceCoreUtilities.getHashKey(width, height, baseFillScheme.getDisplayName(), baseBorderScheme.getDisplayName(), fillPainter.getDisplayName(), borderPainter.getDisplayName(), combo.getClass().getName(), radius, comboFontSize); BufferedImage layerBase = regularBackgrounds.get(keyBase); if (layerBase == null) { layerBase = createBackgroundImage(combo, shaper, fillPainter, borderPainter, width, height, baseFillScheme, baseBorderScheme, radius); regularBackgrounds.put(keyBase, layerBase); } if (currState.isDisabled() || (activeStates.size() == 1)) { return layerBase; } BufferedImage result = SubstanceCoreUtilities.getBlankUnscaledImage(layerBase); Graphics2D g2d = result.createGraphics(); // draw the base layer g2d.drawImage(layerBase, 0, 0, layerBase.getWidth(), layerBase.getHeight(), null); // System.out.println("\nPainting base state " + currState); // draw the other active layers for (Map.Entry<ComponentState, StateTransitionTracker.StateContributionInfo> activeEntry : activeStates .entrySet()) { ComponentState activeState = activeEntry.getKey(); // System.out.println("Painting state " + activeState + "[curr is " // + currState + "] with " + activeEntry.getValue()); if (activeState == currState) continue; float stateContribution = activeEntry.getValue().getContribution(); if (stateContribution > 0.0f) { g2d.setComposite(AlphaComposite.SrcOver.derive(stateContribution)); SubstanceColorScheme fillScheme = SubstanceColorSchemeUtilities .getColorScheme(combo, activeState); SubstanceColorScheme borderScheme = SubstanceColorSchemeUtilities .getColorScheme(combo, ColorSchemeAssociationKind.BORDER, activeState); HashMapKey key = SubstanceCoreUtilities.getHashKey(width, height, fillScheme.getDisplayName(), borderScheme.getDisplayName(), fillPainter.getDisplayName(), borderPainter.getDisplayName(), combo.getClass().getName(), radius, comboFontSize); BufferedImage layer = regularBackgrounds.get(key); if (layer == null) { layer = createBackgroundImage(combo, shaper, fillPainter, borderPainter, width, height, fillScheme, borderScheme, radius); regularBackgrounds.put(key, layer); } g2d.drawImage(layer, 0, 0, layer.getWidth(), layer.getHeight(), null); } } g2d.dispose(); return result; }
Example #20
Source File: RavenSkin.java From radiance with BSD 3-Clause "New" or "Revised" License | 4 votes |
/** * Creates a new <code>Raven</code> skin. */ public RavenSkin() { SubstanceSkin.ColorSchemes schemes = SubstanceSkin.getColorSchemes( this.getClass().getClassLoader().getResourceAsStream( "org/pushingpixels/substance/api/skin/graphite.colorschemes")); SubstanceColorScheme activeScheme = new EbonyColorScheme(); SubstanceColorScheme enabledScheme = new DarkMetallicColorScheme(); SubstanceColorScheme disabledScheme = schemes.get("Raven Disabled"); SubstanceColorSchemeBundle defaultSchemeBundle = new SubstanceColorSchemeBundle( activeScheme, enabledScheme, disabledScheme); // highlight fill scheme + custom alpha for rollover unselected state SubstanceColorScheme highlightScheme = schemes.get("Graphite Highlight"); defaultSchemeBundle.registerHighlightAlpha(0.6f, ComponentState.ROLLOVER_UNSELECTED); defaultSchemeBundle.registerHighlightAlpha(0.8f, ComponentState.SELECTED); defaultSchemeBundle.registerHighlightAlpha(1.0f, ComponentState.ROLLOVER_SELECTED); defaultSchemeBundle.registerHighlightAlpha(0.75f, ComponentState.ARMED, ComponentState.ROLLOVER_ARMED); defaultSchemeBundle.registerHighlightColorScheme(highlightScheme, ComponentState.ROLLOVER_UNSELECTED, ComponentState.SELECTED, ComponentState.ROLLOVER_SELECTED, ComponentState.ARMED, ComponentState.ROLLOVER_ARMED); // highlight border scheme defaultSchemeBundle.registerColorScheme(new EbonyColorScheme(), ColorSchemeAssociationKind.HIGHLIGHT_BORDER, ComponentState .getActiveStates()); // text highlight scheme SubstanceColorScheme textHighlightScheme = schemes.get("Graphite Text Highlight"); defaultSchemeBundle.registerColorScheme(textHighlightScheme, ColorSchemeAssociationKind.HIGHLIGHT_TEXT, ComponentState.SELECTED, ComponentState.ROLLOVER_SELECTED); defaultSchemeBundle.registerColorScheme(highlightScheme, ComponentState.ARMED, ComponentState.ROLLOVER_ARMED); SubstanceColorScheme highlightMarkScheme = schemes .get("Raven Highlight Mark"); defaultSchemeBundle.registerColorScheme(highlightMarkScheme, ColorSchemeAssociationKind.HIGHLIGHT_MARK, ComponentState .getActiveStates()); defaultSchemeBundle.registerAlpha(0.5f, ComponentState.DISABLED_UNSELECTED, ComponentState.DISABLED_SELECTED); defaultSchemeBundle.registerColorScheme(disabledScheme, ComponentState.DISABLED_UNSELECTED); defaultSchemeBundle.registerColorScheme(highlightScheme, ComponentState.DISABLED_SELECTED); SubstanceColorScheme tabHighlightScheme = schemes .get("Graphite Tab Highlight"); defaultSchemeBundle.registerColorScheme(highlightScheme, ComponentState.SELECTED); defaultSchemeBundle.registerColorScheme(tabHighlightScheme, ColorSchemeAssociationKind.TAB, ComponentState.SELECTED); defaultSchemeBundle.registerColorScheme(activeScheme, ColorSchemeAssociationKind.BORDER, ComponentState.SELECTED, ComponentState.ROLLOVER_SELECTED, ComponentState.ROLLOVER_UNSELECTED); SubstanceColorScheme selectedMarkScheme = schemes .get("Raven Selected Mark"); defaultSchemeBundle.registerColorScheme(selectedMarkScheme, ColorSchemeAssociationKind.MARK, ComponentState.SELECTED, ComponentState.ROLLOVER_SELECTED, ComponentState.DISABLED_SELECTED); defaultSchemeBundle.registerColorScheme(selectedMarkScheme, ColorSchemeAssociationKind.MARK, ComponentState.ROLLOVER_UNSELECTED); defaultSchemeBundle.registerColorScheme(activeScheme, ColorSchemeAssociationKind.BORDER, ComponentState.DISABLED_SELECTED); this.registerDecorationAreaSchemeBundle(defaultSchemeBundle, schemes.get("Graphite Background").shade(0.4), DecorationAreaType.NONE); this.registerAsDecorationArea(enabledScheme, DecorationAreaType.PRIMARY_TITLE_PANE, DecorationAreaType.SECONDARY_TITLE_PANE, DecorationAreaType.HEADER, DecorationAreaType.FOOTER, DecorationAreaType.GENERAL, DecorationAreaType.TOOLBAR); this.watermarkScheme = activeScheme.shade(0.4); this.setTabFadeStart(0.18); this.setTabFadeEnd(0.18); this.buttonShaper = new ClassicButtonShaper(); this.fillPainter = new GlassFillPainter(); this.decorationPainter = new ArcDecorationPainter(); this.highlightPainter = new ClassicHighlightPainter(); this.borderPainter = new GlassBorderPainter(); }
Example #21
Source File: BusinessAccentedSkin.java From radiance with BSD 3-Clause "New" or "Revised" License | 4 votes |
/** * Creates a new accented <code>Business</code> skin. */ protected BusinessAccentedSkin(AccentBuilder accentBuilder) { super(accentBuilder); ColorSchemes businessSchemes = SubstanceSkin.getColorSchemes( this.getClass().getClassLoader().getResourceAsStream( "org/pushingpixels/substance/api/skin/business.colorschemes")); SubstanceColorScheme enabledScheme = businessSchemes.get("Business Enabled"); SubstanceColorSchemeBundle defaultSchemeBundle = new SubstanceColorSchemeBundle( this.getActiveControlsAccent(), enabledScheme, enabledScheme); defaultSchemeBundle.registerHighlightColorScheme(this.getHighlightsAccent()); defaultSchemeBundle.registerAlpha(0.5f, ComponentState.DISABLED_UNSELECTED, ComponentState.DISABLED_SELECTED); defaultSchemeBundle.registerColorScheme(enabledScheme, ComponentState.DISABLED_UNSELECTED); defaultSchemeBundle.registerColorScheme(this.getActiveControlsAccent(), ComponentState.DISABLED_SELECTED, ComponentState.SELECTED); defaultSchemeBundle.registerColorScheme(this.getActiveControlsAccent(), ColorSchemeAssociationKind.TAB, ComponentState.SELECTED, ComponentState.ROLLOVER_SELECTED); this.registerDecorationAreaSchemeBundle(defaultSchemeBundle, DecorationAreaType.NONE); this.registerAsDecorationArea(this.getWindowChromeAccent(), DecorationAreaType.PRIMARY_TITLE_PANE, DecorationAreaType.SECONDARY_TITLE_PANE, DecorationAreaType.HEADER, DecorationAreaType.FOOTER); ColorSchemes kitchenSinkSchemes = SubstanceSkin.getColorSchemes( this.getClass().getClassLoader().getResourceAsStream( "org/pushingpixels/substance/api/skin/kitchen-sink.colorschemes")); this.registerAsDecorationArea(kitchenSinkSchemes.get("LightGray General Background"), DecorationAreaType.GENERAL); // add an overlay painter to paint a drop shadow along the top edge of toolbars this.addOverlayPainter(TopShadowOverlayPainter.getInstance(80), DecorationAreaType.TOOLBAR); // add an overlay painter to paint separator lines along the bottom // edges of title panes and menu bars BottomLineOverlayPainter bottomLineOverlayPainter = new BottomLineOverlayPainter( ColorSchemeSingleColorQuery.MID); this.addOverlayPainter(bottomLineOverlayPainter, DecorationAreaType.HEADER); this.buttonShaper = new ClassicButtonShaper(); this.fillPainter = new ClassicFillPainter(); this.borderPainter = new ClassicBorderPainter(); BrushedMetalDecorationPainter decorationPainter = new BrushedMetalDecorationPainter(); decorationPainter.setBaseDecorationPainter(new ArcDecorationPainter()); decorationPainter.setTextureAlpha(0.2f); this.decorationPainter = decorationPainter; this.highlightPainter = new ClassicHighlightPainter(); }
Example #22
Source File: SeaGlassSkin.java From radiance with BSD 3-Clause "New" or "Revised" License | 4 votes |
/** * Creates a new <code>Gemini</code> skin. */ public SeaGlassSkin() { SubstanceSkin.ColorSchemes schemes = SubstanceSkin.getColorSchemes( this.getClass().getClassLoader().getResourceAsStream( "org/pushingpixels/demo/spyglass/seaglass/skin/seaglass.colorschemes")); SubstanceColorScheme activeScheme = schemes.get("Sea Glass Active"); SubstanceColorScheme enabledScheme = schemes.get("Sea Glass Enabled"); SubstanceColorScheme disabledScheme = schemes.get("Sea Glass Disabled"); SubstanceColorSchemeBundle defaultSchemeBundle = new SubstanceColorSchemeBundle( activeScheme, enabledScheme, disabledScheme); // borders SubstanceColorScheme activeBorderScheme = schemes .get("Sea Glass Active Border"); SubstanceColorScheme enabledBorderScheme = schemes .get("Sea Glass Enabled Border"); SubstanceColorScheme disabledBorderScheme = schemes .get("Sea Glass Enabled Border"); defaultSchemeBundle.registerColorScheme(enabledBorderScheme, ColorSchemeAssociationKind.BORDER, ComponentState.ENABLED); defaultSchemeBundle.registerColorScheme(activeBorderScheme, ColorSchemeAssociationKind.BORDER, ComponentState.DEFAULT); defaultSchemeBundle.registerColorScheme(disabledBorderScheme, ColorSchemeAssociationKind.BORDER, ComponentState.DISABLED_DEFAULT, ComponentState.DISABLED_SELECTED, ComponentState.DISABLED_UNSELECTED); // states SubstanceColorScheme defaultScheme = schemes.get("Sea Glass Default"); SubstanceColorScheme defaultBorderScheme = schemes .get("Sea Glass Default Border"); defaultSchemeBundle.registerColorScheme(defaultScheme, ComponentState.DEFAULT); defaultSchemeBundle.registerColorScheme(defaultBorderScheme, ColorSchemeAssociationKind.BORDER, ComponentState.DEFAULT); SubstanceColorScheme pressedScheme = schemes.get("Sea Glass Pressed"); SubstanceColorScheme pressedBorderScheme = schemes .get("Sea Glass Pressed Border"); defaultSchemeBundle.registerColorScheme(pressedScheme, ComponentState.PRESSED_SELECTED, ComponentState.PRESSED_UNSELECTED); defaultSchemeBundle.registerColorScheme(pressedBorderScheme, ColorSchemeAssociationKind.BORDER, ComponentState.PRESSED_SELECTED, ComponentState.PRESSED_UNSELECTED); SubstanceColorScheme selectedScheme = schemes.get("Sea Glass Selected"); SubstanceColorScheme selectedBorderScheme = schemes .get("Sea Glass Selected Border"); defaultSchemeBundle.registerColorScheme(selectedScheme, ComponentState.SELECTED, ComponentState.ROLLOVER_SELECTED); defaultSchemeBundle.registerColorScheme(selectedBorderScheme, ColorSchemeAssociationKind.BORDER, ComponentState.SELECTED, ComponentState.ROLLOVER_SELECTED); SubstanceColorScheme backgroundScheme = schemes .get("Sea Glass Background"); this.registerDecorationAreaSchemeBundle(defaultSchemeBundle, backgroundScheme, DecorationAreaType.NONE); this.registerAsDecorationArea(activeScheme, DecorationAreaType.PRIMARY_TITLE_PANE); this.addOverlayPainter(new BottomLineOverlayPainter( new ColorSchemeSingleColorQuery() { @Override public Color query(SubstanceColorScheme scheme) { return scheme.getDarkColor().darker(); } }), DecorationAreaType.PRIMARY_TITLE_PANE); this.buttonShaper = new ClassicButtonShaper(); this.watermark = null; this.fillPainter = new FractionBasedFillPainter("Sea Glass", new float[] { 0.0f, 0.49999f, 0.5f, 0.65f, 1.0f }, new ColorSchemeSingleColorQuery[] { ColorSchemeSingleColorQuery.EXTRALIGHT, ColorSchemeSingleColorQuery.LIGHT, ColorSchemeSingleColorQuery.MID, ColorSchemeSingleColorQuery.LIGHT, ColorSchemeSingleColorQuery.ULTRALIGHT }); this.decorationPainter = new MatteDecorationPainter(); this.highlightPainter = new ClassicHighlightPainter(); this.borderPainter = new FractionBasedBorderPainter("Sea Glass", new float[] { 0.0f, 0.5f, 1.0f }, new ColorSchemeSingleColorQuery[] { ColorSchemeSingleColorQuery.MID, ColorSchemeSingleColorQuery.DARK, ColorSchemeSingleColorQuery.ULTRADARK }); this.highlightBorderPainter = new ClassicBorderPainter(); }
Example #23
Source File: VisorSkin.java From radiance with BSD 3-Clause "New" or "Revised" License | 4 votes |
/** * Creates a new <code>Visor</code> skin. */ public VisorSkin() { ColorSchemes visorSchemes = SubstanceSkin.getColorSchemes( this.getClass().getClassLoader().getResourceAsStream( "org/pushingpixels/demo/spyglass/mail/skin/visor.colorschemes")); SubstanceColorScheme activeScheme = visorSchemes.get("Visor Active"); SubstanceColorScheme enabledScheme = visorSchemes.get("Visor Enabled"); SubstanceColorScheme disabledScheme = visorSchemes.get("Visor Disabled"); SubstanceColorSchemeBundle defaultSchemeBundle = new SubstanceColorSchemeBundle( activeScheme, enabledScheme, disabledScheme); defaultSchemeBundle.registerAlpha(0.5f, ComponentState.DISABLED_SELECTED); defaultSchemeBundle.registerColorScheme(activeScheme, ComponentState.DISABLED_SELECTED); this.registerDecorationAreaSchemeBundle(defaultSchemeBundle, DecorationAreaType.NONE); SubstanceColorScheme activeDestinationsScheme = visorSchemes.get("Visor Active Destinations"); SubstanceColorScheme enabledDestinationsScheme = visorSchemes.get("Visor Enabled Destinations"); SubstanceColorSchemeBundle destinationsSchemeBundle = new SubstanceColorSchemeBundle( activeDestinationsScheme, enabledDestinationsScheme, disabledScheme); destinationsSchemeBundle.registerAlpha(0.7f, ComponentState.DISABLED_UNSELECTED); destinationsSchemeBundle.registerColorScheme(enabledDestinationsScheme, ComponentState.DISABLED_UNSELECTED); // use SunGlare for destinations highlights SubstanceColorScheme destinationsHighlight = new SunGlareColorScheme(); destinationsSchemeBundle.registerAlpha(0.75f, ComponentState.ROLLOVER_UNSELECTED); destinationsSchemeBundle.registerHighlightColorScheme(destinationsHighlight, ComponentState.ROLLOVER_UNSELECTED); destinationsSchemeBundle.registerAlpha(0.9f, ComponentState.SELECTED); destinationsSchemeBundle.registerHighlightColorScheme(destinationsHighlight, ComponentState.SELECTED); destinationsSchemeBundle.registerAlpha(1.0f, ComponentState.ROLLOVER_SELECTED); destinationsSchemeBundle.registerHighlightColorScheme(destinationsHighlight, ComponentState.ROLLOVER_SELECTED); destinationsSchemeBundle.registerAlpha(0.8f, ComponentState.ARMED, ComponentState.ROLLOVER_ARMED); destinationsSchemeBundle.registerHighlightColorScheme(destinationsHighlight, ComponentState.ARMED, ComponentState.ROLLOVER_ARMED); // use Terracotta for borders of destinations highlights destinationsSchemeBundle.registerColorScheme(new TerracottaColorScheme(), SubstanceSlices.ColorSchemeAssociationKind.HIGHLIGHT_BORDER, ComponentState.getActiveStates()); this.registerDecorationAreaSchemeBundle(destinationsSchemeBundle, VisorMail.DESTINATIONS); SubstanceColorSchemeBundle threadsSchemeBundle = new SubstanceColorSchemeBundle( activeScheme, enabledScheme, disabledScheme); threadsSchemeBundle.registerAlpha(0.5f, ComponentState.DISABLED_SELECTED); threadsSchemeBundle.registerColorScheme(activeScheme, ComponentState.DISABLED_SELECTED); // Configure white-on-dark-blue highlights for the threads view SubstanceColorScheme threadsHighlight = visorSchemes.get("Visor Threads Highlight"); SubstanceColorScheme threadsHighlightLight = visorSchemes.get("Visor Threads Highlight Light"); threadsSchemeBundle.registerAlpha(1.0f, ComponentState.ROLLOVER_UNSELECTED); threadsSchemeBundle.registerHighlightColorScheme(threadsHighlightLight, ComponentState.ROLLOVER_UNSELECTED); threadsSchemeBundle.registerAlpha(0.9f, ComponentState.SELECTED); threadsSchemeBundle.registerHighlightColorScheme(threadsHighlight, ComponentState.SELECTED); threadsSchemeBundle.registerAlpha(1.0f, ComponentState.ROLLOVER_SELECTED); threadsSchemeBundle.registerHighlightColorScheme(threadsHighlight, ComponentState.ROLLOVER_SELECTED); threadsSchemeBundle.registerAlpha(0.8f, ComponentState.ARMED, ComponentState.ROLLOVER_ARMED); threadsSchemeBundle.registerHighlightColorScheme(threadsHighlight, ComponentState.ARMED, ComponentState.ROLLOVER_ARMED); this.registerDecorationAreaSchemeBundle(threadsSchemeBundle, VisorMail.THREADS); this.buttonShaper = new ClassicButtonShaper(); this.fillPainter = new ClassicFillPainter(); this.borderPainter = new ClassicBorderPainter(); BrushedMetalDecorationPainter decorationPainter = new BrushedMetalDecorationPainter(); decorationPainter.setBaseDecorationPainter(new ArcDecorationPainter()); decorationPainter.setTextureAlpha(0.3f); this.decorationPainter = decorationPainter; this.highlightPainter = new FractionBasedHighlightPainter( "Visor Highlight", new float[] { 0.0f, 1.0f }, new ColorSchemeSingleColorQuery[] { ColorSchemeSingleColorQuery.EXTRALIGHT, ColorSchemeSingleColorQuery.EXTRALIGHT }); this.borderPainter = new ClassicBorderPainter(); }