Package anlavn.ui

Class Mode

java.lang.Object
anlavn.ui.Mode

public class Mode extends Object
The Mode class supports change mode from light to dark, component from nimbus to windows look and feel.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static 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
    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
    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
    WConfirm(Component parentComponent, Object message)
    Use this method to brings up a Confirm dialog with the options "Yes, No and Cancel".
    static int
    WConfirm(Component parentComponent, Object message, String title, int optionType)
    Use this method to brings up a Confirm dialog, where the number of choices is determined by the optionType parameter.
    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.
    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.
    Use this method to change File Chooser into Windows Look and Feel.
    static String
    WInput(Component parentComponent, Object message)
    Use this method to brings up a Input dialog, displayed on top of the Component.
    static String
    WInput(Component parentComponent, Object message, String title, int messageType)
    Use this method to brings up a Input dialog, have tittle and messageType.
    static String
    WInput(Object message)
    Use this method to brings up a Input dialog, shows a question message.
    static void
    WMessage(Component parentComponent, Object message)
    Use this method to brings up a dialog displaying a message.
    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.
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public static Color getTextColor()
      Use this method to get Text color at current Mode.
      Returns:
      Text color at current Mode.
    • getTextLightColor

      public static Color getTextLightColor()
      Use this method to get text color at light Mode.
      Returns:
      Text Color at light Mode.
    • getTextDarkColor

      public static Color getTextDarkColor()
      Use this method to get text color at dark Mode.
      Returns:
      Text Color at dark Mode.
    • getBackColor

      public static Color getBackColor()
      Use this method to get background color at current Mode.
      Returns:
      Background color at current Mode.
    • getBackLightColor

      public static Color getBackLightColor()
      Use this method to get background color at light Mode.
      Returns:
      Background Color at light Mode.
    • getBackDarkColor

      public static Color getBackDarkColor()
      Use this method to get background color at dark Mode.
      Returns:
      Background Color at dark Mode.
    • setTextColor

      public static void setTextColor(Color TextDarkMode, Color TextLightMode)
      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

      public static void setBackColor(Color BackDarkMode, Color BackLightMode)
      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

      public static void setModeComponent(Component... components)
      Use this method to change Mode for Components.
      Parameters:
      components - is list of variable Component need change Mode.
    • setModeComponent

      public static void setModeComponent(Component component)
      Use this method to change Mode for a Component.
      Parameters:
      component - is a variable Component need change Mode.
    • WFileChooser

      public static JFileChooser WFileChooser()
      Use this method to change File Chooser into Windows Look and Feel.
      Returns:
      a JFileChooser was change Look and Feel.
    • WCheckBox

      public static JCheckBox WCheckBox()
      Use this method to change Check Box into Windows Look and Feel.
      Returns:
      a JCheckBox was change Look and Feel.
    • WComboBox

      public static JComboBox WComboBox()
      Use this method to change Combo Box into Windows Look and Feel.
      Returns:
      a JComboBox was change Look and Feel.
    • WMessage

      public static void WMessage(Component parentComponent, Object message)
      Use this method to brings up a dialog displaying a message.
      Parameters:
      parentComponent - the Frame in which the dialog is displayed, if null, or has no Frame, a default Frame is used.
      message - the Object 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 - the Frame in which the dialog is displayed, if null, or has no Frame, a default Frame is used.
      message - the Object to display.
      title - the title String for the dialog.
      messageType - the type of message to be displayed:
      ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_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 - the Frame in which the dialog is displayed, if null, or has no Frame, a default Frame is used.
      message - the Object to display.
      title - the title String for the dialog.
      messageType - the type of message to be displayed:
      ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE.
      icon - an icon to display in the dialog that helps the user identify the kind of message that is being displayed.
    • WConfirm

      public static int WConfirm(Component parentComponent, Object message)
      Use this method to brings up a Confirm dialog with the options "Yes, No and Cancel".
      Parameters:
      parentComponent - the Frame in which the dialog is displayed.
      message - the Object to display.
      Returns:
      an integer indicating the option selected by the user.
    • WConfirm

      public static int WConfirm(Component parentComponent, Object message, String title, int optionType)
      Use this method to brings up a Confirm dialog, where the number of choices is determined by the optionType parameter.
      Parameters:
      parentComponent - the Frame in which the dialog is displayed.
      message - the Object to display.
      title - The title String for the dialog.
      optionType - an int designating the options available on the dialog:
      YES_NO_OPTION, YES_NO_CANCEL_OPTION, or OK_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 - the Frame in which the dialog is displayed.
      message - the Object to display.
      title - The title String for the dialog.
      optionType - an int designating the options available on the dialog:
      YES_NO_OPTION, YES_NO_CANCEL_OPTION, or OK_CANCEL_OPTION.
      messageType - the type of message to be displayed:
      ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_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 - the Frame in which the dialog is displayed.
      message - the Object to display.
      title - The title String for the dialog.
      optionType - an int designating the options available on the dialog:
      YES_NO_OPTION, YES_NO_CANCEL_OPTION, or OK_CANCEL_OPTION.
      messageType - the type of message to be displayed:
      ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE.
      icon - the icon to display in the dialog.
      Returns:
      an integer indicating the option selected by the user.
    • WInput

      public static String WInput(Object message)
      Use this method to brings up a Input dialog, shows a question message.
      Parameters:
      message - the Object to display.
      Returns:
      a user's input.
    • WInput

      public static String WInput(Component parentComponent, Object message)
      Use this method to brings up a Input dialog, displayed on top of the Component.
      Parameters:
      parentComponent - the parent Component for the dialog.
      message - the Object 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, have tittle and messageType.
      Parameters:
      parentComponent - Component chứa hộp thoại.
      message - the Object to display.
      title - the String 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, or PLAIN_MESSAGE.
      Returns:
      a user's input.