/** * Called when the names of the files were changed. The event contains the three strings * representing the names of the files. */ public void filesNamesChanged(FilesTypeEvent event) { if (event.getFirstFile() != null) { scriptComponent.setContents(event.getFirstFile()); notifyControllerListeners(ControllerEvent.SCRIPT_CHANGE, event.getFirstFile()); } if (event.getSecondFile() != null) { outputComponent.setContents(event.getSecondFile()); } if (event.getThirdFile() != null) { comparisonComponent.setContents(event.getThirdFile()); } }
// called when the load script button is pressed. private void scriptPressed() { int returnVal = fileChooser.showDialog(this, "Load Script"); if (returnVal == JFileChooser.APPROVE_OPTION) { notifyControllerListeners( ControllerEvent.SCRIPT_CHANGE, fileChooser.getSelectedFile().getAbsoluteFile()); scriptComponent.setContents(fileChooser.getSelectedFile().getAbsolutePath()); } }
/** Called when the output file is updated. */ public void outputFileUpdated() { outputComponent.refresh(); }
/** Sets the current comparison line. */ public void setCurrentComparisonLine(int line) { comparisonComponent.setSelectedRow(line); }
/** Sets the current output line. */ public void setCurrentOutputLine(int line) { outputComponent.setSelectedRow(line); }
/** Sets the current script line. */ public void setCurrentScriptLine(int line) { scriptComponent.setSelectedRow(line); }
/** Sets the comparison file name with the given one. */ public void setComparisonFile(String fileName) { comparisonComponent.setContents(fileName); }
/** Sets the output file name with the given one. */ public void setOutputFile(String fileName) { outputComponent.setContents(fileName); }
/** Sets the script file name with the given one. */ public void setScriptFile(String fileName) { scriptComponent.setContents(fileName); }