Search in sources :

Example 1 with ConceptSurface

use of nars.gui.ConceptSurface in project narchy by automenta.

the class DynamicConceptSpace method get.

@Override
protected List<ConceptWidget> get() {
    if (updated.get()) {
        List<ConceptWidget> w;
        w = next.write();
        w.clear();
        concepts.forEach((clink) -> {
            // ConceptWidget cw = space.getOrAdd(clink.get().id, ConceptWidget::new);
            Concept cc = clink.get().id;
            ConceptWidget cw = cc.meta(spaceID, (sid) -> new ConceptWidget(cc) {

                @Override
                protected void onClicked(PushButton b) {
                    SpaceGraph.window(new ConceptSurface(id.term(), nar), 800, 700);
                }
            });
            if (cw != null) {
                cw.activate();
                cw.pri = clink.priElseZero();
                w.add(cw);
            }
        // space.getOrAdd(concept.term(), materializer).setConcept(concept, now)
        });
        vis.accept(next.write());
        next.commit();
        updated.set(false);
    }
    return next.read();
}
Also used : Concept(nars.concept.Concept) ConceptSurface(nars.gui.ConceptSurface) PushButton(spacegraph.space2d.widget.button.PushButton)

Aggregations

Concept (nars.concept.Concept)1 ConceptSurface (nars.gui.ConceptSurface)1 PushButton (spacegraph.space2d.widget.button.PushButton)1