Package com.cburch.logisim.comp

Examples of com.cburch.logisim.comp.Component


        if (xnReverse != null) {
            xnReverse.execute();
        }

        for (int i = oldValues.size() - 1; i >= 0; i--) {
            Component comp = comps.get(i);
            Attribute<Object> attr = attrs.get(i);
            Object value = oldValues.get(i);
            if (value != null) {
                comp.getAttributeSet().setValue(attr, value);
            }
        }
    }
View Full Code Here


    public void circuitChanged(CircuitEvent event) {
        int action = event.getAction();
        if (action == CircuitEvent.ACTION_CLEAR
                || action == CircuitEvent.ACTION_REMOVE) {
            Circuit circ = event.getCircuit();
            Component circComp = null;
            if (circ == model.getCircuitState().getCircuit()) {
                circComp = path != null && path.length > 0 ? path[0] : comp;
            } else if (path != null) {
                for (int i = 0; i < path.length; i++) {
                    SubcircuitFactory circFact = (SubcircuitFactory) path[i].getFactory();
View Full Code Here

        HashSet<Wire> wires = new HashSet<Wire>();
        for (Location loc : points.getSplitLocations()) {
            Collection<? extends Component> at = points.getComponents(loc);
            if (at.size() == 2) {
                Iterator<? extends Component> atIt = at.iterator();
                Component o0 = atIt.next();
                Component o1 = atIt.next();
                if (o0 instanceof Wire && o1 instanceof Wire) {
                    Wire w0 = (Wire) o0;
                    Wire w1 = (Wire) o1;
                    if (w0.is_x_equal == w1.is_x_equal) {
                        wires.add(w0);
View Full Code Here

            if (copyFactory == null) {
                replMap.put(comp, null);
            } else if (copyFactory != compFactory) {
                Location copyLoc = comp.getLocation();
                AttributeSet copyAttrs = (AttributeSet) comp.getAttributeSet().clone();
                Component copy = copyFactory.createComponent(copyLoc, copyAttrs);
                replMap.put(comp, copy);
            }
        }

        if (dropped != null) {
View Full Code Here

            java.awt.Component ret = super.getListCellRendererComponent(list,
                value, index, isSelected, hasFocus);
            if (ret instanceof JLabel && value instanceof SelectionItem) {
                JLabel label = (JLabel) ret;
                SelectionItem item = (SelectionItem) value;
                Component comp = item.getComponent();
                label.setIcon(new ComponentIcon(comp));
                label.setText(item.toString() + " - " + item.getRadix());
            }
            return ret;
        }
View Full Code Here

        if (!handlers.isEmpty()) {
            boolean consume = false;
            ArrayList<KeyConfigurationResult> results;
            results = new ArrayList<KeyConfigurationResult>();
            for (Map.Entry<Component, KeyConfigurator> entry : handlers.entrySet()) {
                Component comp = entry.getKey();
                KeyConfigurator handler = entry.getValue();
                KeyConfigurationEvent event = new KeyConfigurationEvent(type,
                        comp.getAttributeSet(), e, comp);
                KeyConfigurationResult result = handler.keyEventReceived(event);
                consume |= event.isConsumed();
                if (result != null) {
                    results.add(result);
                }
            }
            if (consume) {
                e.consume();
            }
            if (!results.isEmpty()) {
                SetAttributeAction act = new SetAttributeAction(canvas.getCircuit(),
                        getFromLocale("changeComponentAttributesAction"));
                for (KeyConfigurationResult result : results) {
                    Component comp = (Component) result.getEvent().getData();
                    Map<Attribute<?>,Object> newValues = result.getAttributeValues();
                    for (Map.Entry<Attribute<?>,Object> entry : newValues.entrySet()) {
                        act.set(comp, entry.getKey(), entry.getValue());
                    }
                }
View Full Code Here

TOP

Related Classes of com.cburch.logisim.comp.Component

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.