org.nuiton.log
Class MonitorMapper

java.lang.Object
  extended by org.nuiton.log.MonitorMapper
All Implemented Interfaces:
ActionListener, EventListener, LutinLogListener

public class MonitorMapper
extends Object
implements LutinLogListener, ActionListener

Helper to monitor LutinLog. This class permit to say which component used to display text, which component used to display progress and what is the cancel button

Author:
poussin

Field Summary
protected  Component cancel
           
protected  boolean changeCancelText
           
protected  Component label
           
protected  LutinLog lutinLog
           
protected  Container parentContainer
           
protected  JProgressBar progress
           
 
Constructor Summary
MonitorMapper(LutinLog lutinLog, Container parentContainer, Component label, JProgressBar progress, Component cancel, boolean changeCancelText)
           
 
Method Summary
 void actionPerformed(ActionEvent e)
           
protected  void addActionListener(Component c, ActionListener action)
          Try to call addActionListener on component, do nothing if call failed
 void logEvent(LutinLogEvent e)
           
 void progressEvent(LutinProgressEvent e)
           
protected  void setText(Component c, String text)
          try to call setText on component, do nothing if call failed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lutinLog

protected LutinLog lutinLog

parentContainer

protected Container parentContainer

label

protected Component label

progress

protected JProgressBar progress

cancel

protected Component cancel

changeCancelText

protected boolean changeCancelText
Constructor Detail

MonitorMapper

public MonitorMapper(LutinLog lutinLog,
                     Container parentContainer,
                     Component label,
                     JProgressBar progress,
                     Component cancel,
                     boolean changeCancelText)
Parameters:
lutinLog - LutinLog to monitor
parentContainer - component that contains all other component if not null, then when task begin setVisible(true) is called and when task end setVisible(false) is called
label - component that have setText method to display user log (JLabel, JTextField, ...)
progress - progress widget
cancel - componant that have addActionListener (JButton,Button, ...)
changeCancelText - if true try to change text display in cancel component switch between "Cancel" and "Don't cancel"
Method Detail

addActionListener

protected void addActionListener(Component c,
                                 ActionListener action)
Try to call addActionListener on component, do nothing if call failed

Parameters:
c -
action -

setText

protected void setText(Component c,
                       String text)
try to call setText on component, do nothing if call failed

Parameters:
c -
text - text to put in component

logEvent

public void logEvent(LutinLogEvent e)
Specified by:
logEvent in interface LutinLogListener

progressEvent

public void progressEvent(LutinProgressEvent e)
Specified by:
progressEvent in interface LutinLogListener

actionPerformed

public void actionPerformed(ActionEvent e)
Specified by:
actionPerformed in interface ActionListener


Copyright © 2004-2009 CodeLutin. All Rights Reserved.