private void createVariableCells(DynamicGridRow row, boolean bDefault) { clearVariableCells(row); DynamicGridCell cell = row.getCells().newCell(form.dyngrdLinkedDataSets().getColumns().getByIdentifier(COL_LINETYPE), DynamicCellType.ENUMERATION); engine.populate(cell, LineType.getNegativeInstancesAsIItemCollection()); cell.setReadOnly(false); if(bDefault) { cell.setValue(((DataSetTypeVo)row.getValue()).getDefaultLineType()); cell.setReadOnly(true); } cell = row.getCells().newCell(form.dyngrdLinkedDataSets().getColumns().getByIdentifier(COL_COLOR_ICON), DynamicCellType.ENUMERATION); engine.populate(cell, LineColourPointIcon.getNegativeInstancesAsIItemCollection()); cell.setReadOnly(false); if(bDefault) { cell.setValue(((DataSetTypeVo)row.getValue()).getDefLineColPtIcon()); cell.setReadOnly(true); } }
private void submitQmbDataset(String value, DataSetTypeVo voToSelect) { form.qmbDataset().clear(); DataSetTypeVoCollection dataset = domain.listDataset("%" + value + "%"); for (int i = 0; i < dataset.size(); i++) { form.qmbDataset().newRow(dataset.get(i), dataset.get(i).getName()); } if(dataset.size() == 1) { form.qmbDataset().setValue(dataset.get(0)); } else { if(voToSelect == null) form.qmbDataset().showOpened(); else form.qmbDataset().setValue(voToSelect); } form.dyngrdChart().getRows().clear(); }
private void createVariableCells(DynamicGridRow row, boolean bDefault) { clearVariableCells(row); DynamicGridCell cell = row.getCells().newCell(form.dyngrdChart().getColumns().getByIdentifier(COL_LINETYPE), DynamicCellType.ENUMERATION); engine.populate(cell, LineType.getNegativeInstancesAsIItemCollection()); cell.setReadOnly(true); if(bDefault) { cell.setValue(((DataSetTypeVo)row.getValue()).getDefaultLineType()); } cell = row.getCells().newCell(form.dyngrdChart().getColumns().getByIdentifier(COL_COLOR_ICON), DynamicCellType.ENUMERATION); engine.populate(cell, LineColourPointIcon.getNegativeInstancesAsIItemCollection()); cell.setReadOnly(true); if(bDefault) { cell.setValue(((DataSetTypeVo)row.getValue()).getDefLineColPtIcon()); } }
/** * saveDataSetType */ public ims.core.vo.DataSetTypeVo saveDataSetType(ims.core.vo.DataSetTypeVo recordVo) throws ims.domain.exceptions.StaleObjectException, ims.domain.exceptions.UniqueKeyViolationException { if (!recordVo.isValidated()) throw new DomainRuntimeException("DataSetType record has not been validated"); DomainFactory factory = getDomainFactory(); ims.core.charting.domain.objects.DatasetType bo = DataSetTypeVoAssembler.extractDatasetType(factory, recordVo); try { factory.save(bo); } catch(UnqViolationUncheckedException e) { throw new ims.domain.exceptions.UniqueKeyViolationException(e); } return DataSetTypeVoAssembler.create(bo); }
private DatasetAnalyte[] getDatasetCollection(AnalyteRefVoCollection analytes) { ArrayList<DatasetAnalyte> resultCollection = new ArrayList<DatasetAnalyte>(); for(int x = 0; x < analytes.size(); x++) { DataSetTypeVo dataset = domain.getDataset(analytes.get(x)); resultCollection.add(new DatasetAnalyte(dataset, analytes.get(x))); } DatasetAnalyte[] result = new DatasetAnalyte[resultCollection.size()]; for(int x = 0; x < resultCollection.size(); x++) { result[x] = resultCollection.get(x); } return result; }
private DatasetAnalyte[] getDatasetCollection(ChartResultAnalyteVoCollection analytes) { ArrayList<DatasetAnalyte> resultCollection = new ArrayList<DatasetAnalyte>(); for(ChartResultAnalyteVo chartResultAnalyteVo : analytes) { DataSetTypeVo dataset = chartResultAnalyteVo.getDatasetType(); resultCollection.add(new DatasetAnalyte(dataset, chartResultAnalyteVo, chartResultAnalyteVo.getRefRange())); } DatasetAnalyte[] result = new DatasetAnalyte[resultCollection.size()]; for(int x = 0; x < resultCollection.size(); x++) { result[x] = resultCollection.get(x); } return result; }
private void updateContextMenu() { form.getContextMenus().hideAllChartTypeDetailsMenuItems(); if(form.getMode().equals(FormMode.EDIT)) { form.getContextMenus().getChartTypeDetailsADDItem().setVisible(true); if(form.dyngrdLinkedDataSets().getValue() instanceof DataSetTypeVo) form.getContextMenus().getChartTypeDetailsREMOVEItem().setVisible(true); form.getContextMenus().getChartTypeDetailsMOVE_UPItem().setVisible(form.dyngrdLinkedDataSets().getValue() instanceof DataSetTypeVo && form.dyngrdLinkedDataSets().getSelectedRow()!= null && form.dyngrdLinkedDataSets().getSelectedRow().canMoveUp()); //WDEV-12548 form.getContextMenus().getChartTypeDetailsMOVE_DOWNItem().setVisible(form.dyngrdLinkedDataSets().getValue() instanceof DataSetTypeVo && form.dyngrdLinkedDataSets().getSelectedRow()!= null && form.dyngrdLinkedDataSets().getSelectedRow().canMoveDown()); //WDEV-12548 } }
private boolean checkDatasets() { if(form.dyngrdLinkedDataSets().getRows().size() == 0) { engine.showMessage("Please add at least a dataset !"); return false; } for (int i = 0; i < form.dyngrdLinkedDataSets().getRows().size(); i++) { DynamicGridRow row = form.dyngrdLinkedDataSets().getRows().get(i); if(row.getCells().get(form.dyngrdLinkedDataSets().getColumns().getByIdentifier(COL_ANSWERBOX)).getValue().equals(LineTypeStatus.CUSTOM)) { if(row.getCells().get(form.dyngrdLinkedDataSets().getColumns().getByIdentifier(COL_LINETYPE)).getValue() == null) { engine.showMessage("Please set a line type for dataset " + ((DataSetTypeVo)row.getValue()).getName() + " !"); return false; } if(row.getCells().get(form.dyngrdLinkedDataSets().getColumns().getByIdentifier(COL_COLOR_ICON)).getValue() == null) { engine.showMessage("Please set a Colour / Icon for dataset " + ((DataSetTypeVo)row.getValue()).getName() + " !"); return false; } } } return true; }
private ChartTypeVo populateDataFromScreenLocal() { ChartTypeVo record = populateDataFromScreen(form.getLocalContext().getCurrentRecord()); record.setNormalBandColour(form.cmbNormalColour().getValue()); if(record.getDatasetTypes() == null) record.setDatasetTypes(new ChartTypeDatasetVoCollection()); else record.getDatasetTypes().clear(); int order = 1; //WDEV-12548 for (int i = 0; i < form.dyngrdLinkedDataSets().getRows().size(); i++) { DynamicGridRow row = form.dyngrdLinkedDataSets().getRows().get(i); ChartTypeDatasetVo item = new ChartTypeDatasetVo(); item.setDatasetType((DataSetTypeVo)row.getValue()); if(row.getCells().get(form.dyngrdLinkedDataSets().getColumns().getByIdentifier(COL_ANSWERBOX)).getValue().equals(LineTypeStatus.CUSTOM)) { item.setLineType((LineType) row.getCells().get(form.dyngrdLinkedDataSets().getColumns().getByIdentifier(COL_LINETYPE)).getValue()); item.setLineColourPointIcon((LineColourPointIcon) row.getCells().get(form.dyngrdLinkedDataSets().getColumns().getByIdentifier(COL_COLOR_ICON)).getValue()); } item.setSortOrder(Integer.valueOf(order++)); //WDEV-12548 record.getDatasetTypes().add(item); } return record; }
private void addDataSetTypesToGrid(DataSetTypeVoCollection dataSetTypeItems) { for (int i = 0; i < dataSetTypeItems.size(); i++) { DataSetTypeVo item = dataSetTypeItems.get(i); if(recordAlreadySelected(item) == false) { DynamicGridRow row = form.dyngrdLinkedDataSets().getRows().newRow(); DynamicGridCell cell = row.getCells().newCell(form.dyngrdLinkedDataSets().getColumns().getByIdentifier(COL_DATASET_TYPE), DynamicCellType.STRING); cell.setValue(item.getName()); // WDEV-16684 cell.setReadOnly(Boolean.TRUE); cell = row.getCells().newCell(form.dyngrdLinkedDataSets().getColumns().getByIdentifier(COL_ANSWERBOX), DynamicCellType.ANSWER); cell.getItems().newItem(LineTypeStatus.DEFAULT, LineTypeStatus.DEFAULT.getImage()); cell.getItems().newItem(LineTypeStatus.CUSTOM, LineTypeStatus.CUSTOM.getImage()); cell.setValue(LineTypeStatus.DEFAULT); cell.setAutoPostBack(true); row.setValue(item); createVariableCells(row, true); } } }
private boolean recordAlreadySelected(DataSetTypeVo value) { for (int i = 0; i < form.dyngrdLinkedDataSets().getRows().size(); i++) { DynamicGridRow row = form.dyngrdLinkedDataSets().getRows().get(i); if(row.getValue().equals(value)) { return true; } } return false; }
private boolean recordAlreadySelected(DataSetTypeVo value) { for (int i = 0; i < form.grdDataSetSelected().getRows().size(); i++) { grdDataSetSelectedRow row = form.grdDataSetSelected().getRows().get(i); if(row.getValue().equals(value)) { return true; } } return false; }
private DataSetTypeVo getDatasetType(ChartTypeVo chartType, DatasetTypeRefVo id) { for (int x = 0; x < chartType.getDatasetTypes().size(); x++) { if (id.equals(chartType.getDatasetTypes().get(x).getDatasetType())) return chartType.getDatasetTypes().get(x).getDatasetType(); } return null; }
private ChartTypeDatasetVo getChartTypeDataset(ChartTypeVo chartType, DataSetTypeVo dataset) { if (chartType == null || chartType.getDatasetTypes() == null || dataset == null) return null; for (int x = 0; x < chartType.getDatasetTypes().size(); x++) { ChartTypeDatasetVo chartTypeDataset = chartType.getDatasetTypes().get(x); if (chartTypeDataset != null && chartTypeDataset.getDatasetType() != null && chartTypeDataset.getDatasetType().equals(dataset)) return chartTypeDataset; } return null; }
public DataSetTypeVo getDataset(AnalyteRefVo analyte) { if(analyte == null || analyte.getID_Analyte() == null) throw new DomainRuntimeException("Invalid analyte"); ChartResultAnalyteWithDatasetVo resultAnalyte = ChartResultAnalyteWithDatasetVoAssembler.create((Analyte)getDomainFactory().getDomainObject(Analyte.class, analyte.getID_Analyte())); return resultAnalyte.getDatasetType(); }