yu.ac.bg.etf.javaqx.qswing
Class JQWindow

java.lang.Object
  extended byyu.ac.bg.etf.javaqx.core.AbstractDisposable
      extended byyu.ac.bg.etf.javaqx.qswing.JQComponent
          extended byyu.ac.bg.etf.javaqx.qswing.JQContainer
              extended byyu.ac.bg.etf.javaqx.qswing.JQWindow
All Implemented Interfaces:
Disposable, JQComponentProperties, JQContainerProperties, JQWindowConstants, JQWindowProperties
Direct Known Subclasses:
JQDialog, JQFrame, JQInternalFrame, JQToolWindow, SplashScreen

public class JQWindow
extends JQContainer
implements JQWindowConstants, JQWindowProperties

Window Component.

Version:
0.2.0
Author:
Slobodan Vrkacevic (slobodan.vrkacevic@gmail.com)

Field Summary
static boolean ALWAYS_ON_TOP_WINDOW_SUPPORTED
          True if always-on-top windows are supported on the platform.
static int BORDER_HELP_BUTTON
          Undecorated border decoration (the value is 65536).
static int BORDER_MAXIMIZE_BUTTON
          Undecorated border decoration (the value is 32768).
static int BORDER_MINIMIZE_BUTTON
          Undecorated border decoration (the value is 16384).
static int BORDER_SYSTEM_MENU
          Undecorated border decoration (the value is 8192).
static int BORDER_TITLE
          Undecorated border decoration (the value is 4096).
static int BORDER_UNDECORATED
          Undecorated border decoration (the value is 2048).
static boolean FULL_SCREEN_WINDOW_SUPPORTED
          True if full screen window is supported on the platform.
static int TYPE_DIALOG
          Dialog window type (the value is 3).
static int TYPE_POPUP
          Tool window type (the value is 9).
static int TYPE_SPLASH_SCREEN
          Splash screen window type (the value is 15).
static int TYPE_TOOL
          Tool window type (the value is 11).
static int TYPE_WINDOW
          Window window type (the value is 1).
static boolean WINDOW_OPACITY_SUPPORTED
          True if window opacity is supported on the platform.
static boolean WINDOW_SHAPE_SUPPORTED
          True if custom window shape is supported on the platform.
 
Fields inherited from class yu.ac.bg.etf.javaqx.qswing.JQComponent
listenerList
 
Fields inherited from interface yu.ac.bg.etf.javaqx.qswing.JQWindowConstants
APPLICATION_MODAL, DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, FULL_SCREEN, HIDE_ON_CLOSE, ICONIFIED, MAXIMIZED, NON_MODAL, NORMAL, POSITION_CUSTOM, QUIT_ON_CLOSE, WINDOW_MODAL
 
Fields inherited from interface yu.ac.bg.etf.javaqx.qswing.properties.JQWindowProperties
PROPERTY_ALWAYS_ON_TOP, PROPERTY_DEFAULT_CLOSE_OPERATION, PROPERTY_ICON_IMAGE, PROPERTY_OPACITY, PROPERTY_SHAPE, PROPERTY_TITLE
 
Fields inherited from interface yu.ac.bg.etf.javaqx.qswing.properties.JQContainerProperties
PROPERTY_LAYOUT_MANAGER
 
Fields inherited from interface yu.ac.bg.etf.javaqx.qswing.properties.JQComponentProperties
PROPERTY_BACKGROUND, PROPERTY_COMPONENT_ORIENTATION, PROPERTY_CONTEXT_MENU, PROPERTY_ENABLED, PROPERTY_FIXED_SIZE, PROPERTY_FOCUSABLE, PROPERTY_FONT, PROPERTY_FOREGROUND, PROPERTY_INSETS, PROPERTY_LOCALE, PROPERTY_MAXIMUM_SIZE, PROPERTY_MINIMUM_SIZE, PROPERTY_NAME, PROPERTY_OPAQUE, PROPERTY_PREFERRED_SIZE, PROPERTY_RESOURCE_BUNDLE_NAME, PROPERTY_STATUS_TIP_TEXT, PROPERTY_STYLE_SHEET, PROPERTY_TOOL_TIP_TEXT, PROPERTY_VISIBLE, PROPERTY_WHATS_THIS_TEXT
 
Constructor Summary
JQWindow()
          Constructs new JQWindow object.
JQWindow(LayoutManager layoutManager)
          Constructs new JQWindow object.
JQWindow(LayoutManager layoutManager, java.lang.String title)
          Constructs new JQWindow object.
JQWindow(java.lang.String title)
          Constructs new JQWindow object.
 
Method Summary
 void addWindowListener(WindowListener listener)
          Adds window listener.
static JQWindow getActiveWindow()
          Returns active window.
 int getBorderDecoration()
          Returns border decoration.
 int getDefaultCloseOperation()
          Returns default close operation.
 Image getIconImage()
          Returns icon image.
 int getModalityType()
          Returns window modality.
 double getOpacity()
          Returns window opacity.
 JQComponent[] getOwnedComponents()
          Return an array containing all the components this component currently owns.
 JQWindow[] getOwnedWindows()
          Return an array containing all the window this window currently owns.
 int getState()
          Returns window state.
 java.lang.String getTitle()
          Returns window title.
 WindowListener[] getWindowListeners()
          Returns window listeners.
 JQWindow getWindowOwner()
          Returns owner of this window.
static JQWindow[] getWindows()
          Returns all live (non disposed) windows.
 int getWindowType()
          Returns window type.
 boolean isAlwaysOnTop()
          Returns true if the window is an always-on-top window.
 boolean isFullScreen()
          Returns true if the window is full screen.
 boolean isModal()
          Returns true if the window is modal.
 boolean isUndecorated()
          Returns true if the window is undecorated (frameless).
protected  java.lang.String paramString()
          Returns parameters string.
protected  void processWindowEvent(WindowEvent event)
          Process window event.
 void removeWindowListener(WindowListener listener)
          Removes window listener.
 void setAlwaysOnTop(boolean alwaysOnTop)
          Sets this window to be always above other windows.
 void setBorderDecoration(int borderDecoration)
          Sets border decoration.
 void setDefaultCloseOperation(int operation)
          Sets default close operation.
 void setFixedSize(Dimension fixedSize)
          Sets fixed size.
 void setFullScreen(boolean fullScreen)
          Sets full screen window.
 void setIconImage(Image iconImage)
          Sets the icon image.
 void setLocationRelativeTo(JQWindow window)
          Sets location of the window relative to the specified window.
 void setModalityType(int modalityType)
          Sets window modality.
 void setOpacity(double opacity)
          Sets window opacity.
 void setState(int state)
          Sets window state.
 void setTitle(java.lang.String title)
          Sets window title.
 void setUndecorated(boolean undecorated)
          Sets/unsets window decoration.
 void setWindowOwner(JQWindow owner)
          Sets the owner of this window.
protected  void setWindowType(int windowType)
          Sets window type.
 void toBack()
          Brings window to the front.
 void toFront()
          Sends window to the back.
 void toggleFullScreen()
          Toggles full screen.
 void updateLocalization()
          Updates localization.
 
Methods inherited from class yu.ac.bg.etf.javaqx.qswing.JQContainer
add, add, add, add, addImpl, doLayout, getComponent, getComponentCount, getComponentIndex, getComponents, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, invalidate, pack, remove, remove, removeAll, setBackground, setComponentOrientation, setForeground, setLayout, validate
 
Methods inherited from class yu.ac.bg.etf.javaqx.qswing.JQComponent
addComponentListener, addFocusListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, disableEvents, disposeComponent, disposeObject, enableEvents, eventEnabled, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getClientProperty, getComponentListeners, getComponentOrientation, getContextMenu, getCursor, getEventMask, getFocusListener, getFont, getFontMetrics, getForeground, getHeight, getInsets, getKeyListeners, getLocale, getLocation, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getOwner, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getResourceBundleName, getSize, getStatusTipText, getStyleSheet, getToolTipText, getToolTipText, getWhatsThisText, getWidth, getX, getY, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFontSet, isForegroundSet, isLeftToRight, isLocaleSet, isOpaque, isOwnerOf, isPainting, isResizable, isResourceBundleNameSet, isUpdatesEnabled, isValid, isVisible, localizeObject, localizeString, localizeString, localizeStrings, paintComponent, processComponentEvent, processContextMenuEvent, processFocusEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, processStyleChange, putClientProperty, removeComponentListener, removeFocusListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, removeStyleSheet, repaint, repaint, repaint, requestFocus, revalidate, setBounds, setBounds, setContextMenu, setCursor, setDefaultResourceBundleName, setDisplayable, setEnabled, setFixedSize, setFocusable, setFont, setInsets, setInsets, setLeftToRightComponentOrientation, setLocale, setLocation, setLocation, setMaximumSize, setMaximumSize, setMinimumSize, setMinimumSize, setName, setOpaque, setPreferredSize, setPreferredSize, setResizable, setResourceBundleName, setRightToLeftComponentOrientation, setSize, setSize, setStatusTipText, setStyleSheet, setStyleSheet, setToolTipText, setUpdatesEnabled, setVisible, setWhatsThisText, toString, unsetComponentOrientation, update, update, update, updateComponentOrientation
 
Methods inherited from class yu.ac.bg.etf.javaqx.core.AbstractDisposable
addDisposeListener, dispose, disposedCheck, disposedErrorString, finalize, isDisposed, removeDisposeListener
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_WINDOW

public static final int TYPE_WINDOW
Window window type (the value is 1).

See Also:
Constant Field Values

TYPE_DIALOG

public static final int TYPE_DIALOG
Dialog window type (the value is 3).

See Also:
Constant Field Values

TYPE_POPUP

public static final int TYPE_POPUP
Tool window type (the value is 9).

See Also:
Constant Field Values

TYPE_TOOL

public static final int TYPE_TOOL
Tool window type (the value is 11).

See Also:
Constant Field Values

TYPE_SPLASH_SCREEN

public static final int TYPE_SPLASH_SCREEN
Splash screen window type (the value is 15).

See Also:
Constant Field Values

BORDER_UNDECORATED

public static final int BORDER_UNDECORATED
Undecorated border decoration (the value is 2048).

See Also:
Constant Field Values

BORDER_TITLE

public static final int BORDER_TITLE
Undecorated border decoration (the value is 4096).

See Also:
Constant Field Values

BORDER_SYSTEM_MENU

public static final int BORDER_SYSTEM_MENU
Undecorated border decoration (the value is 8192).

See Also:
Constant Field Values

BORDER_MINIMIZE_BUTTON

public static final int BORDER_MINIMIZE_BUTTON
Undecorated border decoration (the value is 16384).

See Also:
Constant Field Values

BORDER_MAXIMIZE_BUTTON

public static final int BORDER_MAXIMIZE_BUTTON
Undecorated border decoration (the value is 32768).

See Also:
Constant Field Values

BORDER_HELP_BUTTON

public static final int BORDER_HELP_BUTTON
Undecorated border decoration (the value is 65536).

See Also:
Constant Field Values

WINDOW_OPACITY_SUPPORTED

public static final boolean WINDOW_OPACITY_SUPPORTED
True if window opacity is supported on the platform.


ALWAYS_ON_TOP_WINDOW_SUPPORTED

public static final boolean ALWAYS_ON_TOP_WINDOW_SUPPORTED
True if always-on-top windows are supported on the platform.


FULL_SCREEN_WINDOW_SUPPORTED

public static final boolean FULL_SCREEN_WINDOW_SUPPORTED
True if full screen window is supported on the platform.


WINDOW_SHAPE_SUPPORTED

public static final boolean WINDOW_SHAPE_SUPPORTED
True if custom window shape is supported on the platform.

Constructor Detail

JQWindow

public JQWindow()
Constructs new JQWindow object.


JQWindow

public JQWindow(java.lang.String title)
Constructs new JQWindow object.

Parameters:
title - the window title

JQWindow

public JQWindow(LayoutManager layoutManager)
Constructs new JQWindow object.

Parameters:
layoutManager - the layout manager

JQWindow

public JQWindow(LayoutManager layoutManager,
                java.lang.String title)
Constructs new JQWindow object.

Parameters:
layoutManager - the layout manager
title - the window title
Method Detail

getWindows

public static JQWindow[] getWindows()
Returns all live (non disposed) windows.

NOTE: A window in the returned array can be disposed after method call!

Returns:
all live (non disposed) windows

getActiveWindow

public static JQWindow getActiveWindow()
Returns active window.

Returns:
active window

getWindowType

public int getWindowType()
Returns window type.

Returns:
window type

getTitle

public java.lang.String getTitle()
Returns window title.

Returns:
window title

setTitle

public void setTitle(java.lang.String title)
Sets window title.

Parameters:
title - the window title

getIconImage

public Image getIconImage()
Returns icon image.

Returns:
icon image

setIconImage

public void setIconImage(Image iconImage)
Sets the icon image.

Parameters:
iconImage - the icon image

getOpacity

public double getOpacity()
Returns window opacity.

Returns:
window opacity

setOpacity

public void setOpacity(double opacity)
Sets window opacity.

Parameters:
opacity - the opacity

getDefaultCloseOperation

public int getDefaultCloseOperation()
Returns default close operation.

Returns:
default close operation

setDefaultCloseOperation

public void setDefaultCloseOperation(int operation)
Sets default close operation.

Parameters:
operation - the default operation

getState

public int getState()
Returns window state.

Returns:
window state

setState

public void setState(int state)
Sets window state.

Parameters:
state - int

isModal

public boolean isModal()
Returns true if the window is modal.

Returns:
true if the window is modal

getModalityType

public int getModalityType()
Returns window modality.

Returns:
window modality

setModalityType

public void setModalityType(int modalityType)
Sets window modality.

Parameters:
modalityType - the modality type

isAlwaysOnTop

public boolean isAlwaysOnTop()
Returns true if the window is an always-on-top window.

Returns:
true if the window is an always-on-top window

setAlwaysOnTop

public void setAlwaysOnTop(boolean alwaysOnTop)
Sets this window to be always above other windows.

Parameters:
alwaysOnTop - if true the window is always above other windows

isFullScreen

public boolean isFullScreen()
Returns true if the window is full screen.

Returns:
true if the window is full screen

setFullScreen

public void setFullScreen(boolean fullScreen)
Sets full screen window.

Parameters:
fullScreen - if true the window is full screen window

toggleFullScreen

public void toggleFullScreen()
Toggles full screen.


setLocationRelativeTo

public void setLocationRelativeTo(JQWindow window)
Sets location of the window relative to the specified window.

Parameters:
window - the window

toBack

public void toBack()
Brings window to the front.


toFront

public void toFront()
Sends window to the back.


getBorderDecoration

public int getBorderDecoration()
Returns border decoration.

Returns:
border decoration

setBorderDecoration

public void setBorderDecoration(int borderDecoration)
Sets border decoration.

Parameters:
borderDecoration - the border decoration

isUndecorated

public boolean isUndecorated()
Returns true if the window is undecorated (frameless).

Returns:
true if the window is undecorated

setUndecorated

public void setUndecorated(boolean undecorated)
Sets/unsets window decoration.

Parameters:
undecorated - if false the window is undecorated.

addWindowListener

public void addWindowListener(WindowListener listener)
Adds window listener.

Parameters:
listener - the window listener

removeWindowListener

public void removeWindowListener(WindowListener listener)
Removes window listener.

Parameters:
listener - the window listener

getWindowListeners

public WindowListener[] getWindowListeners()
Returns window listeners.

Returns:
window listeners

getWindowOwner

public final JQWindow getWindowOwner()
Returns owner of this window.

Returns:
owner of this window

setWindowOwner

public void setWindowOwner(JQWindow owner)
Sets the owner of this window.

Parameters:
owner - the owner

getOwnedWindows

public JQWindow[] getOwnedWindows()
Return an array containing all the window this window currently owns.

Returns:
an array containing all the window this window currently owns

setWindowType

protected void setWindowType(int windowType)
Sets window type.

Parameters:
windowType - the window type

processWindowEvent

protected void processWindowEvent(WindowEvent event)
Process window event.

Parameters:
event - the event

setFixedSize

public void setFixedSize(Dimension fixedSize)
Sets fixed size.

Overrides:
setFixedSize in class JQComponent
Parameters:
fixedSize - the fixed size

updateLocalization

public void updateLocalization()
Updates localization.

Overrides:
updateLocalization in class JQContainer

getOwnedComponents

public JQComponent[] getOwnedComponents()
Return an array containing all the components this component currently owns.

Overrides:
getOwnedComponents in class JQContainer

paramString

protected java.lang.String paramString()
Returns parameters string.

Overrides:
paramString in class JQContainer


Copyright © 2007 ETF and contributors. All Rights Reserved.