Skip to content

Commit

Permalink
Adding headers and auto-javadoc to msi.gama.documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisDrogoul committed Jan 29, 2022
1 parent f4eece2 commit 2df167b
Show file tree
Hide file tree
Showing 22 changed files with 885 additions and 81 deletions.
25 changes: 15 additions & 10 deletions msi.gama.documentation/src/msi/gama/doc/MainGenerateCatalog.java
@@ -1,24 +1,29 @@
/*********************************************************************************************
*
/*******************************************************************************************************
*
* 'MainGenerateWiki.java', in plugin 'msi.gama.documentation', is part of the source code of the
* GAMA modeling and simulation platform.
* (v. 1.8.1)
* MainGenerateCatalog.java, in msi.gama.documentation, is part of the source code of the
* GAMA modeling and simulation platform (v.1.8.2).
*
* (c) 2007-2020 UMI 209 UMMISCO IRD/UPMC & Partners
*
* Visit https://github.com/gama-platform/gama for license information and developers contact.
*
* (c) 2007-2022 UMI 209 UMMISCO IRD/SU & Partners (IRIT, MIAT, TLU, CTU)
*
* Visit https://github.com/gama-platform/gama for license information and contacts.
*
**********************************************************************************************/
********************************************************************************************************/
package msi.gama.doc;

import msi.gama.doc.transform.XmlToCatalog;
import msi.gama.doc.util.PrepareEnv;
import msi.gama.doc.util.UnifyDoc;

/**
* The Class MainGenerateCatalog.
*/
public class MainGenerateCatalog {

/**
* The main method.
*
* @param args the arguments
*/
public static void main(final String[] args) {
try {
System.out.println("GENERATION OF THE CATALOG FROM JAVA CODE");
Expand Down
26 changes: 16 additions & 10 deletions msi.gama.documentation/src/msi/gama/doc/MainGeneratePDF.java
@@ -1,26 +1,32 @@
/*********************************************************************************************
*
/*******************************************************************************************************
*
* 'MainGenerateWiki.java', in plugin 'msi.gama.documentation', is part of the source code of the
* GAMA modeling and simulation platform.
* (v. 1.8.1)
* MainGeneratePDF.java, in msi.gama.documentation, is part of the source code of the
* GAMA modeling and simulation platform (v.1.8.2).
*
* (c) 2007-2020 UMI 209 UMMISCO IRD/UPMC & Partners
*
* Visit https://github.com/gama-platform/gama for license information and developers contact.
*
* (c) 2007-2022 UMI 209 UMMISCO IRD/SU & Partners (IRIT, MIAT, TLU, CTU)
*
* Visit https://github.com/gama-platform/gama for license information and contacts.
*
**********************************************************************************************/
********************************************************************************************************/
package msi.gama.doc;

import msi.gama.doc.util.ConvertToPDF;
import msi.gama.doc.util.GamaStyleGeneration;
import msi.gama.doc.util.PrepareEnv;

/**
* The Class MainGeneratePDF.
*/
public class MainGeneratePDF {

/** The generate gama style. */
public static boolean generateGamaStyle = false;

/**
* The main method.
*
* @param args the arguments
*/
public static void main(String[] args) {
try {
System.out.println("GENERATION OF THE PDF DOCUMENTATION");
Expand Down
18 changes: 18 additions & 0 deletions msi.gama.documentation/src/msi/gama/doc/MainGenerateTOC.java
@@ -1,3 +1,13 @@
/*******************************************************************************************************
*
* MainGenerateTOC.java, in msi.gama.documentation, is part of the source code of the
* GAMA modeling and simulation platform (v.1.8.2).
*
* (c) 2007-2022 UMI 209 UMMISCO IRD/SU & Partners (IRIT, MIAT, TLU, CTU)
*
* Visit https://github.com/gama-platform/gama for license information and contacts.
*
********************************************************************************************************/
package msi.gama.doc;

import java.io.IOException;
Expand All @@ -6,8 +16,16 @@
import msi.gama.doc.util.PrepareEnv;
import msi.gama.precompiler.doc.utils.Constants;

/**
* The Class MainGenerateTOC.
*/
public class MainGenerateTOC {

/**
* The main method.
*
* @param argc the arguments
*/
public static void main(String[] argc) {
try {
final String tocMDFile = Constants.TOC_SIDEBAR_FILE;
Expand Down
25 changes: 15 additions & 10 deletions msi.gama.documentation/src/msi/gama/doc/MainGenerateWiki.java
@@ -1,16 +1,13 @@
/*********************************************************************************************
*
/*******************************************************************************************************
*
* 'MainGenerateWiki.java', in plugin 'msi.gama.documentation', is part of the source code of the
* GAMA modeling and simulation platform.
* (v. 1.8.1)
* MainGenerateWiki.java, in msi.gama.documentation, is part of the source code of the
* GAMA modeling and simulation platform (v.1.8.2).
*
* (c) 2007-2020 UMI 209 UMMISCO IRD/UPMC & Partners
*
* Visit https://github.com/gama-platform/gama for license information and developers contact.
*
* (c) 2007-2022 UMI 209 UMMISCO IRD/SU & Partners (IRIT, MIAT, TLU, CTU)
*
* Visit https://github.com/gama-platform/gama for license information and contacts.
*
**********************************************************************************************/
********************************************************************************************************/
package msi.gama.doc;

import msi.gama.doc.transform.XmlToWiki;
Expand All @@ -19,8 +16,16 @@
import msi.gama.doc.util.PrepareEnv;
import msi.gama.doc.util.UnifyDoc;

/**
* The Class MainGenerateWiki.
*/
public class MainGenerateWiki {

/**
* The main method.
*
* @param args the arguments
*/
public static void main(final String[] args) {
try {
// build the file keywords.xml
Expand Down
29 changes: 19 additions & 10 deletions msi.gama.documentation/src/msi/gama/doc/transform/XmlToCatalog.java
@@ -1,16 +1,13 @@
/*********************************************************************************************
*
/*******************************************************************************************************
*
* 'XmlToWiki.java', in plugin 'msi.gama.documentation', is part of the source code of the
* GAMA modeling and simulation platform.
* (v. 1.8.1)
* XmlToCatalog.java, in msi.gama.documentation, is part of the source code of the
* GAMA modeling and simulation platform (v.1.8.2).
*
* (c) 2007-2020 UMI 209 UMMISCO IRD/UPMC & Partners
*
* Visit https://github.com/gama-platform/gama for license information and developers contact.
*
* (c) 2007-2022 UMI 209 UMMISCO IRD/SU & Partners (IRIT, MIAT, TLU, CTU)
*
* Visit https://github.com/gama-platform/gama for license information and contacts.
*
**********************************************************************************************/
********************************************************************************************************/
package msi.gama.doc.transform;

import java.io.File;
Expand All @@ -21,7 +18,19 @@
import msi.gama.precompiler.doc.utils.Constants;


/**
* The Class XmlToCatalog.
*/
public class XmlToCatalog {

/**
* Creates the catalog.
*
* @throws ParserConfigurationException the parser configuration exception
* @throws SAXException the SAX exception
* @throws IOException Signals that an I/O exception has occurred.
* @throws TransformerException the transformer exception
*/
public static void createCatalog() throws ParserConfigurationException, SAXException, IOException, TransformerException {
System.out.println("Beginning of the transformation");

Expand Down
@@ -1,3 +1,13 @@
/*******************************************************************************************************
*
* XmlToCategoryXML.java, in msi.gama.documentation, is part of the source code of the
* GAMA modeling and simulation platform (v.1.8.2).
*
* (c) 2007-2022 UMI 209 UMMISCO IRD/SU & Partners (IRIT, MIAT, TLU, CTU)
*
* Visit https://github.com/gama-platform/gama for license information and contacts.
*
********************************************************************************************************/
package msi.gama.doc.transform;

import java.io.File;
Expand All @@ -10,8 +20,19 @@

import msi.gama.precompiler.doc.utils.Constants;

/**
* The Class XmlToCategoryXML.
*/
public class XmlToCategoryXML {

/**
* Creates the category wiki.
*
* @throws ParserConfigurationException the parser configuration exception
* @throws SAXException the SAX exception
* @throws IOException Signals that an I/O exception has occurred.
* @throws TransformerException the transformer exception
*/
public static void createCategoryWiki() throws ParserConfigurationException, SAXException, IOException, TransformerException {
System.out.println("Beginning of the transformation");

Expand Down
@@ -1,15 +1,13 @@
/*********************************************************************************************
*
/*******************************************************************************************************
*
* 'XmlToTestGAML.java', in plugin 'msi.gama.documentation', is part of the source code of the GAMA modeling and
* simulation platform. (v. 1.8.1)
* XmlToTestGAML.java, in msi.gama.documentation, is part of the source code of the
* GAMA modeling and simulation platform (v.1.8.2).
*
* (c) 2007-2020 UMI 209 UMMISCO IRD/UPMC & Partners
*
* Visit https://github.com/gama-platform/gama for license information and developers contact.
*
* (c) 2007-2022 UMI 209 UMMISCO IRD/SU & Partners (IRIT, MIAT, TLU, CTU)
*
* Visit https://github.com/gama-platform/gama for license information and contacts.
*
**********************************************************************************************/
********************************************************************************************************/
package msi.gama.doc.transform;

import java.io.File;
Expand All @@ -31,10 +29,23 @@
import msi.gama.precompiler.doc.utils.XMLElements;
import msi.gama.precompiler.doc.utils.XMLUtils;

/**
* The Class XmlToTestGAML.
*/
public class XmlToTestGAML {

/** The Constant ATT_NAME_FILE. */
public static final String ATT_NAME_FILE = "fileName";

/**
* Creates the each test.
*
* @param docFile the doc file
* @throws ParserConfigurationException the parser configuration exception
* @throws SAXException the SAX exception
* @throws IOException Signals that an I/O exception has occurred.
* @throws TransformerException the transformer exception
*/
public static void createEachTest(final File docFile)
throws ParserConfigurationException, SAXException, IOException, TransformerException {
final File pluginFolder = docFile.getParentFile().getParentFile();
Expand All @@ -60,6 +71,14 @@ public static void createEachTest(final File docFile)

}

/**
* Creates the all tests.
*
* @throws ParserConfigurationException the parser configuration exception
* @throws SAXException the SAX exception
* @throws IOException Signals that an I/O exception has occurred.
* @throws TransformerException the transformer exception
*/
public static void createAllTests()
throws ParserConfigurationException, SAXException, IOException, TransformerException {
Document document = XMLUtils.createDoc(Constants.DOCGAMA_GLOBAL_FILE);
Expand Down Expand Up @@ -95,11 +114,33 @@ public static void createAllTests()
System.out.println("End of the transformation");
}

/**
* Creates the master test.
*
* @param document the document
* @param xsl the xsl
* @param targetFolder the target folder
* @param targetFile the target file
* @throws ParserConfigurationException the parser configuration exception
* @throws SAXException the SAX exception
* @throws IOException Signals that an I/O exception has occurred.
*/
private static void createMasterTest(final Document document, final String xsl, final String targetFolder,
final String targetFile) throws ParserConfigurationException, SAXException, IOException {
XMLUtils.transformDocument(document, xsl, targetFolder + File.separator + targetFile);
}

/**
* Creates the operators tests.
*
* @param document the document
* @param xsl the xsl
* @param targetFolder the target folder
* @throws ParserConfigurationException the parser configuration exception
* @throws SAXException the SAX exception
* @throws IOException Signals that an I/O exception has occurred.
* @throws TransformerException the transformer exception
*/
private static void createOperatorsTests(final Document document, final String xsl, final String targetFolder)
throws ParserConfigurationException, SAXException, IOException, TransformerException {

Expand Down Expand Up @@ -153,6 +194,12 @@ private static void createOperatorsTests(final Document document, final String x
// Cleaning means:
// - Category: remove space and minus characters in the category name to be able to use it in the model
// - Operators: replace special characters like +, -, *, /
/**
* Clean document test.
*
* @param doc the doc
* @return the document
*/
// - Operators and statements: addition of an index to have different variables
public static Document cleanDocumentTest(final Document doc) {
final NameOperatorConverter nameConverter = new NameOperatorConverter();
Expand Down Expand Up @@ -205,13 +252,26 @@ public static void main(final String[] args) throws Exception {
createAllTests();
}

/**
* The Class NameOperatorConverter.
*/
static class NameOperatorConverter {

/** The proper name operator map. */
HashMap<String, String> properNameOperatorMap;

/**
* Instantiates a new name operator converter.
*/
public NameOperatorConverter() {
properNameOperatorMap = initProperNameOperatorMap();
}

/**
* Inits the proper name operator map.
*
* @return the hash map
*/
private HashMap<String, String> initProperNameOperatorMap() {
final HashMap<String, String> hm = new HashMap<String, String>();
hm.put("*", "Multiply");
Expand All @@ -235,6 +295,12 @@ private HashMap<String, String> initProperNameOperatorMap() {
return hm;
}

/**
* Gets the proper operator name.
*
* @param opName the op name
* @return the proper operator name
*/
public String getProperOperatorName(final String opName) {
if (properNameOperatorMap.containsKey(opName)) {
return properNameOperatorMap.get(opName);
Expand Down

0 comments on commit 2df167b

Please sign in to comment.