X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.modeling.ui%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2Fui%2Fdiagram%2Fmonitor%2FRGB.java;h=62037f015ad51bec4f3bf741f245e8d2065914f8;hb=615860c40d342c6df580c83189fe15de2a3b965a;hp=ce788477cca7f2d8bc43b637311046455b2dd4b2;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/diagram/monitor/RGB.java b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/diagram/monitor/RGB.java index ce788477c..62037f015 100644 --- a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/diagram/monitor/RGB.java +++ b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/diagram/monitor/RGB.java @@ -1,61 +1,61 @@ -package org.simantics.modeling.ui.diagram.monitor; - -import org.simantics.common.color.Color; -import org.simantics.databoard.Bindings; -import org.simantics.db.ReadGraph; -import org.simantics.db.Resource; -import org.simantics.db.exception.DatabaseException; - -public class RGB implements Color { - - double r,g,b; - - public RGB(double r, double g, double b) { - this.r = r; this.g = g; this.b=b; - } - - public RGB(ReadGraph graph, Resource resource) throws DatabaseException { - double[] array = graph.getValue(resource, Bindings.DOUBLE_ARRAY); - assert(array.length == 3); - r = array[0]; - g = array[1]; - b = array[2]; - } - - @Override - public double getR() { - return r; - } - - @Override - public double getG() { - return g; - } - - @Override - public double getB() { - return b; - } - - @Override - public double getA() { - throw new UnsupportedOperationException(); - } - - @Override - public double getH() { - throw new UnsupportedOperationException(); - } - - @Override - public double getS() { - throw new UnsupportedOperationException(); - } - - @Override - public double getV() { - throw new UnsupportedOperationException(); - } - -} - +package org.simantics.modeling.ui.diagram.monitor; + +import org.simantics.common.color.Color; +import org.simantics.databoard.Bindings; +import org.simantics.db.ReadGraph; +import org.simantics.db.Resource; +import org.simantics.db.exception.DatabaseException; + +public class RGB implements Color { + + double r,g,b; + + public RGB(double r, double g, double b) { + this.r = r; this.g = g; this.b=b; + } + + public RGB(ReadGraph graph, Resource resource) throws DatabaseException { + double[] array = graph.getValue(resource, Bindings.DOUBLE_ARRAY); + assert(array.length == 3); + r = array[0]; + g = array[1]; + b = array[2]; + } + + @Override + public double getR() { + return r; + } + + @Override + public double getG() { + return g; + } + + @Override + public double getB() { + return b; + } + + @Override + public double getA() { + throw new UnsupportedOperationException(); + } + + @Override + public double getH() { + throw new UnsupportedOperationException(); + } + + @Override + public double getS() { + throw new UnsupportedOperationException(); + } + + @Override + public double getV() { + throw new UnsupportedOperationException(); + } + +} +