2 |
26 Feb 07 |
jari |
1 |
/* |
2 |
26 Feb 07 |
jari |
Copyright @ 1999-2004, The Institute for Genomic Research (TIGR). |
2 |
26 Feb 07 |
jari |
All rights reserved. |
2 |
26 Feb 07 |
jari |
4 |
*/ |
2 |
26 Feb 07 |
jari |
5 |
/* |
2 |
26 Feb 07 |
jari |
* $RCSfile: HCLCluster.java,v $ |
2 |
26 Feb 07 |
jari |
* $Revision: 1.4 $ |
2 |
26 Feb 07 |
jari |
* $Date: 2006/03/24 15:50:40 $ |
2 |
26 Feb 07 |
jari |
* $Author: eleanorahowe $ |
2 |
26 Feb 07 |
jari |
* $State: Exp $ |
2 |
26 Feb 07 |
jari |
11 |
*/ |
2 |
26 Feb 07 |
jari |
12 |
package org.tigr.microarray.mev.cluster.gui.impl.hcl; |
2 |
26 Feb 07 |
jari |
13 |
|
2 |
26 Feb 07 |
jari |
14 |
import java.awt.Color; |
2 |
26 Feb 07 |
jari |
15 |
|
2 |
26 Feb 07 |
jari |
16 |
public class HCLCluster { |
2 |
26 Feb 07 |
jari |
17 |
|
2 |
26 Feb 07 |
jari |
18 |
public int root; // root index |
2 |
26 Feb 07 |
jari |
19 |
public int firstElem; |
2 |
26 Feb 07 |
jari |
20 |
public int lastElem; |
2 |
26 Feb 07 |
jari |
21 |
public Color color; // color of the cluster. |
2 |
26 Feb 07 |
jari |
22 |
public String text; // cluster description. |
2 |
26 Feb 07 |
jari |
23 |
public boolean isGeneCluster; |
2 |
26 Feb 07 |
jari |
24 |
public int size; |
2 |
26 Feb 07 |
jari |
25 |
/** |
2 |
26 Feb 07 |
jari |
* Constructs a <code>HCLCluster</code> with specified root, |
2 |
26 Feb 07 |
jari |
* firstRow and lastRow indices. |
2 |
26 Feb 07 |
jari |
28 |
*/ |
2 |
26 Feb 07 |
jari |
29 |
public HCLCluster(int root, int firstElem, int lastElem) { |
2 |
26 Feb 07 |
jari |
30 |
this.root = root; |
2 |
26 Feb 07 |
jari |
31 |
this.firstElem = firstElem; |
2 |
26 Feb 07 |
jari |
32 |
this.lastElem = lastElem; |
2 |
26 Feb 07 |
jari |
33 |
this.isGeneCluster = true; |
2 |
26 Feb 07 |
jari |
34 |
this.size = (lastElem - firstElem) + 1; |
2 |
26 Feb 07 |
jari |
35 |
} |
2 |
26 Feb 07 |
jari |
36 |
|
2 |
26 Feb 07 |
jari |
37 |
public void setFinalSize(){ |
2 |
26 Feb 07 |
jari |
38 |
this.size = (this.lastElem - this.firstElem) + 1; |
2 |
26 Feb 07 |
jari |
39 |
} |
2 |
26 Feb 07 |
jari |
40 |
|
2 |
26 Feb 07 |
jari |
//EH These methods and constructor are provided to present a JavaBean |
2 |
26 Feb 07 |
jari |
//interface for XMLEncoder/XMLDecoder serializing. |
2 |
26 Feb 07 |
jari |
43 |
public HCLCluster() { |
2 |
26 Feb 07 |
jari |
44 |
this.isGeneCluster = true; |
2 |
26 Feb 07 |
jari |
45 |
} |
2 |
26 Feb 07 |
jari |
46 |
public void setRoot(int r){this.root = r;} |
2 |
26 Feb 07 |
jari |
47 |
public void setFirstElem(int fe) { |
2 |
26 Feb 07 |
jari |
48 |
this.firstElem = fe; |
2 |
26 Feb 07 |
jari |
49 |
try { |
2 |
26 Feb 07 |
jari |
50 |
this.size = (lastElem = firstElem)+1; |
2 |
26 Feb 07 |
jari |
51 |
} catch (NullPointerException npe){} |
2 |
26 Feb 07 |
jari |
52 |
} |
2 |
26 Feb 07 |
jari |
53 |
public void setLastElem(int le) { |
2 |
26 Feb 07 |
jari |
54 |
this.lastElem = le; |
2 |
26 Feb 07 |
jari |
55 |
try { |
2 |
26 Feb 07 |
jari |
56 |
this.size = (lastElem = firstElem)+1; |
2 |
26 Feb 07 |
jari |
57 |
} catch (NullPointerException npe){} |
2 |
26 Feb 07 |
jari |
58 |
} |
2 |
26 Feb 07 |
jari |
59 |
public int getRoot() {return this.root;} |
2 |
26 Feb 07 |
jari |
60 |
public int getFirstElem() {return this.firstElem;} |
2 |
26 Feb 07 |
jari |
61 |
public int getLastElem() {return this.lastElem;} |
2 |
26 Feb 07 |
jari |
//End beanifying methods |
2 |
26 Feb 07 |
jari |
63 |
|
2 |
26 Feb 07 |
jari |
64 |
|
2 |
26 Feb 07 |
jari |
65 |
} |