Package com.cburch.logisim.data

Examples of com.cburch.logisim.data.AttributeSet


        this.fieldX = x;
        this.fieldY = y;
        this.halign = halign;
        this.valign = valign;
        boolean shouldReg = shouldRegister();
        AttributeSet attrs = comp.getAttributeSet();
        if (!wasReg && shouldReg) attrs.addAttributeListener(this);
        if (wasReg && !shouldReg) attrs.removeAttributeListener(this);

        updateField(attrs);
    }
View Full Code Here


        private void computeAttributeList(Set<AttributeSet> attrsSet) {
            Set<Attribute<?>> attrSet = new LinkedHashSet<Attribute<?>>();
            Iterator<AttributeSet> sit = attrsSet.iterator();
            if (sit.hasNext()) {
                AttributeSet first = sit.next();
                attrSet.addAll(first.getAttributes());
                while (sit.hasNext()) {
                    AttributeSet next = sit.next();
                    for (Iterator<Attribute<?>> ait = attrSet.iterator(); ait.hasNext(); ) {
                        Attribute<?> attr = ait.next();
                        if (!next.containsAttribute(attr)) {
                            ait.remove();
                        }
                    }
                }
            }
View Full Code Here

            subcircInstance.fireInvalidated();
        }
    }

    static AttributeSet createBaseAttrs(Circuit source, String name) {
        AttributeSet ret = AttributeSets.fixedSet(STATIC_ATTRS, STATIC_DEFAULTS);
        ret.setValue(CircuitAttributes.NAME_ATTR, name);
        ret.addAttributeListener(new StaticListener(source));
        return ret;
    }
View Full Code Here

        }
        libs.put(lib, name);
        ret.setAttribute("name", name);
        ret.setAttribute("desc", desc);
        for (Tool t : lib.getTools()) {
            AttributeSet attrs = t.getAttributeSet();
            if (attrs != null) {
                Element toAdd = doc.createElement("tool");
                toAdd.setAttribute("name", t.getName());
                addAttributeSetContent(toAdd, attrs, t);
                if (toAdd.getChildNodes().getLength() > 0) {
View Full Code Here

    }

    public void addToolAttributeListener(AttributeListener l) {
        for (Tool tool : contents) {
            if (tool != null) {
                AttributeSet attrs = tool.getAttributeSet();
                if (attrs != null) attrs.addAttributeListener(l);
            }
        }
        toolListeners.add(l);
    }
View Full Code Here

    }

    public void removeToolAttributeListener(AttributeListener l) {
        for (Tool tool : contents) {
            if (tool != null) {
                AttributeSet attrs = tool.getAttributeSet();
                if (attrs != null) attrs.removeAttributeListener(l);
            }
        }
        toolListeners.remove(l);
    }
View Full Code Here

        toolListeners.remove(l);
    }

    private void addAttributeListeners(Tool tool) {
        for (AttributeListener l : toolListeners) {
            AttributeSet attrs = tool.getAttributeSet();
            if (attrs != null) attrs.addAttributeListener(l);
        }
    }
View Full Code Here

        }
    }

    private void removeAttributeListeners(Tool tool) {
        for (AttributeListener l : toolListeners) {
            AttributeSet attrs = tool.getAttributeSet();
            if (attrs != null) attrs.removeAttributeListener(l);
        }
    }
View Full Code Here

            }
        }
    }

    private Attribute<Direction> getFacingAttribute(Component comp) {
        AttributeSet attrs = comp.getAttributeSet();
        Object key = ComponentFactory.FACING_ATTRIBUTE_KEY;
        Attribute<?> a = (Attribute<?>) comp.getFactory().getFeature(key, attrs);
        @SuppressWarnings("unchecked")
        Attribute<Direction> ret = (Attribute<Direction>) a;
        return ret;
View Full Code Here

    //
    // static methods - shared with other classes
    //
    static Value repair(InstanceState state, Value v) {
        AttributeSet opts = state.getProject().getOptions().getAttributeSet();
        Object onUndefined = opts.getValue(Options.ATTR_GATE_UNDEFINED);
        boolean errorIfUndefined = onUndefined.equals(Options.GATE_UNDEFINED_ERROR);
        Value repaired;
        if (errorIfUndefined) {
            int vw = v.getWidth();
            BitWidth w = state.getAttributeValue(StdAttr.WIDTH);
View Full Code Here

TOP

Related Classes of com.cburch.logisim.data.AttributeSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.