Package org.vanted.scaling
Class ScalingCoordinator
java.lang.Object
org.vanted.scaling.ScalingCoordinator
public class ScalingCoordinator extends Object
It coordinates the scaling among the possible L&Fs and initiates Components-
scaling. Through delegation the main types are ordered and then accordingly
scaled. First LAF-Defaults, afterwards all the user-set resizable components.
Big Scale Operations (e.g. DPI-Scale factor of 50) require additional heap space!
- Author:
- D. Garkov
-
Constructor Summary
Constructors Constructor Description ScalingCoordinator()Empty Coordinator.ScalingCoordinator(float factor, Container main)ScalingCoordinator(Container main)This uses the preferences-stored factor.ScalingCoordinator(Container main, boolean components) -
Method Summary
Modifier and Type Method Description voidadjustDefaults(Scaler delegate)Scan Defaults and re-scale the appropriate values.static voidrefreshGUI(Container main)Call after each major scaling operation.voidscaleComponents(float factor, Container main)Scales JComponents.voidscaleDefaults(float factor)Scaling Look & Feel Defaults.
-
Constructor Details
-
ScalingCoordinator
- Parameters:
factor- the processed Slider valuemain- the main container
-
ScalingCoordinator
This uses the preferences-stored factor. Suitable for initial modifications.- Parameters:
main- the main container
-
ScalingCoordinator
- Parameters:
main- the main containercomponents- false: scale LAF Defaults only
-
ScalingCoordinator
public ScalingCoordinator()Empty Coordinator. You should refresh the GUI thereafter by yourself.
-
-
Method Details
-
scaleDefaults
public void scaleDefaults(float factor)Scaling Look & Feel Defaults.- Parameters:
factor- the required new DPI Factor, from which a scaling ratio would be constructed.
-
adjustDefaults
Scan Defaults and re-scale the appropriate values. Important Note: To scale any added defaults, these must be added to theUIManager.getLookAndFeelDefaults().- Parameters:
delegate-
-
scaleComponents
Scales JComponents.- Parameters:
factor- the scaling ratio from system DPI & requested DPI
-
refreshGUI
Call after each major scaling operation.- Parameters:
main- the main container
-