public static SimpleTheme makeTheme ( boolean activeIsBold , TextColor baseForeground , TextColor baseBackground , TextColor editableForeground , TextColor editableBackground , TextColor selectedForeground , TextColor selectedBackground , TextColor guiBackground ) { SGR [ ] activeStyle = activeIsBold ? new SGR [ ] { SGR . BOLD } : new SGR [ 0 ] ; SimpleTheme theme = new SimpleTheme ( baseForeground , baseBackground ) ; theme . getDefaultDefinition ( ) . setSelected ( baseBackground , baseForeground , activeStyle ) ; theme . getDefaultDefinition ( ) . setActive ( selectedForeground , selectedBackground , activeStyle ) ; theme . addOverride ( AbstractBorder . class , baseForeground , baseBackground ) . setSelected ( baseForeground , baseBackground , activeStyle ) ; theme . addOverride ( AbstractListBox . class , baseForeground , baseBackground ) . setSelected ( selectedForeground , selectedBackground , activeStyle ) ; theme . addOverride ( Button . class , baseForeground , baseBackground ) . setActive ( selectedForeground , selectedBackground , activeStyle ) . setSelected ( selectedForeground , selectedBackground , activeStyle ) ; theme . addOverride ( CheckBox . class , baseForeground , baseBackground ) . setActive ( selectedForeground , selectedBackground , activeStyle ) . setPreLight ( selectedForeground , selectedBackground , activeStyle ) . setSelected ( selectedForeground , selectedBackground , activeStyle ) ; theme . addOverride ( CheckBoxList . class , baseForeground , baseBackground ) . setActive ( selectedForeground , selectedBackground , activeStyle ) ; theme . addOverride ( ComboBox . class , baseForeground , baseBackground ) . setActive ( editableForeground , editableBackground , activeStyle ) . setPreLight ( editableForeground , editableBackground ) ; theme . addOverride ( DefaultWindowDecorationRenderer . class , baseForeground , baseBackground ) . setActive ( baseForeground , baseBackground , activeStyle ) ; theme . addOverride ( GUIBackdrop . class , baseForeground , guiBackground ) ; theme . addOverride ( RadioBoxList . class , baseForeground , baseBackground ) . setActive ( selectedForeground , selectedBackground , activeStyle ) ; theme . addOverride ( Table . class , baseForeground , baseBackground ) . setActive ( editableForeground , editableBackground , activeStyle ) . setSelected ( baseForeground , baseBackground ) ; theme . addOverride ( TextBox . class , editableForeground , editableBackground ) . setActive ( editableForeground , editableBackground , activeStyle ) . setSelected ( editableForeground , editableBackground , activeStyle ) ; theme . setWindowPostRenderer ( new WindowShadowRenderer ( ) ) ; return theme ; }
Helper method that will quickly setup a new theme with some sensible component overrides .