Commit aae6e010 authored by pfreon's avatar pfreon
Browse files

Addition of tabs in Help->Documentation

Addition of tabs in Help->Documentation for the Reference guide & Tutorial &changes in 2 HLP files.
parent bda666b5
package fr.ird.climprod;
// Permet l'ouverture d'un fichier pdf quelle que soit la plateforme (Linux, Mac, Windows).
import java.awt.Desktop;
import java.io.File;
public class AnyPlatformAppPDF {
public static void mainPDF(String PDFpathfilename) {
try {
File pdfFile = new File(PDFpathfilename);
if (pdfFile.exists()) {
if (Desktop.isDesktopSupported()) {
Desktop.getDesktop().open(pdfFile);
} else {
System.out.println("Awt Desktop is not supported!");
}
} else {
System.out.println("PDF file does not exist!");
MsgDialogBox msg = new MsgDialogBox(0, "PDF file not found.\nPlease check if there are pdf files in your directory\nC:/Program Files/CLIMPROD_5.0/Documents/\nIf not please uninstall and resinstall CLIMPROD\nand accept the default location of the software.\nYour data files will not be lost.", 0, Global.CadreMain);
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
// Tentative de suppression ligne incommplète dans fichier input data .CLI
// Ne marche pas complètement.
package fr.ird.climprod;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.*;
public class Application extends JFrame {
private JTable table;
private DefaultTableModel model;
private Object[][] data;
private String[] columnNames;
private JButton button;
public Application() {
setTitle("RemoveSelectedRow Test");
data = new Object[][] {{"101", "Ramesh"}, {"102", "Adithya"}, {"103", "Jai"}, {"104", "Sai"}};
columnNames = new String[] {"ID", "Name"};
model = new DefaultTableModel(data, columnNames);
table = new JTable(model);
table.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
button = new JButton("Remove");
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
// check for selected row first
if(table.getSelectedRow() != -1) {
// remove selected row from the model
model.removeRow(table.getSelectedRow());
JOptionPane.showMessageDialog(null, "Selected row deleted successfully");
}
}
});
add(new JScrollPane(table), BorderLayout.CENTER);
add(button, BorderLayout.SOUTH);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(400, 300);
setLocationRelativeTo(null);
setVisible(true);
}
public static void main(String args[]) {
new Application();
}
}
......@@ -8,6 +8,8 @@ import java.awt.event.*;
import javax.swing.*;
import java.io.*;
import java.net.URL;
import java.io.IOException;
import javax.swing.filechooser.FileFilter;
import java.util.StringTokenizer;
......@@ -23,11 +25,17 @@ public class CadreMain extends JFrame {
JPanel contentPane;
JMenuBar menuBar1 = new JMenuBar();
JMenu menuFile = new JMenu();
JMenuItem menuFileExit = new JMenuItem();
JMenuItem menuFileExit = new JMenuItem();
JMenu menuHelp = new JMenu();
JMenuItem menuHelpAbout = new JMenuItem();
JMenuItem menuHelpReferences = new JMenuItem();
JMenuItem menuHelpHowTo = new JMenuItem();
JMenuItem menuHelpHowTo = new JMenuItem();
JMenuItem menuHelpReferences = new JMenuItem();
JMenuItem menuHelpAbout = new JMenuItem();
JMenu menuHelpDoc = new JMenu();
JMenuItem submenuTuto = new JMenuItem(); //"Tutorial"
JMenuItem submenuGuide = new JMenuItem(); // "Reference guide"
JMenuItem menuFileOpen = new JMenuItem();
JMenuItem menuFileCreate = new JMenuItem();
JMenuItem menuFileFolder = new JMenuItem();
......@@ -37,7 +45,7 @@ public class CadreMain extends JFrame {
JMenu menuPlots = new JMenu();
JMenuItem menuPlotTime = new JMenuItem();
JMenuItem menuPlotHistogr = new JMenuItem();
JMenuItem menuPlotHistogr = new JMenuItem();
JMenuItem menuPlotBivariate = new JMenuItem();
JMenuItem menuPlotFitted = new JMenuItem();
JMenuItem menuPlotResiduals = new JMenuItem();
......@@ -101,7 +109,7 @@ public class CadreMain extends JFrame {
System.exit(0);
}
TexteRegles.initScript(inRegle, inComment);
InputStream inRep = CadreMain.class.getResourceAsStream("resources/Arbre_decisions.csv");
if (inRep == null) {
MsgDialogBox msg = new MsgDialogBox(0, "FATAL ERROR\nFile Arbre_decisions.csv not found", 0, this);
......@@ -147,7 +155,7 @@ public class CadreMain extends JFrame {
this.setIconImage(Toolkit.getDefaultToolkit().createImage(CadreMain.class.getResource("resources/images/Climprod.jpg")));
contentPane = (JPanel) this.getContentPane();
contentPane.setLayout(new GridLayout(1, 2));
this.setTitle("Climprod beta-5.0"); // beta version ici
this.setTitle("Climprod 5.2 beta"); // beta version ici
this.addWindowListener(new java.awt.event.WindowAdapter() {
public void windowActivated(WindowEvent e) {
......@@ -181,7 +189,34 @@ public class CadreMain extends JFrame {
helpHowTo_actionPerformed(e);
}
});
menuHelpDoc.setText("Documentation");
menuHelpDoc.setMnemonic(KeyEvent.VK_D);
menuHelpDoc.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
HelpDoc_actionPerformed(e);
}
});
submenuTuto.setText("Tutorial");
submenuTuto.setMnemonic(KeyEvent.VK_T);
submenuTuto.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
DocTuto_actionPerformed(e);
}
});
submenuGuide.setText("Reference guide");
submenuGuide.setMnemonic(KeyEvent.VK_G);
submenuGuide.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
DocGuide_actionPerformed(e);
}
});
menuHelpReferences.setText("References");
menuHelpReferences.setMnemonic(KeyEvent.VK_R);
menuHelpReferences.addActionListener(new ActionListener() {
......@@ -213,7 +248,7 @@ public class CadreMain extends JFrame {
}
});
menuFileCreate.setText("Create a new Climprod data file");
menuFileCreate.setText("Create a new CLIMPROD data file");
menuFileCreate.setMnemonic(KeyEvent.VK_C);
menuFileCreate.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C,InputEvent.CTRL_DOWN_MASK));
menuFileCreate.addActionListener(new java.awt.event.ActionListener() {
......@@ -224,7 +259,7 @@ public class CadreMain extends JFrame {
}
});
menuFileFolder.setText("Build a history html & graphs folder");
menuFileFolder.setText("Build a history html & graphs directory");
menuFileFolder.setMnemonic(KeyEvent.VK_M);
menuFileFolder.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_M,InputEvent.CTRL_DOWN_MASK));
menuFileFolder.addActionListener(new java.awt.event.ActionListener() {
......@@ -391,7 +426,7 @@ public class CadreMain extends JFrame {
menuModelsResults_actionPerformed(e);
}
});
menuFileOpenFolder.setText("Open an existing html & graphs folder");
menuFileOpenFolder.setText("Open an existing html & graphs directory");
menuPlots.add(menuPlotTime);
menuPlots.add(menuPlotHistogr);
menuPlots.add(menuPlotBivariate);
......@@ -400,6 +435,7 @@ public class CadreMain extends JFrame {
menuPlots.add(menuPlotJacknife);
menuPlots.add(menuPlotThreeVariate);
menuPlots.add(menuPlotMsy);
menuModels.add(menuModelsSelect);
menuModels.add(menuModelsDirectly);
menuModels.addSeparator();
......@@ -408,6 +444,7 @@ public class CadreMain extends JFrame {
menuModels.add(menuModelsResults);
menuOptions.add(menuOptionsBavard);
menuFile.add(menuFileOpen);
menuFile.add(menuFileCreate);
menuFile.add(menuFileExit);
......@@ -416,8 +453,12 @@ public class CadreMain extends JFrame {
menuFile.add(menuFileOpenFolder);
menuHelp.add(menuHelpHowTo);
menuHelp.add(menuHelpDoc);
menuHelpDoc.add(submenuTuto); //Adding menu items to the sub-menu
menuHelpDoc.add(submenuGuide);
menuHelp.add(menuHelpReferences);
menuHelp.add(menuHelpAbout);
menuBar1.add(menuFile);
menuBar1.add(menuModels);
menuBar1.add(menuPlots);
......@@ -508,7 +549,50 @@ public class CadreMain extends JFrame {
dlg.setModal(true);
dlg.setVisible(true);
}
public void HelpDoc_actionPerformed(ActionEvent e) {
}
public void DocTuto_actionPerformed(ActionEvent e) {
//File pdfFile = new File(getClass().getClassLoader().getResource("Freon_et_al_FAO_Manuel_Climprod_1993.pdf").getFile()); // Ne marche pas, à réparer pour lire fichier pdf dans climprod\resources?
//AnyPlatformAppPDF.mainPDF(getClass().getClassLoader().getResource("Freon_et_al_FAO_Manuel_Climprod_1993.pdf").getFile()); // Ne marche pas, à réparer pour lire fichier pdf dans climprod\resources?
AnyPlatformAppPDF.mainPDF("C:/Program Files/CLIMPROD_5.0/Documents/Tutorial_CLIMPROD_5.0.pdf");
//jarPDF(); // Ne marche pas, à réparer pour lire fichier pdf dans climprod\resources?
}
public void DocGuide_actionPerformed(ActionEvent e) {
AnyPlatformAppPDF.mainPDF("C:/Program Files/CLIMPROD_5.0/Documents/Reference_Guide_CLIMPROD_5.0.pdf");
}
/* public void jarPDF(){
InputStream jarPdf = getClass().getClassLoader().getResourceAsStream(Global.pdf$);
// System.out.println("Global.pdf$: " + Global.pdf$ + jarPdf.getClass()); //
try {
File pdfTemp = new File("Freon_et_al_FAO_Manuel_Climprod_1993.pdf");
// Extraction du PDF qui se situe dans l'archive
FileOutputStream fos = new FileOutputStream(pdfTemp);
while (jarPdf.available() > 0) {
fos.write(jarPdf.read());
} // while (pdfInJar.available() > 0)
fos.close();
// Ouverture du PDF
Desktop.getDesktop().open(pdfTemp);
} // try
catch (Exception ex) {
ex.printStackTrace();
}
}*/
// get file from classpath, resources folder
private File getFileFromResources() {
ClassLoader classLoader = getClass().getClassLoader();
URL resource = classLoader.getResource(Global.pdf$);
System.out.println("resource = " + resource);
if (resource == null) {
throw new IllegalArgumentException("PDF file is not found!");
} else {
return new File(resource.getFile());
}
}
public void helpReferences_actionPerformed(ActionEvent e) {
CadreMain_ReferencesBox dlg = new CadreMain_ReferencesBox(this);
......@@ -623,7 +707,7 @@ public class CadreMain extends JFrame {
void menuFileFolder_actionPerformed(ActionEvent e) {
RapportHtml dlg = new RapportHtml(this, this.makeFaits());
dlg.setTitle("Climprod: Build a html & graphs folder ");
dlg.setTitle("Climprod: Build an html & graphs directory ");
dlg.setModal(true);
dlg.setVisible(true);
int d;
......@@ -728,6 +812,7 @@ public class CadreMain extends JFrame {
b5 = Global.test_jackknife; // Autorise sous-menu Use the model for prediction
}
this.jPanData.setVisible(b1);
this.menuFileOpenFolder.setEnabled(b1);
this.menuFileFolder.setEnabled(b1);
this.menuModels.setEnabled(b1);
this.menuModelsResults.setEnabled(b2);
......@@ -1213,11 +1298,7 @@ public class CadreMain extends JFrame {
menuItemOpenFolder_actionPerformed(e);
}
});
menuFileOpenFolder.add(menuItemOpenFolder[i]);
}
}
}
......@@ -12,13 +12,13 @@ the goodness of the fit. If your fishery is on a non-equilibrium situation
(transitional state) with respect to E (several exploited year classes and
an increasing effort, for instance) and/or with respect to V (influence of
environment over several years) some points may be located outside the
the two lines even in the case of a good fit. Look at the next graphs and
two lines even in the case of a good fit. Look at the next graphs and
next statistical results for goodness-of-fit estimation.
In the case of the additive model: CPUE = a exp(b E) + c V + d, surprising
results may be observed, such as an exponential growth of the production
when effort is increasing, which is not a realistic predictive model (never-
theless such a model may be used to describe the historical data).
when effort is increasing, which is not a realistic predictive model
(nevertheless such a model may be used to describe the historical data).
Answer YES if the general shape of the function corresponds to a reasonable
modelization in your case.
......
Is there a strong instability in the cpue time series?
Is there a strong instability in the CPUE time series?
Answer Yes if the CPUE time-series presents large fluctuations in a short
time (over 100%, not autocorrelated, providing an erratic aspect of the plot).
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment