TextSelection.java 1.92 KB
/*
 * Decompiled with CFR 0_118.
 */
package com.adobe.xfa.text;

import com.adobe.xfa.gfx.GFXColour;
import com.adobe.xfa.text.TextRange;
import com.adobe.xfa.text.TextStream;

public class TextSelection
extends TextRange {
    private GFXColour moColour;
    private GFXColour moColourBg;

    public TextSelection() {
        this.moColour = GFXColour.WHITE;
        this.moColourBg = GFXColour.BLACK;
    }

    public TextSelection(TextSelection oSource) {
        super(oSource);
        this.moColour = oSource.moColour;
        this.moColourBg = oSource.moColourBg;
    }

    public TextSelection(GFXColour oColour, GFXColour oColourBg, TextStream poStream) {
        super(poStream);
        this.moColour = oColour;
        this.moColourBg = oColourBg;
    }

    public GFXColour colour() {
        return this.moColour;
    }

    public void colour(GFXColour oNewColour) {
        this.moColour = oNewColour;
    }

    public GFXColour colourBg() {
        return this.moColourBg;
    }

    public void colourBg(GFXColour oNewColourBg) {
        this.moColourBg = oNewColourBg;
    }

    public void copyFrom(TextSelection oSource) {
        super.copyFrom(oSource);
        this.moColour = oSource.moColour;
        this.moColourBg = oSource.moColourBg;
    }

    @Override
    public boolean equals(Object object) {
        if (this == object) {
            return true;
        }
        if (!super.equals(object)) {
            return false;
        }
        if (!(object instanceof TextSelection)) {
            return false;
        }
        TextSelection other = (TextSelection)object;
        return this.moColour.equals(other.moColour) && this.moColourBg.equals(other.moColourBg);
    }

    @Override
    public int hashCode() {
        int hash = 83;
        hash = hash * 31 ^ super.hashCode();
        hash = hash * 31 ^ this.moColour.hashCode();
        hash = hash * 31 ^ this.moColourBg.hashCode();
        return hash;
    }
}