Exemplo n.º 1
0
 @SuppressWarnings({"rawtypes", "unchecked"})
 public List<T> getOfferedTokens() {
   if (this.offeredTokens == null) {
     offeredTokens = (List) group.getTokensOfferedTo(this);
   }
   return offeredTokens;
 }
Exemplo n.º 2
0
  /**
   * Validates a given environment contiained in a JSOBjectBase
   *
   * <p>Requires that the env defined a defaultVersion, and contains at least the default version in
   * it's version list
   *
   * @param env app environment to validate
   * @return fulled AE object
   * @throws Exception if anything amiss
   */
  protected AE createEnv(JSObjectBase env) throws Exception {

    AE ae = new AE();

    ae._defaultVersion = env.getAsString(DEFAULT_VERSION);

    JSArray versions = (JSArray) env.get(VERSIONS);
    assert (versions != null);

    for (String key : versions.keySet()) {

      JSObjectBase verobj = (JSObjectBase) versions.get(key);

      Env ver = createEnvVersion(verobj);
      ae._versions.put(ver._version, ver);
    }

    return ae;
  }
Exemplo n.º 3
0
  public static void createController(final JPanel inpanel, final JCheckBox input) {
    input.addActionListener(
        (ActionEvent AE) -> {
          if (input.isSelected()) {
            inpanel.setVisible(true);

            ccmtoggle.setEnabled(true);
            cmtoggle.setEnabled(true);
            cc.setPreviewPanel(new JPanel());
            CU.pack();
          } else {
            inpanel.setVisible(false);
            if (cmtoggle.equals(AE.getSource())) ccmtoggle.setEnabled(false);
            else if (ccmtoggle.equals(AE.getSource())) cmtoggle.setEnabled(false);
            else if (evtoggle.equals(AE.getSource())) {
              cc.setPreviewPanel(null);
            }
            CU.pack();
          }
        });
  }
Exemplo n.º 4
0
 @SuppressWarnings({"rawtypes", "unchecked"})
 public ActivityEdgeInstance(
     String id, ActivityNodeActivation<AE, T> source, ActivityNodeActivation<AE, T> target) {
   super();
   this.id = id;
   this.group = source.getGroup();
   this.source = source;
   this.target = target;
   offeredTokens = (List) group.getTokensOfferedTo(this);
   source.getOutgoingEdges().add(this);
   target.getIncomingEdges().add(this);
 }
Exemplo n.º 5
0
  /**
   * Returns a framework object for the specified environment name and version
   *
   * @param name name of framework to setup
   * @param version version of framework to setup. if null, will use default version
   * @return framework object for this framework
   */
  public Framework getFramework(String name, String version) {

    final String lowerName = name.toLowerCase();

    AE ae = _map.get(lowerName);

    if (ae == null) {
      throw new RuntimeException("Error : specified known framework not defined : " + name);
    }

    if (version == null || version.equals("")) {
      version = ae.getDefaultVersion();
    }

    final Env env = ae.getEnvironment(version);
    final String ver = version;

    return new Framework() {
      public void install(AppContext context) throws IOException {
        _setupContext(context, env, lowerName, ver);
      }
    };
  }