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

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


  tpScenery = new JTabbedPane();
  tpScenery.addTab("Frame", new JScrollPane(sceneryTreeTable));
  tpScenery.addTab("Constraints", new JScrollPane(constraintTable));
  tpScenery.addTab("Messages", new JScrollPane(tpMessages));

  solutionPanel = new SolutionPanel(data);

  add(
      new JSplitPane(
    JSplitPane.HORIZONTAL_SPLIT,
    solutionPanel,
View Full Code Here


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

      public void perform(ActionEvent actionEvent, Object row, SceneryBaseColumn column) {
      Data data = (Data)sourceView.getData();
      final AreaData area = new AreaData(data);

      area.setTitle("New decision area");
      data.putArea(area);

      setSelectedRow(area);
      }
View Full Code Here

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

      public void perform(ActionEvent actionEvent, Object row, SceneryBaseColumn column) {
      Data data = (Data)sourceView.getData();
      ChooseFromData chooseFrom = new ChooseFromData(data);

      chooseFrom.setTitle("New Mutual Constraint");
      data.putChooseFrom(chooseFrom);
      }
View Full Code Here

  footer.setAlignment(Element.ALIGN_RIGHT);
  doc.setHeader(header);
  doc.setFooter(footer);

  // retriving data
  Data data = view.getDocumentData();

  // printing the title
  boolean toNewPage = false;
  String title = data.getTitle();
  if ((title!=null)&&(title.length()!=0)) {
      Paragraph titlePar = new Paragraph(title, fntRomanTitle);
      // hard-code the leading, the same size of fntRomanTitle
      titlePar.setLeading(32);
      doc.add(titlePar);
      toNewPage = true;
      //System.out.println("title|"+title+"|");
  }

  // some vspace...
  doc.add(new Paragraph(" "));

  // retrive and print the stan-document description
  String description = data.getDescription();
  if ((description!=null)&&(description.length()!=0)) {
      doc.add(new Paragraph(description, fntRomanDescription));
      toNewPage = true;
      //System.out.println("descritpion|"+description+"|");
  }

  // dealing with areas... at a new page
  if (toNewPage) doc.newPage();

  // some vspace...
  // doc.add(new Paragraph(" "));
  // doc.add(new Paragraph("AREAS", fntRomanDescription));

  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);
      optionsPar.setSpacingAfter(12);
      doc.add(optionsPar);


      // create the table for actor/option wedges

      // rows
      int actorsNumber = data.getColumns().size();
      // columns
      int optionsNumber = options.size();

      Iterator<ColumnData> iActors = data.getColumns().iterator();
      Table table = new Table(optionsNumber+1, actorsNumber+1);
      table.setWidth(100);
      table.setBorderWidth(1);
      //table.setBorderColor(new Color(0, 0, 255));
      table.setPadding(4);
      table.setSpacing(0);

      // first cell has to be void
      table.addCell(new Cell("Options/\r\nWedges"),0,0);

      int row = 1;
      while (iActors.hasNext()){
    Cell app = new Cell(iActors.next().getTitle());
    //app.setNoWrap(true);
    app.setHorizontalAlignment(Element.ALIGN_CENTER);
    app.setVerticalAlignment(Element.ALIGN_CENTER);
    table.addCell(app,row++,0);
      }

      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);
View Full Code Here

    nmfDocument
      );
  } catch(IOException ex)
  { throw new FileIOException(FileIOException.ERR_NOACCESS, nmfDocument); }

  return(new Data(null, domDoc.getDocumentElement()));
    }
View Full Code Here

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

      public void perform(ActionEvent actionEvent, Object row, SceneryBaseColumn col) {
      Data data = (Data)sourceView.getData();
      ColumnData column = new ColumnData(data);

      column.setTitle("New Expression/Constraint/Objective");
      data.putColumn(column);
      }
View Full Code Here

    public void actionPerformed(ActionObservable observable, Action action) {
  if(action instanceof DataAction)
      ((DataAction)action).apply(this);
  else if(action instanceof ActionModifyArea) {
      ActionModifyArea ama = (ActionModifyArea)action;
      if(setAreaDatas.contains(ama.getArea()))
    ama.getArea().actionPerformed(observable, action);
  }

  super.actionPerformed(observable, action);
    }
View Full Code Here

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

      public void perform(ActionEvent actionEvent, Object row, SceneryBaseColumn column) {
      Data data = (Data)sourceView.getData();
      final AreaData area = new AreaData(data);

      area.setTitle("New decision area");
      data.putArea(area);

      setSelectedRow(area);
      }
View Full Code Here

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

      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 AreaData);
      AreaData area = (AreaData)row;
      if(
    JOptionPane.showConfirmDialog(
        (Container)sourceView,
        new StringBuffer()
      .append("You are about to remove the area\n")
      .append('"').append(area.getTitle()).append("\".\n")
      .append("Removing the area will remove also the\n")
      .append("options currently belonging to the area\n")
      .append("itself.\n")
      .append("Are you shure?")
        .toString(),
        "Confirm area deletion",
        JOptionPane.YES_NO_OPTION
    ) == JOptionPane.YES_OPTION
      )
    area.getDocumentData().removeArea(area);
      }
View Full Code Here

TOP

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

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.