コード例 #1
2
  public void changeLAF(int iLAFIndex) {
    try {
      // Change LAF
      if (iLAFIndex >= marrLaf.length) iLAFIndex = marrLaf.length - 1;
      UIManager.setLookAndFeel(
          (LookAndFeel) Class.forName(marrLaf[iLAFIndex].getClassName()).newInstance());

      // Update UI
      ((JMenuItem) mvtLAFItem.elementAt(iLAFIndex)).setSelected(true);
      SwingUtilities.updateComponentTreeUI(this);
      SwingUtilities.updateComponentTreeUI(mnuMain);
      WindowManager.updateLookAndField();

      // Store config
      try {
        Hashtable prt = Global.loadHashtable(Global.FILE_CONFIG);
        prt.put("LAF", String.valueOf(iLAFIndex));
        Global.storeHashtable(prt, Global.FILE_CONFIG);
      } catch (Exception e) {
      }
    } catch (Exception e) {
      e.printStackTrace();
      MessageBox.showMessageDialog(this, e, Global.APP_NAME, MessageBox.ERROR_MESSAGE);
    }
  }
コード例 #2
0
  void ICmd$$SINGLETONS() {
    Proto.Obj po;
    Value.Obj vo;

    vo = (Value.Obj) om.findStrict("xdc.tools.ICmd", "xdc.tools");
    po = (Proto.Obj) om.findStrict("xdc.tools.ICmd.Module", "xdc.tools");
    vo.init2(po, "xdc.tools.ICmd", $$DEFAULT, false);
    vo.bind("Module", po);
    vo.bind("$category", "Interface");
    vo.bind("$capsule", om.findStrict("xdc.tools.ICmd$$capsule", "xdc.tools"));
    vo.bind("Instance", om.findStrict("xdc.tools.ICmd.Instance", "xdc.tools"));
    vo.bind("Params", om.findStrict("xdc.tools.ICmd.Params", "xdc.tools"));
    vo.bind(
        "PARAMS", ((Proto.Str) om.findStrict("xdc.tools.ICmd.Params", "xdc.tools")).newInstance());
    vo.bind("$package", om.findStrict("xdc.tools", "xdc.tools"));
    tdefs.clear();
    proxies.clear();
    inherits.clear();
    vo.bind("$$tdefs", Global.newArray(tdefs.toArray()));
    vo.bind("$$proxies", Global.newArray(proxies.toArray()));
    vo.bind("$$inherits", Global.newArray(inherits.toArray()));
    ((Value.Arr) pkgV.getv("$interfaces")).add(vo);
    pkgV.bind("ICmd", vo);
    ((Value.Arr) pkgV.getv("$unitNames")).add("ICmd");
    vo.seal(null);
  }
コード例 #3
0
ファイル: ClientGame.java プロジェクト: Hikari9/SpaceShooter
  void waitForOtherPlayers() throws IOException {

    Global.log("Waiting for other players to register...");

    int n = Integer.parseInt(mainServer.readLine());
    playerNames = new String[n];

    for (int i = 0; i < n; ++i) {
      String info = mainServer.readLine();
      playerNames[i] = info;
    }

    // ping back to server for an OK
    mainServer.println();
    mainServer.flush();

    Global.log("List of Players:");
    for (int i = 0; i < n; ++i) Global.log("\t" + (i + 1) + ": " + playerNames[i]);

    // get player ID
    for (int i = 0; i < n; ++i) {
      if (name.equals(playerNames[i])) {
        playerID = i;
        break;
      }
    }

    Global.log("Player ID: " + (playerID + 1));
  }
コード例 #4
0
  void IRtscProductTemplate$$SINGLETONS() {
    Proto.Obj po;
    Value.Obj vo;

    vo = (Value.Obj) om.findStrict("xdc.tools.IRtscProductTemplate", "xdc.tools");
    po = (Proto.Obj) om.findStrict("xdc.tools.IRtscProductTemplate.Module", "xdc.tools");
    vo.init2(po, "xdc.tools.IRtscProductTemplate", $$DEFAULT, false);
    vo.bind("Module", po);
    vo.bind("$category", "Interface");
    vo.bind("$capsule", $$UNDEF);
    vo.bind("$package", om.findStrict("xdc.tools", "xdc.tools"));
    tdefs.clear();
    proxies.clear();
    inherits.clear();
    vo.bind(
        "TemplateInfo", om.findStrict("xdc.tools.IRtscProductTemplate.TemplateInfo", "xdc.tools"));
    tdefs.add(om.findStrict("xdc.tools.IRtscProductTemplate.TemplateInfo", "xdc.tools"));
    vo.bind("$$tdefs", Global.newArray(tdefs.toArray()));
    vo.bind("$$proxies", Global.newArray(proxies.toArray()));
    vo.bind("$$inherits", Global.newArray(inherits.toArray()));
    ((Value.Arr) pkgV.getv("$interfaces")).add(vo);
    pkgV.bind("IRtscProductTemplate", vo);
    ((Value.Arr) pkgV.getv("$unitNames")).add("IRtscProductTemplate");
    vo.seal(null);
  }
コード例 #5
0
 void $$IMPORTS() {
   Global.callFxn("loadPackage", xdcO, "xdc.bld");
   Global.callFxn("loadPackage", xdcO, "gnu.targets");
   Global.callFxn("loadPackage", xdcO, "xdc");
   Global.callFxn("loadPackage", xdcO, "xdc.corevers");
   Global.callFxn("loadPackage", xdcO, "google.targets");
 }
コード例 #6
0
  public void handleStatement(ASTStatement node) {

    // System.out.println(node.getCode());

    // Drawing
    connector.startSnap(node.getLineNumber());

    // FIXME we'll see how this works

    // Nested scope for by macro
    SimpleNode s = (SimpleNode) node.jjtGetChild(0);

    if (s instanceof ASTStatementList) {
      System.out.println("This'll never happen");
      SymbolTable st = new SymbolTable(Global.getCurrentSymbolTable());
      st.setName("nested");
      Global.setCurrentSymbolTable(st);
      s.jjtAccept(this, null);
      Global.setCurrentSymbolTable(st.getPrevious());
    } else {

      node.jjtGetChild(0).jjtAccept(this, null);
      if (((SimpleNode) node.jjtGetChild(0)).getId() == JJTCALL) {
        ((ASTCall) (node.jjtGetChild(0))).setLineNumber(node.getLineNumber());
      }

      update(node.getLineNumber(), UPDATE_REASON_STATEMENT);
    }
    // System.out.println("endStatement");
    connector.endSnap();
  }
コード例 #7
0
  public void changeDictionary(String strLanguage) {
    // Change dictionary
    MonitorDictionary.setCurrentLanguage(strLanguage);
    DefaultDictionary.setCurrentLanguage(strLanguage);
    ErrorDictionary.setCurrentLanguage(strLanguage);

    // Update UI
    updateLanguage();
    WindowManager.updateLanguage();
    int iIndex = mvtLanguage.indexOf(strLanguage);
    if (iIndex >= 0) {
      JRadioButtonMenuItem mnu = (JRadioButtonMenuItem) mvtLanguageItem.elementAt(iIndex);
      mnu.setSelected(true);
    }

    // Store config
    Hashtable prt = null;
    try {
      prt = Global.loadHashtable(Global.FILE_CONFIG);
    } catch (Exception e) {
      prt = new Hashtable();
    }
    prt.put("Language", strLanguage);
    try {
      Global.storeHashtable(prt, Global.FILE_CONFIG);
    } catch (Exception e) {
    }
  }
コード例 #8
0
 void $$SINGLETONS() {
   pkgP.init(
       "xdc.services.mapping.Package",
       (Proto.Obj) om.findStrict("xdc.IPackage.Module", "xdc.services.mapping"));
   pkgP.bind("$capsule", $$UNDEF);
   pkgV.init2(pkgP, "xdc.services.mapping", Value.DEFAULT, false);
   pkgV.bind("$name", "xdc.services.mapping");
   pkgV.bind("$category", "Package");
   pkgV.bind("$$qn", "xdc.services.mapping.");
   pkgV.bind("$vers", Global.newArray(1, 0, 0));
   Value.Map atmap = (Value.Map) pkgV.getv("$attr");
   atmap.seal("length");
   imports.clear();
   pkgV.bind("$imports", imports);
   StringBuilder sb = new StringBuilder();
   sb.append("var pkg = xdc.om['xdc.services.mapping'];\n");
   sb.append("if (pkg.$vers.length >= 3) {\n");
   sb.append("pkg.$vers.push(Packages.xdc.services.global.Vers.getDate(xdc.csd() + '/..'));\n");
   sb.append("}\n");
   sb.append("if ('xdc.services.mapping$$stat$base' in xdc.om) {\n");
   sb.append("pkg.packageBase = xdc.om['xdc.services.mapping$$stat$base'];\n");
   sb.append("pkg.packageRepository = xdc.om['xdc.services.mapping$$stat$root'];\n");
   sb.append("}\n");
   sb.append("pkg.build.libraries = [\n");
   sb.append("];\n");
   sb.append("pkg.build.libDesc = [\n");
   sb.append("];\n");
   Global.eval(sb.toString());
 }
コード例 #9
0
ファイル: ti_sysbios_rta.java プロジェクト: skitlab/ti-bios
 void $$IMPORTS() {
   Global.callFxn("loadPackage", xdcO, "xdc");
   Global.callFxn("loadPackage", xdcO, "xdc.corevers");
   Global.callFxn("loadPackage", xdcO, "xdc.runtime");
   Global.callFxn("loadPackage", xdcO, "ti.sysbios.knl");
   Global.callFxn("loadPackage", xdcO, "xdc.rov");
 }
コード例 #10
0
 void $$SINGLETONS() {
   pkgP.init(
       "ti.sdo.ce.utils.rtcfg.osal.Package",
       (Proto.Obj) om.findStrict("xdc.IPackage.Module", "ti.sdo.ce.utils.rtcfg.osal"));
   pkgP.bind("$capsule", $$UNDEF);
   pkgV.init2(pkgP, "ti.sdo.ce.utils.rtcfg.osal", Value.DEFAULT, false);
   pkgV.bind("$name", "ti.sdo.ce.utils.rtcfg.osal");
   pkgV.bind("$category", "Package");
   pkgV.bind("$$qn", "ti.sdo.ce.utils.rtcfg.osal.");
   pkgV.bind("$vers", Global.newArray("1, 0, 0"));
   Value.Map atmap = (Value.Map) pkgV.getv("$attr");
   atmap.seal("length");
   imports.clear();
   pkgV.bind("$imports", imports);
   StringBuilder sb = new StringBuilder();
   sb.append("var pkg = xdc.om['ti.sdo.ce.utils.rtcfg.osal'];\n");
   sb.append("if (pkg.$vers.length >= 3) {\n");
   sb.append("pkg.$vers.push(Packages.xdc.services.global.Vers.getDate(xdc.csd() + '/..'));\n");
   sb.append("}\n");
   sb.append("pkg.build.libraries = [\n");
   sb.append("];\n");
   sb.append("pkg.build.libDesc = [\n");
   sb.append("];\n");
   Global.eval(sb.toString());
 }
コード例 #11
0
  void Main$$TYPES() {
    Scriptable cap;
    Proto.Obj po;
    Proto.Str ps;
    Proto.Typedef pt;
    Object fxn;

    cap = (Scriptable) Global.callFxn("loadCapsule", xdcO, "xdc/tools/cdoc/sg/Main.xs");
    om.bind("xdc.tools.cdoc.sg.Main$$capsule", cap);
    po = (Proto.Obj) om.findStrict("xdc.tools.cdoc.sg.Main.Module", "xdc.tools.cdoc.sg");
    po.init("xdc.tools.cdoc.sg.Main.Module", $$Module);
    po.addFld("$hostonly", $$T_Num, 1, "r");
    fxn = Global.get(cap, "module$use");
    if (fxn != null) om.bind("xdc.tools.cdoc.sg.Main$$module$use", true);
    if (fxn != null) po.addFxn("module$use", $$T_Met, fxn);
    fxn = Global.get(cap, "module$meta$init");
    if (fxn != null) om.bind("xdc.tools.cdoc.sg.Main$$module$meta$init", true);
    if (fxn != null) po.addFxn("module$meta$init", $$T_Met, fxn);
    fxn = Global.get(cap, "module$validate");
    if (fxn != null) om.bind("xdc.tools.cdoc.sg.Main$$module$validate", true);
    if (fxn != null) po.addFxn("module$validate", $$T_Met, fxn);
    po.addFxn(
        "main",
        (Proto.Fxn) om.findStrict("xdc.tools.cdoc.sg.Main$$main", "xdc.tools.cdoc.sg"),
        Global.get(cap, "main"));
  }
コード例 #12
0
ファイル: ti_sysbios_rta.java プロジェクト: skitlab/ti-bios
  void Agent$$TYPES() {
    Scriptable cap;
    Proto.Obj po;
    Proto.Str ps;
    Proto.Typedef pt;
    Object fxn;

    cap = (Scriptable) Global.callFxn("loadCapsule", xdcO, "ti/sysbios/rta/Agent.xs");
    om.bind("ti.sysbios.rta.Agent$$capsule", cap);
    po = (Proto.Obj) om.findStrict("ti.sysbios.rta.Agent.Module", "ti.sysbios.rta");
    po.init("ti.sysbios.rta.Agent.Module", $$Module);
    po.addFld("$hostonly", $$T_Num, 1, "r");
    po.addFld("loadLogging", $$T_Bool, true, "wh");
    po.addFld("loadLoggingRuntimeControl", $$T_Bool, true, "wh");
    po.addFld("loadLoggerSize", Proto.Elm.newCNum("(xdc_SizeT)"), 512L, "wh");
    po.addFld("loadLoggerBufferSection", $$T_Str, "[Default]", "wh");
    po.addFld("mainLogging", $$T_Bool, true, "wh");
    po.addFld("mainLoggingRuntimeControl", $$T_Bool, true, "wh");
    po.addFld("mainLoggerSize", Proto.Elm.newCNum("(xdc_SizeT)"), 1024L, "wh");
    po.addFld("mainLoggerBufferSection", $$T_Str, "[Default]", "wh");
    po.addFld("sysbiosHwiLogging", $$T_Bool, false, "wh");
    po.addFld("sysbiosHwiLoggingRuntimeControl", $$T_Bool, false, "wh");
    po.addFld("sysbiosSwiLogging", $$T_Bool, false, "wh");
    po.addFld("sysbiosSwiLoggingRuntimeControl", $$T_Bool, false, "wh");
    po.addFld("sysbiosTaskLogging", $$T_Bool, true, "wh");
    po.addFld("sysbiosTaskLoggingRuntimeControl", $$T_Bool, true, "wh");
    po.addFld("sysbiosLoggerSize", Proto.Elm.newCNum("(xdc_SizeT)"), 4096L, "wh");
    po.addFld("sysbiosLoggerBufferSection", $$T_Str, "[Default]", "wh");
    po.addFld("configureSystemLog", $$T_Bool, true, "wh");
    po.addFld("numSystemRecords", Proto.Elm.newCNum("(xdc_Int)"), 64L, "wh");
    po.addFld("configureLoadLog", $$T_Bool, true, "wh");
    po.addFld("numLoadRecords", Proto.Elm.newCNum("(xdc_Int)"), 64L, "wh");
    po.addFld("periodInMs", Proto.Elm.newCNum("(xdc_Int)"), 100L, "wh");
    po.addFld("priority", Proto.Elm.newCNum("(xdc_Int)"), 1L, "wh");
    po.addFld("agentStackSize", Proto.Elm.newCNum("(xdc_SizeT)"), 1024L, "wh");
    po.addFld("agentStackSection", $$T_Str, "[Default]", "wh");
    po.addFld("transferBufferSize", Proto.Elm.newCNum("(xdc_Int)"), 85L, "wh");
    po.addFld("transferBufferSection", $$T_Str, $$UNDEF, "wh");
    po.addFld("addSupportLogger", $$T_Bool, true, "wh");
    po.addFld("supportControl", $$T_Bool, true, "wh");
    po.addFld(
        "transport",
        (Proto) om.findStrict("ti.sysbios.rta.Agent.Transport", "ti.sysbios.rta"),
        om.find("ti.sysbios.rta.Agent.Transport_STOP_MODE_ONLY"),
        "wh");
    po.addFld("dataStream", $$T_Str, "/rtdx0", "wh");
    po.addFld("commandStream", $$T_Str, "/rtdx1", "wh");
    po.addFld("responseStream", $$T_Str, "/rtdx1", "wh");
    fxn = Global.get(cap, "module$use");
    if (fxn != null) om.bind("ti.sysbios.rta.Agent$$module$use", true);
    if (fxn != null) po.addFxn("module$use", $$T_Met, fxn);
    fxn = Global.get(cap, "module$meta$init");
    if (fxn != null) om.bind("ti.sysbios.rta.Agent$$module$meta$init", true);
    if (fxn != null) po.addFxn("module$meta$init", $$T_Met, fxn);
    fxn = Global.get(cap, "module$validate");
    if (fxn != null) om.bind("ti.sysbios.rta.Agent$$module$validate", true);
    if (fxn != null) po.addFxn("module$validate", $$T_Met, fxn);
  }
コード例 #13
0
  public void handleStatementList(ASTStatementList node) {
    // connector.endPar();						//ENDPAR

    int numStatements = node.jjtGetNumChildren();
    for (int i = 0; i < numStatements; i++) {
      node.jjtGetChild(i).jjtAccept(this, null);
    }
    if (!node.getIsFunction()) {
      Global.setCurrentSymbolTable(Global.getCurrentSymbolTable().getPrevious());
    }
  }
コード例 #14
0
  void $$INITIALIZATION() {
    Value.Obj vo;

    if (isCFG) {} // isCFG
    Global.callFxn(
        "module$meta$init",
        (Scriptable) om.findStrict("xdc.tools.cdoc.sg.Main", "xdc.tools.cdoc.sg"));
    Global.callFxn("init", pkgV);
    ((Value.Obj) om.getv("xdc.tools.cdoc.sg.Main")).bless();
    ((Value.Arr) om.findStrict("$packages", "xdc.tools.cdoc.sg")).add(pkgV);
  }
コード例 #15
0
ファイル: ti_platforms_evm6424.java プロジェクト: sv99/DVSDK
  void $$INITIALIZATION() {
    Value.Obj vo;

    if (isCFG) {} // isCFG
    Global.callFxn(
        "module$meta$init",
        (Scriptable) om.findStrict("ti.platforms.evm6424.Platform", "ti.platforms.evm6424"));
    Global.callFxn("init", pkgV);
    ((Value.Obj) om.getv("ti.platforms.evm6424.Platform")).bless();
    ((Value.Arr) om.findStrict("$packages", "ti.platforms.evm6424")).add(pkgV);
  }
コード例 #16
0
  void $$INITIALIZATION() {
    Value.Obj vo;

    if (isCFG) {} // isCFG
    Global.callFxn(
        "module$meta$init",
        (Scriptable) om.findStrict("google.targets.arm.Bionic", "google.targets.arm"));
    Global.callFxn("init", pkgV);
    ((Value.Obj) om.getv("google.targets.arm.Bionic")).bless();
    ((Value.Arr) om.findStrict("$packages", "google.targets.arm")).add(pkgV);
  }
コード例 #17
0
ファイル: ti_sdo_ipc_examples.java プロジェクト: mutul/ti-ipc
  void $$INITIALIZATION() {
    Value.Obj vo;

    if (isCFG) {} // isCFG
    Global.callFxn(
        "module$meta$init",
        (Scriptable) om.findStrict("ti.sdo.ipc.examples.Examples", "ti.sdo.ipc.examples"));
    Global.callFxn("init", pkgV);
    ((Value.Obj) om.getv("ti.sdo.ipc.examples.Examples")).bless();
    ((Value.Arr) om.findStrict("$packages", "ti.sdo.ipc.examples")).add(pkgV);
  }
コード例 #18
0
  void $$INITIALIZATION() {
    Value.Obj vo;

    if (isCFG) {} // isCFG
    Global.callFxn(
        "module$meta$init",
        (Scriptable)
            om.findStrict("ti.sdo.codecs.mpeg4vdec.ce.MPEG4VDEC", "ti.sdo.codecs.mpeg4vdec.ce"));
    Global.callFxn("init", pkgV);
    ((Value.Obj) om.getv("ti.sdo.codecs.mpeg4vdec.ce.MPEG4VDEC")).bless();
    ((Value.Arr) om.findStrict("$packages", "ti.sdo.codecs.mpeg4vdec.ce")).add(pkgV);
  }
コード例 #19
0
  void $$INITIALIZATION() {
    Value.Obj vo;

    if (isCFG) {} // isCFG
    Global.callFxn(
        "module$meta$init",
        (Scriptable) om.findStrict("ti.sdo.ce.universal.UNIVERSALConfig", "ti.sdo.ce.universal"));
    Global.callFxn("init", pkgV);
    ((Value.Obj) om.getv("ti.sdo.ce.universal.UNIVERSALConfig")).bless();
    ((Value.Obj) om.getv("ti.sdo.ce.universal.IUNIVERSAL")).bless();
    ((Value.Arr) om.findStrict("$packages", "ti.sdo.ce.universal")).add(pkgV);
  }
コード例 #20
0
ファイル: ti_sysbios_rta.java プロジェクト: skitlab/ti-bios
  void $$INITIALIZATION() {
    Value.Obj vo;

    if (isCFG) {} // isCFG
    Global.callFxn(
        "module$meta$init", (Scriptable) om.findStrict("ti.sysbios.rta.Agent", "ti.sysbios.rta"));
    Global.callFxn(
        "module$meta$init",
        (Scriptable) om.findStrict("ti.sysbios.rta.SupportLogger", "ti.sysbios.rta"));
    Global.callFxn("init", pkgV);
    ((Value.Obj) om.getv("ti.sysbios.rta.Agent")).bless();
    ((Value.Obj) om.getv("ti.sysbios.rta.SupportLogger")).bless();
    ((Value.Arr) om.findStrict("$packages", "ti.sysbios.rta")).add(pkgV);
  }
コード例 #21
0
ファイル: ClientGame.java プロジェクト: Hikari9/SpaceShooter
  void turnOnFadeLog() throws IOException {
    Global.log("Connecting to fade log...");
    while (true) {
      if (isDisposed()) throw new IOException("Client game disposed");
      Global.log("Connecting to port " + Global.fadeLogPort() + "...");
      try {
        fadeLog = new ClientByteStream(ip, Global.fadeLogPort(), 12);
        break;
      } catch (IOException ex) {
      }
    }
    Global.log("Connected!");
    timers.add(
        new FixedTimer(
            new FixedTask() {
              public boolean fixedRate() {
                return false;
              }

              public float FPS() {
                return Global.ReceiveFPS;
              }

              public void run() {
                String s = null;
                byte[] data = null;
                try {
                  data = fadeLog.read();
                  if (data == null) return;
                  s = fadeLog.readLine();
                } catch (IOException ex) {
                  System.err.println("Error reading from fade log: " + ex);
                  Global.onException();
                  stop();
                  return;
                }
                if (s == null) return;
                ByteBuffer bb = ByteBuffer.wrap(data);
                float x = bb.getFloat();
                float y = bb.getFloat();
                Color color = Global.IntToColor(bb.getInt());

                // if fade color is same as ship color, play power-up sound

                if (color.equals(getPlayerShip().fill)) Sounds.powerUp.play();

                fadeLog(s, x, y, color);
              }
            }));
  }
コード例 #22
0
  public void handleProgram(ASTProgram node) {
    program = node;
    // System.out.println("visiting program");
    Global.setCurrentSymbolTable(Global.getSymbolTable());
    update(1, UPDATE_REASON_BEGIN);
    startQuestion = questionFactory.getStartQuestion();
    // Drawing Stuff
    connector.addScope(Global.getSymbolTable(), "Global", null);
    connector.startPar(); // STARTPAR
    connector.showScope("Global");
    connector.endPar(); // ENDPAR
    // connector.endSnap();

    node.jjtGetChild(0).jjtAccept(this, null);
    update(LINE_NUMBER_END, UPDATE_REASON_END);

    int value = 0;

    try {
      value = Global.getSymbolTable().get(startQuestion.getVariable());
      System.out.println(startQuestion.getVariable() + " is " + value);
    } catch (Exception e) {
      System.out.println(e);
    }
    if (startQuestion instanceof FIBQuestion) {

      ((FIBQuestion) startQuestion).addAnswer(value + "");
    } else if (startQuestion instanceof TFQuestion) {
      Random r = new Random();
      int prob = r.nextInt(10);
      int qa = value;
      if (prob >= 3 && value != startQuestion.getValue()) {
        qa = startQuestion.getValue();
        ((TFQuestion) startQuestion).setAnswer(false);
      } else {
        ((TFQuestion) startQuestion).setAnswer(true);
      }
      startQuestion.setText(startQuestion.getText() + qa + ".");
    }

    // TODO Write the last snap nicely

    connector.startSnap(node.getPseudocode().length);
    connector.startPar(); // STARTPAR
    // we can't hide foo in by macro cuz it doesn't exist
    if (!byMacroFlag) connector.hideScope("foo");
    connector.endPar(); // ENDPAR
    connector.endSnap();
  }
コード例 #23
0
ファイル: ClientGame.java プロジェクト: Hikari9/SpaceShooter
  void turnOnBulletReceiver() throws IOException {
    Global.log("Turning on bullet receiver...");
    while (true) {
      if (isDisposed()) throw new IOException("Client game disposed");
      Global.log("Connecting to port " + (Global.bulletPort()) + "...");
      try {
        bulletStream = new ClientByteStream(ip, Global.bulletPort(), Bullet.bufferSize());
        break;
      } catch (IOException ex) {
      }
    }
    Global.log("Connected!");
    timers.add(
        new FixedTimer(
            new FixedTask() {
              public boolean fixedRate() {
                return true;
              }

              public float FPS() {
                return Global.ReceiveFPS * 20;
              }

              public void run() {
                byte[] data = null;
                try {
                  data = bulletStream.read();
                } catch (IOException ex) {
                  System.err.println("Bullet receiver error: " + ex);
                  Global.onException();
                  stop();
                  return;
                }
                if (data == null) return;
                Bullet toSpawn = Bullet.fromBytes(data);
                Ship find = cShip.get(toSpawn.getFill());
                if (find == null) {
                  for (Ship s : turrets) {
                    if (s.fill.equals(toSpawn.getFill())) {
                      find = s;
                      break;
                    }
                  }
                }
                if (find == null) return;
                find.getBulletSet().add(toSpawn);
              }
            }));
  }
コード例 #24
0
  void $$INITIALIZATION() {
    Value.Obj vo;

    if (isCFG) {} // isCFG
    Global.callFxn("module$meta$init", (Scriptable) om.findStrict("xdc.tools.Cmdr", "xdc.tools"));
    Global.callFxn(
        "module$meta$init", (Scriptable) om.findStrict("xdc.tools.ResourceBundle", "xdc.tools"));
    Global.callFxn("init", pkgV);
    ((Value.Obj) om.getv("xdc.tools.Cmdr")).bless();
    ((Value.Obj) om.getv("xdc.tools.ResourceBundle")).bless();
    ((Value.Obj) om.getv("xdc.tools.ICmd")).bless();
    ((Value.Obj) om.getv("xdc.tools.IProductView")).bless();
    ((Value.Obj) om.getv("xdc.tools.IRtscProductTemplate")).bless();
    ((Value.Arr) om.findStrict("$packages", "xdc.tools")).add(pkgV);
  }
コード例 #25
0
  void $$INITIALIZATION() {
    Value.Obj vo;

    if (isCFG) {} // isCFG
    Global.callFxn("init", pkgV);
    ((Value.Arr) om.findStrict("$packages", "ti.sdo.ce.utils.rtcfg.osal")).add(pkgV);
  }
コード例 #26
0
  public void handleFunction(ASTFunction node) {
    // Get the function's symbol table, set it's previous to the
    // calling function's, and then set it to current.
    connector.startSnap(node.getLineNumber());
    if (node.getName().equals("main")) {
      connector.addQuestion(startQuestion);
      connector.showScope("main");

    } else {
    }
    connector.endSnap();
    if (!node.getUsed()) {
      return;
    }
    SymbolTable currentSymbolTable = node.getSymbolTable();
    for (String p : node.getParameters()) {
      ByNameVariable v = new ByNameVariable();
      v.setParam();
      currentSymbolTable.put(p, v);
    }
    Global.setCurrentSymbolTable(currentSymbolTable);

    node.jjtGetChild(0).jjtAccept(this, null);
    leaveScope();
  }
コード例 #27
0
ファイル: ClientGame.java プロジェクト: Hikari9/SpaceShooter
  public ClientGame(String name, String ip) throws ClientNameException, IOException {

    super();
    this.name = name;
    this.ip = ip;

    // try {
    connectToMainServer();
    registerName();
    waitForOtherPlayers();
    createBytePorts();
    createShips();
    turnOnBulletReceiver();
    turnOnTurretReceiver();
    turnOnPowerReceiver();
    turnOnChatLog();
    turnOnFadeLog();
    turnOnServerTime();
    // turnOnEndGameReceiver();
    Global.log("Successfully created client game.");
    // }
    // catch (IOException ex) {
    // System.err.println("Exception occured: " + ex.toString());
    // Global.onException();
    // }

  }
コード例 #28
0
ファイル: ti_platforms_sdbTitan.java プロジェクト: sv99/DVSDK
  void $$INITIALIZATION() {
    Value.Obj vo;

    if (isCFG) {} // isCFG
    Global.callFxn("init", pkgV);
    ((Value.Arr) om.findStrict("$packages", "ti.platforms.sdbTitan")).add(pkgV);
  }
コード例 #29
0
ファイル: ClientGame.java プロジェクト: Hikari9/SpaceShooter
  void connectToMainServer() throws IOException {

    while (true) {
      if (isDisposed()) throw new IOException("Client game disposed");
      Global.log("Connecting to main server...");
      try {
        mainServer = new ClientStream(ip, Global.PORT);
        break;
      } catch (UnknownHostException ex) {
        throw ex;
      } catch (IOException ex) {
      }
    }

    Global.log("Connected to server [" + ip + " : " + Global.PORT + "]");
  }
コード例 #30
0
  void $$INITIALIZATION() {
    Value.Obj vo;

    if (isCFG) {} // isCFG
    Global.callFxn("init", pkgV);
    ((Value.Arr) om.findStrict("$packages", "ti.sdo.ce.examples.extensions")).add(pkgV);
  }