Class SwingWindow
- java.lang.Object
- 
- com.inductiveautomation.snap.swing.SwingWindow
 
- 
 public class SwingWindow extends java.lang.ObjectA class to manage the Window of a SwingOwner.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classSwingWindow.Posstatic classSwingWindow.Style
 - 
Constructor SummaryConstructors Constructor Description SwingWindow()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddWindowListener(java.awt.event.WindowListener aListener)Add window listener.protected java.awt.WindowcreateWindow()Creates a window for this panel from window class.java.awt.ContainergetContentPane()Returns the content pane.java.util.concurrent.Callable<javax.swing.JComponent>getContentPaneCall()Returns the Callable that provides the ContentPane.javax.swing.JButtongetDefaultButton()Returns the name of the default button associated with this window.java.io.FilegetDocumentFile()Returns the document file for the window title bar proxy icon.static java.io.FilegetDocumentFile(java.awt.Window aWindow)Returns the document file for the window title bar proxy icon.intgetHeight()Returns the window x.java.awt.ImagegetIconImage()Returns the icon image for the window.javax.swing.JMenuBargetMenuBar()Returns the menu bar associated with this window.java.awt.DimensiongetMinimumSize()Returns the window MinimumSize.java.awt.DimensiongetPreferredSize()Returns the window PreferredSize.javax.swing.JRootPanegetRootPane()Returns the root pane for the window.static javax.swing.JRootPanegetRootPane(java.awt.Window aWin)Returns the root pane for a window, if available.java.awt.DimensiongetSize()Returns the window size.SwingWindow.StylegetStyle()Returns the window style.java.lang.StringgetTitle()Returns the title of the window.intgetWidth()Returns the window width.java.awt.WindowgetWindow()Returns the window associated with this panel, creating it if necessary.java.util.concurrent.Callable<java.awt.Window>getWindowCall()Returns the call to create the window.java.lang.Class<? extends java.awt.Window>getWindowClass()Returns the class of the window associated with this panel.intgetX()Returns the window x.intgetY()Returns the window y.booleanisAlwaysOnTop()Returns whether the window is always on top.booleanisHideOnDeactivate()Returns whether the window will hide on deactivate.booleanisModal()Returns the modal mode of the window.booleanisResizable()Returns whether the window is resizable.booleanisUndecorated()Returns true if the window has no title bar or other decorations.booleanisVisible()Returns whether window is visible.booleanisWindowSet()Returns whether window has been created.voidpack()Packs the window.voidrequestFocus()Requests focus on the window.voidsetAlwaysOnTop(boolean aValue)Sets whether the window is always on top.voidsetContentPane(java.awt.Container aContainer)Sets the content pane.voidsetContentPaneCall(java.util.concurrent.Callable<javax.swing.JComponent> aCall)Sets the Callable that provides the ContentPane.voidsetDefaultButton(javax.swing.JButton aButton)Sets the name of the default button associated with this window.static voidsetDocumentFile(java.awt.Window aWindow, java.io.File aFile)Returns the document file for the window title bar proxy icon.voidsetDocumentFile(java.io.File aFile)Returns the document file for the window title bar proxy icon.voidsetHideOnDeactivate(boolean aValue)Sets whether the window will hide on deacativate.voidsetIconImage(java.awt.Image anImage)Sets the icon image for the window.voidsetMaximizedBounds(java.awt.Rectangle aRect)Set Maximized bounds.voidsetMenuBar(javax.swing.JMenuBar aMenuBar)Sets the menu bar associated with this window.voidsetModal(boolean aValue)Sets the modal mode of the window (defaults to false).voidsetResizable(boolean aValue)Sets whether the window is resizable (default to true).voidsetSize(java.awt.Dimension aSize)Returns the window size.voidsetStyle(SwingWindow.Style aStyle)Sets the window style.voidsetTitle(java.lang.String aValue)Sets the title of the window.voidsetUndecorated(boolean flag)Sets whether the window has a title bar and decorations or not.voidsetVisible(boolean aValue)This method sets the window to be visible or invisible.voidsetVisible(SwingWindow.Pos aPos, int x, int y, java.lang.String fsaveName, boolean doSize)This method set the window associated with this panel to be visible at some given x and y away from a given corner.static voidsetVisible(java.awt.Component aWin, SwingWindow.Pos aPos, int dx, int dy, java.lang.String aFrmSvName, boolean doSize)Makes a window visible with the given corner at the given x & y.protected voidsetWindow(java.awt.Window aWindow)Sets a new window for this panel.voidsetWindowCall(java.util.concurrent.Callable<java.awt.Window> aCall)Sets the call to create the window.voidsetWindowClass(java.lang.Class<? extends java.awt.Window> aClass)Sets the window class.voidtoFront()Order window to front.voidwindowDispose()This method disposes the window associated with this panel.
 
- 
- 
- 
Method Detail- 
isWindowSetpublic boolean isWindowSet() Returns whether window has been created.
 - 
getWindowpublic java.awt.Window getWindow() Returns the window associated with this panel, creating it if necessary.
 - 
setWindowprotected void setWindow(java.awt.Window aWindow) Sets a new window for this panel.
 - 
createWindowprotected java.awt.Window createWindow() Creates a window for this panel from window class.
 - 
getWindowCallpublic java.util.concurrent.Callable<java.awt.Window> getWindowCall() Returns the call to create the window.
 - 
setWindowCallpublic void setWindowCall(java.util.concurrent.Callable<java.awt.Window> aCall) Sets the call to create the window.
 - 
getContentPaneCallpublic java.util.concurrent.Callable<javax.swing.JComponent> getContentPaneCall() Returns the Callable that provides the ContentPane.
 - 
setContentPaneCallpublic void setContentPaneCall(java.util.concurrent.Callable<javax.swing.JComponent> aCall) Sets the Callable that provides the ContentPane.
 - 
getWindowClasspublic java.lang.Class<? extends java.awt.Window> getWindowClass() Returns the class of the window associated with this panel.
 - 
setWindowClasspublic void setWindowClass(java.lang.Class<? extends java.awt.Window> aClass) Sets the window class.
 - 
getTitlepublic java.lang.String getTitle() Returns the title of the window.
 - 
setTitlepublic void setTitle(java.lang.String aValue) Sets the title of the window.
 - 
isResizablepublic boolean isResizable() Returns whether the window is resizable.
 - 
setResizablepublic void setResizable(boolean aValue) Sets whether the window is resizable (default to true).
 - 
getStylepublic SwingWindow.Style getStyle() Returns the window style.
 - 
setStylepublic void setStyle(SwingWindow.Style aStyle) Sets the window style.
 - 
getMenuBarpublic javax.swing.JMenuBar getMenuBar() Returns the menu bar associated with this window.
 - 
setMenuBarpublic void setMenuBar(javax.swing.JMenuBar aMenuBar) Sets the menu bar associated with this window.
 - 
isAlwaysOnToppublic boolean isAlwaysOnTop() Returns whether the window is always on top.
 - 
setAlwaysOnToppublic void setAlwaysOnTop(boolean aValue) Sets whether the window is always on top.
 - 
getDocumentFilepublic java.io.File getDocumentFile() Returns the document file for the window title bar proxy icon.
 - 
setDocumentFilepublic void setDocumentFile(java.io.File aFile) Returns the document file for the window title bar proxy icon.
 - 
isHideOnDeactivatepublic boolean isHideOnDeactivate() Returns whether the window will hide on deactivate.
 - 
setHideOnDeactivatepublic void setHideOnDeactivate(boolean aValue) Sets whether the window will hide on deacativate.
 - 
getIconImagepublic java.awt.Image getIconImage() Returns the icon image for the window.
 - 
setIconImagepublic void setIconImage(java.awt.Image anImage) Sets the icon image for the window.
 - 
isModalpublic boolean isModal() Returns the modal mode of the window.
 - 
setModalpublic void setModal(boolean aValue) Sets the modal mode of the window (defaults to false).
 - 
getDefaultButtonpublic javax.swing.JButton getDefaultButton() Returns the name of the default button associated with this window.
 - 
setDefaultButtonpublic void setDefaultButton(javax.swing.JButton aButton) Sets the name of the default button associated with this window.
 - 
isUndecoratedpublic boolean isUndecorated() Returns true if the window has no title bar or other decorations.
 - 
setUndecoratedpublic void setUndecorated(boolean flag) Sets whether the window has a title bar and decorations or not. This must be done before the first call to getWindow() or an IllegalComponentStateException will be thrown.
 - 
addWindowListenerpublic void addWindowListener(java.awt.event.WindowListener aListener) Add window listener.
 - 
getRootPanepublic javax.swing.JRootPane getRootPane() Returns the root pane for the window.
 - 
getContentPanepublic java.awt.Container getContentPane() Returns the content pane.
 - 
setContentPanepublic void setContentPane(java.awt.Container aContainer) Sets the content pane.
 - 
getXpublic int getX() Returns the window x.
 - 
getYpublic int getY() Returns the window y.
 - 
getWidthpublic int getWidth() Returns the window width.
 - 
getHeightpublic int getHeight() Returns the window x.
 - 
getSizepublic java.awt.Dimension getSize() Returns the window size.
 - 
setSizepublic void setSize(java.awt.Dimension aSize) Returns the window size.
 - 
getPreferredSizepublic java.awt.Dimension getPreferredSize() Returns the window PreferredSize.
 - 
getMinimumSizepublic java.awt.Dimension getMinimumSize() Returns the window MinimumSize.
 - 
packpublic void pack() Packs the window.
 - 
requestFocuspublic void requestFocus() Requests focus on the window.
 - 
toFrontpublic void toFront() Order window to front.
 - 
setMaximizedBoundspublic void setMaximizedBounds(java.awt.Rectangle aRect) Set Maximized bounds.
 - 
windowDisposepublic void windowDispose() This method disposes the window associated with this panel.
 - 
isVisiblepublic boolean isVisible() Returns whether window is visible.
 - 
setVisiblepublic void setVisible(boolean aValue) This method sets the window to be visible or invisible.
 - 
setVisiblepublic void setVisible(SwingWindow.Pos aPos, int x, int y, java.lang.String fsaveName, boolean doSize) This method set the window associated with this panel to be visible at some given x and y away from a given corner. It also allows you to provide a "frame save name" which causes the frame's location and size to be saved between sessions (in which case it will override the default position provided).
 - 
setVisiblepublic static void setVisible(java.awt.Component aWin, SwingWindow.Pos aPos, int dx, int dy, java.lang.String aFrmSvName, boolean doSize)Makes a window visible with the given corner at the given x & y.
 - 
getRootPanepublic static javax.swing.JRootPane getRootPane(java.awt.Window aWin) Returns the root pane for a window, if available.
 - 
getDocumentFilepublic static java.io.File getDocumentFile(java.awt.Window aWindow) Returns the document file for the window title bar proxy icon.
 - 
setDocumentFilepublic static void setDocumentFile(java.awt.Window aWindow, java.io.File aFile)Returns the document file for the window title bar proxy icon.
 
- 
 
-