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 booleanRuns runnable later in Swing if thread not swing.static IconcreateIcon(String aName, Class aClass) Creates the named icon - tries to load from given owner class resource directory or current directory.static ImagecreateImage(String aName, Class aClass) Creates the named image - tries to load from given owner class resource directory or current directory.static JComponentThis method loads a UI file from a byte source.static SwingHelperLegacy.static JComponentHprgetHelper(JComponent aComponent) Legacy.static IconReturns the named icon - tries to load from given owner class resource directory or current directory.static ImageReturns the named image - tries to load from given owner class resource directory or current directory.static InputStreamgetInputStream(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 voidinit()Initializes Snap Swing functionality (installs an event queue and configures helper map).static booleanReturns whether the alt key is down for the current input event.static booleanReturns whether the meta key is down for the current input event.static booleanReturns whether mouse is pressed in mouse drag loop.static booleanRuns runnable later in Swing if thread not swing.static voidsendEvent(EventObject anEvent) Sends Event for the given EventObject.static voidsendEvent(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.
-