public code v1
This commit is contained in:
@@ -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>
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
<?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.method.common.phase.generateUnificationDomain.ui</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
<name>[bundle] Ui</name>
|
||||
</project>
|
||||
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>flintstones.method.common.phase.generateUnificationDomain.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>1779484362650</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>
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding/<project>=UTF-8
|
||||
+7
@@ -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
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Ui
|
||||
Bundle-SymbolicName: flintstones.method.common.phase.generateUnificationDomain.ui;singleton:=true
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Automatic-Module-Name: flintstones.method.common.phase.generateUnificationDomain.ui
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Require-Bundle: flintstones.method.common.phase.generateUnificationDomain,
|
||||
org.eclipse.swt,
|
||||
flintstones.domain.fuzzyset.ui.dialog,
|
||||
flintstones.method.common.phase.unification,
|
||||
flintstones.domain.fuzzyset,
|
||||
org.eclipse.wb.swt,
|
||||
flintstones.entity.domain,
|
||||
flintstones.domain.fuzzyset.ui.chart,
|
||||
flintstones.entity.method.phase,
|
||||
flintstones.entity.method.phase.ui,
|
||||
org.jfree.chart.jfreechart,
|
||||
javax.inject
|
||||
@@ -0,0 +1,5 @@
|
||||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
plugin.xml
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?eclipse version="3.4"?>
|
||||
<plugin>
|
||||
<extension
|
||||
point="flintstones.phasemethod.ui">
|
||||
<phasemethod_ui
|
||||
uid="flintstones.method.common.phase.generateUnificationDomain.ui"
|
||||
implementation="flintstones.method.common.phase.generateUnificationDomain.ui.GenerateUnificationDomainUi"
|
||||
phasemethod="flintstones.method.common.phase.generateUnificationDomain">
|
||||
</phasemethod_ui>
|
||||
</extension>
|
||||
|
||||
</plugin>
|
||||
+181
@@ -0,0 +1,181 @@
|
||||
package flintstones.method.common.phase.generateUnificationDomain.ui;
|
||||
|
||||
import java.util.List;
|
||||
import javax.inject.Inject;
|
||||
import org.eclipse.e4.core.services.nls.Translation;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.ControlAdapter;
|
||||
import org.eclipse.swt.events.ControlEvent;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.wb.swt.SWTResourceManager;
|
||||
|
||||
import flintstones.domain.fuzzyset.FuzzySet;
|
||||
import flintstones.domain.fuzzyset.ui.chart.LinguisticDomainChart;
|
||||
import flintstones.entity.method.phase.ui.PhaseMethodUI;
|
||||
import flintstones.method.common.phase.generateUnificationDomain.GenerateUnificationDomainModel;
|
||||
import flintstones.method.common.phase.generateUnificationDomain.ui.messages.Messages;
|
||||
|
||||
public class GenerateUnificationDomainUi extends PhaseMethodUI {
|
||||
|
||||
GenerateUnificationDomainModel phaseMethod;
|
||||
|
||||
// FS3
|
||||
Composite _parent;
|
||||
private Composite domainInfoPanel;
|
||||
private Composite domainChartPanel;
|
||||
|
||||
private Label levelLabel;
|
||||
private Label nameLabel;
|
||||
private Label descriptionLabel;
|
||||
|
||||
private LinguisticDomainChart _domainChart;
|
||||
|
||||
private ControlAdapter _controlListener;
|
||||
|
||||
private FuzzySet unifiedDomain;
|
||||
|
||||
@Inject
|
||||
@Translation
|
||||
Messages messages;
|
||||
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
phaseMethod = (GenerateUnificationDomainModel) this.getModel();
|
||||
createPartControl(this.getBaseComposite());
|
||||
|
||||
generateLH();
|
||||
refreshDomainChart();
|
||||
domainInfoPanel.layout();
|
||||
|
||||
phaseMethod.export();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refresh() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isForwardEnabled() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSkippable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeSkip() {
|
||||
}
|
||||
|
||||
public void createPartControl(Composite parent) {
|
||||
_parent = parent;
|
||||
|
||||
_controlListener = null;
|
||||
|
||||
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
|
||||
_parent.setLayoutData(gridData);
|
||||
GridLayout layout = new GridLayout(1, true);
|
||||
layout.marginLeft = 20;
|
||||
layout.marginRight = 20;
|
||||
layout.marginBottom = 15;
|
||||
layout.marginTop = 20;
|
||||
_parent.setLayout(layout);
|
||||
|
||||
createDomainInfoPanel();
|
||||
createDomainChartPanel();
|
||||
}
|
||||
|
||||
private void createDomainInfoPanel() {
|
||||
domainInfoPanel = new Composite(_parent, SWT.NONE);
|
||||
domainInfoPanel.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
|
||||
domainInfoPanel.setLayout(new GridLayout(2, false));
|
||||
|
||||
Label level = new Label(domainInfoPanel, SWT.NONE);
|
||||
level.setFont(SWTResourceManager.getFont("Cantarell", 10, SWT.BOLD)); //$NON-NLS-1$
|
||||
level.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1));
|
||||
level.setText(messages.Domain_level);
|
||||
|
||||
levelLabel = new Label(domainInfoPanel, SWT.NONE);
|
||||
levelLabel.setFont(SWTResourceManager.getFont("Cantarell", 10, SWT.NONE)); //$NON-NLS-1$
|
||||
levelLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
|
||||
|
||||
Label name = new Label(domainInfoPanel, SWT.NONE);
|
||||
name.setFont(SWTResourceManager.getFont("Cantarell", 10, SWT.BOLD)); //$NON-NLS-1$
|
||||
name.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1));
|
||||
name.setText(messages.Domain_name);
|
||||
|
||||
nameLabel = new Label(domainInfoPanel, SWT.NONE);
|
||||
nameLabel.setFont(SWTResourceManager.getFont("Cantarell", 10, SWT.NONE)); //$NON-NLS-1$
|
||||
nameLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1));
|
||||
|
||||
Label description = new Label(domainInfoPanel, SWT.NONE);
|
||||
description.setFont(SWTResourceManager.getFont("Cantarell", 10, SWT.BOLD)); //$NON-NLS-1$
|
||||
description.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1));
|
||||
description.setText(messages.Domain_description); //$NON-NLS-1$
|
||||
|
||||
descriptionLabel = new Label(domainInfoPanel, SWT.NONE);
|
||||
descriptionLabel.setFont(SWTResourceManager.getFont("Cantarell", 10, SWT.NONE)); //$NON-NLS-1$
|
||||
descriptionLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1));
|
||||
}
|
||||
|
||||
private void createDomainChartPanel() {
|
||||
domainChartPanel = new Composite(_parent, SWT.NONE);
|
||||
domainChartPanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
|
||||
}
|
||||
|
||||
private void removeChart() {
|
||||
if (_domainChart != null) {
|
||||
_domainChart.getChartComposite().dispose();
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshDomainChart() {
|
||||
removeChart();
|
||||
|
||||
Point size = domainChartPanel.getSize();
|
||||
_domainChart = new LinguisticDomainChart();
|
||||
_domainChart.initialize(unifiedDomain, domainChartPanel, size.x, size.y, SWT.BORDER);
|
||||
|
||||
if(_controlListener == null) {
|
||||
_controlListener = new ControlAdapter() {
|
||||
|
||||
@Override
|
||||
public void controlResized(ControlEvent e) {
|
||||
refreshDomainChart();
|
||||
}
|
||||
};
|
||||
domainChartPanel.addControlListener(_controlListener);
|
||||
}
|
||||
}
|
||||
|
||||
private void generateLH() {
|
||||
List<Object[]> elhDomains = phaseMethod.generateLH();
|
||||
Object[] result = null;
|
||||
|
||||
if (elhDomains != null) {
|
||||
result = elhDomains.get(elhDomains.size() - 1);
|
||||
}
|
||||
|
||||
if(result != null) {
|
||||
levelLabel.setText((String) result[0]);
|
||||
nameLabel.setText((String) result[1]);
|
||||
unifiedDomain = ((FuzzySet) result[2]);
|
||||
descriptionLabel.setText(unifiedDomain.formatDescriptionDomain());
|
||||
} else {
|
||||
levelLabel.setText(""); //$NON-NLS-1$
|
||||
nameLabel.setText(""); //$NON-NLS-1$
|
||||
descriptionLabel.setText(""); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package flintstones.method.common.phase.generateUnificationDomain.ui.messages;
|
||||
|
||||
public class Messages {
|
||||
|
||||
public String Domain_description;
|
||||
public String Domain_level;
|
||||
public String Domain_name;
|
||||
|
||||
}
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
Domain_description=Domain description
|
||||
Domain_level=Domain level
|
||||
Domain_name=Domain name
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
Domain_description=Descripción de dominio
|
||||
Domain_level=Nivel de dominio
|
||||
Domain_name=Nombre de dominio
|
||||
Reference in New Issue
Block a user