public code v1
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
<?flintstones.helper.data.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,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.domain.numeric</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
<name>[bundle] Numeric</name>
|
||||
</project>
|
||||
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>flintstones.domain.numeric</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>1779484362543</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,14 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %Bundle-Name
|
||||
Bundle-SymbolicName: flintstones.domain.numeric;singleton:=true
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Export-Package: flintstones.domain.numeric
|
||||
Require-Bundle: flintstones.helper.validator;visibility:=reexport,
|
||||
org.eclipse.jface,
|
||||
javax.inject,
|
||||
flintstones.entity.extensionenum,
|
||||
flintstones.entity.domain,
|
||||
org.apache.commons.lang
|
||||
Automatic-Module-Name: flintstones.domain.numeric
|
||||
@@ -0,0 +1,4 @@
|
||||
#Properties file for flintstones.domain.numeric
|
||||
Bundle-Name = Numeric
|
||||
domain.category.numeric = Numeric
|
||||
domain.category.numeric.intervalar = Numeric Intervalar
|
||||
@@ -0,0 +1,4 @@
|
||||
#Properties file for flintstones.domain.numeric
|
||||
Bundle-Name = Numérico
|
||||
domain.category.numeric = Numérico
|
||||
domain.category.numeric.intervalar = Numérico Intervalar
|
||||
@@ -0,0 +1,7 @@
|
||||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
OSGI-INF/l10n/bundle.properties,\
|
||||
OSGI-INF/,\
|
||||
plugin.xml
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?eclipse version="3.4"?>
|
||||
<plugin>
|
||||
<extension
|
||||
point="flintstones.entity.domain.domain_category">
|
||||
<domain_category
|
||||
label="%domain.category.numeric"
|
||||
uid="flintstones.domain.numeric.category">
|
||||
</domain_category>
|
||||
</extension>
|
||||
<extension
|
||||
point="flintstones.entity.domain.domain_category">
|
||||
<domain_category
|
||||
label="%domain.category.numeric.intervalar"
|
||||
uid="flintstones.domain.numeric.intervalar.category">
|
||||
</domain_category>
|
||||
</extension>
|
||||
|
||||
</plugin>
|
||||
@@ -0,0 +1,238 @@
|
||||
package flintstones.domain.numeric;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
|
||||
import javax.xml.stream.XMLStreamException;
|
||||
import javax.xml.stream.XMLStreamWriter;
|
||||
|
||||
import org.apache.commons.lang.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
|
||||
import flintstones.entity.domain.Domain;
|
||||
import flintstones.entity.extensionenum.ExtensionEnum;
|
||||
import flintstones.helper.validator.Validator;
|
||||
|
||||
/**
|
||||
* The Class NumericDomain.
|
||||
*/
|
||||
public abstract class NumericDomain extends Domain {
|
||||
|
||||
/** The in range. */
|
||||
protected boolean inRange;
|
||||
|
||||
/** The min. */
|
||||
protected double min;
|
||||
|
||||
/** The max. */
|
||||
protected double max;
|
||||
|
||||
/**
|
||||
* The Enum Fields.
|
||||
*/
|
||||
public static enum Fields implements ExtensionEnum {
|
||||
|
||||
/** The min. */
|
||||
min,
|
||||
/** The max. */
|
||||
max,
|
||||
/** The in range. */
|
||||
inRange
|
||||
};
|
||||
|
||||
/**
|
||||
* Instantiates a new numeric domain.
|
||||
*/
|
||||
public NumericDomain() {
|
||||
super();
|
||||
this.min = 0.0d;
|
||||
this.max = 0.0d;
|
||||
this.inRange = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the in range.
|
||||
*
|
||||
* @param inRange the new in range
|
||||
*/
|
||||
public void setInRange(Boolean inRange) {
|
||||
this.inRange = inRange;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if is in range.
|
||||
*
|
||||
* @return true, if is in range
|
||||
*/
|
||||
public boolean isInRange() {
|
||||
return this.inRange;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the in range.
|
||||
*
|
||||
* @return the in range
|
||||
*/
|
||||
public boolean getInRange() {
|
||||
return this.inRange;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the min.
|
||||
*
|
||||
* @param min the new min
|
||||
*/
|
||||
public void setMin(double min) {
|
||||
this.min = min;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the min.
|
||||
*
|
||||
* @return the min
|
||||
*/
|
||||
public double getMin() {
|
||||
|
||||
if(!inRange)
|
||||
return -100000;
|
||||
|
||||
return this.min;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the max.
|
||||
*
|
||||
* @param max the new max
|
||||
*/
|
||||
public void setMax(double max) {
|
||||
this.max = max;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the max.
|
||||
*
|
||||
* @return the max
|
||||
*/
|
||||
public double getMax() {
|
||||
|
||||
if(!inRange)
|
||||
return 100000;
|
||||
|
||||
return this.max;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the min max.
|
||||
*
|
||||
* @param min the min
|
||||
* @param max the max
|
||||
*/
|
||||
public void setMinMax(double min, double max) {
|
||||
Validator.notDisorder(new double[] { min, max }, false);
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see flintstones.entity.domain.Domain#midpoint()
|
||||
*/
|
||||
@Override
|
||||
public double midpoint() {
|
||||
if (this.inRange)
|
||||
return (this.max + this.min) / 2d;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see flintstones.entity.domain.Domain#formatDescriptionDomain()
|
||||
*/
|
||||
@Override
|
||||
public String formatDescriptionDomain() {
|
||||
String template = "{0}";
|
||||
String param = this.inRange ? this.toString() : "Sin rango";
|
||||
String msg = MessageFormat.format(template, param).toString();
|
||||
return msg;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
String template = "[ {0}, {1} ]";
|
||||
return MessageFormat.format(template, this.min, this.max).toString();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see flintstones.entity.domain.Domain#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
|
||||
if (this == obj)
|
||||
return true;
|
||||
|
||||
if (obj == null)
|
||||
return false;
|
||||
|
||||
if ((obj.getClass() != this.getClass()) || !super.equals(obj))
|
||||
return false;
|
||||
|
||||
final NumericDomain other = (NumericDomain) obj;
|
||||
|
||||
EqualsBuilder eb = new EqualsBuilder();
|
||||
eb.append(this.inRange, other.inRange);
|
||||
eb.append(this.max, other.max);
|
||||
eb.append(this.min, other.min);
|
||||
|
||||
return eb.isEquals();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see flintstones.entity.domain.Domain#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
HashCodeBuilder hcb = new HashCodeBuilder(17, 31);
|
||||
hcb.append(super.hashCode());
|
||||
hcb.append(this.inRange);
|
||||
hcb.append(this.max);
|
||||
hcb.append(this.min);
|
||||
return hcb.toHashCode();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see flintstones.entity.domain.Domain#write(javax.xml.stream.XMLStreamWriter)
|
||||
*/
|
||||
@Override
|
||||
public void write(XMLStreamWriter writer) throws XMLStreamException {
|
||||
writer.writeAttribute("inRange", Boolean.toString(this.inRange)); //$NON-NLS-1$
|
||||
writer.writeAttribute("min", Double.toString(this.min)); //$NON-NLS-1$
|
||||
writer.writeAttribute("max", Double.toString(this.max)); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see flintstones.entity.domain.Domain#clone()
|
||||
*/
|
||||
@Override
|
||||
public Object clone() {
|
||||
NumericDomain result = null;
|
||||
result = (NumericDomain) super.clone();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
// This file has been auto-generated
|
||||
package flintstones.domain.numeric.messages;
|
||||
|
||||
import org.eclipse.e4.core.services.nls.Message;
|
||||
|
||||
@Message
|
||||
@SuppressWarnings("javadoc")
|
||||
public class Messages {
|
||||
|
||||
public String NumericDomain_formatTemplate;
|
||||
public String NumericDomain_toStringTemplate;
|
||||
public String NumericDomainChart_range;
|
||||
public String plusInfinity;
|
||||
public String noInfinity;
|
||||
public String Without_range;
|
||||
public String lessInfinity;
|
||||
public String label_domain_name;
|
||||
public String error_domain_name;
|
||||
public String limits;
|
||||
public String rangeless;
|
||||
public String limitless;
|
||||
public String error_limits;
|
||||
public String error_limits1;
|
||||
public String to;
|
||||
public String error_limits2;
|
||||
public String preview;
|
||||
public String dialogTitleTemplate;
|
||||
public String crating;
|
||||
public String integer;
|
||||
public String intervalar;
|
||||
public String error_empty_domain;
|
||||
public String error_alredy_used_name;
|
||||
public String error_out_of_limits;
|
||||
public String modifying;
|
||||
public String real;
|
||||
public String blank;
|
||||
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
Without_range=Without range
|
||||
error_limits1=limits1
|
||||
error_limits2=limits2
|
||||
error_domain_name=name
|
||||
error_limits=limits
|
||||
chart=chart
|
||||
crating=Creating
|
||||
dialogTitleTemplate=%s domain of type %s %s
|
||||
label_domain_name=Domain name
|
||||
error_alredy_used_name=The chosen name is alredy used by another domain
|
||||
error_empty_domain=Domain name can not be empty
|
||||
error_out_of_limits=The first limit must be smaller than the second one
|
||||
integer=Integer
|
||||
intervalar=intervalar
|
||||
lessInfinity=-Infinity
|
||||
limitless=(-\u221E to \u221E)
|
||||
limits=Limits
|
||||
modifying=Editing
|
||||
noInfinity=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
|
||||
NumericDomainChart_range=Range
|
||||
plusInfinity=+Infinity
|
||||
preview=Preview
|
||||
rangeless=No range
|
||||
real=Real
|
||||
to=to
|
||||
NumericDomain_formatTemplate={0} {1}
|
||||
NumericDomain_toStringTemplate=[ {0} - {1} ]
|
||||
blank=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
Without_range=Sin rango
|
||||
error_limits1=limits1
|
||||
error_limits2=limits2
|
||||
error_domain_name=name
|
||||
error_limits=limits
|
||||
chart=chart
|
||||
crating=Creando
|
||||
dialogTitleTemplate=%s dominio de tipo %s %s
|
||||
label_domain_name=Nombre del dominio
|
||||
error_alredy_used_name=El nombre ya esta siendo usado por otro dominio
|
||||
error_empty_domain=El nombre de dominio no puede estar vacio
|
||||
error_out_of_limits=El limite inferior debe ser menor que el limite superior
|
||||
integer=Entero
|
||||
intervalar=intervalar
|
||||
limitless=(-\u221E to \u221E)
|
||||
limits=Limites
|
||||
modifying=Modificando
|
||||
preview=Previsualización
|
||||
rangeless=Sin rango
|
||||
real=Real
|
||||
to=a
|
||||
NumericDomainChart_range=Rango
|
||||
plusInfinity=+Infinito
|
||||
lessInfinity=-Infinito
|
||||
noInfinity=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
|
||||
NumericDomain_formatTemplate={0} {1}
|
||||
NumericDomain_toStringTemplate=[ {0} - {1} ]
|
||||
blank=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
|
||||
Reference in New Issue
Block a user