Class Swing
java.lang.Object
com.inductiveautomation.snap.swing.Swing
This class helps to load and manage panels of UI components in the form of a UI file, which is a simple
XML description of UI controls.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Runs runnable later in Swing if thread not swing.static Icon
createIcon
(String aName, Class aClass) Creates the named icon - tries to load from given owner class resource directory or current directory.static Image
createImage
(String aName, Class aClass) Creates the named image - tries to load from given owner class resource directory or current directory.static JComponent
This method loads a UI file from a byte source.static SwingHelper
Legacy.static JComponentHpr
getHelper
(JComponent aComponent) Legacy.static Icon
Returns the named icon - tries to load from given owner class resource directory or current directory.static Image
Returns the named image - tries to load from given owner class resource directory or current directory.static InputStream
getInputStream
(String aName, Class aClass) Returns an input stream for the given name - tries to load from given owner class resource dir or current dir.static void
init()
Initializes Snap Swing functionality (installs an event queue and configures helper map).static boolean
Returns whether the alt key is down for the current input event.static boolean
Returns whether the meta key is down for the current input event.static boolean
Returns whether mouse is pressed in mouse drag loop.static boolean
Runs runnable later in Swing if thread not swing.static void
sendEvent
(EventObject anEvent) Sends Event for the given EventObject.static void
sendEvent
(EventObject anEvent, JComponent aComp) Sends Event for the given EventObject and component.
-
Constructor Details
-
Swing
public Swing()
-
-
Method Details
-
init
public static void init()Initializes Snap Swing functionality (installs an event queue and configures helper map). This is called automatically when Ribs class is first touched. -
createUI
This method loads a UI file from a byte source. -
getImage
Returns the named image - tries to load from given owner class resource directory or current directory. -
createImage
Creates the named image - tries to load from given owner class resource directory or current directory. -
getIcon
Returns the named icon - tries to load from given owner class resource directory or current directory. -
createIcon
Creates the named icon - tries to load from given owner class resource directory or current directory. -
getInputStream
Returns an input stream for the given name - tries to load from given owner class resource dir or current dir. -
isAltDown
public static boolean isAltDown()Returns whether the alt key is down for the current input event. -
isMetaDown
public static boolean isMetaDown()Returns whether the meta key is down for the current input event. -
isMouseDown
public static boolean isMouseDown()Returns whether mouse is pressed in mouse drag loop. -
sendEvent
Sends Event for the given EventObject. -
sendEvent
Sends Event for the given EventObject and component. -
getHelper
Legacy. -
getHelper
Legacy. -
runSwing
Runs runnable later in Swing if thread not swing. -
callSwing
Runs runnable later in Swing if thread not swing.
-