/**
- *
+ *
*/
package eu.etaxonomy.taxeditor.labels;
import eu.etaxonomy.cdm.model.name.NameRelationshipType;
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
-import eu.etaxonomy.cdm.model.name.TaxonNameBase;
+import eu.etaxonomy.cdm.model.name.TaxonName;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
/**
* code using a code-specific ILabelImageStrategy.
*
* @author p.ciardelli
- * @version $Id: $
*/
public class LabelImageProvider implements ILabelImageStrategy {
* @param name a {@link eu.etaxonomy.cdm.model.name.TaxonNameBase} object.
* @return a {@link eu.etaxonomy.taxeditor.labels.ILabelImageStrategy} object.
*/
- public static ILabelImageStrategy getLabelStrategy(TaxonNameBase name) {
+ public static ILabelImageStrategy getLabelStrategy(TaxonName name) {
if (name == null) {
if (PreferencesUtil.getPreferredNomenclaturalCode().
equals(NomenclaturalCode.ICZN)) {
return new ZoologicalNameLabelStrategy();
}
- } else if (name.getNomenclaturalCode() != null &&
- name.getNomenclaturalCode().equals(NomenclaturalCode.ICZN)) {
+ } else if (name.getNameType() != null &&
+ name.getNameType().equals(NomenclaturalCode.ICZN)) {
return new ZoologicalNameLabelStrategy();
}
return new DefaultLabelStrategy();
public LabelImageProvider(ILabelImageStrategy strategy) {
this.strategy = strategy;
}
-
+
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.editor.labels.IEditorLabelStrategy#getNameRelationTypeLabel(eu.etaxonomy.cdm.model.name.NameRelationshipType)
*/
/** {@inheritDoc} */
- public String getNameRelationTypeLabel(NameRelationshipType type) {
+ @Override
+ public String getNameRelationTypeLabel(NameRelationshipType type) {
return strategy.getNameRelationTypeLabel(type);
}
* @see eu.etaxonomy.taxeditor.editor.labels.IEditorLabelStrategy#getNameRelationInverseTypeLabel(eu.etaxonomy.cdm.model.name.NameRelationshipType)
*/
/** {@inheritDoc} */
- public String getNameRelationTypeInverseLabel(NameRelationshipType type) {
+ @Override
+ public String getNameRelationTypeInverseLabel(NameRelationshipType type) {
return strategy.getNameRelationTypeInverseLabel(type);
}
* @see eu.etaxonomy.taxeditor.editor.labels.ILabelImageStrategy#getNameRelationImage(eu.etaxonomy.cdm.model.name.NameRelationship)
*/
/** {@inheritDoc} */
- public Image getNameRelationTypeImage(NameRelationshipType type) {
+ @Override
+ public Image getNameRelationTypeImage(NameRelationshipType type) {
return strategy.getNameRelationTypeImage(type);
}
* @see eu.etaxonomy.taxeditor.labels.ILabelImageStrategy#getNameRelationDescription(eu.etaxonomy.cdm.model.name.NameRelationshipType)
*/
/** {@inheritDoc} */
- public String getNameRelationTypeDescription(NameRelationshipType type) {
+ @Override
+ public String getNameRelationTypeDescription(NameRelationshipType type) {
return strategy.getNameRelationTypeDescription(type);
}
}