Autopsy  4.4
Graphical digital forensics platform for The Sleuth Kit and other tools.
AbstractFilter.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2014 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.timeline.filters;
20 
21 import javafx.beans.binding.Bindings;
22 import javafx.beans.binding.BooleanBinding;
23 import javafx.beans.property.SimpleBooleanProperty;
24 import javafx.beans.value.ObservableBooleanValue;
25 
30 public abstract class AbstractFilter implements Filter {
31 
32  private final SimpleBooleanProperty selected = new SimpleBooleanProperty(true);
33  private final SimpleBooleanProperty disabled = new SimpleBooleanProperty(false);
34  private final BooleanBinding activeProperty = Bindings.and(selected, disabled.not());
35 
36  @Override
37  public SimpleBooleanProperty selectedProperty() {
38  return selected;
39  }
40 
41  @Override
42  public ObservableBooleanValue disabledProperty() {
43  return disabled;
44  }
45 
46  @Override
47  public void setSelected(Boolean act) {
48  selected.set(act);
49  }
50 
51  @Override
52  public boolean isSelected() {
53  return selected.get();
54  }
55 
56  @Override
57  public void setDisabled(Boolean act) {
58  disabled.set(act);
59  }
60 
61  @Override
62  public boolean isDisabled() {
63  return disabledProperty().get();
64  }
65 
66 
67 
68  @Override
69  public boolean isActive() {
70  return activeProperty().get();
71  }
72 
73  @Override
74  public BooleanBinding activeProperty() {
75  return activeProperty;
76  }
77 }

Copyright © 2012-2016 Basis Technology. Generated on: Tue Jun 13 2017
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.