fr.ifremer.isisfish.logging.console
Class LogConsoleModel

java.lang.Object
  extended by fr.ifremer.isisfish.logging.console.LogConsoleModel

public class LogConsoleModel
extends Object

This class is the model used in LogConsole.

The model deals with ChangeEvent to notify ui, model has changed.

Author:
chemit

Field Summary
protected  List<String> allItems
          list of all items we keep in store
protected  ChangeEvent changeEvent
          The unique changeEvent
protected  long firstLinePosition
          the position of the first line in model
protected  String from
          default from from mail send
protected  int levels
          the levels to filter
protected  EventListenerList listenerList
          to contains listeners
protected  File logFile
          the real log file
protected  long nbLines
          the size of the stream
protected  int nbLinesInEditor
          the maximum number of items to display in ui
protected  String searchText
          the text to filter
protected  String smtpServer
          server to use for mail send
protected  String to
          default destinataire for mail send
 
Constructor Summary
LogConsoleModel(File logFile, int nbLinesInEditor, String smtpServer, String fromMail, String to)
           
 
Method Summary
 void addChangeListener(ChangeListener l)
          Adds a ChangeListener to the button.
 boolean canReset()
           
protected  void fireStateChanged()
          Notifies all listeners that have registered interest for notification on this event type.
 ChangeListener[] getChangeListeners()
          Returns an array of all the ChangeListeners added to this AbstractButton with addChangeListener().
 long getFirstLinePosition()
           
 String getFrom()
           
 long getLastLinePosition()
           
 int getLevels()
           
 File getLogFile()
           
 long getNbLines()
           
 int getNbLinesInEditor()
           
 String getSearchText()
           
 String getSmtpServer()
           
 String getText()
           
 boolean isBOF()
           
 boolean isEOF()
           
 void removeChangeListener(ChangeListener l)
          Removes a ChangeListener from the button.
 void setEmailFrom(String from)
           
 void setEmailTo(String to)
           
 void setFirstLinePosition(long firstLinePosition)
           
 void setLevels(int levels)
           
 void setNbLines(long nbLines)
           
 void setNbLinesInEditor(int nbLinesInEditor)
           
 void setSearchText(String searchText)
           
 void setSmtpServer(String smtpServer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nbLinesInEditor

protected int nbLinesInEditor
the maximum number of items to display in ui


nbLines

protected long nbLines
the size of the stream


searchText

protected String searchText
the text to filter


levels

protected int levels
the levels to filter


logFile

protected File logFile
the real log file


smtpServer

protected String smtpServer
server to use for mail send


to

protected String to
default destinataire for mail send


from

protected String from
default from from mail send


firstLinePosition

protected long firstLinePosition
the position of the first line in model


allItems

protected List<String> allItems
list of all items we keep in store


listenerList

protected EventListenerList listenerList
to contains listeners


changeEvent

protected ChangeEvent changeEvent
The unique changeEvent

Constructor Detail

LogConsoleModel

public LogConsoleModel(File logFile,
                       int nbLinesInEditor,
                       String smtpServer,
                       String fromMail,
                       String to)
Method Detail

getText

public String getText()
Returns:
the text to be displayed in ui

canReset

public boolean canReset()

getNbLines

public long getNbLines()

getLogFile

public File getLogFile()

getFirstLinePosition

public long getFirstLinePosition()

getLastLinePosition

public long getLastLinePosition()

getLevels

public int getLevels()

getSearchText

public String getSearchText()

setSmtpServer

public void setSmtpServer(String smtpServer)

setEmailTo

public void setEmailTo(String to)

setEmailFrom

public void setEmailFrom(String from)

setFirstLinePosition

public void setFirstLinePosition(long firstLinePosition)

setSearchText

public void setSearchText(String searchText)

setNbLines

public void setNbLines(long nbLines)

setLevels

public void setLevels(int levels)

getNbLinesInEditor

public int getNbLinesInEditor()

setNbLinesInEditor

public void setNbLinesInEditor(int nbLinesInEditor)

isBOF

public boolean isBOF()

isEOF

public boolean isEOF()

getFrom

public String getFrom()

getSmtpServer

public String getSmtpServer()

addChangeListener

public void addChangeListener(ChangeListener l)
Adds a ChangeListener to the button.

Parameters:
l - the listener to be added

removeChangeListener

public void removeChangeListener(ChangeListener l)
Removes a ChangeListener from the button.

Parameters:
l - the listener to be removed

getChangeListeners

public ChangeListener[] getChangeListeners()
Returns an array of all the ChangeListeners added to this AbstractButton with addChangeListener().

Returns:
all of the ChangeListeners added or an empty array if no listeners have been added
Since:
1.4

fireStateChanged

protected void fireStateChanged()
Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created.

See Also:
EventListenerList


Copyright © 1999-2012 CodeLutin. All Rights Reserved.