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 Color
Use this method to get background color at current Mode.static Color
Use this method to get background color at dark Mode.static Color
Use this method to get background color at light Mode.static boolean
getMode()
Use this method to get current Mode.static Color
Use this method to get Text color at current Mode.static Color
Use this method to get text color at dark Mode.static Color
Use this method to get text color at light Mode.static void
setBackColor
(Color BackDarkMode, Color BackLightMode) Use this method to custom Color of Background in 2 case Dark and Light.static void
setMode
(boolean MODE) Use this method to set Mode for UI.static void
setModeComponent
(Component component) Use this method to change Mode for a Component.static void
setModeComponent
(Component... components) Use this method to change Mode for Components.static void
setTextColor
(Color TextDarkMode, Color TextLightMode) Use this method to custom Color of Text in 2 case Dark and Light.static JCheckBox
Use this method to change Check Box into Windows Look and Feel.static JComboBox
Use this method to change Combo Box into Windows Look and Feel.static int
Use this method to brings up a Confirm dialog with the options "Yes, No and Cancel".static int
Use this method to brings up a Confirm dialog, where the number of choices is determined by the optionType parameter.static int
Use this method to brings up a Confirm dialog, with all parameters and default icon.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.static JFileChooser
Use this method to change File Chooser into Windows Look and Feel.static String
Use this method to brings up a Input dialog, displayed on top of theComponent
.static String
Use this method to brings up a Input dialog, havetittle
andmessageType
.static String
Use this method to brings up a Input dialog, shows a questionmessage
.static void
Use this method to brings up a dialog displaying a message.static void
Use this method to brings up a dialog displaying a message, with all parameters.static void
Use 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:
true
if Dark Mode,false
if Light Mode.
-
setMode
public static void setMode(boolean MODE) Use this method to set Mode for UI.- Parameters:
MODE
-true
is Dark Mode,false
is 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
JFileChooser
was change Look and Feel.
-
WCheckBox
Use this method to change Check Box into Windows Look and Feel.- Returns:
- a
JCheckBox
was change Look and Feel.
-
WComboBox
Use this method to change Combo Box into Windows Look and Feel.- Returns:
- a
JComboBox
was change Look and Feel.
-
WMessage
Use this method to brings up a dialog displaying a message.- Parameters:
parentComponent
- theFrame
in which the dialog is displayed, if null, or has noFrame
, a defaultFrame
is used.message
- theObject
to 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
- theFrame
in which the dialog is displayed, if null, or has noFrame
, a defaultFrame
is used.message
- theObject
to display.title
- the titleString
for 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
- theFrame
in which the dialog is displayed, if null, or has noFrame
, a defaultFrame
is used.message
- theObject
to display.title
- the titleString
for 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
- theFrame
in which the dialog is displayed.message
- theObject
to 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
- theFrame
in which the dialog is displayed.message
- theObject
to display.title
- The titleString
for the dialog.optionType
- anint
designating 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
- theFrame
in which the dialog is displayed.message
- theObject
to display.title
- The title String for the dialog.optionType
- anint
designating 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
- theFrame
in which the dialog is displayed.message
- theObject
to display.title
- The title String for the dialog.optionType
- anint
designating 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
- theObject
to display.- Returns:
- a user's input.
-
WInput
Use this method to brings up a Input dialog, displayed on top of theComponent
.- Parameters:
parentComponent
- the parentComponent
for the dialog.message
- theObject
to 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, havetittle
andmessageType
.- Parameters:
parentComponent
-Component
chứa hộp thoại.message
- theObject
to display.title
- theString
to 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.
-