Class RevisionComparePresenter
- java.lang.Object
 - 
- org.tweetyproject.beliefdynamics.gui.RevisionComparePresenter
 
 
- 
- All Implemented Interfaces:
 java.awt.event.ActionListener,java.awt.event.ItemListener,java.util.EventListener,javax.swing.event.ChangeListener
public class RevisionComparePresenter extends java.lang.Object implements java.awt.event.ItemListener, javax.swing.event.ChangeListener, java.awt.event.ActionListenerThis class couples the RevisionCompare View and Model, it needs to know the implementation used to load external belief base files, see FileHandler interface. The presenter reacts to user inputs on the view and proofs if the changes are valid and then delegates them to the model. It also registers the view as a PropertyListener to the correct model.- Author:
 - Tim Janus
 
 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceRevisionComparePresenter.FileHandlerThis interface is used by the RevisionComparePresenter to handle the file loading. 
- 
Constructor Summary
Constructors Constructor Description RevisionComparePresenter(RevisionCompareModel model, RevisionCompareView view)Default Ctor: registers the view as listener to the correct model. 
- 
Method Summary
Modifier and Type Method Description voidactionPerformed(java.awt.event.ActionEvent ev)voiditemStateChanged(java.awt.event.ItemEvent ev)static voidmain(java.lang.String[] args)Functional Test method: Only shows the view in a JFrame to test resize behavior.voidsetFileHandler(RevisionComparePresenter.FileHandler handler)Sets a file handler which is responsible to filter the open file dialog and to load the selected file.voidstateChanged(javax.swing.event.ChangeEvent ev) 
 - 
 
- 
- 
Constructor Detail
- 
RevisionComparePresenter
public RevisionComparePresenter(RevisionCompareModel model, RevisionCompareView view)
Default Ctor: registers the view as listener to the correct model.- Parameters:
 model- a revision compare modelview- a view
 
 - 
 
- 
Method Detail
- 
setFileHandler
public void setFileHandler(RevisionComparePresenter.FileHandler handler)
Sets a file handler which is responsible to filter the open file dialog and to load the selected file.- Parameters:
 handler- An implementation of the FileHandler interface or null. If null is given then the default handler is used which cannot open any files.
 
- 
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent ev)
- Specified by:
 actionPerformedin interfacejava.awt.event.ActionListener
 
- 
stateChanged
public void stateChanged(javax.swing.event.ChangeEvent ev)
- Specified by:
 stateChangedin interfacejavax.swing.event.ChangeListener
 
- 
itemStateChanged
public void itemStateChanged(java.awt.event.ItemEvent ev)
- Specified by:
 itemStateChangedin interfacejava.awt.event.ItemListener
 
- 
main
public static void main(java.lang.String[] args)
Functional Test method: Only shows the view in a JFrame to test resize behavior.- Parameters:
 args- arguments
 
 - 
 
 -