mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-09 16:25:10 +03:00
Styling: FlatMenuItemArrowIcon no longer extends FlatMenuArrowIcon because it does not paint anything and therefore should not inherit styling properties from FlatMenuArrowIcon
This commit is contained in:
@@ -21,14 +21,16 @@ import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
|
||||
/**
|
||||
* "arrow" icon for {@link javax.swing.JMenuItem}.
|
||||
* "arrow" icon for {@link javax.swing.JMenuItem}, {@link javax.swing.JCheckBoxMenuItem}
|
||||
* and {@link javax.swing.JRadioButtonMenuItem}.
|
||||
*
|
||||
* @author Karl Tauber
|
||||
*/
|
||||
public class FlatMenuItemArrowIcon
|
||||
extends FlatMenuArrowIcon
|
||||
extends FlatAbstractIcon
|
||||
{
|
||||
public FlatMenuItemArrowIcon() {
|
||||
super( 6, 10, null );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -301,7 +301,6 @@ public class TestFlatStyleableInfo
|
||||
|
||||
Map<String, Class<?>> expected = new LinkedHashMap<>();
|
||||
menuItem( expected );
|
||||
menuItem_arrowIcon( expected );
|
||||
|
||||
assertMapEquals( expected, ui.getStyleableInfos( c ) );
|
||||
}
|
||||
@@ -314,7 +313,6 @@ public class TestFlatStyleableInfo
|
||||
Map<String, Class<?>> expected = new LinkedHashMap<>();
|
||||
menuItem( expected );
|
||||
menuItem_checkIcon( expected );
|
||||
menuItem_arrowIcon( expected );
|
||||
|
||||
assertMapEquals( expected, ui.getStyleableInfos( c ) );
|
||||
}
|
||||
@@ -327,7 +325,6 @@ public class TestFlatStyleableInfo
|
||||
Map<String, Class<?>> expected = new LinkedHashMap<>();
|
||||
menuItem( expected );
|
||||
menuItem_checkIcon( expected );
|
||||
menuItem_arrowIcon( expected );
|
||||
|
||||
assertMapEquals( expected, ui.getStyleableInfos( c ) );
|
||||
}
|
||||
@@ -1147,17 +1144,6 @@ public class TestFlatStyleableInfo
|
||||
assertMapEquals( expected, icon.getStyleableInfos() );
|
||||
}
|
||||
|
||||
@Test
|
||||
void flatMenuItemArrowIcon() {
|
||||
FlatMenuItemArrowIcon icon = new FlatMenuItemArrowIcon();
|
||||
|
||||
// FlatMenuItemArrowIcon extends FlatMenuArrowIcon
|
||||
Map<String, Class<?>> expected = new LinkedHashMap<>();
|
||||
flatMenuArrowIcon( expected );
|
||||
|
||||
assertMapEquals( expected, icon.getStyleableInfos() );
|
||||
}
|
||||
|
||||
private void flatMenuArrowIcon( Map<String, Class<?>> expected ) {
|
||||
expectedMap( expected,
|
||||
"arrowType", String.class,
|
||||
|
||||
@@ -455,7 +455,6 @@ public class TestFlatStyling
|
||||
|
||||
Consumer<String> applyStyle = style -> ui.applyStyle( style );
|
||||
menuItem( applyStyle );
|
||||
menuItem_arrowIcon( applyStyle );
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -466,7 +465,6 @@ public class TestFlatStyling
|
||||
Consumer<String> applyStyle = style -> ui.applyStyle( style );
|
||||
menuItem( applyStyle );
|
||||
menuItem_checkIcon( applyStyle );
|
||||
menuItem_arrowIcon( applyStyle );
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -477,7 +475,6 @@ public class TestFlatStyling
|
||||
Consumer<String> applyStyle = style -> ui.applyStyle( style );
|
||||
menuItem( applyStyle );
|
||||
menuItem_checkIcon( applyStyle );
|
||||
menuItem_arrowIcon( applyStyle );
|
||||
}
|
||||
|
||||
private void menuItem( Consumer<String> applyStyle ) {
|
||||
@@ -1366,18 +1363,6 @@ public class TestFlatStyling
|
||||
void flatMenuArrowIcon() {
|
||||
FlatMenuArrowIcon icon = new FlatMenuArrowIcon();
|
||||
|
||||
flatMenuArrowIcon( icon );
|
||||
}
|
||||
|
||||
@Test
|
||||
void flatMenuItemArrowIcon() {
|
||||
FlatMenuItemArrowIcon icon = new FlatMenuItemArrowIcon();
|
||||
|
||||
// FlatMenuItemArrowIcon extends FlatMenuArrowIcon
|
||||
flatMenuArrowIcon( icon );
|
||||
}
|
||||
|
||||
private void flatMenuArrowIcon( FlatMenuArrowIcon icon ) {
|
||||
icon.applyStyleProperty( "arrowType", "chevron" );
|
||||
icon.applyStyleProperty( "arrowColor", Color.WHITE );
|
||||
icon.applyStyleProperty( "disabledArrowColor", Color.WHITE );
|
||||
|
||||
Reference in New Issue
Block a user