use of org.talend.dataquality.indicators.IndicatorParameters in project tdq-studio-se by Talend.
the class FileSystemImportWriter method updatePatternInAnaParams.
/**
* if there is a same name pattern in current workspace,update the pattern in imported analysis IndicatorParameters.
*
* @param systemSupplyModelElement
* @param analysis
*/
private void updatePatternInAnaParams(ModelElement systemSupplyModelElement, Analysis analysis) {
if (analysis.getResults() != null) {
EList<Indicator> indicators = analysis.getResults().getIndicators();
IndicatorParameters parameters = null;
for (Indicator indicator : indicators) {
// AllMatchIndicator is in column set analysis.
if (indicator instanceof AllMatchIndicator) {
EList<RegexpMatchingIndicator> list = ((AllMatchIndicator) indicator).getCompositeRegexMatchingIndicators();
for (RegexpMatchingIndicator regMatchIndicator : list) {
parameters = regMatchIndicator.getParameters();
removOldAddSysPatternInAnaParams(parameters, (Pattern) systemSupplyModelElement, analysis);
}
} else if (indicator instanceof PatternMatchingIndicator) {
parameters = ((PatternMatchingIndicator) indicator).getParameters();
removOldAddSysPatternInAnaParams(parameters, (Pattern) systemSupplyModelElement, analysis);
}
}
}
}
use of org.talend.dataquality.indicators.IndicatorParameters in project tdq-studio-se by Talend.
the class DynamicTableIndicatorOptionsPage method createForm.
public AbstractIndicatorForm[] createForm(Composite parent, ICheckListener listener, FormEnum[] formTypes) {
IndicatorParameters parameters = indicatorUnit.getIndicator().getParameters();
if (parameters == null) {
parameters = IndicatorsFactory.eINSTANCE.createIndicatorParameters();
indicatorUnit.getIndicator().setParameters(parameters);
}
AbstractIndicatorForm[] froms = new AbstractIndicatorForm[formTypes.length];
for (int i = 0; i < formTypes.length; i++) {
AbstractIndicatorForm form = IndicatorFormFactory.createForm(parent, formTypes[i], parameters);
form.setListener(listener);
froms[i] = form;
}
return froms;
}
use of org.talend.dataquality.indicators.IndicatorParameters in project tdq-studio-se by Talend.
the class FrequencyDynamicChartEventReceiver method setFrequecyToDataset.
private void setFrequecyToDataset(Object customerdataset, FrequencyExt[] frequencyExt, Indicator indicator) {
int numOfShown = frequencyExt.length;
IndicatorParameters parameters = indicator.getParameters();
if (parameters != null) {
if (parameters.getTopN() < numOfShown) {
numOfShown = parameters.getTopN();
}
}
FrequencyExt[] tempFreq = handleFrequency(frequencyExt);
clearDataEntity(customerdataset);
boolean withRowCountIndicator = FrequencyTypeStateUtil.isWithRowCountIndicator(indicator);
// Added TDQ-12870
List columnKeys = TOPChartUtils.getInstance().getColumnKeys(customerdataset);
FrequencyExt freqE = tempFreq[0];
if (!columnKeys.contains(String.valueOf(freqE.getKey()))) {
// columnKeys.clear();
TOPChartUtils.getInstance().clearDataset(customerdataset);
ICustomerDataset customerDataset = TOPChartUtils.getInstance().getCustomerDataset(customerdataset);
if (customerDataset != null && customerDataset instanceof CustomerDefaultCategoryDataset) {
((CustomerDefaultCategoryDataset) customerDataset).clearAll();
}
}
for (int i = 0; i < numOfShown; i++) {
FrequencyExt freqExt = tempFreq[i];
String keyLabel = String.valueOf(freqExt.getKey());
if ("null".equals(keyLabel)) {
// $NON-NLS-1$
keyLabel = SpecialValueDisplay.NULL_FIELD;
}
if ("".equals(keyLabel)) {
// $NON-NLS-1$
keyLabel = SpecialValueDisplay.EMPTY_FIELD;
}
ChartDataEntity entity = FrequencyTypeStateUtil.createChartEntity(indicator, freqExt, keyLabel, withRowCountIndicator);
if (customerdataset instanceof CustomerDefaultCategoryDataset) {
((CustomerDefaultCategoryDataset) customerdataset).addDataEntity(entity);
addValueToDataset(((CustomerDefaultCategoryDataset) customerdataset).getDataset(), freqExt, keyLabel);
} else {
ICustomerDataset customerDataset = TOPChartUtils.getInstance().getCustomerDataset(customerdataset);
if (customerDataset != null && customerDataset instanceof CustomerDefaultCategoryDataset) {
customerDataset.addDataEntity(entity);
addValueToDataset(((CustomerDefaultCategoryDataset) customerDataset).getDataset(), freqExt, keyLabel);
}
}
}
}
use of org.talend.dataquality.indicators.IndicatorParameters in project tdq-studio-se by Talend.
the class PieStatisticsStateUtil method getNumberOfShown.
/**
* DOC yyin Comment method "getNumberOfShown".
*
* @param unit
* @param frequencyExt
* @return
*/
public static int getNumberOfShown(IndicatorUnit unit, FrequencyExt[] frequencyExt) {
int numOfShown = frequencyExt.length;
IndicatorParameters parameters = unit.getIndicator().getParameters();
if (parameters != null) {
if (parameters.getTopN() < numOfShown) {
numOfShown = parameters.getTopN();
}
}
return numOfShown;
}
use of org.talend.dataquality.indicators.IndicatorParameters in project tdq-studio-se by Talend.
the class PatternNode method createNewIndicatorInstance.
/*
* (non-Javadoc)
*
* @see org.talend.dq.nodes.indicator.IIndicatorNode#createNewIndicatorInstance()
*/
@Override
public Indicator createNewIndicatorInstance() {
Indicator patternIndicatorInstance = super.createNewIndicatorInstance();
IndicatorParameters createIndicatorParameter = IndicatorsFactory.eINSTANCE.createIndicatorParameters();
Domain createDomain = DomainFactory.eINSTANCE.createDomain();
createDomain.getPatterns().add(pattern);
createIndicatorParameter.setDataValidDomain(createDomain);
patternIndicatorInstance.setParameters(createIndicatorParameter);
return patternIndicatorInstance;
}
Aggregations