X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=bundles%2Forg.simantics.modeling.ui%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2Fui%2Fchart%2Fproperty%2FObtainedDoubleStringAdapter.java;h=36349f96dc0e00c00a5812d2be3c7c3d52e9a58d;hb=01829f2ac0839902c07f29ef723cbd37751bfc51;hp=3d15d3afc7f8f6b24810e64add870ed1b8623960;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/chart/property/ObtainedDoubleStringAdapter.java b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/chart/property/ObtainedDoubleStringAdapter.java index 3d15d3afc..36349f96d 100644 --- a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/chart/property/ObtainedDoubleStringAdapter.java +++ b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/chart/property/ObtainedDoubleStringAdapter.java @@ -1,33 +1,33 @@ -/******************************************************************************* - * Copyright (c) 2007, 2011 Association for Decentralized Information Management in - * Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.modeling.ui.chart.property; - -import org.simantics.db.ReadGraph; -import org.simantics.db.RelationContext; -import org.simantics.db.Resource; -import org.simantics.db.common.adaption.SimpleContextualAdapter; -import org.simantics.db.exception.DatabaseException; - -/** - * @author Tuukka Lehtonen - */ -public class ObtainedDoubleStringAdapter extends SimpleContextualAdapter { - - private static final ObtainedDoubleAdapter ADAPTER = new ObtainedDoubleAdapter(); - - @Override - public String adapt(ReadGraph graph, Resource source, RelationContext context) throws DatabaseException { - Double value = ADAPTER.adapt(graph, source, context); - return value != null ? value.toString() : ""; - } - -} +/******************************************************************************* + * Copyright (c) 2007, 2011 Association for Decentralized Information Management in + * Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.modeling.ui.chart.property; + +import org.simantics.db.ReadGraph; +import org.simantics.db.RelationContext; +import org.simantics.db.Resource; +import org.simantics.db.common.adaption.SimpleContextualAdapter; +import org.simantics.db.exception.DatabaseException; + +/** + * @author Tuukka Lehtonen + */ +public class ObtainedDoubleStringAdapter extends SimpleContextualAdapter { + + private static final ObtainedDoubleAdapter ADAPTER = new ObtainedDoubleAdapter(); + + @Override + public String adapt(ReadGraph graph, Resource source, RelationContext context) throws DatabaseException { + Double value = ADAPTER.adapt(graph, source, context); + return value != null ? value.toString() : ""; + } + +}