switch(unitType) {
case ELEVATION:
text_minVal = formFactory.createNumberTextWithLabelElement(this, "Min [m] : ", getMinimum(), style);
- text_maxVal = formFactory.createNumberTextWithLabelElement(this, "Max [m] : ", getMaximum(), style);
+ text_maxVal = formFactory.createNumberTextWithLabelElement(this, "Max [m] : ", getMaximum(), style);
break;
default:
text_minVal = formFactory.createNumberTextWithLabelElement(this, "Min [m] : ", getMinimum(), style);
- text_maxVal = formFactory.createNumberTextWithLabelElement(this, "Max [m] : ", getMaximum(), style);
- break;
+ text_maxVal = formFactory.createNumberTextWithLabelElement(this, "Max [m] : ", getMaximum(), style);
+ break;
}
text_freeText = formFactory.createTextWithLabelElement(this,
"Freetext : ", getFreetext(), style);
public void setEntity(DerivedUnitFacade gatheringEvent) {
super.setEntity(gatheringEvent);
updateValues();
+ updateTitle();
}
private void updateValues() {
} else if (eventSource == text_freeText) {
updateFreetext();
}
+ updateTitle();
firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null));
}
-
+ private void updateTitle(){
+ String title = "";
+ if(text_minVal.getText()!=null){
+ title += text_minVal.getText();
+ }
+ if(text_maxVal.getText()!=null && !text_maxVal.getText().equals("")){
+ if(!title.equals("")){
+ title += " - "+text_maxVal.getText();
+ }
+ }
+ if(title.equals("") && text_freeText.getText()!=null){
+ title = text_freeText.getText();
+ }
+ this.setText(title);
+ layout();
+ }
/*
* (non-Javadoc)
private void updateMinimum() {
switch(unitType) {
case ELEVATION:
- getEntity().setAbsoluteElevation(text_minVal.getDouble().intValue());
+ getEntity().setAbsoluteElevation(text_minVal.getDouble()!=null?text_minVal.getDouble().intValue():null);
break;
case DIST_TO_GROUND:
getEntity().setDistanceToGround(text_minVal.getDouble());
private void updateMaximum() {
switch(unitType) {
case ELEVATION:
- getEntity().setAbsoluteElevationMax(text_maxVal.getDouble().intValue());
+ getEntity().setAbsoluteElevationMax(text_maxVal.getDouble()!=null?text_maxVal.getDouble().intValue():null);
break;
case DIST_TO_GROUND:
getEntity().setDistanceToGroundMax(text_maxVal.getDouble());