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

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


  }

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

      option.setTitle("New decision option");
      area.putOption(option);

      setSelectedRow(option);
      }
View Full Code Here


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

      public void perform(ActionEvent actionEvent, Object row, SceneryBaseColumn column) {
      assert(row instanceof OptionData);
      OptionData option = (OptionData)row;
      if(
    JOptionPane.showConfirmDialog(
        (Container)sourceView,
        new StringBuffer()
      .append("You are about to remove the option\n")
      .append('"').append(option.getTitle()).append("\".\n")
      .append("Are you shure?")
        .toString(),
        "Confirm option deletion",
        JOptionPane.YES_NO_OPTION
    ) == JOptionPane.YES_OPTION
      )
    option.getAreaData().removeOption(option);
      }
View Full Code Here

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

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

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

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

      row = 1;
      int column = 1;

      while (iOptions.hasNext()){
    // working with a single option
    OptionData o = iOptions.next();

    String optionName = o.getTitle();
    if ((optionName==null)||(optionName.length()==0)) optionName = "No (Option) name provided.";
    //Paragraph optionNamePar = new Paragraph(optionName, fntRomanOptionTitle);
    Paragraph optionNamePar = new Paragraph(optionName, fntRomanOptionTitle);
    ListItem item = new ListItem(optionNamePar);

    String optionDescription = o.getDescription();
    if ((optionDescription!=null)&&(optionDescription.length()!=0)) {
        //Paragraph optionDescriptionPar = new Paragraph("\r\n" + optionDescription, fntRomanOptionDescription);
        Paragraph optionDescriptionPar = new Paragraph("\r\n" + optionDescription, fntRomanOptionDescription);
        optionDescriptionPar.setSpacingAfter(12);
        //optionDescriptionPar.setSpacingBefore(0);
        item.add(optionDescriptionPar);
    }

    itemize.add(item);

    // prepare the table
    iActors = data.getColumns().iterator();
    row = 0;
    //System.out.println("option: " + o.getTitle());
    Cell optionNameHeader = new Cell(o.getTitle());
    //optionNameHeader.rotate();
    optionNameHeader.setHeader(true);
    //cell.setColspan(3);
    table.addCell(optionNameHeader,row++,column);
    table.endHeaders();
View Full Code Here

      );

      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

  SceneryTreeTable table,
  boolean hasFocus,
  Object row,
  Object column
    ) {
  OptionData option = (OptionData)row;
  ChooseFromData chooseFrom = (ChooseFromData)column;

  renderer.setSelected(chooseFrom.getOptions().contains(option));
  renderer.setEnabled(((ChooseFromData)column).isEnabled());
  return(renderer);
View Full Code Here

  SceneryTreeTable table,
  boolean hasFocus,
  Object row,
  Object column
    ) {
  OptionData option = (OptionData)row;

  final int status = option.getDocumentData().getStatus();

  if(!option.isFixed() && status != Data.STATUS_COMPLETED) {
      renderState.setEnabled(false);
      renderState.setSelected(false);
      renderState.setVisible(true);
  } else {
      renderState.setEnabled(true);
      renderState.setSelected(option.getValue());
      renderState.setVisible(true);
  }

  renderFixed.setSelected(option.isFixed());

  if(option.isValueStatistical() && status == Data.STATUS_COMPLETED)
      renderOccurrence.setText(
    format.format(100 * option.getStatisticalValue()) + '%'
      );
  else
      renderOccurrence.setText(null);

  return(renderPanel);
View Full Code Here

  Map<String, OptionData> mapOptions = new HashMap<String, OptionData>();
  for(
      Iterator<OptionData> i = getOptionsCache().iterator();
      i.hasNext();
  ) {
      OptionData option = i.next();
      if(mapOptions.put(option.getId(), option) != null) {
    System.err.print("stan: in file \"");
    System.err.print(getDocument().getFilename());
    System.err.println('"');

    System.err.print("stan: option id \"");
    System.err.print(option.getId());
    System.err.println("\" is multiply defined.");

    System.err.print("stan: previous same-id option will be discarded.");
      }
  }
View Full Code Here

    setTitle(Utils.TrimLR(e.getTextContent()));
      else if(TAG_DESCR.equals(nmTag))
    setDescription(Utils.TrimLR(e.getTextContent()));
      else if(TAG_CONSIDER.equals(nmTag)) {
    String idOption = e.getAttribute(ATTR_OPTION);
    OptionData option = mapOptions.get(idOption);
    if(option == null) {
        System.err.print("stan: in file \"");
        System.err.print(documentData.getDocument().getFilename());
        System.err.println('"');
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(OptionData.TAG_OPTION.equals(nmTag))
    putOption(new OptionData(this, e));
  }
    }
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.