Package net.alteiar.beans.map

Examples of net.alteiar.beans.map.Scale


    }

    assertTrue("The map should'nt have any element",
        elementsOnMap.isEmpty());

    battle.setScale(new Scale(25, 1.5));
    battle.setFilter(new UniqueID());

    sleep();
    // Should have 4 call
    // (add element, remove element, scale change, filter change)
View Full Code Here


    battle.removePropertyChangeListener(listener);
  }

  @Test
  public void testScale() {
    Scale scale = new Scale();

    assertEquals("default scale should be 0", Double.valueOf(0.0),
        scale.getMeter());
    assertEquals("default scale should be 0", Integer.valueOf(0),
        scale.getPixels());

    Double meters = 1.5;
    Integer pixels = 150;

    scale.setMeter(meters);
    scale.setPixels(150);

    assertEquals("meters should have changed", meters, scale.getMeter());
    assertEquals("pixels should have changed", pixels, scale.getPixels());

    Double meters2 = 5.0;
    Integer pixels2 = 300;
    Double meters3 = null;
    Integer pixels3 = null;
    Scale scale1 = new Scale(pixels, meters);
    Scale scale2 = new Scale(pixels2, meters);
    Scale scale3 = new Scale(pixels, meters2);
    Scale scale4 = new Scale(pixels3, meters);
    Scale scale5 = new Scale(pixels, meters3);

    assertTrue("Scale should be equals to itself", scale.equals(scale));
    assertTrue("Scale should'nt be equals to null", !scale.equals(null));
    assertTrue("Scale should'nt be equals to other object",
        !scale.equals(""));

    assertTrue("Scale should be equals to a same scale",
        scale.equals(scale1));
    assertTrue("Scale should be equals to a same scale",
        !scale.equals(scale2));
    assertTrue("Scale should be equals to a same scale",
        !scale.equals(scale3));
    assertTrue("Scale should be equals to a same scale",
        !scale4.equals(scale));
    assertTrue("Scale should be equals to a same scale",
        !scale5.equals(scale));

    assertTrue("Scale hashcode should be equals to a same scale hashCode",
        scale.hashCode() == scale1.hashCode());

    assertTrue(
View Full Code Here

        .getRootDirectory(), targetName, "document-type", map);

    doc = addBean(doc);
    map = doc.getBean();

    Scale newScale = new Scale(map.getScale().getPixels() + 5, map
        .getScale().getMeter());
    map.setScale(newScale);

    Integer newWidth = map.getWidth() + 5;
    map.setWidth(newWidth);
View Full Code Here

    dlg.setLocationRelativeTo(null);
    dlg.setVisible(true);

    if (dlg.getReturnStatus() == DialogOkCancel.RET_OK) {
      Scale scale = dlg.getMainPanel().getScale();
      this.getMapInfo().getMap().setScale(scale);
    }
  }
View Full Code Here

    add(panelPreviousZoom, gbc_panelPrevious);
  }

  public void scaleChange() {
    int scale = (Integer) spinner.getValue();
    zoomableMap.setScale(new Scale(scale, 1.5));
  }
View Full Code Here

    zoomableMap.setScale(new Scale(scale, 1.5));
  }

  public Scale getScale() {
    int scale = (Integer) spinner.getValue();
    return new Scale(scale, 1.5);
  }
View Full Code Here

  @Override
  public Boolean isDataValid() {
    Boolean isValid = true;
    try {
      MapElementSize size = panelWidth.getMapElementSize(0);
      size.getPixels(new Scale());
      size = panelHeight.getMapElementSize(0);
      size.getPixels(new Scale());
    } catch (Exception ex) {
      isValid = false;
    }

    return isValid;
View Full Code Here

  @Override
  public Boolean isDataValid() {
    Boolean isValid = true;
    try {
      MapElementSize size = panelRadius.getMapElementSize(0);
      size.getPixels(new Scale());
    } catch (Exception ex) {
      isValid = false;
    }

    return isValid;
View Full Code Here

  @Override
  public Boolean isDataValid() {
    Boolean isValid = true;
    try {
      MapElementSize size = panelWidth.getMapElementSize(0);
      size.getPixels(new Scale());
      size = panelHeight.getMapElementSize(0);
      size.getPixels(new Scale());
    } catch (Exception ex) {
      isValid = false;
    }

    return isValid;
View Full Code Here

  @Override
  public Boolean isDataValid() {
    Boolean isValid = true;
    try {
      MapElementSize size = panelRadius.getMapElementSize(0);
      size.getPixels(new Scale());
    } catch (Exception ex) {
      isValid = false;
    }

    return isValid;
View Full Code Here

TOP

Related Classes of net.alteiar.beans.map.Scale

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.