@Override protected Set<EvidenceType> retrieveEvidenceTypeAll() { return parent.getEvidence(); }
/** * Creates an evidence type on relation only if it does not already exists * * @param target * - relation * @param newEv * - attribute to create * @throws AccessDeniedException * @throws NullValueException */ public static void addNewEvidence(ONDEXRelation target, EvidenceType newEv) throws NullValueException, AccessDeniedException { if (!target.getEvidence().contains(newEv)) target.addEvidenceType(newEv); }
/** * Adds the evidence types to the target relation where they do not already * exist * * @param newRelation * the new relations * @param evi * the new evidence types */ private void addEvidenceTypeToRelation(ONDEXRelation newRelation, Set<EvidenceType> evi) { if (evi.size() == 0) { return; } Set<EvidenceType> eviExisting = newRelation.getEvidence(); for (EvidenceType et : evi) { if (!eviExisting.contains(et)) { newRelation.addEvidenceType(et); } } }
/** * Update the colour of a given edge. * * @param edge * ONDEXRelation */ public void updateColor(ONDEXRelation edge) { switch (strategy) { case RELATIONTYPE: colors.put(edge, Config.getColorForRelationType(edge.getOfType())); break; case EVIDENCETYPE: Color[] etcolors = new Color[edge.getEvidence().size()]; int i = 0; for (EvidenceType et : edge.getEvidence()) { etcolors[i] = Config.getColorForEvidenceType(et); i++; } colors.put(edge, new MultiColorEdgePaint(etcolors)); break; case MANUAL: break; default: colors.put(edge, Config.getDefaultColor()); break; } }
for (EvidenceType et : r.getEvidence()) { clause.delete(0, clause.length()); clause.append(rtMapping.get(rtid));
/** * Copies all of the attributes from one relation to another (only if they * do not already exist at target) * * @param source * - relation to copy from * @param target * - relation to copy to * @throws AccessDeniedException * @throws NullValueException */ public static void copyRelationAttributes(ONDEXRelation source, ONDEXRelation target) throws NullValueException, AccessDeniedException { for (EvidenceType et : source.getEvidence()) addNewEvidence(target, et); for (Attribute attribute : source.getAttributes()) addNewAttribute(target, attribute); }
@Override protected void doAction() { for (ONDEXRelation edge : entities) { ONDEXRelation r = edge; for (EvidenceType et : r.getEvidence()) { for (ONDEXRelation or : viewer.getONDEXJUNGGraph().getRelationsOfEvidenceType(et)) { viewer.getONDEXJUNGGraph().setVisibility(or, false); } } } }
if (!relation.getEvidence().contains(newET)) { if (relation.getEvidence().size() > 1) relation.removeEvidenceType(newET); return relation.getEvidence(); default: System.out.println("unknown state for updating cell editor value");
Set<EvidenceType> evidenceTypes= rel.getEvidence();
/** * Transfers all relations that the old concept takes part into to the new * concept. * * @param oldC * old ONDEXConcept * @param newC * new ONDEXConcept */ private void transferRelations(ONDEXConcept oldC, ONDEXConcept newC) { // iterate over all relations of old concept for (ONDEXRelation oldR : graph.getRelationsOfConcept(oldC)) { ONDEXRelation newR = null; if (oldR.getFromConcept().equals(oldC)) { // old concept is from concept newR = graph.createRelation(newC, oldR.getToConcept(), oldR.getOfType(), oldR.getEvidence()); } else if (oldR.getToConcept().equals(oldC)) { // old concept is to concept newR = graph.createRelation(oldR.getFromConcept(), newC, oldR.getOfType(), oldR.getEvidence()); } // transfer context old to new for (ONDEXConcept c : oldR.getTags()) { newR.addTag(c); } } }
Set<EvidenceType> evidenceTypes= rel.getEvidence();
/** * Initialises table data with the given ONDEXGraph. * * @param graph * ONDEXGraph to extract relations from */ public RelationPanel(ONDEXGraph graph) { // iterate over all relations Set<ONDEXRelation> view = graph.getRelations(); Object[][] data = new Object[view.size()][]; int i = 0; for (ONDEXRelation relation : view) { // first entry in table row is relation itself Object[] row = { relation, relation.getFromConcept(), relation.getToConcept(), relation.getOfType(), relation.getEvidence() }; data[i] = row; i++; } // initialise table model and populate table DefaultTableModel model = new DefaultTableModel(); model.setDataVector(data, header); table = new RelationTable(model, graph); // add table to panel this.setLayout(new GridLayout(1, 1)); this.add(new JScrollPane(table)); Util.calcColumnWidths(table, 150); }
/** * This method will create a copy of the original relation between the * concepts specified. * * @param graph * - graph where this things live * @param from * - source concept of the copied relation * @param to * - target concept of the copied relation * @param r * - relation that will be copied */ public static void copyRelation(ONDEXGraph graph, ONDEXConcept from, ONDEXConcept to, ONDEXRelation r) { ONDEXRelation nr = null; Collection<EvidenceType> evidence = r.getEvidence(); Collection<ONDEXConcept> tags = new HashSet<ONDEXConcept>(r.getTags()); Collection<Attribute> rgdss = r.getAttributes(); nr = graph.createRelation(from, to, r.getOfType(), evidence); for (ONDEXConcept tag : tags) nr.addTag(tag); for (Attribute rattribute : rgdss) { cloneAttributeWithAttName(graph, r, nr, rattribute.getOfType()); } }
newR = graph.createRelation(newC, oldR.getToConcept(), oldR.getOfType(), oldR.getEvidence()); break; case TO: newR = graph.createRelation(oldR.getFromConcept(), newC, oldR.getOfType(), oldR.getEvidence()); break; default:
for (EvidenceType et : r.getEvidence()) { evidence.add(et);
/** * Clone relation with having a new RelationType. * * @param oldR * old ONDEXRelation * @param newRT * new RelationType to use * @return new ONDEXRelation */ public ONDEXRelation clone(ONDEXRelation oldR, RelationType newRT) { // first clone concept with new ConceptClass ONDEXRelation newR = graph.getRelation(oldR.getFromConcept(), oldR.getToConcept(), oldR.getOfType()); if (newR == null) graph.createRelation(oldR.getFromConcept(), oldR.getToConcept(), oldR.getOfType(), oldR.getEvidence()); // copies everything else copyEverythingElse(oldR, newR); return newR; }
throws NullValueException, AccessDeniedException { ONDEXRelation nr = null; Collection<EvidenceType> evidence = r.getEvidence(); Collection<ONDEXConcept> tags = new HashSet<ONDEXConcept>(r.getTags()); Collection<Attribute> rgdss = r.getAttributes();
Set<EvidenceType> itEt = r.getEvidence(); if (prettyPrint) xmlw.writeCharacters(newline);
if ( sizeIsEmpty ( rel.getAttributes () ) && sizeIsEmpty ( rel.getEvidence () ) && sizeIsEmpty ( rel.getTags () ) )