new app icon

This commit is contained in:
Jindra Petřík
2016-01-03 14:34:27 +01:00
parent e5bdb1075f
commit 78a10afcef
3 changed files with 57 additions and 16 deletions

View File

@@ -21,6 +21,7 @@ import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.LinearGradientPaint;
import java.awt.MultipleGradientPaint;
import java.awt.RadialGradientPaint;
import java.awt.RenderingHints;
@@ -85,13 +86,27 @@ public class MyRibbonApplicationMenuButtonUI extends BasicRibbonApplicationMenuB
g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
SubstanceSkin skin = SubstanceLookAndFeel.getCurrentSkin();
g2.setPaint(new RadialGradientPaint(getIconWidth() / 2.0f, getIconHeight() / 2.0f, getIconWidth() / 2.0f, new float[]{0.32f, 0.84f, 1f}, new Color[]{
skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.HIGHLIGHT, ComponentState.ENABLED).shiftBackground(Color.white, 0.5).getUltraLightColor(),
skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED).getMidColor(),
skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.BORDER, ComponentState.ENABLED).getUltraDarkColor()
}, MultipleGradientPaint.CycleMethod.NO_CYCLE));
Color darkColor = skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.BORDER, ComponentState.ENABLED).getUltraDarkColor();
Color lightColor = skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.HIGHLIGHT, ComponentState.ENABLED).shiftBackground(Color.white, 0.5).getUltraLightColor();
Color midColor = skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED).getMidColor();
g2.setPaint(new LinearGradientPaint(0, 0, 0, getIconHeight(), new float[]{0f, 0.5f, 1f}, new Color[]{lightColor, midColor, darkColor}, MultipleGradientPaint.CycleMethod.NO_CYCLE));
Shape s = new Ellipse2D.Double(x, y, getIconWidth(), getIconHeight());
g2.fill(s);
float border = (0.0625f * getIconWidth());
float wborder = (0.00625f * getIconWidth());
g2.setPaint(lightColor);
s = new Ellipse2D.Double(x + border, y + border, getIconWidth() - 2 * border, getIconHeight() - 2 * border);
g2.fill(s);
g2.setPaint(new RadialGradientPaint(getIconWidth() / 2.0f, getIconHeight() / 2.0f, getIconWidth() / 2.0f - border - wborder, new float[]{0.2f, 1f}, new Color[]{lightColor, midColor}, MultipleGradientPaint.CycleMethod.NO_CYCLE));
s = new Ellipse2D.Double(x + border + wborder, y + border + wborder, getIconWidth() - 2 * border - 2 * wborder, getIconHeight() - 2 * border - 2 * wborder);
g2.fill(s);
g2.setPaint(skin.getEnabledColorScheme(DecorationAreaType.PRIMARY_TITLE_PANE).getMidColor());
super.paintIcon(c, g, x, y);
}
@@ -106,13 +121,25 @@ public class MyRibbonApplicationMenuButtonUI extends BasicRibbonApplicationMenuB
g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
SubstanceSkin skin = SubstanceLookAndFeel.getCurrentSkin();
g2.setPaint(new RadialGradientPaint(getIconWidth() / 2, getIconHeight() / 2, getIconWidth() / 2, new float[]{0.32f, 0.84f, 1f}, new Color[]{
skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.HIGHLIGHT, ComponentState.ROLLOVER_UNSELECTED)/*.shiftBackground(Color.white, 0.8)*/.getUltraLightColor(),
skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.FILL, ComponentState.ROLLOVER_UNSELECTED).getMidColor(),
skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.BORDER, ComponentState.ROLLOVER_UNSELECTED)/*.shiftBackground(new Color(0x7c, 0x7c, 0x7c), 0.8)*/.getUltraDarkColor()
}, MultipleGradientPaint.CycleMethod.NO_CYCLE));
Color lightColor = skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.HIGHLIGHT, ComponentState.ROLLOVER_UNSELECTED)/*.shiftBackground(Color.white, 0.8)*/.getUltraLightColor();
Color midColor = skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.FILL, ComponentState.ROLLOVER_UNSELECTED).getMidColor();
Color darkColor = skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.BORDER, ComponentState.ROLLOVER_UNSELECTED)/*.shiftBackground(new Color(0x7c, 0x7c, 0x7c), 0.8)*/.getUltraDarkColor();
g2.setPaint(new LinearGradientPaint(0, 0, 0, getIconHeight(), new float[]{0f, 0.5f, 1f}, new Color[]{lightColor, midColor, darkColor}, MultipleGradientPaint.CycleMethod.NO_CYCLE));
Shape s = new Ellipse2D.Double(x, y, getIconWidth(), getIconHeight());
g2.fill(s);
float border = (0.0625f * getIconWidth());
float wborder = (0.00625f * getIconWidth());
g2.setPaint(lightColor);
s = new Ellipse2D.Double(x + border, y + border, getIconWidth() - 2 * border, getIconHeight() - 2 * border);
g2.fill(s);
g2.setPaint(new RadialGradientPaint(getIconWidth() / 2.0f, getIconHeight() / 2.0f, getIconWidth() / 2.0f - border - wborder, new float[]{0.2f, 1f}, new Color[]{lightColor, midColor}, MultipleGradientPaint.CycleMethod.NO_CYCLE));
s = new Ellipse2D.Double(x + border + wborder, y + border + wborder, getIconWidth() - 2 * border - 2 * wborder, getIconHeight() - 2 * border - 2 * wborder);
g2.fill(s);
super.paintIcon(c, g, x, y);
}
},
@@ -126,13 +153,27 @@ public class MyRibbonApplicationMenuButtonUI extends BasicRibbonApplicationMenuB
g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
SubstanceSkin skin = SubstanceLookAndFeel.getCurrentSkin();
g2.setPaint(new RadialGradientPaint(getIconWidth() / 2, getIconHeight() / 2, getIconWidth() / 2, new float[]{0.2f, 0.5f, 0.8f}, new Color[]{
skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.FILL, ComponentState.ROLLOVER_SELECTED).getUltraLightColor(),
skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.FILL, ComponentState.ROLLOVER_SELECTED).getMidColor(),
skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.FILL, ComponentState.ROLLOVER_SELECTED).shiftBackground(Color.black, 0.7).getUltraDarkColor()
}, MultipleGradientPaint.CycleMethod.NO_CYCLE));
Color lightColor = skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.FILL, ComponentState.ROLLOVER_SELECTED).getUltraLightColor();
Color midColor = skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.FILL, ComponentState.ROLLOVER_SELECTED).getMidColor();
Color darkColor = skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.FILL, ComponentState.ROLLOVER_SELECTED).shiftBackground(Color.black, 0.7).getUltraDarkColor();
g2.setPaint(new LinearGradientPaint(0, 0, 0, getIconHeight(), new float[]{0f, 0.5f, 1f}, new Color[]{lightColor, midColor, darkColor}, MultipleGradientPaint.CycleMethod.NO_CYCLE));
Shape s = new Ellipse2D.Double(x, y, getIconWidth(), getIconHeight());
g2.fill(s);
float border = (0.0625f * getIconWidth());
float wborder = (0.00625f * getIconWidth());
g2.setPaint(lightColor);
s = new Ellipse2D.Double(x + border, y + border, getIconWidth() - 2 * border, getIconHeight() - 2 * border);
g2.fill(s);
g2.setPaint(new RadialGradientPaint(getIconWidth() / 2.0f, getIconHeight() / 2.0f, getIconWidth() / 2.0f - border - wborder, new float[]{0.2f, 1f}, new Color[]{lightColor, midColor}, MultipleGradientPaint.CycleMethod.NO_CYCLE));
s = new Ellipse2D.Double(x + border + wborder, y + border + wborder, getIconWidth() - 2 * border - 2 * wborder, getIconHeight() - 2 * border - 2 * wborder);
g2.fill(s);
AffineTransform origt = g2.getTransform();
AffineTransform t = (AffineTransform) origt.clone();
t.translate(-getIconWidth() / 2, -getIconHeight() / 2);

View File

@@ -133,7 +133,7 @@ public class JPersistentSplitPane extends JSplitPane {
return;
}
if (getLeftComponent().isVisible() && getRightComponent().isVisible()) {
if (getLeftComponent() != null && getRightComponent() != null && getLeftComponent().isVisible() && getRightComponent().isVisible()) {
JPersistentSplitPane pane = (JPersistentSplitPane) pce.getSource();
double size = (getOrientation() == JSplitPane.HORIZONTAL_SPLIT
? pane.getWidth() : pane.getHeight()) - pane.getDividerSize();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 12 KiB