X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.ui%2Fsrc%2Forg%2Fsimantics%2Fui%2Fcolors%2FRGBColor.java;h=8433a43006785d4c2d27f238ca9cc753e9b132ab;hp=ea258b28dc9e1e0e93225edf2410775ee370b9bf;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.ui/src/org/simantics/ui/colors/RGBColor.java b/bundles/org.simantics.ui/src/org/simantics/ui/colors/RGBColor.java index ea258b28d..8433a4300 100644 --- a/bundles/org.simantics.ui/src/org/simantics/ui/colors/RGBColor.java +++ b/bundles/org.simantics.ui/src/org/simantics/ui/colors/RGBColor.java @@ -1,61 +1,61 @@ -package org.simantics.ui.colors; - -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 RGBColor implements Color { - - double r,g,b; - - public RGBColor(double r, double g, double b) { - this.r = r; this.g = g; this.b=b; - } - - public RGBColor(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.ui.colors; + +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 RGBColor implements Color { + + double r,g,b; + + public RGBColor(double r, double g, double b) { + this.r = r; this.g = g; this.b=b; + } + + public RGBColor(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(); + } + +} +