Package org.openscience.cdk.io.listener
Class TextGUIListener
- java.lang.Object
-
- org.openscience.cdk.io.listener.TextGUIListener
-
- All Implemented Interfaces:
EventListener
,IChemObjectIOListener
,IReaderListener
,IWriterListener
public class TextGUIListener extends Object implements IReaderListener, IWriterListener
Allows processing of IOSetting quesions which are passed to the user by using the System.out and System.in by default.This listener can also be used to list all the questions a ChemObjectWriter has, by using a dummy StringWriter, and a
null
Reader.- Author:
- Egon Willighagen <egonw@sci.kun.nl>
- Source code:
- main
- Belongs to CDK module:
- io
-
-
Constructor Summary
Constructors Constructor Description TextGUIListener(IOSetting.Importance level)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
frameRead(ReaderEvent event)
Indicates that a new frame has been read.void
processIOSettingQuestion(IOSetting setting)
Processes the IOSettings by listing the question, giving the options and asking the user to provide their choice.void
setInputReader(Reader reader)
Overwrites the default reader from which the input is taken.void
setLevel(IOSetting.Importance level)
void
setOutputWriter(Writer writer)
Overwrites the default writer to which the output is directed.
-
-
-
Constructor Detail
-
TextGUIListener
public TextGUIListener(IOSetting.Importance level)
-
-
Method Detail
-
setLevel
public void setLevel(IOSetting.Importance level)
-
setOutputWriter
public void setOutputWriter(Writer writer)
Overwrites the default writer to which the output is directed.
-
setInputReader
public void setInputReader(Reader reader)
Overwrites the default reader from which the input is taken.
-
frameRead
public void frameRead(ReaderEvent event)
Description copied from interface:IReaderListener
Indicates that a new frame has been read.- Specified by:
frameRead
in interfaceIReaderListener
- Parameters:
event
- information about the event.
-
processIOSettingQuestion
public void processIOSettingQuestion(IOSetting setting)
Processes the IOSettings by listing the question, giving the options and asking the user to provide their choice.Note: if the input reader is
null
, then the method does not wait for an answer, and takes the default.- Specified by:
processIOSettingQuestion
in interfaceIChemObjectIOListener
-
-