Revision d31115e0
Added by Niels Hoffmann over 13 years ago
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/classification/TaxonNodeDetailElement.java | ||
---|---|---|
10 | 10 |
|
11 | 11 |
package eu.etaxonomy.taxeditor.section.classification; |
12 | 12 |
|
13 |
import org.apache.log4j.Logger; |
|
14 |
|
|
15 | 13 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase; |
16 |
import eu.etaxonomy.cdm.model.reference.ReferenceBase; |
|
14 |
import eu.etaxonomy.cdm.model.reference.Reference; |
|
15 |
import eu.etaxonomy.cdm.model.taxon.Classification; |
|
17 | 16 |
import eu.etaxonomy.cdm.model.taxon.ITreeNode; |
18 | 17 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
19 | 18 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode; |
20 |
import eu.etaxonomy.cdm.model.taxon.TaxonomicTree; |
|
21 |
import eu.etaxonomy.cdm.persistence.hibernate.CdmPostDataChangeObservableListener; |
|
22 | 19 |
import eu.etaxonomy.taxeditor.forms.CdmFormFactory; |
23 | 20 |
import eu.etaxonomy.taxeditor.forms.CdmFormFactory.SelectionType; |
24 | 21 |
import eu.etaxonomy.taxeditor.forms.CdmPropertyChangeEvent; |
... | ... | |
26 | 23 |
import eu.etaxonomy.taxeditor.forms.ICdmFormElement; |
27 | 24 |
import eu.etaxonomy.taxeditor.forms.TextWithLabelElement; |
28 | 25 |
import eu.etaxonomy.taxeditor.forms.selection.ClassificationSelectionElement; |
29 |
import eu.etaxonomy.taxeditor.forms.selection.TaxonNodeSelectionElement; |
|
30 | 26 |
import eu.etaxonomy.taxeditor.forms.selection.TaxonBaseSelectionElement; |
27 |
import eu.etaxonomy.taxeditor.forms.selection.TaxonNodeSelectionElement; |
|
31 | 28 |
import eu.etaxonomy.taxeditor.parser.ParseHandler; |
32 | 29 |
import eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement; |
33 | 30 |
|
... | ... | |
40 | 37 |
*/ |
41 | 38 |
public class TaxonNodeDetailElement extends AbstractCdmDetailElement<ITreeNode> { |
42 | 39 |
|
43 |
private static final Logger logger = Logger |
|
44 |
.getLogger(TaxonNodeDetailElement.class); |
|
45 |
|
|
46 | 40 |
private ClassificationSelectionElement selection_classification; |
47 | 41 |
|
48 |
private TaxonomicTree classification;
|
|
42 |
private Classification classification;
|
|
49 | 43 |
|
50 | 44 |
private TaxonNodeSelectionElement selection_parentTaxonNode; |
51 | 45 |
|
... | ... | |
124 | 118 |
* |
125 | 119 |
* @return the classification |
126 | 120 |
*/ |
127 |
public TaxonomicTree getClassification() {
|
|
121 |
public Classification getClassification() {
|
|
128 | 122 |
return classification; |
129 | 123 |
} |
130 | 124 |
|
... | ... | |
158 | 152 |
/** |
159 | 153 |
* @param classification the classification to set |
160 | 154 |
*/ |
161 |
private void setClassification(TaxonomicTree classification) {
|
|
155 |
private void setClassification(Classification classification) {
|
|
162 | 156 |
this.classification = classification; |
163 | 157 |
setParentTreeNode(classification); |
164 | 158 |
} |
... | ... | |
169 | 163 |
private void setParentTreeNode(ITreeNode parentTreeNode) { |
170 | 164 |
this.parentTreeNode = parentTreeNode; |
171 | 165 |
|
172 |
if(parentTreeNode instanceof TaxonomicTree){
|
|
166 |
if(parentTreeNode instanceof Classification){
|
|
173 | 167 |
selection_parentTaxonNode.setEntity(null); |
174 | 168 |
} |
175 | 169 |
else if(parentTreeNode instanceof TaxonNode){ |
176 |
classification = ((TaxonNode) parentTreeNode).getTaxonomicTree();
|
|
170 |
classification = ((TaxonNode) parentTreeNode).getClassification();
|
|
177 | 171 |
selection_classification.setEntity(classification); |
178 | 172 |
selection_parentTaxonNode.setEntity((TaxonNode) parentTreeNode); |
179 | 173 |
} |
... | ... | |
188 | 182 |
|
189 | 183 |
private void setTaxon(String taxonNameString){ |
190 | 184 |
TaxonNameBase taxonName = ParseHandler.quickParse(taxonNameString); |
191 |
ReferenceBase secundum = null;
|
|
185 |
Reference secundum = null; |
|
192 | 186 |
if(getParentTreeNode() != null){ |
193 |
if(getParentElement() instanceof TaxonomicTree){
|
|
194 |
secundum = ((TaxonomicTree) getParentTreeNode()).getReference();
|
|
187 |
if(getParentElement() instanceof Classification){
|
|
188 |
secundum = ((Classification) getParentTreeNode()).getReference();
|
|
195 | 189 |
} |
196 | 190 |
else if(getParentTreeNode() instanceof TaxonNode){ |
197 | 191 |
secundum = ((TaxonNode) getParentTreeNode()).getTaxon().getSec(); |
Also available in: Unified diff
added a readme file