Package javascript
Class SwingJS
- java.lang.Object
-
- javascript.SwingJS
-
public class SwingJS extends java.lang.Object
The class to perform some "magics"- Author:
- gianpiero.diblasi
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
build()
Builds the new global stylestatic <T> T
convert(java.lang.Object object)
Converts "any" Java object into a JavaScript object.SwingJS
darkMode(boolean b)
Sets the dark modeSwingJS
fontFamily(java.lang.String fontFamily)
Sets the global font family, to complete the setting the build method has to be calledSwingJS
fontSize(int fontSize)
Sets the global font size, to complete the setting the build method has to be calledstatic SwingJS
instance()
Returns the singleton instance of SwingJSSwingJS
mainActionBGColor(java.lang.String color)
Sets the global main action background color, to complete the setting the build method has to be calledSwingJS
mainActionColor(java.lang.String color)
Sets the global main action color, to complete the setting the build method has to be calledSwingJS
mainBGColor(java.lang.String color)
Sets the global main background color, to complete the setting the build method has to be calledSwingJS
mainColor(java.lang.String color)
Sets the global main color, to complete the setting the build method has to be calledSwingJS
roundness(double roundness)
Sets the roundness, to complete the setting the build method has to be called
-
-
-
Method Detail
-
convert
public static <T> T convert(java.lang.Object object)
Converts "any" Java object into a JavaScript object. This method is useful when developing in Java, whene developing in JavaScript this method is useless- Type Parameters:
T
- The return type- Parameters:
object
- The original java object- Returns:
- The javascript object
-
instance
public static SwingJS instance()
Returns the singleton instance of SwingJS- Returns:
- The singleton instance of SwingJS
-
darkMode
public SwingJS darkMode(boolean b)
Sets the dark mode- Parameters:
b
- true to set the dark mode, false otherwise- Returns:
- The SwingJS instance (for chaining)
-
fontFamily
public SwingJS fontFamily(java.lang.String fontFamily)
Sets the global font family, to complete the setting the build method has to be called- Parameters:
fontFamily
- The font family- Returns:
- The SwingJS instance (for chaining)
-
fontSize
public SwingJS fontSize(int fontSize)
Sets the global font size, to complete the setting the build method has to be called- Parameters:
fontSize
- The font size- Returns:
- The SwingJS instance (for chaining)
-
mainColor
public SwingJS mainColor(java.lang.String color)
Sets the global main color, to complete the setting the build method has to be called- Parameters:
color
- The color- Returns:
- The SwingJS instance (for chaining)
-
mainBGColor
public SwingJS mainBGColor(java.lang.String color)
Sets the global main background color, to complete the setting the build method has to be called- Parameters:
color
- The color- Returns:
- The SwingJS instance (for chaining)
-
mainActionColor
public SwingJS mainActionColor(java.lang.String color)
Sets the global main action color, to complete the setting the build method has to be called- Parameters:
color
- The color- Returns:
- The SwingJS instance (for chaining)
-
mainActionBGColor
public SwingJS mainActionBGColor(java.lang.String color)
Sets the global main action background color, to complete the setting the build method has to be called- Parameters:
color
- The color- Returns:
- The SwingJS instance (for chaining)
-
roundness
public SwingJS roundness(double roundness)
Sets the roundness, to complete the setting the build method has to be called- Parameters:
roundness
- The roundness, a value in the range [0,1]- Returns:
- The SwingJS instance (for chaining)
-
build
public void build()
Builds the new global style
-
-