Styling: renamed "update" methods

This commit is contained in:
Karl Tauber
2021-06-21 20:49:31 +02:00
parent 14b06507cb
commit 24a9fa1ccc
4 changed files with 15 additions and 15 deletions

View File

@@ -58,7 +58,7 @@ public class FlatArrowButton
Color hoverForeground, Color hoverBackground, Color pressedForeground, Color pressedBackground ) Color hoverForeground, Color hoverBackground, Color pressedForeground, Color pressedBackground )
{ {
super( direction, Color.WHITE, Color.WHITE, Color.WHITE, Color.WHITE ); super( direction, Color.WHITE, Color.WHITE, Color.WHITE, Color.WHITE );
update( type, foreground, disabledForeground, hoverForeground, hoverBackground, updateStyle( type, foreground, disabledForeground, hoverForeground, hoverBackground,
pressedForeground, pressedBackground ); pressedForeground, pressedBackground );
setOpaque( false ); setOpaque( false );
@@ -98,7 +98,7 @@ public class FlatArrowButton
/** /**
* @since TODO * @since TODO
*/ */
public void update( String type, Color foreground, Color disabledForeground, public void updateStyle( String type, Color foreground, Color disabledForeground,
Color hoverForeground, Color hoverBackground, Color pressedForeground, Color pressedBackground ) Color hoverForeground, Color hoverBackground, Color pressedForeground, Color pressedBackground )
{ {
this.chevron = FlatUIUtils.isChevron( type ); this.chevron = FlatUIUtils.isChevron( type );

View File

@@ -222,9 +222,9 @@ public class FlatScrollBarUI
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty ); oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
if( incrButton instanceof FlatScrollBarButton ) if( incrButton instanceof FlatScrollBarButton )
((FlatScrollBarButton)incrButton).update(); ((FlatScrollBarButton)incrButton).updateStyle();
if( decrButton instanceof FlatScrollBarButton ) if( decrButton instanceof FlatScrollBarButton )
((FlatScrollBarButton)decrButton).update(); ((FlatScrollBarButton)decrButton).updateStyle();
} }
/** /**
@@ -424,8 +424,8 @@ public class FlatScrollBarUI
setRequestFocusEnabled( false ); setRequestFocusEnabled( false );
} }
protected void update() { protected void updateStyle() {
update( arrowType, buttonArrowColor, buttonDisabledArrowColor, updateStyle( arrowType, buttonArrowColor, buttonDisabledArrowColor,
null, hoverButtonBackground, null, pressedButtonBackground ); null, hoverButtonBackground, null, pressedButtonBackground );
} }

View File

@@ -189,7 +189,7 @@ public class FlatSpinnerUI
*/ */
protected void applyStyle( Object style ) { protected void applyStyle( Object style ) {
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty ); oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
updateArrowButtons(); updateArrowButtonsStyle();
} }
/** /**
@@ -309,10 +309,10 @@ public class FlatSpinnerUI
return button; return button;
} }
private void updateArrowButtons() { private void updateArrowButtonsStyle() {
for( Component c : spinner.getComponents() ) { for( Component c : spinner.getComponents() ) {
if( c instanceof FlatArrowButton ) { if( c instanceof FlatArrowButton ) {
((FlatArrowButton)c).update( arrowType, buttonArrowColor, ((FlatArrowButton)c).updateStyle( arrowType, buttonArrowColor,
buttonDisabledArrowColor, buttonHoverArrowColor, null, buttonPressedArrowColor, null ); buttonDisabledArrowColor, buttonHoverArrowColor, null, buttonPressedArrowColor, null );
} }
} }

View File

@@ -140,7 +140,7 @@ public class FlatSplitPaneUI
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty ); oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
if( divider instanceof FlatSplitPaneDivider ) if( divider instanceof FlatSplitPaneDivider )
((FlatSplitPaneDivider)divider).updateButtons(); ((FlatSplitPaneDivider)divider).updateStyle();
} }
/** /**
@@ -180,11 +180,11 @@ public class FlatSplitPaneUI
return FlatStyleSupport.applyToAnnotatedObject( this, key, value ); return FlatStyleSupport.applyToAnnotatedObject( this, key, value );
} }
void updateButtons() { void updateStyle() {
if( leftButton instanceof FlatOneTouchButton ) if( leftButton instanceof FlatOneTouchButton )
((FlatOneTouchButton)leftButton).update(); ((FlatOneTouchButton)leftButton).updateStyle();
if( rightButton instanceof FlatOneTouchButton ) if( rightButton instanceof FlatOneTouchButton )
((FlatOneTouchButton)rightButton).update(); ((FlatOneTouchButton)rightButton).updateStyle();
} }
@Override @Override
@@ -267,8 +267,8 @@ public class FlatSplitPaneUI
this.left = left; this.left = left;
} }
protected void update() { protected void updateStyle() {
update( arrowType, oneTouchArrowColor, null, updateStyle( arrowType, oneTouchArrowColor, null,
oneTouchHoverArrowColor, null, oneTouchPressedArrowColor, null ); oneTouchHoverArrowColor, null, oneTouchPressedArrowColor, null );
} }