fr.ifremer.isisfish.logging.console
Class LogConsoleModel

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

public class LogConsoleModel
extends java.lang.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  java.util.List<java.lang.String> allItems
          list of all items we keep in store
protected  javax.swing.event.ChangeEvent changeEvent
          The unique changeEvent
protected  long firstLinePosition
          the position of the first line in model
protected  java.lang.String from
          default from from mail send
protected  int levels
          the levels to filter
protected  javax.swing.event.EventListenerList listenerList
          to contains listeners
protected  java.io.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  java.lang.String searchText
          the text to filter
protected  java.lang.String smtpServer
          server to use for mail send
protected  java.lang.String to
          default destinataire for mail send
 
Constructor Summary
LogConsoleModel(java.io.File logFile, int nbLinesInEditor, java.lang.String smtpServer, java.lang.String fromMail, java.lang.String to)
           
 
Method Summary
 void addChangeListener(javax.swing.event.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.
 javax.swing.event.ChangeListener[] getChangeListeners()
          Returns an array of all the ChangeListeners added to this AbstractButton with addChangeListener().
 long getFirstLinePosition()
           
 java.lang.String getFrom()
           
 long getLastLinePosition()
           
 int getLevels()
           
 java.io.File getLogFile()
           
 long getNbLines()
           
 int getNbLinesInEditor()
           
 java.lang.String getSearchText()
           
 java.lang.String getSmtpServer()
           
 java.lang.String getText()
           
 boolean isBOF()
           
 boolean isEOF()
           
 void removeChangeListener(javax.swing.event.ChangeListener l)
          Removes a ChangeListener from the button.
 void setEmailFrom(java.lang.String from)
           
 void setEmailTo(java.lang.String to)
           
 void setFirstLinePosition(long firstLinePosition)
           
 void setLevels(int levels)
           
 void setNbLines(long nbLines)
           
 void setNbLinesInEditor(int nbLinesInEditor)
           
 void setSearchText(java.lang.String searchText)
           
 void setSmtpServer(java.lang.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 java.lang.String searchText
the text to filter


levels

protected int levels
the levels to filter


logFile

protected java.io.File logFile
the real log file


smtpServer

protected java.lang.String smtpServer
server to use for mail send


to

protected java.lang.String to
default destinataire for mail send


from

protected java.lang.String from
default from from mail send


firstLinePosition

protected long firstLinePosition
the position of the first line in model


allItems

protected java.util.List<java.lang.String> allItems
list of all items we keep in store


listenerList

protected javax.swing.event.EventListenerList listenerList
to contains listeners


changeEvent

protected javax.swing.event.ChangeEvent changeEvent
The unique changeEvent

Constructor Detail

LogConsoleModel

public LogConsoleModel(java.io.File logFile,
                       int nbLinesInEditor,
                       java.lang.String smtpServer,
                       java.lang.String fromMail,
                       java.lang.String to)
Method Detail

getText

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

canReset

public boolean canReset()

getNbLines

public long getNbLines()

getLogFile

public java.io.File getLogFile()

getFirstLinePosition

public long getFirstLinePosition()

getLastLinePosition

public long getLastLinePosition()

getLevels

public int getLevels()

getSearchText

public java.lang.String getSearchText()

setSmtpServer

public void setSmtpServer(java.lang.String smtpServer)

setEmailTo

public void setEmailTo(java.lang.String to)

setEmailFrom

public void setEmailFrom(java.lang.String from)

setFirstLinePosition

public void setFirstLinePosition(long firstLinePosition)

setSearchText

public void setSearchText(java.lang.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 java.lang.String getFrom()

getSmtpServer

public java.lang.String getSmtpServer()

addChangeListener

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

Parameters:
l - the listener to be added

removeChangeListener

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

Parameters:
l - the listener to be removed

getChangeListeners

public javax.swing.event.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-2010 CodeLutin. All Rights Reserved.