Package com.onpositive.semantic.model.ui.property.editors

Examples of com.onpositive.semantic.model.ui.property.editors.SpinnerEditor


    tm.setBinding(binding);
  }

  private static void createRating(CompositeEditor editor,
      final Binding binding) {
    SpinnerEditor ed = new SpinnerEditor() {

      protected void configure(IBinding binding, Spinner control) {
        control.setMinimum(0);
        control.setMaximum(100);
        Rating c = (Rating) binding.getValue();
        if (c != null) {
          initValue(control, c.getRating());
        }
      }

      protected void commitToBinding(Object newValue) {
        Number m = (Number) newValue;
        super.commitToBinding(new Rating(m.intValue()));
      }
    };

    ed.setBinding(binding);
    editor.add(ed);
  }
View Full Code Here


    binding2.setAutoCommit(true);
    binding2.addBindingChangeListener(l);
    binding2.setReadOnly(false);
    binding2.setName("Latitude");
    // binding2.setValue(vv.getLatitude(),null);
    SpinnerEditor sp2 = new SpinnerEditor() {
      protected void configure(IBinding binding, Spinner control) {
        // super.configure(binding,control);
        control.setMinimum(-90000000);
        control.setMaximum(90000000);
        control.setDigits(6);
        this.scale = 1000000;
        isFloat = true;
        control.setIncrement(1);
        Object value = binding.getValue();
        if (value == null) {
          value = 0f;
        }

        initValue(control, ((Float) value)/* * 1000000 */);

      }
    };
    sp2.setBinding(binding2);

    tr.add(sp2);
    binding3.setName("Longitude");
    // binding3.setValue(vv.getLongitude(),null);
    binding3.setReadOnly(false);
    binding3.setRequired(true);
    binding3.setAutoCommit(true);
    binding3.addBindingChangeListener(l);

    SpinnerEditor sp = new SpinnerEditor() {
      protected void configure(IBinding binding, Spinner control) {
        control.setMinimum(-180000000);
        control.setMaximum(180000000);
        control.setDigits(6);
        control.setIncrement(1);
        isFloat = true;
        // super.configure(binding3, control);
        this.scale = 1000000;
        Object value = binding.getValue();
        if (value == null) {
          value = 0f;
        }
        initValue(control, (Float) value/* * 1000000 */);

      }
    };
    sp.setBinding(binding3);
    tr.add(sp);
    editor.add(tr);
  }
 
View Full Code Here

TOP

Related Classes of com.onpositive.semantic.model.ui.property.editors.SpinnerEditor

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.