Author: dumoulin Date: 2008-11-19 14:26:11 +0000 (Wed, 19 Nov 2008) New Revision: 1535 Added: trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/data/RuntimeType.java Removed: trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/data/ComponentType.java Modified: trunk/simexplorer-is/simexplorer-is-entities/ trunk/simexplorer-is/simexplorer-is-entities/pom.xml trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/EntityTypeEnum.java trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/data/Component.java trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/data/Structure.java trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/random/ElementGenerator.java trunk/simexplorer-is/simexplorer-is-swing-generated/ Log: * ComponentType rename to RuntimeType * Component know own subcomponents * Structure entity implementation Property changes on: trunk/simexplorer-is/simexplorer-is-entities ___________________________________________________________________ Name: svn:ignore - target + target .project .classpath .settings Modified: trunk/simexplorer-is/simexplorer-is-entities/pom.xml =================================================================== --- trunk/simexplorer-is/simexplorer-is-entities/pom.xml 2008-11-17 11:23:06 UTC (rev 1534) +++ trunk/simexplorer-is/simexplorer-is-entities/pom.xml 2008-11-19 14:26:11 UTC (rev 1535) @@ -1,58 +1,58 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <!--groupId>simexplorer-is</groupId--> - <artifactId>simexplorer-is-entities</artifactId> - <name>Entities</name> - - <version>${current.version}</version> - <description>simexplorer-is entities module</description> - <packaging>jar</packaging> - - <parent> - <groupId>simexplorer-is</groupId> - <artifactId>simexplorer-is</artifactId> - <version>${current.version}</version> - </parent> - - <profiles> - <profile> - <id>project</id> - <activation> - <activeByDefault>true</activeByDefault> - </activation> - <properties> - <!--launch unit tests--> - <maven.test.skip>false</maven.test.skip> - </properties> - </profile> - </profiles> - - <build> - <plugins> - <plugin> - <groupId>lutinplugin</groupId> - <artifactId>maven-i18n-plugin</artifactId> - <executions> - <execution> - <phase>process-classes</phase> - <goals> - <goal>parserJava</goal> - <goal>gen</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - - <dependencies> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - </dependency> - </dependencies> -</project> +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <!--groupId>simexplorer-is</groupId--> + <artifactId>simexplorer-is-entities</artifactId> + <name>Entities</name> + + <version>${current.version}</version> + <description>simexplorer-is entities module</description> + <packaging>jar</packaging> + + <parent> + <groupId>simexplorer-is</groupId> + <artifactId>simexplorer-is</artifactId> + <version>${current.version}</version> + </parent> + + <profiles> + <profile> + <id>project</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + <properties> + <!--launch unit tests--> + <maven.test.skip>false</maven.test.skip> + </properties> + </profile> + </profiles> + + <build> + <plugins> + <plugin> + <groupId>lutinplugin</groupId> + <artifactId>maven-i18n-plugin</artifactId> + <executions> + <execution> + <phase>process-classes</phase> + <goals> + <goal>parserJava</goal> + <goal>gen</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + + <dependencies> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + </dependency> + </dependencies> +</project> Modified: trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/EntityTypeEnum.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/EntityTypeEnum.java 2008-11-17 11:23:06 UTC (rev 1534) +++ trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/EntityTypeEnum.java 2008-11-19 14:26:11 UTC (rev 1535) @@ -22,7 +22,7 @@ import fr.cemagref.simexplorer.is.entities.attachment.Attachment; import fr.cemagref.simexplorer.is.entities.data.Code; import fr.cemagref.simexplorer.is.entities.data.Component; -import fr.cemagref.simexplorer.is.entities.data.ComponentType; +import fr.cemagref.simexplorer.is.entities.data.RuntimeType; import fr.cemagref.simexplorer.is.entities.data.Constant; import fr.cemagref.simexplorer.is.entities.data.ConstantValue; import fr.cemagref.simexplorer.is.entities.data.Descriptor; @@ -52,7 +52,7 @@ /** The Component. */ Component(true, n_("simexplorer.common.component"), n_("simexplorer.common.components"), Component.class), - ComponentType(false, n_("simexplorer.common.componenttype"), null, ComponentType.class), + ComponentType(false, n_("simexplorer.common.componenttype"), null, RuntimeType.class), /** The Constant. */ Constant(false, n_("simexplorer.common.constant"), n_("simexplorer.common.constants"), Constant.class), Modified: trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/data/Component.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/data/Component.java 2008-11-17 11:23:06 UTC (rev 1534) +++ trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/data/Component.java 2008-11-19 14:26:11 UTC (rev 1535) @@ -21,6 +21,7 @@ import fr.cemagref.simexplorer.is.entities.Entity; import fr.cemagref.simexplorer.is.entities.EntityTypeEnum; import fr.cemagref.simexplorer.is.entities.composite.Codes; +import fr.cemagref.simexplorer.is.entities.composite.Components; import fr.cemagref.simexplorer.is.entities.composite.Constants; import fr.cemagref.simexplorer.is.entities.composite.Libraries; import fr.cemagref.simexplorer.is.entities.composite.Structures; @@ -35,7 +36,9 @@ /** The Constant serialVersionUID. */ private static final long serialVersionUID = 1; /** The component type */ - ComponentType type; + RuntimeType type; + /** The sub-components */ + Components subComponents; /** The constants. */ Constants constants; /** The structures. */ @@ -46,15 +49,43 @@ Libraries libraries; private static final String[] excludeFields = {"excludeFields", "metadataIS"}; - public ComponentType getType() { + /** + * Gets the type + * + * @return the type + */ + public RuntimeType getType() { return type; } - public void setType(ComponentType type) { + /** + * Sets the type + * + * @param type the new type + */ + public void setType(RuntimeType type) { this.type = type; } /** + * Gets the sub-components + * + * @return the sub-components + */ + public Components getSubComponents() { + return subComponents; + } + + /** + * Sets the sub-components + * + * @param subComponents the mew sub-components + */ + public void setSubComponents(Components subComponents) { + this.subComponents = subComponents; + } + + /** * Gets the constants. * * @return the constants @@ -136,6 +167,7 @@ directChildren.add(structures); directChildren.add(codes); directChildren.add(libraries); + directChildren.add(subComponents); return directChildren; } Deleted: trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/data/ComponentType.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/data/ComponentType.java 2008-11-17 11:23:06 UTC (rev 1534) +++ trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/data/ComponentType.java 2008-11-19 14:26:11 UTC (rev 1535) @@ -1,77 +0,0 @@ -/* - * Copyright © 2008, Cemagref - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, - * MA 02110-1301 USA - */ -package fr.cemagref.simexplorer.is.entities.data; - -import fr.cemagref.simexplorer.is.entities.Leaf; -import java.util.ArrayList; -import java.util.List; - -/** - * Used to represent the class of the component at the exploration runtime - * - * @author dumoulin - */ -public class ComponentType extends Leaf { - - /** The Constant serialVersionUID. */ - private static final long serialVersionUID = 1; - private static final String[] excludeFields = {"excludeFields"}; - private String type; - - public ComponentType(String type) { - this.type = type; - } - - public ComponentType(Class type) { - setType(type); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public void setType(Class<?> type) { - this.type = type.getCanonicalName(); - } - - @Override - public String toString() { - assert type != null; - return type; - } - - @Override - public List<String> getRow() { - List<String> row = new ArrayList<String>(); - row.add(toString()); - return row; - } - - /* (non-Javadoc) - * @see fr.cemagref.simexplorer.is.entities.Entity#getExcludeFields() - */ - @Override - protected String[] getExcludeFields() { - return excludeFields; - } -} Copied: trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/data/RuntimeType.java (from rev 1531, trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/data/ComponentType.java) =================================================================== --- trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/data/RuntimeType.java (rev 0) +++ trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/data/RuntimeType.java 2008-11-19 14:26:11 UTC (rev 1535) @@ -0,0 +1,77 @@ +/* + * Copyright © 2008, Cemagref + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 3 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + */ +package fr.cemagref.simexplorer.is.entities.data; + +import fr.cemagref.simexplorer.is.entities.Leaf; +import java.util.ArrayList; +import java.util.List; + +/** + * Used to represent the class of an entity at the exploration runtime + * + * @author dumoulin + */ +public class RuntimeType extends Leaf { + + /** The Constant serialVersionUID. */ + private static final long serialVersionUID = 1; + private static final String[] excludeFields = {"excludeFields"}; + private String type; + + public RuntimeType(String type) { + this.type = type; + } + + public RuntimeType(Class type) { + setType(type); + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public void setType(Class<?> type) { + this.type = type.getCanonicalName(); + } + + @Override + public String toString() { + assert type != null; + return type; + } + + @Override + public List<String> getRow() { + List<String> row = new ArrayList<String>(); + row.add(toString()); + return row; + } + + /* (non-Javadoc) + * @see fr.cemagref.simexplorer.is.entities.Entity#getExcludeFields() + */ + @Override + protected String[] getExcludeFields() { + return excludeFields; + } +} Property changes on: trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/data/RuntimeType.java ___________________________________________________________________ Name: svn:mergeinfo + Modified: trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/data/Structure.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/data/Structure.java 2008-11-17 11:23:06 UTC (rev 1534) +++ trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/data/Structure.java 2008-11-19 14:26:11 UTC (rev 1535) @@ -1,39 +1,89 @@ /* -* ##% Copyright (C) 2008 Cemagref -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see <http://www.gnu.org/licenses/>. -* ##% */ + * ##% Copyright (C) 2008 Cemagref + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * ##% */ package fr.cemagref.simexplorer.is.entities.data; +import fr.cemagref.simexplorer.is.entities.Leaf; +import fr.cemagref.simexplorer.is.entities.composite.Descriptors; +import fr.cemagref.simexplorer.is.entities.composite.Structures; import java.util.ArrayList; import java.util.List; -import fr.cemagref.simexplorer.is.entities.Leaf; /** * The Class Structure. * * @author Code Lutin, Landais Gabriel, Chemit Tony */ -public abstract class Structure extends Leaf { +public class Structure extends Leaf { /** The Constant serialVersionUID. */ private static final long serialVersionUID = 1; + private String name; + private RuntimeType runtimeType; + /** The sub-structures, if any*/ + private Structures subStructures; + /** The descriptors. */ + private Descriptors descriptors; - private static final String[] excludeFields = { "excludeFields" }; + private static final String[] excludeFields = {"excludeFields"}; + public Structure() { + this.subStructures = new Structures(); + this.descriptors = new Descriptors(); + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public RuntimeType getRuntimeType() { + return runtimeType; + } + + public void setRuntimeType(RuntimeType runtimeType) { + this.runtimeType = runtimeType; + } + + public Structures getSubStructures() { + return subStructures; + } + + public void setSubStructures(Structures subStructures) { + this.subStructures = subStructures; + } + + public Descriptors getDescriptors() { + return descriptors; + } + + public void setDescriptors(Descriptors descriptors) { + this.descriptors = descriptors; + } + @Override + public String toString() { + return getName(); + } + + @Override public List<String> getRow() { List<String> row = new ArrayList<String>(); row.add(toString()); Modified: trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/random/ElementGenerator.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/random/ElementGenerator.java 2008-11-17 11:23:06 UTC (rev 1534) +++ trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/random/ElementGenerator.java 2008-11-19 14:26:11 UTC (rev 1535) @@ -38,7 +38,7 @@ import fr.cemagref.simexplorer.is.entities.composite.Structures; import fr.cemagref.simexplorer.is.entities.data.Code; import fr.cemagref.simexplorer.is.entities.data.Component; -import fr.cemagref.simexplorer.is.entities.data.ComponentType; +import fr.cemagref.simexplorer.is.entities.data.RuntimeType; import fr.cemagref.simexplorer.is.entities.data.Constant; import fr.cemagref.simexplorer.is.entities.data.ConstantValue; import fr.cemagref.simexplorer.is.entities.data.Descriptor; @@ -264,7 +264,7 @@ * @throws Exception the exception */ private void processComponent(Component component) throws Exception { - component.setType(new ComponentType(Object.class)); + component.setType(new RuntimeType(Object.class)); Constants constants = generateComposite(Constants.class); for (Constant constant : constants) { processConstant(constant); Property changes on: trunk/simexplorer-is/simexplorer-is-swing-generated ___________________________________________________________________ Name: svn:ignore - target target/* .project .classpath *.iml *.ipr *.iws + target target/* .project .classpath *.iml *.ipr *.iws .settings