コード例 #1
-1
ファイル: LightDevice.java プロジェクト: Zerak/CyberLink4Java
  public boolean actionControlReceived(Action action) {
    String actionName = action.getName();

    boolean ret = false;

    if (actionName.equals("GetPower") == true) {
      String state = getPowerState();
      Argument powerArg = action.getArgument("Power");
      powerArg.setValue(state);
      ret = true;
    }
    if (actionName.equals("SetPower") == true) {
      Argument powerArg = action.getArgument("Power");
      String state = powerArg.getValue();
      setPowerState(state);
      state = getPowerState();
      Argument resultArg = action.getArgument("Result");
      resultArg.setValue(state);
      ret = true;
    }

    comp.repaint();

    return ret;
  }