Examples of IntBox


Examples of org.openpixi.pixi.physics.util.IntBox

  /**
   * In this mode the iterator does also calculate the extra cells.
   */
  public void setExtraCellsMode(int numCellsX, int numCellsY) {
    dimensions = new IntBox(
        -Grid.EXTRA_CELLS_BEFORE_GRID,
        numCellsX + Grid.EXTRA_CELLS_AFTER_GRID - 1,
        -Grid.EXTRA_CELLS_BEFORE_GRID,
        numCellsY + Grid.EXTRA_CELLS_AFTER_GRID - 1);
  }
View Full Code Here

Examples of org.openpixi.pixi.physics.util.IntBox

      throw new RuntimeException(
          "Number of partitions must be less or equal to the number of cells!");
    }

    List<IntBox> partitions = new ArrayList<IntBox>();
    partitions.add(new IntBox(0, numCellsX - 1, 0, numCellsY - 1));

    while (partitions.size() < numPartitions) {
      partitions = splitBoxes(partitions);
    }
View Full Code Here

Examples of org.openpixi.pixi.physics.util.IntBox

  private Point getNeighborDirection(int neighbor) {
    if (neighbor == NO_NEIGHBOR) {
      return null;
    }

    IntBox myPart = partitions[thisWorkerID];
    IntBox neighborPart = partitions[neighbor];

    int xdirec = 0;
    int ydirec = 0;

    if (myPart.xmax() < neighborPart.xmin()) {
      xdirec = +1;
    }
    else if (neighborPart.xmax() < myPart.xmin()) {
      xdirec = -1;
    }

    if (myPart.ymax() < neighborPart.ymin()) {
      ydirec = +1;
    }
    else if (neighborPart.ymax() < myPart.ymin()) {
      ydirec = -1;
    }

    return new Point(xdirec, ydirec);
  }
View Full Code Here

Examples of org.openpixi.pixi.physics.util.IntBox

    List<IntBox> newPartitions = new ArrayList<IntBox>();
    for (IntBox b: partitions) {
      if (b.xsize() > b.ysize()) {
        // Split along x axis
        int xmid = (b.xmin() + b.xsize() / 2);
        newPartitions.add(new IntBox(b.xmin(), xmid - 1, b.ymin(), b.ymax()));
        newPartitions.add(new IntBox(xmid, b.xmax(), b.ymin(), b.ymax()));
      }
      else {
        // Split along y axis
        int ymid = (b.ymin() + b.ysize() / 2);
        newPartitions.add(new IntBox(b.xmin(), b.xmax(), b.ymin(), ymid - 1));
        newPartitions.add(new IntBox(b.xmin(), b.xmax(), ymid, b.ymax()));
      }
    }
    return newPartitions;
  }
View Full Code Here

Examples of org.openpixi.pixi.physics.util.IntBox


  @Override
  public String toString() {
    StringBuilder retval = new StringBuilder();
    IntBox first = findFirst();
    IntBox nextY = first;
    while (nextY != null) {
      IntBox nextX = nextY;
      while (nextX != null) {
        int index = getIndex(nextX);
        retval.append(index + " ");
        nextX = findNextX(nextX);
      }
View Full Code Here

Examples of org.openpixi.pixi.physics.util.IntBox

    int smallestXmin = Integer.MAX_VALUE;
    int largestYmax = Integer.MIN_VALUE;
    int smallestYmin = Integer.MAX_VALUE;

    for (int i = 0; i < partitions.length; ++i) {
      IntBox b = partitions[i];

      if (isMalformed(b)) {
        Assert.fail("Malformed partition! " + b);
      }

      if (b.xmax() > largestXmax) {
        largestXmax = b.xmax();
      }
      if (b.ymax() > largestYmax) {
        largestYmax = b.ymax();
      }
      if (b.xmin() < smallestXmin) {
        smallestXmin = b.xmin();
      }
      if (b.ymin() < smallestYmin) {
        smallestYmin = b.ymin();
      }

      for (int j = i + 1; j < partitions.length; ++j) {
        IntBox b2 = partitions[j];
        if (areEqual(b, b2)) {
          Assert.fail("Equal partitions: " + b + " " + b2);
        }
        if (interleave(b, b2)) {
          Assert.fail("Interleaving partitions: " + b + " " + b2);
View Full Code Here

Examples of org.zkoss.zul.Intbox

        obj.setVenderCode(venderCodeTB.getText());

        Textbox insideCodeTB = (Textbox) getFellow("insideCode");
        Combobox priorityCB = (Combobox) getFellow("priority");
        Doublebox latestPriceTB = (Doublebox) getFellow("latestPrice");
        Intbox inventoryAmountTB = (Intbox) getFellow("inventoryAmount");
        Combobox systemTypeCB = (Combobox) getFellow("system");
        obj.setInsideCode(insideCodeTB.getText());
        obj.setPriority(priorityCB.getSelectedItem().getValue().toString());
        obj.setLatestPrice(latestPriceTB.getValue());
        obj.setInventoryAmount(inventoryAmountTB.getValue());
        obj.setSystemType(systemTypeCB.getSelectedItem().getValue().toString());

        return obj;
    }
View Full Code Here

Examples of org.zkoss.zul.Intbox

        venderCodeTB.setText(var.getVenderCode());

        Textbox insideCodeTB = (Textbox) getFellow("insideCode");
        Combobox priorityCB = (Combobox) getFellow("priority");
        Doublebox latestPriceTB = (Doublebox) getFellow("latestPrice");
        Intbox inventoryAmountTB = (Intbox) getFellow("inventoryAmount");
        Combobox systemTypeCB = (Combobox) getFellow("system");

        insideCodeTB.setText(var.getInsideCode());
        Iterator priorityIt = priorityCB.getItems().iterator();
        while (priorityIt.hasNext()) {
            Comboitem item = (Comboitem) priorityIt.next();

            String priorityStr = item.getValue().toString();
            if (var.getPriority() != null && var.getPriority().equals(priorityStr)) {
                priorityCB.setSelectedItem(item);
            }
        }
        latestPriceTB.setValue(var.getLatestPrice());
        inventoryAmountTB.setValue(var.getInventoryAmount());

        Iterator stItr = systemTypeCB.getItems().iterator();
        while (stItr.hasNext()) {
            Comboitem item = (Comboitem) stItr.next();
            String s = (String) item.getValue();
View Full Code Here

Examples of org.zkoss.zul.Intbox

        // optional fields
        Textbox faxTelTB = (Textbox) getFellow("faxTel");
        Textbox contactMobileTB = (Textbox) getFellow("contactMobile");
        Textbox officeTel2TB = (Textbox) getFellow("officeTel2");
        Textbox contactEmailTB = (Textbox) getFellow("contactEmail");
        Intbox quotaTB = (Intbox) getFellow("quota");
        obj.setFaxTel(faxTelTB.getText());
        obj.setContactMobile(contactMobileTB.getText());
        obj.setOfficeTel2(officeTel2TB.getText());
        obj.setContactEmail(contactEmailTB.getText());
        if (!"".equals(quotaTB.getText())) {
            obj.setQuota(Integer.parseInt(quotaTB.getText()));
        }

        return obj;
    }
View Full Code Here

Examples of org.zkoss.zul.Intbox

        Textbox faxTelTB = (Textbox) getFellow("faxTel");
        Textbox contactMobileTB = (Textbox) getFellow("contactMobile");
        Textbox officeTel2TB = (Textbox) getFellow("officeTel2");
        Textbox contactEmailTB = (Textbox) getFellow("contactEmail");
        Intbox quotaTB = (Intbox) getFellow("quota");
        faxTelTB.setText(var.getFaxTel());
        contactMobileTB.setText(var.getContactMobile());
        officeTel2TB.setText(var.getOfficeTel2());
        contactEmailTB.setText(var.getContactEmail());
        quotaTB.setText(var.getQuota() + "");

    }
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.