Revision 61e07907
Added by Katja Luther almost 8 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/PointElement.java | ||
---|---|---|
12 | 12 |
|
13 | 13 |
import java.text.ParseException; |
14 | 14 |
|
15 |
import org.apache.commons.lang.StringUtils; |
|
15 | 16 |
import org.eclipse.jface.util.PropertyChangeEvent; |
16 | 17 |
|
17 | 18 |
import eu.etaxonomy.cdm.model.common.TermType; |
... | ... | |
102 | 103 |
Object eventSource = event.getSource(); |
103 | 104 |
if (eventSource == text_latitude) { |
104 | 105 |
try { |
105 |
getPoint().setLatitudeByParsing(text_latitude.getText()); |
|
106 |
text_latitudeParsed.setText(point.getLatitudeSexagesimal() |
|
107 |
.toString(false)); |
|
108 |
text_latitude |
|
109 |
.setBackground(getColor(Resources.COLOR_COMPOSITE_BACKGROUND)); |
|
106 |
if (StringUtils.isBlank(text_latitude.getText())){ |
|
107 |
getPoint().setLatitudeByParsing(null); |
|
108 |
text_latitudeParsed.setText(null); |
|
109 |
text_latitude |
|
110 |
.setBackground(getColor(Resources.COLOR_COMPOSITE_BACKGROUND)); |
|
111 |
}else{ |
|
112 |
getPoint().setLatitudeByParsing(text_latitude.getText()); |
|
113 |
text_latitudeParsed.setText(point.getLatitudeSexagesimal() |
|
114 |
.toString(false)); |
|
115 |
text_latitude |
|
116 |
.setBackground(getColor(Resources.COLOR_COMPOSITE_BACKGROUND)); |
|
117 |
} |
|
110 | 118 |
propagate = true; |
111 | 119 |
} catch (ParseException e) { |
112 | 120 |
text_latitude |
... | ... | |
114 | 122 |
} |
115 | 123 |
} else if (eventSource == text_longitude) { |
116 | 124 |
try { |
117 |
getPoint().setLongitudeByParsing(text_longitude.getText()); |
|
118 |
text_longitudeParsed.setText(point.getLongitudeSexagesimal() |
|
119 |
.toString(false)); |
|
120 |
text_longitude |
|
121 |
.setBackground(getColor(Resources.COLOR_COMPOSITE_BACKGROUND)); |
|
125 |
if (StringUtils.isBlank(text_longitude.getText())){ |
|
126 |
getPoint().setLongitudeByParsing(null); |
|
127 |
text_longitudeParsed.setText(null); |
|
128 |
text_longitude |
|
129 |
.setBackground(getColor(Resources.COLOR_COMPOSITE_BACKGROUND)); |
|
130 |
}else{ |
|
131 |
getPoint().setLongitudeByParsing(text_longitude.getText()); |
|
132 |
text_longitudeParsed.setText(point.getLongitudeSexagesimal() |
|
133 |
.toString(false)); |
|
134 |
text_longitude |
|
135 |
.setBackground(getColor(Resources.COLOR_COMPOSITE_BACKGROUND)); |
|
136 |
} |
|
122 | 137 |
propagate = true; |
123 | 138 |
} catch (ParseException e) { |
124 | 139 |
text_longitude |
Also available in: Unified diff
fix #5379