com.objectwave.appArch
Class WindowModel
java.lang.Object
|
+--com.objectwave.appArch.EventSupport
|
+--com.objectwave.appArch.WindowModel
- All Implemented Interfaces:
- java.util.EventListener, PacketListener, PacketProducerIF, PresentationModelIF, java.beans.PropertyChangeListener, WindowModelIF
- Direct Known Subclasses:
- OkCancelModel
- public class WindowModel
- extends EventSupport
- implements WindowModelIF, PresentationModelIF
A window model is different from a presentation model in that it holds
the common event pool. This is important in that it prevents some cyclical
relations from occurring.
A window model is the first PresentationModel in the pool.
Methods inherited from class com.objectwave.appArch.EventSupport |
addPacketListener, addPropertyChangeListener, fireDataAvailable, fireDataChanged, fireDataRequest, firePacket, firePropertyChange, packetAvailable, packetAvailable, packetAvailable, propertyChange, removePacketListener, removePropertyChangeListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
windowClass
protected java.lang.Class windowClass
allowingMultipleInstances
protected boolean allowingMultipleInstances
window
protected java.awt.Window window
closer
protected java.awt.event.WindowListener closer
pool
protected PresentationModelIF pool
WindowModel
public WindowModel()
WindowModel
public WindowModel(java.lang.Class c)
addConsumer
public void addConsumer(PacketListener pm)
- Don't really connect to me. Connect to the pool
- Specified by:
addConsumer
in interface PresentationModelIF
- Overrides:
addConsumer
in class EventSupport
addPresentationModel
public void addPresentationModel(PresentationModelIF pm)
- Specified by:
addPresentationModel
in interface PresentationModelIF
addProducer
public void addProducer(PacketProducerIF pm)
- Don't really connect to me. Connect to the pool
- Specified by:
addProducer
in interface PresentationModelIF
- Overrides:
addProducer
in class EventSupport
createCache
public java.awt.Window createCache()
throws java.lang.ClassNotFoundException,
java.lang.InstantiationException,
java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException,
java.beans.PropertyVetoException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
java.beans.PropertyVetoException
getDefaultWindowListener
public java.awt.event.WindowListener getDefaultWindowListener()
getWindow
public java.awt.Window getWindow()
isAllowingMultipleInstances
public boolean isAllowingMultipleInstances()
- Specified by:
isAllowingMultipleInstances
in interface WindowModelIF
isCached
public boolean isCached()
- It is rare that a screen should be cached, however, it does happen.
- Specified by:
isCached
in interface WindowModelIF
open
public java.awt.Window open()
throws java.lang.ClassNotFoundException,
java.lang.InstantiationException,
java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException,
java.beans.PropertyVetoException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
java.beans.PropertyVetoException
reset
public void reset()
- Called before a new UI is being created for this model.
The function of this method is to clean up any old EventPool listeners.
This should only be called if new Screens are being created for
this particular WindowModel
- Specified by:
reset
in interface WindowModelIF
setAllowingMulitpleInstances
public void setAllowingMulitpleInstances(boolean value)
setDefaultWindowListener
public void setDefaultWindowListener(java.awt.event.WindowListener l)
setTerminateOnClose
public void setTerminateOnClose(boolean value)
setWindow
public void setWindow(java.awt.Window w)
- Description copied from interface:
WindowModelIF
- Allow the window model to clean up before a new instance is created.
- Specified by:
setWindow
in interface WindowModelIF
setWindowClass
public void setWindowClass(java.lang.Class c)