Package com.scriptographer.sg

Examples of com.scriptographer.sg.Script


  public static Script getCurrentScript() {
    // There can be 'holes' in the script stack, so find the first non-null
    // entry and return it.
    for (int i = scriptStack.size() - 1; i >= 0; i--) {
      Script last = scriptStack.get(i);
      if (last != null)
        return last;
    }
    return null;
  }
View Full Code Here


    // Since the interface is done in scripts too and we receive being /
    // endExecution events for all UI notifications as well, we need to
    // cheat a bit here.
    // When file is set, we ignore the current state of "executing",
    // as we're about to to execute a new script...
    Script script = scope != null ? (Script) scope.get("script") : null;

    // Only call Document.beginExecution for the first script in the call
    // stack.
    if (scriptStack.empty()) {
      // Set script coordinate system and angle units on each execution,
      // at the beginning of the script stack.
      anglesInDegrees = AngleUnits.DEGREES == (script != null
          ? script.getAngleUnits()
          : AngleUnits.DEFAULT);
      topDownCoordinates = CoordinateSystem.TOP_DOWN == (script != null
          ? script.getCoordinateSystem()
          : CoordinateSystem.DEFAULT);
      // Pass topDownCoordinates value to the client side as well
      Document.beginExecution(topDownCoordinates,
          // Do not update coordinate systems for tool scripts,
          // as this has already happened in Tool.onHandleEvent()
          script == null || !script.isToolScript());
      // Disable output to the console while the script is executed as it
      // won't get updated anyway
      // ConsoleOutputStream.enableOutput(false);
    }
    if (file != null) {
      Dialog.destroyAll(false, false);
      Timer.abortAll(false, false);
      // Put a script object in the scope to offer the user
      // access to information about it.
      if (script == null) {
        script = new Script(file, file.getPath().startsWith(
            coreDir.getPath()));
        scope.put("script", script, true);
      }
    }
    if (scriptStack.empty() || file != null) {
      if (script != null && !script.getShowProgress()) {
        closeProgress();
      } else if (file == null || !file.getName().startsWith("__")) {
        showProgress(file != null ? "Executing " + file.getName()
            + "..." : "Executing...");
      }
View Full Code Here

TOP

Related Classes of com.scriptographer.sg.Script

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.