view gwt-client/src/main/java/org/dive4elements/river/client/shared/model/ModuleGroup.java @ 9416:05405292a7ca

Navigationtheme panel now shows themes of dWt and WQ charts grayed out, if the current station is outside the valid range of the theme.
author gernotbelger
date Thu, 16 Aug 2018 16:28:03 +0200
parents 78cd6572778d
children
line wrap: on
line source
/** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde
 * Software engineering by 
 *  Björnsen Beratende Ingenieure GmbH 
 *  Dr. Schumacher Ingenieurbüro für Wasser und Umwelt
 *
 * This file is Free Software under the GNU AGPL (>=v3)
 * and comes with ABSOLUTELY NO WARRANTY! Check out the
 * documentation coming with Dive4Elements River for details.
 */
package org.dive4elements.river.client.shared.model;

import java.io.Serializable;

/**
 * A module group marks modules to belong to a common group. Modules of the same group are put together in the user-interface.
 * 
 * @author Gernot Belger
 */
public class ModuleGroup implements Serializable {
    
    private static final long serialVersionUID = 1L;

    private String id;
    private String label;

    public ModuleGroup() {
        this.id = null;
        this.label = null;
    }
    
    public ModuleGroup(final String id, final String label) {
        this.id = id;
        this.label = label;
    }

    @Override
    public String toString() {
        return label;
    }

    @Override
    public int hashCode() {
        return id == null ? 0 : id.hashCode();
    }

    @Override
    public boolean equals(Object obj) {

        if (obj == null)
            return false;
        if (obj == this)
            return true;

        if (obj.getClass() != getClass()) {
            return false;
        }

        final ModuleGroup rhs = (ModuleGroup) obj;
        return (id == rhs.id) || (id != null && id.equals(rhs.id));
    }

    public boolean showGroupFrame() {
        return label != null && !label.trim().isEmpty();
    }
}

http://dive4elements.wald.intevation.org