1 /*******************************************************************************
\r
2 * Copyright (c) 2012, 2013 Association for Decentralized Information Management in
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.g3d.property;
\r
14 import java.lang.reflect.Method;
\r
16 public class DoublePropertyManipulator implements PropertyManipulator {
\r
18 ValueProvider provider;
\r
22 String editValue = null;
\r
24 public DoublePropertyManipulator(ValueProvider provider, Object input) {
\r
25 this.provider = provider;
\r
30 public int getValueCount() {
\r
35 public String getDescription(int i) {
\r
42 public String getValue(int i) {
\r
46 return provider.getValue(input).toString();
\r
47 } catch (Exception e) {
\r
53 public String setValue(String value, int i) {
\r
56 provider.setValue(input, Double.parseDouble(value));
\r
57 } catch (Exception e) {
\r
58 return e.getMessage();
\r
64 public boolean getEditMode() {
\r
69 public void setEditMode(boolean b) {
\r
73 editValue = provider.getValue(input).toString();
\r
74 } catch (Exception e) {
\r