Project MVC architecture
version 0.1 - 010723

lib.gui.mvc
Class Controler

java.lang.Object
  |
  +--lib.gui.mvc.Controler
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.ComponentListener, java.util.EventListener, java.awt.event.ItemListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.TextListener

public class Controler
extends java.lang.Object
implements java.awt.event.ComponentListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.event.TextListener

Controler is part of the the MVC architecture.

Synopsis

Version:
2001-07-22
Author:
Ivan Wellesz - ivanw@club-internet.fr

Field Summary
private static java.lang.String CONTROLER
          Identifier used to sign warning and trace messages.
private  boolean key_alt_down
          Current ALT Key modifier depressed state.
private  boolean key_control_down
          Current CONTROL Key modifier depressed state.
private  boolean key_shift_down
          Current SHIFT Key modifier depressed state.
protected  java.awt.event.MouseEvent last_MouseEvent
          Remember last mouse event to make it avaliale to MVC components.
protected  int message_callback_reason
          The current dialog message callback switch to handle ACCEPT or CANCEL user selection.
private  Model model
          The Model instance of the MVC.
private  boolean mouseBtnPressed
          Current mouse button depressed state.
private  View view
          The View instance of the MVC.
 
Constructor Summary
Controler(View view)
          Controler View.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent a)
          public actionPerformed - GUI buttons callback.
private  void addListeners(java.awt.Container container)
          addListeners.
 void componentHidden(java.awt.event.ComponentEvent e)
          public componentHidden.
 void componentMoved(java.awt.event.ComponentEvent e)
          public componentMoved.
 void componentResized(java.awt.event.ComponentEvent e)
          public componentResized.
 void componentShown(java.awt.event.ComponentEvent e)
          public componentShown.
 void dispose()
          dispose - Destroys any allocated resources.
 boolean get_Component_State(java.lang.String cName)
          public get_Component_State.
 ImageButton get_toggle_ImageButton(java.lang.String tbName)
          private get_toggle_ImageButton.
 java.awt.Component getComponent(java.lang.String cName, java.lang.Class instanceClass)
          private getComponent.
 Model getModel()
          getModel - Returns the current associated Model instance.
 java.lang.String getText(java.lang.String tcName)
          public getText.
 void itemStateChanged(java.awt.event.ItemEvent ie)
          public itemStateChanged - Process GUI choice callbacks.
 void keyPressed(java.awt.event.KeyEvent keyEvent)
          public keyPressed.
 void keyReleased(java.awt.event.KeyEvent keyEvent)
          public keyReleased.
 void keyTyped(java.awt.event.KeyEvent keyEvent)
          public keyTyped.
 void mouseClicked(java.awt.event.MouseEvent mouseEvent)
          public mouseClicked.
 void mouseDragged(java.awt.event.MouseEvent mouseEvent)
          public mouseDragged.
 void mouseEntered(java.awt.event.MouseEvent mouseEvent)
          public mouseEntered.
 void mouseExited(java.awt.event.MouseEvent mouseEvent)
          public mouseExited.
 void mouseMoved(java.awt.event.MouseEvent mouseEvent)
          public mouseMoved.
 void mousePressed(java.awt.event.MouseEvent mouseEvent)
          public mousePressed.
 void mouseReleased(java.awt.event.MouseEvent mouseEvent)
          public mouseReleased.
private  boolean parse_command(java.awt.Component src, java.lang.String cmd)
          private parse_command - Parse GUI components callbacks.
private  boolean parse_scheduled_message_callback()
          private parse_scheduled_message_callback - Parse scheduled message callbacks.
 void set_Component_State(java.lang.String cName, boolean state)
          public set_Component_State.
protected  void setModel(Model model)
          setModel.
 void setText(java.lang.String tcName, java.lang.String txt)
          public setText.
 void setView(View view)
          setView.
 void textValueChanged(java.awt.event.TextEvent e)
          public void textValueChanged - TextListener interface methods.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

CONTROLER

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

view

private View view
The View instance of the MVC.

model

private Model model
The Model instance of the MVC.

key_alt_down

private boolean key_alt_down
Current ALT Key modifier depressed state.

key_control_down

private boolean key_control_down
Current CONTROL Key modifier depressed state.

key_shift_down

private boolean key_shift_down
Current SHIFT Key modifier depressed state.

mouseBtnPressed

private boolean mouseBtnPressed
Current mouse button depressed state.

message_callback_reason

protected int message_callback_reason
The current dialog message callback switch to handle ACCEPT or CANCEL user selection.

last_MouseEvent

protected java.awt.event.MouseEvent last_MouseEvent
Remember last mouse event to make it avaliale to MVC components.
Constructor Detail

Controler

public Controler(View view)
Controler View. // {{{
Instanciate an initial default Model.
It may change later when setModel is called by the Model instance itself.
Method Detail

dispose

public void dispose()
dispose - Destroys any allocated resources. // {{{

getModel

public Model getModel()
getModel - Returns the current associated Model instance. // {{{

setModel

protected void setModel(Model model)
setModel. // {{{
Replaces the default Model with the specified instance. This method is typicaly called by the Model constructor.

setView

public void setView(View view)
setView. // {{{ Associate the specified View instance of the MVC.
Controler instance will register itself as Listener to all View Components.
See Also:
addListeners(java.awt.Container)

get_Component_State

public boolean get_Component_State(java.lang.String cName)
public get_Component_State. // {{{

set_Component_State

public void set_Component_State(java.lang.String cName,
                                boolean state)
public set_Component_State. // {{{

setText

public void setText(java.lang.String tcName,
                    java.lang.String txt)
public setText. // {{{

getText

public java.lang.String getText(java.lang.String tcName)
public getText. // {{{

get_toggle_ImageButton

public ImageButton get_toggle_ImageButton(java.lang.String tbName)
private get_toggle_ImageButton. // {{{

getComponent

public java.awt.Component getComponent(java.lang.String cName,
                                       java.lang.Class instanceClass)
private getComponent. // {{{

addListeners

private void addListeners(java.awt.Container container)
addListeners. // {{{ Controler instance registers itself as Listener to all View Components.
See Also:
setView(lib.gui.mvc.View)

componentResized

public void componentResized(java.awt.event.ComponentEvent e)
public componentResized. // {{{
Specified by:
componentResized in interface java.awt.event.ComponentListener
See Also:
java.awt.Component#componentResized

componentMoved

public void componentMoved(java.awt.event.ComponentEvent e)
public componentMoved. // {{{
Specified by:
componentMoved in interface java.awt.event.ComponentListener
See Also:
java.awt.Component#componentMoved

componentShown

public void componentShown(java.awt.event.ComponentEvent e)
public componentShown. // {{{
Specified by:
componentShown in interface java.awt.event.ComponentListener
See Also:
java.awt.Component#componentShown

componentHidden

public void componentHidden(java.awt.event.ComponentEvent e)
public componentHidden. // {{{
Specified by:
componentHidden in interface java.awt.event.ComponentListener
See Also:
java.awt.Component#componentHidden

keyPressed

public void keyPressed(java.awt.event.KeyEvent keyEvent)
public keyPressed. // {{{
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent keyEvent)
public keyReleased. // {{{
Specified by:
keyReleased in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent keyEvent)
public keyTyped. // {{{
Specified by:
keyTyped in interface java.awt.event.KeyListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent mouseEvent)
public mouseEntered. // {{{
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent mouseEvent)
public mouseExited. // {{{
Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent mouseEvent)
public mousePressed. // {{{
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent mouseEvent)
public mouseReleased. // {{{
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent mouseEvent)
public mouseClicked. // {{{ Mouse button has been released, not moved since it has been pressed.
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent mouseEvent)
public mouseDragged. // {{{ Mouse pointer has been moved whith a button depressed.
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent mouseEvent)
public mouseMoved. // {{{ No button has been depressed yet
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent ie)
public itemStateChanged - Process GUI choice callbacks. // {{{
Specified by:
itemStateChanged in interface java.awt.event.ItemListener
Parameters:
ie - Choice event

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent a)
public actionPerformed - GUI buttons callback. // {{{
Specified by:
actionPerformed in interface java.awt.event.ActionListener

parse_scheduled_message_callback

private boolean parse_scheduled_message_callback()
private parse_scheduled_message_callback - Parse scheduled message callbacks. // {{{

parse_command

private boolean parse_command(java.awt.Component src,
                              java.lang.String cmd)
private parse_command - Parse GUI components callbacks. // {{{

textValueChanged

public void textValueChanged(java.awt.event.TextEvent e)
public void textValueChanged - TextListener interface methods. // {{{
Specified by:
textValueChanged in interface java.awt.event.TextListener

MVC architecture

Document Tech Infos - Ivan Wellesz