org.geotoolkit.gui.swing
Interface Window

All Superinterfaces:
WindowConstants

public interface Window
extends WindowConstants

Interfaces for windows created by WindowCreator. This interface is typically implemented by JDialog, JFrame or JInternalFrame subclasses, but users can provide other implementation. For example an application developed on top of the NetBeans platform may need to provide their own implementation for better integration with their platform.

Instances of Window are created by WindowCreator.Handler.createWindow(Component, Component, String).

Since:
3.12
Version:
3.12
Author:
Martin Desruisseaux (Geomatys)
Module:
display/geotk-widgets-swing (download)    View source code for this class

Field Summary
 
Fields inherited from interface WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Method Summary
 void addWindowListener(WindowListener listener)
          Adds the specified window listener to receive window events from this window.
 void dispose()
          Releases the resources used by this window.
 int getDefaultCloseOperation()
          Returns the default operation that occurs when the user initiates a "close" on this window.
 String getTitle()
          Returns the current title, or null if none.
 boolean isVisible()
          Return true if this window is visible.
 void removeWindowListener(WindowListener listener)
          Removes the specified window listener.
 void setDefaultCloseOperation(int operation)
          Sets the default operation that occurs when the user initiates a "close" on this window.
 void setSize(int width, int height)
          Sets the window size.
 void setTitle(String title)
          Sets the window title.
 void setVisible(boolean visible)
          Sets whatever this window should be visible.
 

Method Detail

isVisible

boolean isVisible()
Return true if this window is visible. The default value on window creation is false.

Returns:
true if this window is visible.
See Also:
Component.isVisible()

setVisible

void setVisible(boolean visible)
Sets whatever this window should be visible. New windows created by WindowCreator.Handler needs an explicit call to this method in order to be visible.

Parameters:
visible - true for showing this window, or false for hiding it.
See Also:
Component.setVisible(boolean)

setSize

void setSize(int width,
             int height)
Sets the window size.

Parameters:
width - The width in pixels.
height - The height in pixels.
See Also:
Component.setSize(int, int)

getTitle

String getTitle()
Returns the current title, or null if none.

Returns:
The current title, or null if none.
See Also:
Frame.getTitle(), JInternalFrame.getTitle()

setTitle

void setTitle(String title)
Sets the window title.

Parameters:
title - The new title, or null if none.
See Also:
Frame.setTitle(String), JInternalFrame.setTitle(String)

addWindowListener

void addWindowListener(WindowListener listener)
Adds the specified window listener to receive window events from this window. If listener is null, no exception is thrown and no action is performed.

The listener given to this method shall be tolerant to null WindowEvent argument value, since it is not guaranteed that the events fired by the actual window implementation can be converted to WindowEvent in every cases.

Parameters:
listener - the window listener to add.
See Also:
Window.addWindowListener(WindowListener)

removeWindowListener

void removeWindowListener(WindowListener listener)
Removes the specified window listener.

Parameters:
listener - the window listener to remove.
See Also:
Window.removeWindowListener(WindowListener)

getDefaultCloseOperation

int getDefaultCloseOperation()
Returns the default operation that occurs when the user initiates a "close" on this window. The default value on window creation is WindowConstants.DISPOSE_ON_CLOSE.

Returns:
The operation that will occur when the user closes the window, as one of the WindowConstants.
See Also:
JFrame.getDefaultCloseOperation(), JInternalFrame.getDefaultCloseOperation()

setDefaultCloseOperation

void setDefaultCloseOperation(int operation)
Sets the default operation that occurs when the user initiates a "close" on this window. This method may be invoked after window creation in order to set the default close operation to WindowConstants.HIDE_ON_CLOSE. In such case, the caller is responsible for disposing this window when it is no longer needed.

Parameters:
operation - The operation that will occur when the user closes the window, as one of the WindowConstants.
See Also:
JFrame.setDefaultCloseOperation(int), JInternalFrame.setDefaultCloseOperation(int)

dispose

void dispose()
Releases the resources used by this window.

See Also:
Window.dispose(), JInternalFrame.dispose()


Copyright © 2009-2012 Geotoolkit.org. All Rights Reserved.