Package anlavn.ui
Class Mode
java.lang.Object
anlavn.ui.Mode
The Mode class supports change mode from light to dark, component from nimbus to windows look and feel.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ColorUse this method to get background color at current Mode.static ColorUse this method to get background color at dark Mode.static ColorUse this method to get background color at light Mode.static booleangetMode()Use this method to get current Mode.static ColorUse this method to get Text color at current Mode.static ColorUse this method to get text color at dark Mode.static ColorUse this method to get text color at light Mode.static voidsetBackColor(Color BackDarkMode, Color BackLightMode) Use this method to custom Color of Background in 2 case Dark and Light.static voidsetMode(boolean MODE) Use this method to set Mode for UI.static voidsetModeComponent(Component component) Use this method to change Mode for a Component.static voidsetModeComponent(Component... components) Use this method to change Mode for Components.static voidsetTextColor(Color TextDarkMode, Color TextLightMode) Use this method to custom Color of Text in 2 case Dark and Light.static JCheckBoxUse this method to change Check Box into Windows Look and Feel.static JComboBoxUse this method to change Combo Box into Windows Look and Feel.static intUse this method to brings up a Confirm dialog with the options "Yes, No and Cancel".static intUse this method to brings up a Confirm dialog, where the number of choices is determined by the optionType parameter.static intUse this method to brings up a Confirm dialog, with all parameters and default icon.static intWConfirm(Component parentComponent, Object message, String title, int optionType, int messageType, Icon icon) Use this method to brings up a Confirm dialog, with all parameters.static JFileChooserUse this method to change File Chooser into Windows Look and Feel.static StringUse this method to brings up a Input dialog, displayed on top of theComponent.static StringUse this method to brings up a Input dialog, havetittleandmessageType.static StringUse this method to brings up a Input dialog, shows a questionmessage.static voidUse this method to brings up a dialog displaying a message.static voidUse this method to brings up a dialog displaying a message, with all parameters.static voidUse this method to brings up a dialog displaying a message, with all parameters.
-
Constructor Details
-
Mode
public Mode()
-
-
Method Details
-
getMode
public static boolean getMode()Use this method to get current Mode.- Returns:
trueif Dark Mode,falseif Light Mode.
-
setMode
public static void setMode(boolean MODE) Use this method to set Mode for UI.- Parameters:
MODE-trueis Dark Mode,falseis Light Mode.
-
getTextColor
Use this method to get Text color at current Mode.- Returns:
- Text color at current Mode.
-
getTextLightColor
Use this method to get text color at light Mode.- Returns:
- Text Color at light Mode.
-
getTextDarkColor
Use this method to get text color at dark Mode.- Returns:
- Text Color at dark Mode.
-
getBackColor
Use this method to get background color at current Mode.- Returns:
- Background color at current Mode.
-
getBackLightColor
Use this method to get background color at light Mode.- Returns:
- Background Color at light Mode.
-
getBackDarkColor
Use this method to get background color at dark Mode.- Returns:
- Background Color at dark Mode.
-
setTextColor
Use this method to custom Color of Text in 2 case Dark and Light.- Parameters:
TextDarkMode- is Color of Text if The Mode is Dark, should be light color.TextLightMode- is Color of Text if The Mode is Light, should be dark color.
-
setBackColor
Use this method to custom Color of Background in 2 case Dark and Light.- Parameters:
BackDarkMode- is Color of Background if The Mode is Dark, should be dark color.BackLightMode- is Color of Background if The Mode is Light, should be light color.
-
setModeComponent
Use this method to change Mode for Components.- Parameters:
components- is list of variable Component need change Mode.
-
setModeComponent
Use this method to change Mode for a Component.- Parameters:
component- is a variable Component need change Mode.
-
WFileChooser
Use this method to change File Chooser into Windows Look and Feel.- Returns:
- a
JFileChooserwas change Look and Feel.
-
WCheckBox
Use this method to change Check Box into Windows Look and Feel.- Returns:
- a
JCheckBoxwas change Look and Feel.
-
WComboBox
Use this method to change Combo Box into Windows Look and Feel.- Returns:
- a
JComboBoxwas change Look and Feel.
-
WMessage
Use this method to brings up a dialog displaying a message.- Parameters:
parentComponent- theFramein which the dialog is displayed, if null, or has noFrame, a defaultFrameis used.message- theObjectto display.
-
WMessage
public static void WMessage(Component parentComponent, Object message, String title, int messageType) Use this method to brings up a dialog displaying a message, with all parameters.- Parameters:
parentComponent- theFramein which the dialog is displayed, if null, or has noFrame, a defaultFrameis used.message- theObjectto display.title- the titleStringfor the dialog.messageType- the type of message to be displayed:
ERROR_MESSAGE,INFORMATION_MESSAGE,WARNING_MESSAGE,QUESTION_MESSAGE, orPLAIN_MESSAGE.
-
WMessage
public static void WMessage(Component parentComponent, Object message, String title, int messageType, Icon icon) Use this method to brings up a dialog displaying a message, with all parameters.- Parameters:
parentComponent- theFramein which the dialog is displayed, if null, or has noFrame, a defaultFrameis used.message- theObjectto display.title- the titleStringfor the dialog.messageType- the type of message to be displayed:
ERROR_MESSAGE,INFORMATION_MESSAGE,WARNING_MESSAGE,QUESTION_MESSAGE, orPLAIN_MESSAGE.icon- an icon to display in the dialog that helps the user identify the kind of message that is being displayed.
-
WConfirm
Use this method to brings up a Confirm dialog with the options "Yes, No and Cancel".- Parameters:
parentComponent- theFramein which the dialog is displayed.message- theObjectto display.- Returns:
- an integer indicating the option selected by the user.
-
WConfirm
Use this method to brings up a Confirm dialog, where the number of choices is determined by the optionType parameter.- Parameters:
parentComponent- theFramein which the dialog is displayed.message- theObjectto display.title- The titleStringfor the dialog.optionType- anintdesignating the options available on the dialog:
YES_NO_OPTION,YES_NO_CANCEL_OPTION, orOK_CANCEL_OPTION.- Returns:
- an integer indicating the option selected by the user.
-
WConfirm
public static int WConfirm(Component parentComponent, Object message, String title, int optionType, int messageType) Use this method to brings up a Confirm dialog, with all parameters and default icon.- Parameters:
parentComponent- theFramein which the dialog is displayed.message- theObjectto display.title- The title String for the dialog.optionType- anintdesignating the options available on the dialog:
YES_NO_OPTION,YES_NO_CANCEL_OPTION, orOK_CANCEL_OPTION.messageType- the type of message to be displayed:
ERROR_MESSAGE,INFORMATION_MESSAGE,WARNING_MESSAGE,QUESTION_MESSAGE, orPLAIN_MESSAGE.- Returns:
- an integer indicating the option selected by the user.
-
WConfirm
public static int WConfirm(Component parentComponent, Object message, String title, int optionType, int messageType, Icon icon) Use this method to brings up a Confirm dialog, with all parameters.- Parameters:
parentComponent- theFramein which the dialog is displayed.message- theObjectto display.title- The title String for the dialog.optionType- anintdesignating the options available on the dialog:
YES_NO_OPTION,YES_NO_CANCEL_OPTION, orOK_CANCEL_OPTION.messageType- the type of message to be displayed:
ERROR_MESSAGE,INFORMATION_MESSAGE,WARNING_MESSAGE,QUESTION_MESSAGE, orPLAIN_MESSAGE.icon- the icon to display in the dialog.- Returns:
- an integer indicating the option selected by the user.
-
WInput
Use this method to brings up a Input dialog, shows a questionmessage.- Parameters:
message- theObjectto display.- Returns:
- a user's input.
-
WInput
Use this method to brings up a Input dialog, displayed on top of theComponent.- Parameters:
parentComponent- the parentComponentfor the dialog.message- theObjectto display.- Returns:
- a user's input.
-
WInput
public static String WInput(Component parentComponent, Object message, String title, int messageType) Use this method to brings up a Input dialog, havetittleandmessageType.- Parameters:
parentComponent-Componentchứa hộp thoại.message- theObjectto display.title- theStringto display in the dialog title bar.messageType- the type of message that is to be displayed:
ERROR_MESSAGE,INFORMATION_MESSAGE,WARNING_MESSAGE,QUESTION_MESSAGE, orPLAIN_MESSAGE.- Returns:
- a user's input.
-