Examples of KeyConfigurationResult


Examples of com.cburch.logisim.tools.key.KeyConfigurationResult

    }

    if (handler != null) {
      AttributeSet baseAttrs = getBaseAttributes();
      KeyConfigurationEvent e = new KeyConfigurationEvent(type, baseAttrs, event, this);
      KeyConfigurationResult r = handler.keyEventReceived(e);
      if (r != null) {
        Action act = ToolAttributeAction.create(r);
        canvas.getProject().doAction(act);
      }
    }
View Full Code Here

Examples of com.cburch.logisim.tools.key.KeyConfigurationResult

public class ToolAttributeAction extends Action {
  public static Action create(Tool tool, Attribute<?> attr, Object value) {
    AttributeSet attrs = tool.getAttributeSet();
    KeyConfigurationEvent e = new KeyConfigurationEvent(0, attrs, null, null);
    KeyConfigurationResult r = new KeyConfigurationResult(e, attr, value);
    return new ToolAttributeAction(r);
  }
View Full Code Here

Examples of com.cburch.logisim.tools.key.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(),
            Strings.getter("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());
          }
        }
        if (!act.isEmpty()) {
View Full Code Here

Examples of com.cburch.logisim.tools.key.KeyConfigurationResult

public class ToolAttributeAction extends Action {
    public static Action create(Tool tool, Attribute<?> attr, Object value) {
        AttributeSet attrs = tool.getAttributeSet();
        KeyConfigurationEvent e = new KeyConfigurationEvent(0, attrs, null, null);
        KeyConfigurationResult r = new KeyConfigurationResult(e, attr, value);
        return new ToolAttributeAction(r);
    }
View Full Code Here

Examples of com.cburch.logisim.tools.key.KeyConfigurationResult

        }

        if (handler != null) {
            AttributeSet baseAttrs = getBaseAttributes();
            KeyConfigurationEvent e = new KeyConfigurationEvent(type, baseAttrs, event, this);
            KeyConfigurationResult r = handler.keyEventReceived(e);
            if (r != null) {
                Action act = ToolAttributeAction.create(r);
                canvas.getProject().doAction(act);
            }
        }
View Full Code Here

Examples of com.cburch.logisim.tools.key.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());
                    }
                }
                if (!act.isEmpty()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.