1 /*******************************************************************************
2 * Copyright (c) 2012, 2013 Association for Decentralized Information Management in
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.g3d.property;
14 public class DoublePropertyManipulator implements PropertyManipulator {
16 ValueProvider provider;
20 String editValue = null;
22 public DoublePropertyManipulator(ValueProvider provider, Object input) {
23 this.provider = provider;
28 public int getValueCount() {
33 public String getDescription(int i) {
40 public String getValue(int i) {
44 return provider.getValue(input).toString();
45 } catch (Exception e) {
51 public String setValue(String value, int i) {
54 provider.setValue(input, Double.parseDouble(value));
55 } catch (Exception e) {
56 return e.getMessage();
62 public boolean getEditMode() {
67 public void setEditMode(boolean b) {
71 editValue = provider.getValue(input).toString();
72 } catch (Exception e) {