all files / component/color-selector/ color-fab.class.ts

89.47% Statements 17/19
50% Branches 2/4
75% Functions 6/8
87.5% Lines 14/16
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48                            444× 222× 222× 222×             70×             19×     229×            
/*
 *  @license
 *  Copyright Hôpitaux Universitaires de Genève. All Rights Reserved.
 *
 *  Use of this source code is governed by an Apache-2.0 license that can be
 *  found in the LICENSE file at https://github.com/DSI-HUG/dejajs-components/blob/master/LICENSE
 */
 
import { BehaviorSubject ,  Subject } from 'rxjs';
import { Color } from '../../common/core/graphics/color';
 
export class DejaColorFab {
    public color$: Subject<Color>;
    public active$: Subject<boolean>;
    public disabled$: Subject<boolean>;
 
    constructor(private _color: Color, private I_disabled = false, private I_active = false) {
        this.color$ = new BehaviorSubject<Color>(_color);
        this.disabled$ = new BehaviorSubject<boolean>(_disabled);
        this.active$ = new BehaviorSubject<boolean>(_active);
    }
 
    public set color(value: Color) {
        this.color$.next(this._color = value);
    }
 
    public get color() {
        return this._color;
    }
 
    public set disabled(value: boolean) {
        this.disabled$.next(this._disabled = value);
    }
 
    public get disabled() {
        return this._disabled;
    }
 
    public set active(value: boolean) {
        this.active$.next(this._active = value);
    }
 
    public get active() {
        return this._active;
    }
}