@Override protected boolean existsAttributeName(String id) { return parent.checkAttributeName(id); }
/** * Validate data entry. * * @return true if data is valid */ private boolean validateEntry() { if (id.getText().trim().length() == 0 || id.getText().contains(" ")) { JOptionPane.showInternalMessageDialog(dialog, Config.language.getProperty("Dialog.Attribute.AttributeName.InvalidID"), Config.language.getProperty("Dialog.Attribute.AttributeName.InvalidTitle"), JOptionPane.ERROR_MESSAGE); return false; } else if (aog.getMetaData().checkAttributeName(id.getText())) { JOptionPane.showInternalMessageDialog(dialog, Config.language.getProperty("Dialog.Attribute.AttributeName.DuplicateID"), Config.language.getProperty("Dialog.Attribute.AttributeName.DuplicateTitle"), JOptionPane.ERROR_MESSAGE); return false; } else if (classField.getText().trim().length() == 0) { JOptionPane.showInternalMessageDialog(dialog, Config.language.getProperty("Dialog.Attribute.AttributeName.InvalidClass"), Config.language.getProperty("Dialog.Attribute.AttributeName.InvalidTitle"), JOptionPane.ERROR_MESSAGE); return false; } return true; }
if (!og.getMetaData().checkAttributeName(nameS)) {
if (!graph.getMetaData().checkAttributeName("visible")) { this.an = graph.getMetaData().getFactory().createAttributeName("visible", Boolean.class); } else { if (!graph.getMetaData().checkAttributeName("visibleNLV")) { this.anNLV = graph.getMetaData().getFactory().createAttributeName("visibleNLV", Boolean.class); } else {
if (!graph.getMetaData().checkAttributeName("visible")) { this.an = graph.getMetaData().getFactory().createAttributeName("visible", Boolean.class); } else { if (!graph.getMetaData().checkAttributeName("visibleELV")) { this.anELV = graph.getMetaData().getFactory().createAttributeName("visibleELV", Boolean.class); } else {
/** * @param attNames * @param omd * copy from MetaData * @param nomd * copy to MetaData */ private void copyAttributeNames(Iterable<AttributeName> attNames, ONDEXGraphMetaData omd, ONDEXGraphMetaData nomd) { // "specializations_of"s that occur before there specialisation HashSet<AttributeName> atDependencyNotResolved = new HashSet<AttributeName>(); for (AttributeName att : attNames) { AttributeName spec = att.getSpecialisationOf(); AttributeName newSpec = null; if (spec != null) { newSpec = nomd.getAttributeName(spec.getId()); if (newSpec == null) { atDependencyNotResolved.add(att); continue; } } if (!nomd.checkAttributeName(att.getId())) nomd.createAttributeName(att.getId(), att.getFullname(), att .getDescription(), att.getUnit(), att.getDataType(), newSpec); } if (atDependencyNotResolved.size() > 0) { copyAttributeNames(atDependencyNotResolved, omd, nomd); } }