Package ca.cgjennings.apps.arkham
Class TrackedWindowProxy
- java.lang.Object
-
- ca.cgjennings.apps.arkham.TrackedWindowProxy
-
- All Implemented Interfaces:
TrackedWindow,IconProvider
public abstract class TrackedWindowProxy extends java.lang.Object implements TrackedWindow
An abstract base class for tracked windows that create the true window or dialog on demand.- Since:
- 3.0
- Author:
- Chris Jennings
- See Also:
StrangeEonsAppWindow.startTracking(ca.cgjennings.apps.arkham.TrackedWindow)
-
-
Constructor Summary
Constructors Constructor Description TrackedWindowProxy(java.lang.String windowTitle)Creates a new proxy for a tracked window.TrackedWindowProxy(java.lang.String windowTitle, javax.swing.Icon windowIcon)Creates a new proxy for a tracked window.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.lang.ObjectcreateWindow()This method is called to create the dialog or window being tracked.voiddispose()Disposes of the underlying window or frame if it has been created.javax.swing.IcongetIcon()java.lang.StringgetTitle()Returns the window title.booleanisVisible()Returns whether the window is visible if it has been created, otherwise returns false.booleanrequestFocusInWindow()Requests that the window be given focus, if it is focusable.voidsetVisible(boolean visible)Makes the tracked window visible or invisible.voidtoFront()Moves the tracked window to the front; only called after the window is made visible.
-
-
-
Constructor Detail
-
TrackedWindowProxy
public TrackedWindowProxy(java.lang.String windowTitle)
Creates a new proxy for a tracked window.- Parameters:
windowTitle- the non-nullwindow title
-
TrackedWindowProxy
public TrackedWindowProxy(java.lang.String windowTitle, javax.swing.Icon windowIcon)Creates a new proxy for a tracked window.- Parameters:
windowTitle- the non-nullwindow titlewindowIcon- the icon to use for the menu item (may benull)
-
-
Method Detail
-
createWindow
public abstract java.lang.Object createWindow()
This method is called to create the dialog or window being tracked. It must return either aJWindow, aJFrame, or a modelessJDialog.- Returns:
- the window that this is acting as a proxy for
-
getTitle
public java.lang.String getTitle()
Description copied from interface:TrackedWindowReturns the window title.- Specified by:
getTitlein interfaceTrackedWindow- Returns:
- the title of the window, as shown in the menu
-
setVisible
public void setVisible(boolean visible)
Description copied from interface:TrackedWindowMakes the tracked window visible or invisible.- Specified by:
setVisiblein interfaceTrackedWindow- Parameters:
visible- whether the window should be made visible
-
toFront
public void toFront()
Description copied from interface:TrackedWindowMoves the tracked window to the front; only called after the window is made visible.- Specified by:
toFrontin interfaceTrackedWindow
-
requestFocusInWindow
public boolean requestFocusInWindow()
Description copied from interface:TrackedWindowRequests that the window be given focus, if it is focusable.- Specified by:
requestFocusInWindowin interfaceTrackedWindow- Returns:
falseif the request will certainly fail
-
getIcon
public javax.swing.Icon getIcon()
- Specified by:
getIconin interfaceIconProvider
-
dispose
public void dispose()
Disposes of the underlying window or frame if it has been created.
-
isVisible
public boolean isVisible()
Returns whether the window is visible if it has been created, otherwise returns false.- Returns:
- true if the window is visible
-
-