Package it.uniroma1.dptu.stan.gui.model

Examples of it.uniroma1.dptu.stan.gui.model.FieldChooseFromActual


      super.setupUI(parent, row, column);
  }

      public void perform(ActionEvent actionEvent, Object row, SceneryBaseColumn column) {
      assert(row instanceof AreaData);
      AreaData area = (AreaData)row;

      PropertiesDialog dlg = new PropertiesDialog(
    sourceView,
    "Decision Area Properties"
      );

      dlg.setTitle(area.getTitle());
      dlg.setDescription(area.getDescription());
      if(dlg.run()) {
    area.setTitle(dlg.getTitle());
    area.setDescription(dlg.getDescription());
      }
      }
View Full Code Here


  Collection<AreaData> areas = data.getAreas();
  Iterator<AreaData> i = areas.iterator();
  int j = 1;
  while (i.hasNext()){
      // working with a single area
      AreaData area = i.next();

      String nameArea = area.getTitle();
      String areaPrefix = "Area: ";
      Paragraph areaPar = new Paragraph(areaPrefix + nameArea,fntRomanArea);
      areaPar.setSpacingAfter(12);
      doc.add(areaPar);

      String areaDescription = area.getDescription();
      if ((areaDescription!=null)&&(areaDescription.length()!=0)) {
    Paragraph areaDescriptionPar = new Paragraph(areaDescription,fntRomanAreaDescription);
    areaDescriptionPar.setSpacingAfter(12);
    doc.add(areaDescriptionPar);
      }



      // dealing with area's'option
      Collection<OptionData> options = area.getOptions();
      Iterator<OptionData> iOptions = options.iterator();

      // create an itemize
      List itemize = new List(false,20);
      Paragraph optionsPar = new Paragraph("OPTIONS",fntRomanOption);
View Full Code Here

  cacheObjectToChildren = new HashMap<Object, Vector<Object>>();
  for(
      Iterator<AreaData> i = root.getAreas().iterator();
      i.hasNext();
  ) {
      AreaData area = i.next();

      Vector<Object> vOptions = new Vector<Object>();
      for(
    Iterator<OptionData> j = area.getOptions().iterator();
    j.hasNext();
      )
    vOptions.add(j.next());

      cacheObjectToChildren.put(area, vOptions);
View Full Code Here

    /*
     * Tiene traccia delle modifiche apportate al modello
     */
    public void actionPerformed(ActionObservable observable, Action action) {
  if(action instanceof ActionPutArea) {
      AreaData areaNew = ((ActionPutArea)action).getArea();

      cacheObjectToChildren.get(root).add(areaNew);
      cacheObjectToChildren.put(areaNew, new Vector<Object>());
      fireTreeNodesInserted(
    this,
    new Object[] { root },
    new int[] { getIndexOfChild(root, areaNew) },
    new Object[] { areaNew }
      );
  } else if(action instanceof ActionRemoveArea) {
      AreaData areaOld = ((ActionRemoveArea)action).getArea();

      final int idxRemoved = getIndexOfChild(root, areaOld);
      fireTreeNodesRemoved(
    this,
    new Object[] { root },
    new int[] { idxRemoved },
    new Object[] { areaOld }
      );

      cacheObjectToChildren.get(root).remove(areaOld);
      cacheObjectToChildren.remove(areaOld);
  } else if(action instanceof ActionPutOption) {
      OptionData optionNew = ((ActionPutOption)action).getOption();
      AreaData area = optionNew.getAreaData();

      cacheObjectToChildren.get(area).add(optionNew);
      fireTreeNodesInserted(
    this,
    new Object[] { root, area },
    new int[] { getIndexOfChild(area, optionNew) },
    new Object[] { optionNew }
      );
  } else if(action instanceof ActionRemoveOption) {
      OptionData optionOld = ((ActionRemoveOption)action).getOption();
      AreaData area = optionOld.getAreaData();

      fireTreeNodesRemoved(
    this,
    new Object[] { root, area },
    new int[] { getIndexOfChild(area, optionOld) },
View Full Code Here

  if(data != null) {
      for(
    Iterator<AreaData> i = data.getAreas().iterator();
    i.hasNext();
      ) {
    AreaData area = i.next();
    newCache.add(area);

    for(
        Iterator<OptionData> j = area.getOptions().iterator();
        j.hasNext();
    )
        newCache.add(j.next());
      }
View Full Code Here

  int id = 0;
  for(
      Iterator<AreaData> i = setAreaDatas.iterator();
      i.hasNext();
  ) {
      AreaData area = i.next();

      for(
    Iterator<OptionData> j = area.getOptions().iterator();
    j.hasNext();
      )
    j.next().setId(new StringBuffer("o").append(id++).toString());

      // Salva l'area ed il suo contenuto
      deRoot.appendChild(area.save(doc));
  }

  // Salva le choose-from
  for(
      Iterator<ChooseFromData> i = setChooseFromDatas.iterator();
View Full Code Here

      if(TAG_TITLE.equals(nmTag))
    setTitle(Utils.TrimLR(e.getTextContent()));
      else if(TAG_DESCR.equals(nmTag))
    setDescription(Utils.TrimLR(e.getTextContent()));
      else if(AreaData.TAG_AREA.equals(nmTag))
    putArea(new AreaData(this, e));
      else
    break;
  }

  Map<String, OptionData> mapOptions = new HashMap<String, OptionData>();
View Full Code Here

  // Recupera constraint di area + opzioni
  for(
      Iterator<AreaData> a = model.getAreas().iterator();
      a.hasNext();
  ) {
      AreaData area = a.next();

      addConstraint(area);
      for(
    Iterator<OptionData> o = area.getOptions().iterator();
    o.hasNext();
      )
    addConstraint(o.next());
  }
View Full Code Here

    public void actionPerformed(ActionObservable observable, Action action) {
  if(action instanceof AreaAction)
      ((AreaAction)action).apply(this);
  else if(action instanceof ActionModifyOption) {
      ActionModifyOption amo = (ActionModifyOption)action;
      if(options.contains(amo.getOption()))
    amo.getOption().actionPerformed(observable, action);
  }
    }
View Full Code Here

      else {
    for(
        Iterator<OptionData> i = scenery.getOptionsCache().iterator();
        i.hasNext();
    ) {
        OptionData option = i.next();
        option.setValue(
      solution.chosenOptions.contains(option) ? 1.0 : 0.0,
      Structural.BOUND
        );
    }
View Full Code Here

TOP

Related Classes of it.uniroma1.dptu.stan.gui.model.FieldChooseFromActual

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.