Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / java / awt / image / LookupTable.js
1 Clazz.declarePackage ("java.awt.image");
2 Clazz.load (null, "java.awt.image.LookupTable", ["java.lang.IllegalArgumentException"], function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.numComponents = 0;
5 this.offset = 0;
6 this.numEntries = 0;
7 Clazz.instantialize (this, arguments);
8 }, java.awt.image, "LookupTable");
9 Clazz.makeConstructor (c$, 
10 function (offset, numComponents) {
11 if (offset < 0) {
12 throw  new IllegalArgumentException ("Offset must be greater than 0");
13 }if (numComponents < 1) {
14 throw  new IllegalArgumentException ("Number of components must  be at least 1");
15 }this.numComponents = numComponents;
16 this.offset = offset;
17 }, "~N,~N");
18 Clazz.defineMethod (c$, "getNumComponents", 
19 function () {
20 return this.numComponents;
21 });
22 Clazz.defineMethod (c$, "getOffset", 
23 function () {
24 return this.offset;
25 });
26 });