net.sf.doolin.gui.window.support
Class AbstractIWindow<W extends Window>

java.lang.Object
  extended by net.sf.doolin.gui.window.support.AbstractIWindow<W>
Type Parameters:
W - Type of Window to hold
All Implemented Interfaces:
IWindow
Direct Known Subclasses:
DialogIWindow, FrameIWindow

public abstract class AbstractIWindow<W extends Window>
extends Object
implements IWindow

Abstract IWindow implementation that holds the concrete implementation of a Window.

Author:
Damien Coraboeuf

Constructor Summary
AbstractIWindow(ActionContext actionContext)
          Constructor
 
Method Summary
 void addWindowListener(WindowListener windowListener)
          Adds a window listener
protected abstract  W buildWindow()
          Actually builds the window instance
 void dispose()
          Disposes of the window.
protected  ActionContext getActionContext()
          Gets the associated action context
 int getHeight()
           
 int getWidth()
           
protected  W getWindow()
          Gets the actual window instance
 void setIcon(Icon icon)
          Sets the window icon
 void setLocation()
          Sets the location of the window according to its parent
 void setSize(int width, int height)
          Sets the size of the window
 void show()
          Shows the window
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.doolin.gui.window.support.IWindow
getContentPane, getRootPane, isModal, pack, setDefaultButton, setTitle
 

Constructor Detail

AbstractIWindow

public AbstractIWindow(ActionContext actionContext)
Constructor

Parameters:
actionContext -
Method Detail

addWindowListener

public void addWindowListener(WindowListener windowListener)
Description copied from interface: IWindow
Adds a window listener

Specified by:
addWindowListener in interface IWindow
See Also:
Window.addWindowListener(WindowListener)

buildWindow

protected abstract W buildWindow()
Actually builds the window instance

Returns:
Window

dispose

public void dispose()
Description copied from interface: IWindow
Disposes of the window.

Specified by:
dispose in interface IWindow
See Also:
Window.dispose()

getActionContext

protected ActionContext getActionContext()
Gets the associated action context

Returns:
Action context

getHeight

public int getHeight()
Specified by:
getHeight in interface IWindow

getWidth

public int getWidth()
Specified by:
getWidth in interface IWindow

getWindow

protected W getWindow()
Gets the actual window instance

Returns:
Window

setIcon

public void setIcon(Icon icon)
Description copied from interface: IWindow
Sets the window icon

Specified by:
setIcon in interface IWindow
Parameters:
icon - Icon to set
See Also:
Window.setIconImage(java.awt.Image), SwingUtils.toImage(Icon)

setLocation

public void setLocation()
Description copied from interface: IWindow
Sets the location of the window according to its parent

Specified by:
setLocation in interface IWindow
See Also:
Window.setLocationRelativeTo(java.awt.Component), Window.getOwner()

setSize

public void setSize(int width,
                    int height)
Description copied from interface: IWindow
Sets the size of the window

Specified by:
setSize in interface IWindow
Parameters:
width - Width in pixels
height - Height in pixels
See Also:
Window.setSize(int, int)

show

public void show()
Description copied from interface: IWindow
Shows the window

Specified by:
show in interface IWindow
See Also:
Window.setVisible(boolean)


Copyright © 2011. All Rights Reserved.