Examples of Scale


Examples of cross.reputation.model.Scale

          createResource(riNamespace + "CategoricScale");
      while(stmtI1.hasNext()) {
        Statement typeStatement = stmtI1.nextStatement();
        if(typeStatement.getObject().asResource().getURI().equals(
            numericScale.getURI())) {
          Scale scale = getNumericScale(model, resource);
          return scale;
        } else if (typeStatement.getObject().asResource().getURI().equals(
            categoricScale.getURI())) {
          Scale scale = getCategoricScale(model, resource);
          return scale;
        }       
      }
      if(type == null) {
        if(!ModelException.throwException(ModelException.SCALE,
            "Impossible to instanciate a generic Scale(resource:"+resource+"" +
            "Please, see the model and assign a specific type.")) {
          return null;
        }
      }
    }   
    Scale scale = (Scale) getResourceFromCache(resource, type);
    if(scale != null) {     
      return scale;
    }   
    scale = type.newInstance();
    scale.setResource(resource);
    addResourceInstanceToCache(resource, scale);   
    // name //
    Property name = ResourceFactory.createProperty(riNamespace + "name");
    StmtIterator stmtI1 = model.listStatements(resource,
        name, (RDFNode)null);
    while(stmtI1.hasNext()) {
      Statement statement = stmtI1.nextStatement();
      // validate name property //
      if(!statement.getObject().isLiteral()) {         
        if(!ModelException.throwException(ModelException.SCALE,
            "name property of scale resource:"+
            resource.getURI()+" is not a literal")) {
          return null;
        }
      } else {
        scale.setName(statement.getObject().asLiteral().getString());
      }
    }
    return scale;
  }
View Full Code Here

Examples of cross.reputation.model.Scale

        System.out.println("The database contains subjects" +
            " of type scale:");
        while (iters.hasNext()) {
            Resource resource = iters.nextResource();
            System.out.println("  " + resource.getLocalName());
            Scale scaleInstance =
              getScale(model,resource,null);
            System.out.println("     name:" +
                scaleInstance.getName());                     
        }
    } else {
        System.out.println("No simple String riNamespace+" +
            "Scale were found in the database");
    }
View Full Code Here

Examples of de.maramuse.soundcomp.process.Scale

  }

  private void prepareScaleData() {
  if(txt.getScales()!=null){
    for(de.maramuse.soundcomp.parser.Scale _scale:txt.getScales().values()){
    Scale scale=new Scale();
    // TODO: offer option to set a pitch offset to a scale
    Integer pitch=0;
    List<ParserVal> values=_scale.getValues();
    int sz=values.size();
    for(int i=0; i<=sz; i++){
      ParserVal val=values.get(i);
      if(!(val instanceof StringIndexedNumber)){
      throw new IllegalArgumentException("illegal content in scale "+_scale.getName());
      }
      StringIndexedNumber sin=(StringIndexedNumber)val;
      // TODO make index and value possible calculation results for more flexibility
      // the constant term elimination will already allow some value calculation, though
      String index=sin.getIndex().getText();
      Double value=sin.getValue().asDouble();
      scale.put(index, value, pitch, pitch<sz-1 ? pitch+1 : null, pitch>0 ? pitch-1 : null);
    }
    scales.put(_scale.getName(), scale);
    }
  }
  }
View Full Code Here

Examples of eu.planets_project.pp.plato.model.scales.Scale

    public MeasurementInfoUri toMeasurementInfoUri(){
        MeasurementInfoUri uri = new MeasurementInfoUri(getUri());
        return uri;
    }
    public Scale getScale() {
        Scale s = null;
        if ((metric != null)&& (metric.getScale() != null)) {
            s = metric.getScale();
        } else if ((property != null) &&(property.getScale() != null)) {
            s = property.getScale();
        }
View Full Code Here

Examples of eu.scape_project.planning.model.scales.Scale

     *
     * @param className
     *            canonical class name of the new scale
     */
    public void setScaleByClassName(String className) {
        Scale scaleType = null;
        try {
            if (className != null && !"".equals(className)) {
                scaleType = (Scale) Class.forName(className).newInstance();
            }
        } catch (InstantiationException e) {
View Full Code Here

Examples of fcagnin.jgltut.tut06.Scale

                            Framework.CURRENT_TUTORIAL_DATAPATH = "/fcagnin/jgltut/tut06/data/";
                            new Translation().start();
                            break;
                        case "Scale":
                            Framework.CURRENT_TUTORIAL_DATAPATH = "/fcagnin/jgltut/tut06/data/";
                            new Scale().start();
                            break;
                        case "Rotation":
                            Framework.CURRENT_TUTORIAL_DATAPATH = "/fcagnin/jgltut/tut06/data/";
                            new Rotation().start();
                            break;
View Full Code Here

Examples of javafx.scene.transform.Scale

        contentPaneProperty.setValue(contentPane);
        contentPane.setManaged(false);
        initContentPaneListener();
//        contentPane.setStyle("-fx-border-color: rgb(0,0,0);");

        contentScaleTransform = new Scale(1, 1);
        getContentScaleTransform().setPivotX(0);
        getContentScaleTransform().setPivotY(0);
        getContentScaleTransform().setPivotZ(0);
        getContentPane().getTransforms().add(getContentScaleTransform());
View Full Code Here

Examples of jpianotrain.staff.Scale

      lowerBoundTreble.setValue(64);
      upperBoundTreble.setValue(127);
    }
    numberSpinner.setValue(rtf.getNoteCount());

    Scale s=rtf.getScale();
    if (s==null) {
      majorCheck.setSelected(true);
      for (NoteName nn:Scale.MAJOR_SCALES_CLASSIC_EN) {
        scaleBox.addItem(nn);
      }
    } else {
      majorCheck.setSelected(s.isMajor());
      if (s.isMajor()) {
        for (NoteName nn:Scale.MAJOR_SCALES_CLASSIC_EN) {
          scaleBox.addItem(nn);
        }
      } else {
        for (NoteName nn:Scale.MINOR_SCALES_CLASSIC_EN) {
          scaleBox.addItem(nn);
        }
      }
      scaleBox.setSelectedItem(s.getRoot().getName());
    }
  }
View Full Code Here

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

Examples of net.alteiar.beans.map.Scale

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