qflib 0.98.0

de.qfs.lib.config
Class RelativeDialogConfigWrapper

java.lang.Object
  |
  +--de.qfs.lib.config.ConfigWrapper
        |
        +--de.qfs.lib.config.DialogConfigWrapper
              |
              +--de.qfs.lib.config.RelativeDialogConfigWrapper
All Implemented Interfaces:
java.awt.event.ComponentListener, Configurable, java.util.EventListener

public class RelativeDialogConfigWrapper
extends DialogConfigWrapper

Special configuration wrapper that stores the Dialog location relative to some other window instead of as absolute screen values.

Since:
0.98.0
Version:
$Revision: 1.2 $
Author:
Gregor Schmid

Field Summary
protected  boolean constrain
          Whether to constrain the dialog to the screen
protected  java.awt.Point location
          The stored relative location of the dialog.
protected  EventQueueMark mark
          Mark to distinguish user events from artificial ones.
protected  java.awt.Window master
          The master window to position relative to.
protected  java.lang.String reference
          The reference for the Dialog's location, one of "Absolute", "Center", "Northwest", "Northeast", "Southwest" and "Southeast".
protected  boolean storeSize
          Whether to store the dialog's size as well as its location.
 
Fields inherited from class de.qfs.lib.config.DialogConfigWrapper
dialog, regHelper
 
Constructor Summary
RelativeDialogConfigWrapper(java.awt.Dialog dialog, java.lang.String name, boolean constrain, boolean storeSize)
          Create a new RelativeDialogConfigWrapper.
 
Method Summary
 void componentMoved(java.awt.event.ComponentEvent e)
          Notify the RelativeDialogConfigWrapper that its dialog has moved.
 void componentResized(java.awt.event.ComponentEvent e)
          Notify the RelativeDialogConfigWrapper that a window was resized.
 java.util.Properties getConfigurableState()
          Get the Configurable's state.
protected  void getLocation()
          Determine location and reference relative to the master window.
protected  void restore(java.awt.Dimension size, java.awt.Point location)
          Restore the dialog's size and location.
 void setConfigurableState(java.util.Properties state)
          Set the Configurable's state.
protected  void setLocation(java.awt.Dimension size)
          Set the dialog's location relative to its master.
 void setMaster(java.awt.Window window)
          Set the master window for the dialog.
 
Methods inherited from class de.qfs.lib.config.DialogConfigWrapper
componentHidden, componentShown, registrationChanged, setClient
 
Methods inherited from class de.qfs.lib.config.ConfigWrapper
addPackage, getConfigurableName, makeWrapper, makeWrapper, setConfigurableName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

master

protected java.awt.Window master
The master window to position relative to.

location

protected java.awt.Point location
The stored relative location of the dialog. Must be stored since the Dialog's location may have been overridden to constrain it to the screen.

reference

protected java.lang.String reference
The reference for the Dialog's location, one of "Absolute", "Center", "Northwest", "Northeast", "Southwest" and "Southeast".

mark

protected EventQueueMark mark
Mark to distinguish user events from artificial ones.

constrain

protected boolean constrain
Whether to constrain the dialog to the screen

storeSize

protected boolean storeSize
Whether to store the dialog's size as well as its location.
Constructor Detail

RelativeDialogConfigWrapper

public RelativeDialogConfigWrapper(java.awt.Dialog dialog,
                                   java.lang.String name,
                                   boolean constrain,
                                   boolean storeSize)
Create a new RelativeDialogConfigWrapper.
Method Detail

setMaster

public void setMaster(java.awt.Window window)
Set the master window for the dialog.
Parameters:
window - The new master.

getConfigurableState

public java.util.Properties getConfigurableState()
Get the Configurable's state.
Overrides:
getConfigurableState in class DialogConfigWrapper
Following copied from class: de.qfs.lib.config.ConfigWrapper
Returns:
An empty Properties object.

setConfigurableState

public void setConfigurableState(java.util.Properties state)
Set the Configurable's state.
Overrides:
setConfigurableState in class DialogConfigWrapper
Following copied from class: de.qfs.lib.config.ConfigWrapper
Parameters:
state - The state to set. Ignored.

componentMoved

public void componentMoved(java.awt.event.ComponentEvent e)
Notify the RelativeDialogConfigWrapper that its dialog has moved.
Overrides:
componentMoved in class DialogConfigWrapper
Parameters:
e - Details about the event.

componentResized

public void componentResized(java.awt.event.ComponentEvent e)
Notify the RelativeDialogConfigWrapper that a window was resized.
Overrides:
componentResized in class DialogConfigWrapper
Parameters:
e - Details about the event.

restore

protected void restore(java.awt.Dimension size,
                       java.awt.Point location)
Restore the dialog's size and location.
Overrides:
restore in class DialogConfigWrapper
Parameters:
size - The size to set.
location - The location to set.

setLocation

protected void setLocation(java.awt.Dimension size)
Set the dialog's location relative to its master.
Parameters:
size - The new size for the dialog.

getLocation

protected void getLocation()
Determine location and reference relative to the master window.

qflib 0.98.0