/** * Returns <code>true</code> if property mapped to the column at given index is the same as the provided one * @param columnIndex * @param propertyName * @return */ public boolean isSameSelectedColumnProperty(int columnIndex, String propertyName) { SimulationDescriptor simulationDescriptor = simulation.getSimulationDescriptor(); final FactMapping factMappingByIndex = simulationDescriptor.getFactMappingByIndex(columnIndex); return factMappingByIndex.getExpressionAlias().equals(propertyName); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } FactMapping that = (FactMapping) o; return getExpressionElements().equals(that.getExpressionElements()) && Objects.equals(getExpressionIdentifier(), that.getExpressionIdentifier()) && Objects.equals(getFactIdentifier(), that.getFactIdentifier()) && Objects.equals(getClassName(), that.getClassName()) && Objects.equals(getFactAlias(), that.getFactAlias()) && Objects.equals(getExpressionAlias(), that.getExpressionAlias()); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } FactMapping that = (FactMapping) o; return getExpressionElements().equals(that.getExpressionElements()) && Objects.equals(getExpressionIdentifier(), that.getExpressionIdentifier()) && Objects.equals(getFactIdentifier(), that.getFactIdentifier()) && Objects.equals(getClassName(), that.getClassName()) && Objects.equals(getFactAlias(), that.getFactAlias()) && Objects.equals(getExpressionAlias(), that.getExpressionAlias()); }
@Override public int hashCode() { return Objects.hash(getExpressionElements(), getExpressionIdentifier(), getFactIdentifier(), getClassName(), getFactAlias(), getExpressionAlias()); } }
@Override public int hashCode() { return Objects.hash(getExpressionElements(), getExpressionIdentifier(), getFactIdentifier(), getClassName(), getFactAlias(), getExpressionAlias()); } }
protected void setHeaderColumn(int columnIndex, FactMapping factMapping, boolean editableHeaders) { final FactIdentifier factIdentifier = factMapping.getFactIdentifier(); String columnId = factMapping.getExpressionIdentifier().getName(); String instanceTitle = factMapping.getFactAlias(); String propertyTitle = factMapping.getExpressionAlias(); String columnGroup = factMapping.getExpressionIdentifier().getType().name(); boolean isInstanceAssigned = isInstanceAssigned(factIdentifier); boolean isPropertyAssigned = isPropertyAssigned(isInstanceAssigned, factMapping); String placeHolder = getPlaceholder(isPropertyAssigned); ScenarioGridColumn scenarioGridColumn = getScenarioGridColumnLocal(instanceTitle, propertyTitle, columnId, columnGroup, factMapping.getExpressionIdentifier().getType(), placeHolder); scenarioGridColumn.setInstanceAssigned(isInstanceAssigned); scenarioGridColumn.setPropertyAssigned(isPropertyAssigned); scenarioGridColumn.setFactIdentifier(factIdentifier); scenarioGridColumn.setEditableHeaders(editableHeaders); // by default ScenarioGridColumnBuilders.ScenarioGridColumnBuilder.build() set ColumnWidthMode.auto to all generated columns if (FactMappingType.OTHER.equals(factMapping.getExpressionIdentifier().getType())) { scenarioGridColumn.setColumnWidthMode(ColumnWidthMode.FIXED); scenarioGridColumn.setMinimumWidth(scenarioGridColumn.getWidth()); } ((ScenarioGridModel) model).insertColumnGridOnly(columnIndex, scenarioGridColumn); }