Examples of Comboitem


Examples of lupos.gui.operatorgraph.visualeditor.queryeditor.comboItemDisabler.ComboItem

          this.queryResult_preceding, this.varSO, this.varPred);
      rowPanel.setLayout(null);

      // --- subject - begin ---
      final LinkedList<ComboItem> variablesSubj = new LinkedList<ComboItem>();
      variablesSubj.add(new ComboItem(this.varSO));

      final HashSet<Literal> soLiterals = new HashSet<Literal>();

      for (final Bindings b : this.queryResult_preceding)
        soLiterals.add(b.get(this.varSO));

      final LinkedList<Literal> soSortedLiterals = new LinkedList<Literal>();
      soSortedLiterals.addAll(soLiterals);

      Collections.sort(soSortedLiterals);

      for (final Literal l : soSortedLiterals)
        variablesSubj.add(new ComboItem(l));

      QueryRDFTerm queryRDFTerm = new QueryRDFTerm(prefixInstance);
      // just in order to set panel of QueryRDFTerm...
      queryRDFTerm.draw(new GraphWrapperOperator(queryRDFTerm), AdvancedQueryEditor.this.visualGraphs.get(0));
     
      subjectPanel = new SuggestionPanel(PADDING, queryRDFTerm, variablesSubj, rowPanel);

      final int subjectX = PADDING;
      final int subjectY = PADDING;
      final int subjectWidth = subjectPanel.getPreferredSize().width;
      final int subjectHeight = subjectPanel.getPreferredSize().height;

      subjectPanel.setBounds(subjectX, subjectY, subjectWidth,
          subjectHeight);

      rowPanel.add(subjectPanel);
      // --- subject - end ---

      // --- predicate - begin ---
      final LinkedList<ComboItem> variablesPred = new LinkedList<ComboItem>();
      variablesPred.add(new ComboItem(this.varPred));

      final HashSet<Literal> predLiterals = new HashSet<Literal>();

      for (final Bindings b : this.queryResult_preceding)
        predLiterals.add(b.get(this.varPred));

      final LinkedList<Literal> predSortedLiterals = new LinkedList<Literal>();
      predSortedLiterals.addAll(predLiterals);

      Collections.sort(predSortedLiterals);

      for (final Literal l : predSortedLiterals)
        variablesPred.add(new ComboItem(l));

      QueryRDFTerm queryRDFTerm2 = new QueryRDFTerm(prefixInstance);
      // just in order to set panel of QueryRDFTerm...
      queryRDFTerm2.draw(new GraphWrapperOperator(queryRDFTerm2), AdvancedQueryEditor.this.visualGraphs.get(0));
     
View Full Code Here

Examples of lupos.gui.operatorgraph.visualeditor.queryeditor.comboItemDisabler.ComboItem

      rowPanel.add(subjectPanel);
      // --- subject - end ---

      // --- predicate - begin ---
      final LinkedList<ComboItem> variablesPred = new LinkedList<ComboItem>();
      variablesPred.add(new ComboItem(this.varPred));

      final HashSet<Literal> predLiterals = new HashSet<Literal>();

      for (final Bindings b : this.queryResult_succeeding)
        predLiterals.add(b.get(this.varPred));

      final LinkedList<Literal> predSortedLiterals = new LinkedList<Literal>();
      predSortedLiterals.addAll(predLiterals);

      Collections.sort(predSortedLiterals);

      for (final Literal l : predSortedLiterals)
        variablesPred.add(new ComboItem(l));

      predicatePanelO = new SuggestionPanel(PADDING, this.op,
          variablesPred, rowPanel);

      final int predicateX = subjectX + subjectWidth + SPACING;
      final int predicateY = PADDING;
      final int predicateWidth = predicatePanelO.getPreferredSize().width;
      final int predicateHeight = predicatePanelO.getPreferredSize().height;

      predicatePanelO.setBounds(predicateX, predicateY, predicateWidth,
          predicateHeight);

      rowPanel.add(predicatePanelO);
      // --- predicate - end ---

      // --- object - begin ---
      final LinkedList<ComboItem> variablesObj = new LinkedList<ComboItem>();
      variablesObj.add(new ComboItem(this.varSO));

      final HashSet<Literal> soLiterals = new HashSet<Literal>();

      for (final Bindings b : this.queryResult_succeeding)
        soLiterals.add(b.get(this.varSO));

      final LinkedList<Literal> soSortedLiterals = new LinkedList<Literal>();
      soSortedLiterals.addAll(soLiterals);

      Collections.sort(soSortedLiterals);

      for (final Literal l : soSortedLiterals)
        variablesObj.add(new ComboItem(l));

      QueryRDFTerm queryRDFTerm = new QueryRDFTerm(prefixInstance);
     
      objectPanel = new SuggestionPanel(PADDING, queryRDFTerm, variablesObj, rowPanel);
View Full Code Here

Examples of lupos.gui.operatorgraph.visualeditor.queryeditor.comboItemDisabler.ComboItem

        this.queryResult_preceding, this.varSO, this.varPred);
    rowPanel.setLayout(null);

    // --- subject - begin ---
    final LinkedList<ComboItem> variablesSubj = new LinkedList<ComboItem>();
    variablesSubj.add(new ComboItem(this.varSO));

    final HashSet<Literal> soLiterals = new HashSet<Literal>();

    for (final Bindings b : this.queryResult_preceding)
      soLiterals.add(b.get(this.varSO));

    final LinkedList<Literal> soSortedLiterals = new LinkedList<Literal>();
    soSortedLiterals.addAll(soLiterals);

    Collections.sort(soSortedLiterals);

    for (final Literal l : soSortedLiterals)
      variablesSubj.add(new ComboItem(l));

    QueryRDFTerm queryRDFTerm = new QueryRDFTerm(this.queryGraph.prefix);
   
    subjectPanel = new SuggestionPanel(this.queryGraph, queryRDFTerm, variablesSubj, rowPanel);

    final int subjectX = (int) this.queryGraph.PADDING;
    final int subjectY = (int) this.queryGraph.PADDING;
    final int subjectWidth = subjectPanel.getPreferredSize().width;
    final int subjectHeight = subjectPanel.getPreferredSize().height;

    subjectPanel.setBounds(subjectX, subjectY, subjectWidth, subjectHeight);

    rowPanel.add(subjectPanel);
    // --- subject - end ---

    // --- predicate - begin ---
    final LinkedList<ComboItem> variablesPred = new LinkedList<ComboItem>();
    variablesPred.add(new ComboItem(this.varPred));

    final HashSet<Literal> predLiterals = new HashSet<Literal>();

    for (final Bindings b : this.queryResult_preceding)
      predLiterals.add(b.get(this.varPred));

    final LinkedList<Literal> predSortedLiterals = new LinkedList<Literal>();
    predSortedLiterals.addAll(predLiterals);

    Collections.sort(predSortedLiterals);

    for (final Literal l : predSortedLiterals)
      variablesPred.add(new ComboItem(l));

    predicatePanelS = new SuggestionPanel(this.queryGraph,
        new QueryRDFTerm(this.queryGraph.prefix), variablesPred,
        rowPanel);
View Full Code Here

Examples of lupos.gui.operatorgraph.visualeditor.queryeditor.comboItemDisabler.ComboItem

    rowPanel.add(subjectPanel);
    // --- subject - end ---

    // --- predicate - begin ---
    final LinkedList<ComboItem> variablesPred = new LinkedList<ComboItem>();
    variablesPred.add(new ComboItem(this.varPred));

    final HashSet<Literal> predLiterals = new HashSet<Literal>();

    for (final Bindings b : this.queryResult_succeeding)
      predLiterals.add(b.get(this.varPred));

    final LinkedList<Literal> predSortedLiterals = new LinkedList<Literal>();
    predSortedLiterals.addAll(predLiterals);

    Collections.sort(predSortedLiterals);

    for (final Literal l : predSortedLiterals)
      variablesPred.add(new ComboItem(l));

    predicatePanelO = new SuggestionPanel(this.queryGraph, this.op,
        variablesPred, rowPanel);

    final int predicateX = subjectX + subjectWidth
        + (int) this.queryGraph.getSPACING_X();
    final int predicateY = (int) this.queryGraph.PADDING;
    final int predicateWidth = predicatePanelO.getPreferredSize().width;
    final int predicateHeight = predicatePanelO.getPreferredSize().height;

    predicatePanelO.setBounds(predicateX, predicateY, predicateWidth,
        predicateHeight);

    rowPanel.add(predicatePanelO);
    // --- predicate - end ---

    // --- object - begin ---
    final LinkedList<ComboItem> variablesObj = new LinkedList<ComboItem>();
    variablesObj.add(new ComboItem(this.varSO));

    final HashSet<Literal> soLiterals = new HashSet<Literal>();

    for (final Bindings b : this.queryResult_succeeding)
      soLiterals.add(b.get(this.varSO));

    final LinkedList<Literal> soSortedLiterals = new LinkedList<Literal>();
    soSortedLiterals.addAll(soLiterals);

    Collections.sort(soSortedLiterals);

    for (final Literal l : soSortedLiterals)
      variablesObj.add(new ComboItem(l));

    QueryRDFTerm queryRDFTerm = new QueryRDFTerm(this.queryGraph.prefix);
   
    objectPanel = new SuggestionPanel(this.queryGraph, queryRDFTerm, variablesObj, rowPanel);
View Full Code Here

Examples of lupos.gui.operatorgraph.visualeditor.queryeditor.comboItemDisabler.ComboItem

    GraphBox.drawConnection((Graphics2D) g, this.startX, this.startY, this.endX, this.endY, true);
  }


  public void actionPerformed(ActionEvent ae) {
    ComboItem choice;

    String first = ((JComboBox) ae.getSource()).getItemAt(0).toString();

    if(first.equalsIgnoreCase(this.varSO.toString())) {
      choice = (ComboItem) this.soBox.getSelectedItem();

      if(choice.toString().equalsIgnoreCase(this.varSO.toString())) {
        for(ComboItem ci : this.predElements)
          ci.isEnabled = true;

        return;
      }

      for(ComboItem ci : this.predElements)
        ci.isEnabled = false;

      this.predElements.get(0).isEnabled = true;

      for(Bindings b : this.queryResult) {
        int i = this.predElements.indexOf(new ComboItem(b.get(this.varPred)));

        if(b.get(this.varSO).toString().equalsIgnoreCase(choice.toString()))
          this.predElements.get(i).isEnabled = true;
      }

      if(!((ComboItem) this.predBox.getSelectedItem()).isEnabled)
        this.predBox.setSelectedIndex(0);

      return;
    }

    if(first.equalsIgnoreCase(this.varPred.toString())) {
      choice = (ComboItem) this.predBox.getSelectedItem();

      if(choice.toString().equalsIgnoreCase(this.varPred.toString())) {
        for(ComboItem ci : this.soElements)
          ci.isEnabled = true;

        return;
      }

      for(ComboItem ci : this.soElements)
        ci.isEnabled = false;

      this.soElements.get(0).isEnabled = true;

      for(Bindings b : this.queryResult) {
        int i = this.soElements.indexOf(new ComboItem(b.get(this.varSO)));

        if(b.get(this.varPred).toString().equalsIgnoreCase(choice.toString()))
          this.soElements.get(i).isEnabled = true;
      }

      if(!((ComboItem) this.soBox.getSelectedItem()).isEnabled)
        this.soBox.setSelectedIndex(0);
View Full Code Here

Examples of org.zkoss.zul.Comboitem

        dao.update(buildingDocForm);
    }

    private Comboitem getSelectedIndex(Combobox cb, String value) {
        for (int j = 0; j < cb.getItemCount(); j++) {
            Comboitem item = cb.getItemAtIndex(j);
            if (value.equals(item.getValue().toString())) {
                return item;
            }
        }
        return null;
    }
View Full Code Here

Examples of org.zkoss.zul.Comboitem

        List paraList = ParaCache.getInstance().getByCatalogue(paraCatalogue);
        Combobox cb = (Combobox) getFellow(comboboxGetFellowName);
        Iterator it = paraList.iterator();
        while (it.hasNext()) {
            Para obj = (Para) it.next();
            Comboitem item = new Comboitem();
            item.setLabel(obj.getParaValue());
            item.setValue(obj.getParaName());
            item.setParent(cb);
        }
    }
View Full Code Here

Examples of org.zkoss.zul.Comboitem

    }

    protected void setSelectedBy(Combobox cb, String value) {
        Iterator it = cb.getItems().iterator();
        while (it.hasNext()) {
            Comboitem item = (Comboitem) it.next();
            String s = (String) item.getValue();
            if (s.equals(value)) {
                cb.setSelectedItem(item);
            }
        }
    }
View Full Code Here

Examples of org.zkoss.zul.Comboitem

/* package */ class ComboitemCollectionItem implements CollectionItemExt, java.io.Serializable {
  private static final long serialVersionUID = 200808191454L;

  public Component getComponentCollectionOwner(Component comp) {
    if (comp instanceof Comboitem) {
      final Comboitem item = (Comboitem) comp;
      return item.getParent();
    } else {
      throw new UiException(
          "Unsupported type for ComboitemCollectionItem: " + comp);
    }
  }
View Full Code Here

Examples of org.zkoss.zul.Comboitem

    }
  }

  public void setupBindingRenderer(Component comp, DataBinder binder) {
    if (comp instanceof Comboitem) {
      final Comboitem li = (Comboitem) comp;
      final Combobox cbbox = (Combobox) li.getParent();
      if (cbbox.getItemRenderer() == null) {
        cbbox.setItemRenderer(new BindingComboitemRenderer(li, binder));
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.