public boolean insideGroup(Group g) { if (EntityUtils.equals(cl1.getContainer(), g) && ((IEntityMutable) cl1).isGroup() == false && EntityUtils.equals(cl2.getContainer(), g) && ((IEntityMutable) cl2).isGroup() == false) { return true; } return false; }
public Link mute(Group g, IEntity proxy) { final Group g1 = EntityUtils.getContainerOrEquivalent(cl1); final Group g2 = EntityUtils.getContainerOrEquivalent(cl2); if (EntityUtils.equals(g1, g) && ((IEntityMutable) cl1).isGroup() == false && EntityUtils.equals(g, g2) && ((IEntityMutable) cl2).isGroup() == false) { return null; } final IEntity ent1 = muteProxy(cl1, g, proxy); final IEntity ent2 = muteProxy(cl2, g, proxy); if (this.cl1 == ent1 && this.cl2 == ent2) { return this; } return new Link( ent1, ent2, getType(), label, length, qualifier1, qualifier2, labeldistance, labelangle); }
private static IEntity muteProxy(IEntity ent, Group g, IEntity proxy) { if (((IEntityMutable) ent).isGroup()) { if (EntityUtils.equals((Group) ent, g)) { return proxy; } } return ent; }
public boolean isAutolink(Group g) { if (((IEntityMutable) getEntity1()).isGroup() == false) { return false; } if (((IEntityMutable) getEntity2()).isGroup() == false) { return false; } if (EntityUtils.equals(g, (Group) getEntity1()) && EntityUtils.equals(g, (Group) getEntity1())) { return true; } // if (getEntity1() == g.zgetEntityCluster() && getEntity2() == g.zgetEntityCluster()) { // assert getEntity1().getType() == EntityType.GROUP; // assert getEntity2().getType() == EntityType.GROUP; // return true; // } return false; }
public boolean isFromEdgeLink(Group g) { final Group g1 = EntityUtils.getContainerOrEquivalent(getEntity1()); final Group g2 = EntityUtils.getContainerOrEquivalent(getEntity2()); if (EntityUtils.equals(g1, g) == false || EntityUtils.equals(g2, g) == false) { return false; } assert EntityUtils.equals(g1, g) && EntityUtils.equals(g2, g); if (isAutolink(g)) { return false; } if (((EntityMutable) getEntity1()).isGroup()) { assert ((EntityMutable) getEntity2()).isGroup() == false; return true; } return false; }