Project MVC architecture
version 0.1 - 010723

lib.gui.mvc
Class Model

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--lib.gui.mvc.Model
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class Model
extends java.awt.Container

Model is part of the the MVC architecture.
Synopsis ...see also...overview
  o-o Model o-----------o View o-o
  |     o                  o     |
  |     |                  |     |
  |     |                  |     |
  |     o---o Controler o--o     |
  |               o              |
  |               |              |
  |               |              |
  |               o              |
  o--------o CommandListener o---o
                  o
                  |
                  o
             Application (ex: ViewTest)

 ImageCanvas ImageLabel ImageButton ObjectSpec

 Trace
 

Version:
2001-07-22
Author:
Ivan Wellesz - ivanw@club-internet.fr
See Also:
Serialized Form

Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock
 
Field Summary
protected  CommandListener commandListener
          The MVC application listener instance handling commands received from the Contoler.
protected  Controler controler
          The MVC Controler instance dispatching commands associated to input events.
private static java.lang.String MODEL
          Identifier used to sign warning and trace messages.
 
Fields inherited from class java.awt.Container
component, containerListener, containerSerializedDataVersion, dbg, dispatcher, layoutMgr, listeningBoundsChildren, listeningChildren, maxSize, ncomponents, printing, printingThreads, serialVersionUID
 
Fields inherited from class java.awt.Component
accessibleContext, actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, privateKey, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Model(Controler controler)
          Model controler.
 
Method Summary
 void beep()
          public beep - Emits a audible message.
 boolean componentValueChanged(java.awt.Component component)
          public componentValueChanged - Handles a modification of a TextComponent contents.
static Model create_model_tracer(Controler _controler)
          create_model_tracer - Returns a verbose Model instance.
 void displayAction(java.lang.String action)
          public displayAction String - Displays the current action in the status bar.
 java.awt.Component get_default_Focus_Component()
          public get_default_Focus_Component - Returns the default Focus Component.
 void helpDropBubble()
          public helpDropBubble - Undisplays any current help tooltip bubble.
 void next(boolean arg)
          public next - Handles the history forward stepping.
 boolean parse_command(java.awt.Component src, java.lang.String cmd)
          public parse_command - Parses the user selected action command.
 boolean parse_TextField(java.awt.TextField t)
          public parse_TextField - Handles a validation request from a TextField.
 void previous(boolean arg)
          public previous - Handles the history back stepping.
 void print()
          public print - Calls the application print processing.
 boolean quit()
          public quit - Handle the quit Component command.
 void setCommandListener(CommandListener commandListener)
          setCommandListener - Associates the application instance to the Model.
 
Methods inherited from class java.awt.Container
, add, add, add, add, add, addContainerListener, addImpl, addNotify, adjustListeningChildren, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventImpl, dispatchEventToSelf, doLayout, eventEnabled, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, initIDs, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, nextFocus, numListening, paint, paintComponents, paintHeavyweightComponents, paramString, postProcessKeyEvent, postsOldMouseEvents, preferredSize, preProcessKeyEvent, print, printComponents, printHeavyweightComponents, processContainerEvent, processEvent, proxyEnableEvents, proxyRequestFocus, readObject, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusOwner, setFont, setLayout, transferFocus, update, validate, validateTree, writeObject
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, checkWindowClosingException, coalesceEvents, constructComponentName, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleContext, getAccessibleIndexInParent, getAccessibleStateSet, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkit, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isRecursivelyVisible, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, resetGC, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

MODEL

private static final java.lang.String MODEL
Identifier used to sign warning and trace messages.

commandListener

protected CommandListener commandListener
The MVC application listener instance handling commands received from the Contoler.
The MVC application must implement the CommandListener interface and be referenced by this member. Model will invoke its method implementation before it attempts to handle the received command on its own.
See Also:
setCommandListener(lib.gui.mvc.CommandListener)

controler

protected Controler controler
The MVC Controler instance dispatching commands associated to input events.
Constructor Detail

Model

public Model(Controler controler)
Model controler. // {{{
Creates a Model instance associated to the controler argument.
Parameters:
controler - the Controler MVC instance to associate
Method Detail

create_model_tracer

public static Model create_model_tracer(Controler _controler)
create_model_tracer - Returns a verbose Model instance. // {{{
This testing Model instance prints processing traces while executing.
Overloads the parse_command(Component, command) which handle the QUIT, START and STOP commands and returns a true diagnostic to the Controler. The STOP command is used to exercise some TextArea interaction for test purpose.
Other commands are just printed, and a false diagnostic is returned to the Controler.
Parameters:
_controler - the Controler MVC instance to associate

setCommandListener

public void setCommandListener(CommandListener commandListener)
setCommandListener - Associates the application instance to the Model. // {{{
Parameters:
commandListener - the CommandListener application instance to associate to the Model

get_default_Focus_Component

public java.awt.Component get_default_Focus_Component()
public get_default_Focus_Component - Returns the default Focus Component. // {{{
When the focus is gained by a top level frame, the Controler asks for the default Component to whitch it should be propagated.

displayAction

public void displayAction(java.lang.String action)
public displayAction String - Displays the current action in the status bar. // {{{
Parameters:
action - a descrition of the current processing

beep

public void beep()
public beep - Emits a audible message. // {{{

print

public void print()
public print - Calls the application print processing. // {{{

previous

public void previous(boolean arg)
public previous - Handles the history back stepping. // {{{

next

public void next(boolean arg)
public next - Handles the history forward stepping. // {{{

helpDropBubble

public void helpDropBubble()
public helpDropBubble - Undisplays any current help tooltip bubble. // {{{

quit

public boolean quit()
public quit - Handle the quit Component command. // {{{
If not handled by commandListener, this will result in a call to System.exit( 0 ).

componentValueChanged

public boolean componentValueChanged(java.awt.Component component)
public componentValueChanged - Handles a modification of a TextComponent contents. // {{{
See Also:
CommandListener

parse_command

public boolean parse_command(java.awt.Component src,
                             java.lang.String cmd)
public parse_command - Parses the user selected action command. // {{{
See Also:
CommandListener

parse_TextField

public boolean parse_TextField(java.awt.TextField t)
public parse_TextField - Handles a validation request from a TextField. // {{{
This method is triggered when the user hits the Return key in a TextField.
See Also:
CommandListener

MVC architecture

Document Tech Infos - Ivan Wellesz