Search in sources :

Example 1 with NFastStringSet

use of com.ait.tooling.nativetools.client.collection.NFastStringSet in project lienzo-core by ahome-it.

the class AbstractAccumulatingAttributesChangedBatcher method dispatch.

protected final void dispatch() {
    if ((null != m_manager) && (false == m_changed.isEmpty())) {
        final NFastStringSet changed = new NFastStringSet(m_changed);
        m_changed = new NFastStringSet();
        final long begtime = m_begtime;
        final long endtime = m_endtime;
        final AttributesChangedManager manager = m_manager;
        m_begtime = 0L;
        m_endtime = 0L;
        m_manager = null;
        manager.fireChanged(changed, begtime, endtime);
    }
}
Also used : NFastStringSet(com.ait.tooling.nativetools.client.collection.NFastStringSet)

Example 2 with NFastStringSet

use of com.ait.tooling.nativetools.client.collection.NFastStringSet in project lienzo-core by ahome-it.

the class ImmediateAttributesChangedBatcher method bufferAttributeWithManager.

@Override
public void bufferAttributeWithManager(final String name, final AttributesChangedManager manager) {
    final long time = System.currentTimeMillis();
    Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {

        @Override
        public boolean execute() {
            manager.fireChanged(new NFastStringSet(name), time, time);
            return false;
        }
    }, 0);
}
Also used : NFastStringSet(com.ait.tooling.nativetools.client.collection.NFastStringSet) RepeatingCommand(com.google.gwt.core.client.Scheduler.RepeatingCommand)

Example 3 with NFastStringSet

use of com.ait.tooling.nativetools.client.collection.NFastStringSet in project lienzo-core by ahome-it.

the class AttributesChangedEvent method one.

public final boolean one(final List<Attribute> attributes) {
    int count = 0;
    final NFastStringSet seen = new NFastStringSet();
    for (Attribute attribute : attributes) {
        final String name = attribute.getProperty();
        if (false == seen.contains(name)) {
            if (m_changed.contains(name)) {
                if (++count > 1) {
                    return false;
                }
                seen.add(name);
            }
        }
    }
    return (0 != count);
}
Also used : NFastStringSet(com.ait.tooling.nativetools.client.collection.NFastStringSet) Attribute(com.ait.lienzo.client.core.Attribute)

Example 4 with NFastStringSet

use of com.ait.tooling.nativetools.client.collection.NFastStringSet in project lienzo-core by ahome-it.

the class AttributesChangedEvent method one.

public final boolean one(final Attribute... attributes) {
    int count = 0;
    final NFastStringSet seen = new NFastStringSet();
    for (Attribute attribute : attributes) {
        final String name = attribute.getProperty();
        if (false == seen.contains(name)) {
            if (m_changed.contains(name)) {
                if (++count > 1) {
                    return false;
                }
                seen.add(name);
            }
        }
    }
    return (0 != count);
}
Also used : NFastStringSet(com.ait.tooling.nativetools.client.collection.NFastStringSet) Attribute(com.ait.lienzo.client.core.Attribute)

Example 5 with NFastStringSet

use of com.ait.tooling.nativetools.client.collection.NFastStringSet in project lienzo-core by ahome-it.

the class AttributesChangedEvent method count.

public final int count(final List<Attribute> attributes) {
    int count = 0;
    final NFastStringSet seen = new NFastStringSet();
    for (Attribute attribute : attributes) {
        final String name = attribute.getProperty();
        if (false == seen.contains(name)) {
            if (m_changed.contains(name)) {
                count++;
                seen.add(name);
            }
        }
    }
    return count;
}
Also used : NFastStringSet(com.ait.tooling.nativetools.client.collection.NFastStringSet) Attribute(com.ait.lienzo.client.core.Attribute)

Aggregations

NFastStringSet (com.ait.tooling.nativetools.client.collection.NFastStringSet)6 Attribute (com.ait.lienzo.client.core.Attribute)4 RepeatingCommand (com.google.gwt.core.client.Scheduler.RepeatingCommand)1