Class Swing
- java.lang.Object
- 
- com.inductiveautomation.snap.swing.Swing
 
- 
 public class Swing extends java.lang.ObjectThis 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 SummaryConstructors Constructor Description Swing()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancallSwing(java.lang.Runnable aRunnable)Runs runnable later in Swing if thread not swing.static javax.swing.IconcreateIcon(java.lang.String aName, java.lang.Class aClass)Creates the named icon - tries to load from given owner class resource directory or current directory.static java.awt.ImagecreateImage(java.lang.String aName, java.lang.Class aClass)Creates the named image - tries to load from given owner class resource directory or current directory.static javax.swing.JComponentcreateUI(java.lang.Object aSource)This method loads a UI file from a byte source.static SwingHelpergetHelper(java.lang.Object anObj)Legacy.static JComponentHprgetHelper(javax.swing.JComponent aComponent)Legacy.static javax.swing.IcongetIcon(java.lang.String aName, java.lang.Class aClass)Returns the named icon - tries to load from given owner class resource directory or current directory.static java.awt.ImagegetImage(java.lang.String aName, java.lang.Class aClass)Returns the named image - tries to load from given owner class resource directory or current directory.static java.io.InputStreamgetInputStream(java.lang.String aName, java.lang.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 booleanisAltDown()Returns whether the alt key is down for the current input event.static booleanisMetaDown()Returns whether the meta key is down for the current input event.static booleanisMouseDown()Returns whether mouse is pressed in mouse drag loop.static booleanrunSwing(java.lang.Runnable aRunnable)Runs runnable later in Swing if thread not swing.static voidsendEvent(java.util.EventObject anEvent)Sends Event for the given EventObject.static voidsendEvent(java.util.EventObject anEvent, javax.swing.JComponent aComp)Sends Event for the given EventObject and component.
 
- 
- 
- 
Method Detail- 
initpublic 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.
 - 
createUIpublic static javax.swing.JComponent createUI(java.lang.Object aSource) This method loads a UI file from a byte source.
 - 
getImagepublic static java.awt.Image getImage(java.lang.String aName, java.lang.Class aClass)Returns the named image - tries to load from given owner class resource directory or current directory.
 - 
createImage@Nullable public static java.awt.Image createImage(java.lang.String aName, java.lang.Class aClass)Creates the named image - tries to load from given owner class resource directory or current directory.
 - 
getIconpublic static javax.swing.Icon getIcon(java.lang.String aName, java.lang.Class aClass)Returns the named icon - tries to load from given owner class resource directory or current directory.
 - 
createIconpublic static javax.swing.Icon createIcon(java.lang.String aName, java.lang.Class aClass)Creates the named icon - tries to load from given owner class resource directory or current directory.
 - 
getInputStreampublic static java.io.InputStream getInputStream(java.lang.String aName, java.lang.Class aClass)Returns an input stream for the given name - tries to load from given owner class resource dir or current dir.
 - 
isAltDownpublic static boolean isAltDown() Returns whether the alt key is down for the current input event.
 - 
isMetaDownpublic static boolean isMetaDown() Returns whether the meta key is down for the current input event.
 - 
isMouseDownpublic static boolean isMouseDown() Returns whether mouse is pressed in mouse drag loop.
 - 
sendEventpublic static void sendEvent(java.util.EventObject anEvent) Sends Event for the given EventObject.
 - 
sendEventpublic static void sendEvent(java.util.EventObject anEvent, javax.swing.JComponent aComp)Sends Event for the given EventObject and component.
 - 
getHelperpublic static SwingHelper getHelper(java.lang.Object anObj) Legacy.
 - 
getHelperpublic static JComponentHpr getHelper(javax.swing.JComponent aComponent) Legacy.
 - 
runSwingpublic static boolean runSwing(java.lang.Runnable aRunnable) Runs runnable later in Swing if thread not swing.
 - 
callSwingpublic static boolean callSwing(java.lang.Runnable aRunnable) Runs runnable later in Swing if thread not swing.
 
- 
 
-