public boolean equals(Object obj) {

        if (obj == this) {
            return true;
        }
        if (!(obj instanceof ColorBar)) {
            return false;   
        }
        ColorBar that = (ColorBar) obj;
        if (!this.axis.equals(that.axis)) {
            return false;
        }
        if (this.colorBarThickness != that.colorBarThickness) {
            return false;
        }
        if (this.colorBarThicknessPercent != that.colorBarThicknessPercent) {
            return false;
        }
        if (!this.colorPalette.equals(that.colorPalette)) {
            return false;
        }
        if (this.colorBarLength != that.colorBarLength) {
            return false;
        }
        if (this.outerGap != that.outerGap) {
            return false;
        }
        return true;