private static String toEntityTypePrintName(boolean singleEntityDeclaration, EntityType<?> entityType) { return singleEntityDeclaration ? entityType.getPrintName() : entityType.getPluralPrintName(); }
/** * Constructs a WizardPanel that will ask the user whether they want to make siblings disjoint. * @param owlEditorKit The relevant editor kit. * @param entityType The type of sibling. * @param recommendation Whether or not it is recommended that siblings be disjoint. */ public MakeSiblingsDisjointPanel(OWLEditorKit owlEditorKit, EntityType<?> entityType, Recommendation recommendation) { super(ID, String.format("Make sibling %s disjoint?", entityType.getPluralPrintName().toLowerCase()), owlEditorKit); this.checkBox = new JCheckBox(String.format("Do you want to make sibling %s disjoint? (%s)", entityType.getPluralPrintName().toLowerCase(), recommendation.getPrintName()), recommendation == Recommendation.RECOMMENDED); checkBox.setBackground(null); this.entityType = entityType; this.recommendation = recommendation; setInstructions(String.format("Make sibling %s disjoint (%s)", entityType.getPluralPrintName().toLowerCase(), recommendation.getPrintName())); JPanel parent = new JPanel(new BorderLayout()); parent.add(checkBox, BorderLayout.NORTH); setContent(parent); }
/** * Constructs a WizardPanel that will ask the user whether they want to make siblings disjoint. * @param owlEditorKit The relevant editor kit. * @param entityType The type of sibling. * @param recommendation Whether or not it is recommended that siblings be disjoint. */ public MakeSiblingsDisjointPanel(OWLEditorKit owlEditorKit, EntityType<?> entityType, Recommendation recommendation) { super(ID, String.format("Make sibling %s disjoint?", entityType.getPluralPrintName().toLowerCase()), owlEditorKit); this.checkBox = new JCheckBox(String.format("Do you want to make sibling %s disjoint? (%s)", entityType.getPluralPrintName().toLowerCase(), recommendation.getPrintName()), recommendation == Recommendation.RECOMMENDED); checkBox.setBackground(null); this.entityType = entityType; this.recommendation = recommendation; setInstructions(String.format("Do you want to make sibling %s disjoint? (%s)", entityType.getPluralPrintName().toLowerCase(), recommendation.getPrintName())); JPanel parent = new JPanel(new BorderLayout()); parent.add(checkBox, BorderLayout.NORTH); setContent(parent); }
private void generateMessage() { if (entities.size() == 1) { message = msgFormatter.format("Deleted {0}: {1}", entities.iterator().next().getEntityType().getPrintName().toLowerCase(), entities); } else { Collection<EntityType<?>> deletedTypes = entities.stream() .map(OWLEntity::getEntityType) .collect(Collectors.toSet()); if (deletedTypes.size() == 1) { message = msgFormatter.format("Deleted {0} {1}: {2}", entities.size(), deletedTypes.iterator().next().getPluralPrintName().toLowerCase(), entities); } else { message = msgFormatter.format("Deleted: {1}", entities); } } }
PrimitiveType(EntityType<?> entityType) { this(entityType.getShortForm(), entityType.getPrintName(), entityType.getPluralPrintName()); }
PrimitiveType(EntityType<?> entityType) { this(entityType.getShortForm(), entityType.getPrintName(), entityType.getPluralPrintName()); }
PrimitiveType(EntityType<?> entityType) { this(entityType.getShortForm(), entityType.getPrintName(), entityType.getPluralPrintName()); }
f = e -> (SortedSet<E>) reasoner.getSuperProperties((OWLDataProperty) e); } else { throw new RuntimeException("LCS for " + entityType.getPluralPrintName() + " not implemented!");
@Nonnull @Override public String getMessage(ChangeApplicationResult<Set<E>> result) { Set<E> entities = result.getSubject(); int entityCount = entities.size(); String mainMsg; if(entityCount == 1) { mainMsg = msg.format("Created {0} {1}", entityType.getPrintName().toLowerCase(), entities); if (!parents.isEmpty()) { mainMsg += msg.format(" {0} {1}", getSingularRelationship(), parents); } } else { mainMsg = msg.format("Created {0} {1}", entityType.getPluralPrintName().toLowerCase(), entities); if (!parents.isEmpty()) { mainMsg += msg.format(" {0} {1}", getPluralRelationship(), parents); } } return mainMsg; }