public code v1

This commit is contained in:
Francisco Jesús Martínez Mimbrera
2026-05-23 00:32:57 +02:00
commit 759a8968a2
4357 changed files with 163763 additions and 0 deletions
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>flintstones.group</groupId>
<artifactId>flintstones.bundles</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>flintstones.application.perspective.rating.ui</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<name>[bundle] RatingUI</name>
<organization>
<name>Sinbad2</name>
</organization>
</project>
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>flintstones.application.perspective.rating.ui</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<filteredResources>
<filter>
<id>1779484362532</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
@@ -0,0 +1,7 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
@@ -0,0 +1,20 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: flintstones.application.perspective.rating.ui;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: %Bundle-Vendor
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Automatic-Module-Name: flintstones.rating.ui
Import-Package: org.osgi.service.event
Require-Bundle: org.eclipse.jface,
javax.inject,
org.eclipse.e4.core.services,
org.eclipse.e4.core.contexts,
flintstones.model.domain.service,
flintstones.model.ui.service,
flintstones.helper.chainvalidator,
org.eclipse.e4.ui.services,
org.eclipse.e4.core.di,
flintstones.entity.domain
Export-Package: flintstones.application.perspective.rating.ui.dialogs
@@ -0,0 +1,6 @@
#Properties file for flintstones.rating.ui
Bundle-Vendor = Sinbad2
Bundle-Name = RatingUI
phase.name = Method selection
phasemethod_ui.description = DESC
phasemethod_ui.name = NAME
@@ -0,0 +1,6 @@
#Properties file for flintstones.rating.ui
Bundle-Vendor = Sinbad2
Bundle-Name = RatingUI
phase.name = Selecci\u00F3n de metodo
phasemethod_ui.description = DESC
phasemethod_ui.name = NAME
@@ -0,0 +1,8 @@
output.. = bin/
bin.includes = META-INF/,\
.,\
fragment.e4xmi,\
OSGI-INF/l10n/bundle.properties,\
OSGI-INF/,\
faq/
source.. = src/
@@ -0,0 +1,7 @@
# Method Selection Phase
From this phase you can select a method to be loaded. Green methods are the ones that can be executed with the data that was collected during the previous phases.
To check why a method can not be executed you can view the conditios for it to be executed in the show algorithm button.
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="ASCII"?>
<fragment:ModelFragments xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:advanced="http://www.eclipse.org/ui/2010/UIModel/application/ui/advanced" xmlns:basic="http://www.eclipse.org/ui/2010/UIModel/application/ui/basic" xmlns:fragment="http://www.eclipse.org/ui/2010/UIModel/fragment" xmi:id="_O6nFECFnEei-PuSOcjnBBg">
<fragments xsi:type="fragment:StringModelFragment" xmi:id="_O6nFESFnEei-PuSOcjnBBg" featurename="children" parentElementId="flintstones.application.perspectivestack.modes">
<elements xsi:type="advanced:Perspective" xmi:id="_O6nFEiFnEei-PuSOcjnBBg" elementId="flintstones.application.perspective.rating" label="%flintstones.application.perspective.rating.label">
<children xsi:type="basic:Part" xmi:id="_R2dyMCFnEei-PuSOcjnBBg" elementId="flintstones.rating.ui.part.window" contributionURI="bundleclass://flintstones.application.perspective.rating.ui/flintstones.application.perspective.rating.ui.MethodContainerPartUI"/>
</elements>
</fragments>
</fragment:ModelFragments>
@@ -0,0 +1,276 @@
package flintstones.application.perspective.rating.ui.dialogs;
import java.util.ArrayList;
import javax.inject.Inject;
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.e4.core.services.nls.Translation;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.widgets.Composite;
import flintstones.application.perspective.rating.ui.messages.Messages;
import flintstones.helper.chainvalidator.ChainValidator;
import flintstones.helper.chainvalidator.Statement;
import flintstones.helper.chainvalidator.operation.BaseOperation;
import flintstones.helper.chainvalidator.operation.method.ValidFuzzysetDomainsOperation;
import flintstones.helper.chainvalidator.pseudocode.Generator;
import flintstones.model.domain.service.IDomainService;
import flintstones.model.ui.service.UiService;
/**
* The Class AlgorithmDialog.
*/
public class Algorithm {
/** The translation. */
@Inject
@Translation
private Messages messages;
/** The context. */
@Inject
IEclipseContext context;
/** The ui service. */
/** The domain service. */
@Inject
IDomainService domainService;
/** The container. */
private Composite container;
/** The left box. */
//private StyledText leftBox;
/** The right box. */
private StyledText rightBox;
/** The bottom box. */
private StyledText bottomBox;
/** The IF statements. */
ArrayList<Statement> statements = new ArrayList<>();
/**
* Instantiates a new algorithm dialog. This dialog will show the method conditions to be executed.
*
* @param shell the shell
*/
/* (non-Javadoc)
*
* @see
* org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.
* Composite) */
public void drawAlgorithm(Composite parent) {
container = parent;
Composite upContainer = new Composite(this.container, SWT.NONE);
UiService.setGridLayout(upContainer, 1);
UiService.setGridData(upContainer, 9, 9, true, false);
// UiService.setMargin(upContainer, 15);
Composite bottomContainer = new Composite(this.container, SWT.NONE);
UiService.setGridLayout(bottomContainer, 1);
UiService.setGridData(bottomContainer, 9, 9, true, false);
// UiService.setMargin(container, 15);
/*Label leftLabel = new Label(upContainer, SWT.NONE);
UiService.setFont(leftLabel, UiService.FONT_SECTION_TITLE);
leftLabel.setText(this.messages.AlgorithmDialog_Algorithm);*/
/*Label rightLabel = new Label(upContainer, SWT.NONE);
UiService.setFont(rightLabel, UiService.FONT_SECTION_TITLE);
rightLabel.setText(this.messages.AlgorithmDialog_Algorithm_instantation);*/
/*this.leftBox = new StyledText(upContainer, SWT.BORDER | SWT.READ_ONLY | SWT.MULTI | SWT.WRAP);
UiService.setGridLayout(this.leftBox, 1);
UiService.setGridData(this.leftBox, 9, 9, true, false);*/
this.rightBox = new StyledText(upContainer, SWT.BORDER | SWT.READ_ONLY | SWT.MULTI | SWT.WRAP);
UiService.setGridLayout(this.rightBox, 1);
UiService.setGridData(this.rightBox, 9, 9, true, false);
this.bottomBox = new StyledText(bottomContainer, SWT.BORDER | SWT.READ_ONLY | SWT.MULTI | SWT.WRAP);
UiService.setGridLayout(this.bottomBox, 1);
UiService.setGridData(this.bottomBox, 9, 9, true, false);
//this.bottomBox.setText("\n"); //$NON-NLS-1$
this.drawContent();
}
/**
* Gets the demo generator.
*
* @return the demo generator
*/
@SuppressWarnings("nls")
private Generator getDemoGenerator() {
Generator generator = ContextInjectionFactory.make(Generator.class, this.context);
// Variables que obtendramos en runtime
int tamEdLinList = 1;
boolean edNum = true;
boolean edIntFALLO = false;
boolean edLinUnb = true;
boolean edHesit = true;
int numExperts = 1;
int numDomains = 1;
ArrayList<ChainValidator> validators = new ArrayList<>();
ChainValidator c = ContextInjectionFactory.make(ChainValidator.class, this.context)
.setReturn("Modelo computacional 2-tuplas") //$NON-NLS-1$
.isTrue("ALGO?", true) //$NON-NLS-1$
.named("edLin[1].2T") //$NON-NLS-1$
.equals("Nmero de dominios linguisticos", 1, tamEdLinList) //$NON-NLS-1$
.named("tamEdLinList"); //$NON-NLS-1$
validators.add(c);
c = ContextInjectionFactory.make(ChainValidator.class, this.context)
.setReturn("Enfoque de fusin para la manipulacin de informacinn heterognea") //$NON-NLS-1$
.isTrue("Es dominio numerico", edNum) //$NON-NLS-1$
.named("edNum") //$NON-NLS-1$
.or()
.isTrue("Es dominio entero", edIntFALLO) //$NON-NLS-1$
.named("edInt"); //$NON-NLS-1$
validators.add(c);
c = ContextInjectionFactory.make(ChainValidator.class, this.context)
.setReturn("Metodologa para tratar con conjuntos de trminos lingisticos no balanceados") //$NON-NLS-1$
.isTrue("Es dominio linguistico no balanceado", edLinUnb) //$NON-NLS-1$
.named("edLinUnb"); //$NON-NLS-1$
validators.add(c);
c = ContextInjectionFactory.make(ChainValidator.class, this.context)
.setReturn("Informacin Lingistica Hesitant 2-tuplas") //$NON-NLS-1$
.isTrue("Es dominio hesitant", edHesit) //$NON-NLS-1$
.named("edHesit") //$NON-NLS-1$
.greaterThan("Numero de expertos", 1, numExperts) //$NON-NLS-1$
.named("numExperts") //$NON-NLS-1$
.equals("Numero de dominios", 1, numDomains) //$NON-NLS-1$
.named("numDomains"); //$NON-NLS-1$
validators.add(c);
c = ContextInjectionFactory.make(ChainValidator.class, this.context)
.setReturn("Hesitant Fuzzy Linguistic Term Set") //$NON-NLS-1$
.isTrue("Es dominio hesitant", edHesit) //$NON-NLS-1$
.named("edHesit") //$NON-NLS-1$
.equals("Numero de expertos", 1, numExperts) //$NON-NLS-1$
.named("numExperts") //$NON-NLS-1$
.equals("Numero de dominios", 1, numDomains) //$NON-NLS-1$
.named("numDomains"); //$NON-NLS-1$
validators.add(c);
c = ContextInjectionFactory.make(ChainValidator.class, this.context)
.setReturn("Informacin Lingistica Difusa Hesitant con terminos en 2-tuplas") //$NON-NLS-1$
.isTrue("Es dominio hesitant", edHesit) //$NON-NLS-1$
.named("edHesit") //$NON-NLS-1$
.greaterThan("Numero de dominios", 1, numDomains) //$NON-NLS-1$
.named("numDomains"); //$NON-NLS-1$
validators.add(c);
c = ContextInjectionFactory.make(ChainValidator.class, this.context)
.setReturn("Prueba") //$NON-NLS-1$
.custom(new ValidFuzzysetDomainsOperation("dominios", this.domainService.getAll())) //$NON-NLS-1$
.named("domains"); //$NON-NLS-1$
validators.add(c);
validators.stream()
.forEach(k -> {
generator.addStatement(k.getStatement());
});
return generator;
}
/**
* Draw content of the dialog. It will draw valid statement if avaliable. Else it will render the default example.
*/
private void drawContent() {
Generator generator = ContextInjectionFactory.make(Generator.class, this.context);
if (this.statements.isEmpty())
generator = this.getDemoGenerator();
else
this.statements.stream()
.forEach(generator::addStatement);
//generator.drawStyledPseudoCode(this.leftBox, false);
generator.drawStyledPseudoCode(this.rightBox, true);
//this.addDescriptionListener(generator);
this.addValidationListener(generator);
}
/**
* Adds the description onclick listener.
*
* @param generator the generator
*/
/*private void addDescriptionListener(Generator generator) {
this.leftBox.addMouseListener(new MouseListener() {
@Override
public void mouseUp(MouseEvent e) {
}
@Override
public void mouseDown(MouseEvent e) {
BaseOperation op = generator.getOperator(Algorithm.this.leftBox.getSelection());
if (op != null && op.getDescription() != null)
Algorithm.this.bottomBox.setText(op.getDescription());
}
@Override
public void mouseDoubleClick(MouseEvent e) {
}
});
}*/
/**
* Adds the validation box onclick listener.
*
* @param generator the generator
*/
private void addValidationListener(Generator generator) {
this.rightBox.addMouseListener(new MouseListener() {
@Override
public void mouseUp(MouseEvent e) {
}
@Override
public void mouseDown(MouseEvent e) {
BaseOperation op = generator.getOperator(Algorithm.this.rightBox.getSelection());
if (op != null && op.getValidationMessage() != null)
Algorithm.this.bottomBox.setText(op.getValidationMessage());
}
@Override
public void mouseDoubleClick(MouseEvent e) {
}
});
}
/**
* Adds the If statements to be draw.
*
* @param statement the statement
*/
public void addStatement(Statement statement) {
this.statements.add(statement);
}
public void clearStatements() {
this.statements.clear();
}
}
@@ -0,0 +1,31 @@
// This file has been auto-generated
package flintstones.application.perspective.rating.ui.messages;
import org.eclipse.e4.core.services.nls.Message;
@Message
@SuppressWarnings("javadoc")
public class Messages {
public String AlgorithmDialog_Algorithm;
public String AlgorithmDialog_Algorithm_instantation;
public String AlgorithmDialog_btn_close;
public String checks;
public String Container_back_button;
public String Container_method_label;
public String Container_next_button;
public String Container_reset_button;
public String Container_step_label;
public String Container_step_label_default;
public String Container_step_template;
public String messagesFormat;
public String method_selection;
public String phasename;
public String RatingView_All_information_will_be_lost;
public String RatingView_Cancel_confirm;
public String RatingView_Method_description;
public String RatingView_Method_phases;
public String RatingView_SUITABLE;
public String show_algorith_button;
}
@@ -0,0 +1,27 @@
AlgorithmDialog_Algorithm=Algorithm
AlgorithmDialog_Algorithm_instantation=Algorithm instantiation
AlgorithmDialog_btn_close=Close
checks=Checks
Container_back_button=Back
Container_method_label=Method:
Container_next_button=Next
Container_reset_button=Reset
Container_step_label=Step:
Container_step_label_default=(0/0)
Container_step_template=( %d / %d )
messagesFormat={0} ({1})
method_selection=Method Selection
phasename=Method Selection
RatingView_All_information_will_be_lost=All information will be lost
RatingView_Cancel_confirm=Cancel confirm
RatingView_Method_description=Method description
RatingView_Method_phases=Method phases
RatingView_SUITABLE=\ (SUITABLE)
show_algorith_button=Show Algorithm
RatingView_All_information_will_be_lost=All the information will be lost
RatingView_Cancel_confirm=Confirm cancel
RatingView_Method_description=Method Description
RatingView_Method_phases=Method phases
checks=Checks
phasename=Method selection
show_algorith_button=Show algorithm
@@ -0,0 +1,18 @@
RatingView_All_information_will_be_lost=Toda la información se perderá
RatingView_Cancel_confirm=Confirmar cancelación
RatingView_Method_description=Descripción de método
RatingView_Method_phases=Fases de método
RatingView_SUITABLE=\ (RECOMENDADO)
checks=Condiciones
Container_back_button=Anterior
Container_method_label=Metodo:
Container_next_button=Siguiente
Container_reset_button=Reiniciar
Container_step_label=Paso:
Container_step_label_default=(0/0)
Container_step_template=( %d / %d )
messagesFormat={0} ({1})
method_selection=Selección de metodo
phasename=Selección de metodo
RatingView_All_information_will_be_lost=Toda la información se perderá
show_algorith_button=Mostrar algoritmo