@Override
protected void onPropertyChange( JXHeader h, String propertyName, Object oldValue, Object newValue ) {
super.onPropertyChange( h, propertyName, oldValue, newValue );
if( "iconPosition".equals( propertyName ) )
scaleLayout( h );
}
private void scaleLayout( JXHeader header ) {
if( UIScale.getUserScaleFactor() == 1f )
return;
LayoutManager layout = header.getLayout();
if( !(layout instanceof GridBagLayout) )
return;
GridBagLayout gbl = (GridBagLayout) layout;
for( Component c : header.getComponents() ) {
GridBagConstraints cons = gbl.getConstraints( c );
cons.insets = UIScale.scale( cons.insets );
gbl.setConstraints( c, cons );
}
}
@Override
protected void installComponents( JXHeader header ) {
super.installComponents( header );
scaleLayout( header );
}