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.Object
createWindow()
This method is called to create the dialog or window being tracked.void
dispose()
Disposes of the underlying window or frame if it has been created.javax.swing.Icon
getIcon()
java.lang.String
getTitle()
Returns the window title.boolean
isVisible()
Returns whether the window is visible if it has been created, otherwise returns false.boolean
requestFocusInWindow()
Requests that the window be given focus, if it is focusable.void
setVisible(boolean visible)
Makes the tracked window visible or invisible.void
toFront()
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-null
window title
-
TrackedWindowProxy
public TrackedWindowProxy(java.lang.String windowTitle, javax.swing.Icon windowIcon)
Creates a new proxy for a tracked window.- Parameters:
windowTitle
- the non-null
window 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:TrackedWindow
Returns the window title.- Specified by:
getTitle
in interfaceTrackedWindow
- Returns:
- the title of the window, as shown in the menu
-
setVisible
public void setVisible(boolean visible)
Description copied from interface:TrackedWindow
Makes the tracked window visible or invisible.- Specified by:
setVisible
in interfaceTrackedWindow
- Parameters:
visible
- whether the window should be made visible
-
toFront
public void toFront()
Description copied from interface:TrackedWindow
Moves the tracked window to the front; only called after the window is made visible.- Specified by:
toFront
in interfaceTrackedWindow
-
requestFocusInWindow
public boolean requestFocusInWindow()
Description copied from interface:TrackedWindow
Requests that the window be given focus, if it is focusable.- Specified by:
requestFocusInWindow
in interfaceTrackedWindow
- Returns:
false
if the request will certainly fail
-
getIcon
public javax.swing.Icon getIcon()
- Specified by:
getIcon
in 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
-
-