コード例 #1
0
ファイル: Service.java プロジェクト: ms777/CyberLink4Java
 public Action getAction(String actionName) {
   ActionList actionList = getActionList();
   int nActions = actionList.size();
   for (int n = 0; n < nActions; n++) {
     Action action = actionList.getAction(n);
     String name = action.getName();
     if (name == null) continue;
     if (name.equals(actionName) == true) return action;
   }
   return null;
 }
コード例 #2
0
ファイル: TreeComp.java プロジェクト: Zerak/CyberLink4Java
 void updateActionList(TreeNode parentNode, Service service) {
   ActionList actionList = service.getActionList();
   int nActions = actionList.size();
   for (int n = 0; n < nActions; n++) {
     Action action = actionList.getAction(n);
     String actionName = action.getName();
     TreeNode actionNode = new TreeNode(actionName);
     actionNode.setUserData(action);
     parentNode.add(actionNode);
     updateArgumentList(actionNode, action);
   }
 }
コード例 #3
-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;
  }