Skip to content
Snippets Groups Projects
Commit 82d2b7d2 authored by Richard Cordovano's avatar Richard Cordovano
Browse files

Remove JFX dependency in TSK

parent 89d347a9
No related branches found
No related tags found
No related merge requests found
...@@ -30,10 +30,6 @@ ...@@ -30,10 +30,6 @@
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static java.util.stream.Collectors.joining; import static java.util.stream.Collectors.joining;
import java.util.stream.Stream; import java.util.stream.Stream;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.Property;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.collections.FXCollections; import javafx.collections.FXCollections;
import javafx.collections.ObservableList; import javafx.collections.ObservableList;
import static org.apache.commons.lang3.ObjectUtils.notEqual; import static org.apache.commons.lang3.ObjectUtils.notEqual;
...@@ -246,7 +242,7 @@ public String toString() { ...@@ -246,7 +242,7 @@ public String toString() {
*/ */
public static final class TagsFilter extends TimelineFilter { public static final class TagsFilter extends TimelineFilter {
private final BooleanProperty eventSourcesAreTagged = new SimpleBooleanProperty(); private boolean eventSourcesAreTagged;
/** /**
* Constructs a timeline events filter used to query for a events where * Constructs a timeline events filter used to query for a events where
...@@ -266,19 +262,19 @@ public TagsFilter() { ...@@ -266,19 +262,19 @@ public TagsFilter() {
* accepted by this filter. * accepted by this filter.
*/ */
public TagsFilter(boolean eventSourceIsTagged) { public TagsFilter(boolean eventSourceIsTagged) {
this.eventSourcesAreTagged.set(eventSourceIsTagged); this.eventSourcesAreTagged = eventSourceIsTagged;
} }
/** /**
* Sets whether the direct sources of the events have to be tagged or * Sets whether the direct sources of the events have to be tagged or
* not tagged to be accepted by this filter. * not tagged to be accepted by this filter.
* *
* @param eventSourceIsTagged Whether the direct sources of the events * @param eventSourcesAreTagged Whether the direct sources of the events
* have to be tagged or not tagged to be * have to be tagged or not tagged to be
* accepted by this filter. * accepted by this filter.
*/ */
public synchronized void setEventSourcesAreTagged(boolean eventSourceIsTagged) { public synchronized void setEventSourcesAreTagged(boolean eventSourcesAreTagged) {
this.eventSourcesAreTagged.set(eventSourceIsTagged); this.eventSourcesAreTagged = eventSourcesAreTagged;
} }
/** /**
...@@ -288,7 +284,7 @@ public synchronized void setEventSourcesAreTagged(boolean eventSourceIsTagged) { ...@@ -288,7 +284,7 @@ public synchronized void setEventSourcesAreTagged(boolean eventSourceIsTagged) {
* @return True or false. * @return True or false.
*/ */
public synchronized boolean getEventSourceAreTagged() { public synchronized boolean getEventSourceAreTagged() {
return eventSourcesAreTagged.get(); return eventSourcesAreTagged;
} }
@Override @Override
...@@ -298,7 +294,7 @@ public String getDisplayName() { ...@@ -298,7 +294,7 @@ public String getDisplayName() {
@Override @Override
public TagsFilter copyOf() { public TagsFilter copyOf() {
return new TagsFilter(eventSourcesAreTagged.get()); return new TagsFilter(eventSourcesAreTagged);
} }
@Override @Override
...@@ -307,7 +303,7 @@ public boolean equals(Object obj) { ...@@ -307,7 +303,7 @@ public boolean equals(Object obj) {
return false; return false;
} }
return ((TagsFilter) obj).getEventSourceAreTagged() == eventSourcesAreTagged.get(); return ((TagsFilter) obj).getEventSourceAreTagged() == getEventSourceAreTagged();
} }
@Override @Override
...@@ -320,7 +316,7 @@ public int hashCode() { ...@@ -320,7 +316,7 @@ public int hashCode() {
@Override @Override
String getSQLWhere(TimelineManager manager) { String getSQLWhere(TimelineManager manager) {
String whereStr; String whereStr;
if (eventSourcesAreTagged.get()) { if (eventSourcesAreTagged) {
whereStr = "tagged = 1"; whereStr = "tagged = 1";
} else { } else {
whereStr = "tagged = 0"; whereStr = "tagged = 0";
...@@ -368,7 +364,7 @@ String getSQLWhere(TimelineManager manager) { ...@@ -368,7 +364,7 @@ String getSQLWhere(TimelineManager manager) {
*/ */
public static final class TextFilter extends TimelineFilter { public static final class TextFilter extends TimelineFilter {
private final SimpleStringProperty descriptionSubstring = new SimpleStringProperty(); private String descriptionSubstring;
/** /**
* Constructs a timeline events filter used to query for events that * Constructs a timeline events filter used to query for events that
...@@ -389,17 +385,7 @@ public TextFilter() { ...@@ -389,17 +385,7 @@ public TextFilter() {
*/ */
public TextFilter(String descriptionSubstring) { public TextFilter(String descriptionSubstring) {
super(); super();
this.descriptionSubstring.set(descriptionSubstring.trim()); this.descriptionSubstring = descriptionSubstring.trim();
}
/**
* Sets the substring that must be present in one or more of the
* descriptions of each event that passes the filter.
*
* @param descriptionSubstring The substring.
*/
public synchronized void setDescriptionSubstring(String descriptionSubstring) {
this.descriptionSubstring.set(descriptionSubstring.trim());
} }
@Override @Override
...@@ -408,28 +394,28 @@ public String getDisplayName() { ...@@ -408,28 +394,28 @@ public String getDisplayName() {
} }
/** /**
* Gets the substring that must be present in one or more of the * Sets the substring that must be present in one or more of the
* descriptions of each event that passes the filter. * descriptions of each event that passes the filter.
* *
* @return The required substring. * @param descriptionSubstring The substring.
*/ */
public synchronized String getSubstring() { public synchronized void setDescriptionSubstring(String descriptionSubstring) {
return descriptionSubstring.getValue(); this.descriptionSubstring = descriptionSubstring.trim();
} }
/** /**
* Gets the substring that must be present in one or more of the * Gets the substring that must be present in one or more of the
* descriptions of each event that passes the filter. * descriptions of each event that passes the filter.
* *
* @return The required substring as a Property. * @return The required substring.
*/ */
public Property<String> substringProperty() { public synchronized String getDescriptionSubstring() {
return descriptionSubstring; return descriptionSubstring;
} }
@Override @Override
public synchronized TextFilter copyOf() { public synchronized TextFilter copyOf() {
return new TextFilter(getSubstring()); return new TextFilter(getDescriptionSubstring());
} }
@Override @Override
...@@ -441,22 +427,22 @@ public boolean equals(Object obj) { ...@@ -441,22 +427,22 @@ public boolean equals(Object obj) {
return false; return false;
} }
final TextFilter other = (TextFilter) obj; final TextFilter other = (TextFilter) obj;
return Objects.equals(getSubstring(), other.getSubstring()); return Objects.equals(getDescriptionSubstring(), other.getDescriptionSubstring());
} }
@Override @Override
public int hashCode() { public int hashCode() {
int hash = 5; int hash = 5;
hash = 29 * hash + Objects.hashCode(this.descriptionSubstring.get()); hash = 29 * hash + Objects.hashCode(descriptionSubstring);
return hash; return hash;
} }
@Override @Override
String getSQLWhere(TimelineManager manager) { String getSQLWhere(TimelineManager manager) {
if (StringUtils.isNotBlank(this.getSubstring())) { if (StringUtils.isNotBlank(this.getDescriptionSubstring())) {
return "((med_description like '%" + escapeSingleQuotes(this.getSubstring()) + "%')" //NON-NLS return "((med_description like '%" + escapeSingleQuotes(this.getDescriptionSubstring()) + "%')" //NON-NLS
+ " or (full_description like '%" + escapeSingleQuotes(this.getSubstring()) + "%')" //NON-NLS + " or (full_description like '%" + escapeSingleQuotes(this.getDescriptionSubstring()) + "%')" //NON-NLS
+ " or (short_description like '%" + escapeSingleQuotes(this.getSubstring()) + "%'))"; //NON-NLS + " or (short_description like '%" + escapeSingleQuotes(this.getDescriptionSubstring()) + "%'))"; //NON-NLS
} else { } else {
return manager.getSQLWhere(null); return manager.getSQLWhere(null);
} }
...@@ -464,7 +450,7 @@ String getSQLWhere(TimelineManager manager) { ...@@ -464,7 +450,7 @@ String getSQLWhere(TimelineManager manager) {
@Override @Override
public String toString() { public String toString() {
return "TextFilter{" + "textProperty=" + descriptionSubstring.getValue() + '}'; return "TextFilter{" + "textProperty=" + descriptionSubstring + '}';
} }
} }
...@@ -884,7 +870,7 @@ String getSQLWhere(TimelineManager manager) { ...@@ -884,7 +870,7 @@ String getSQLWhere(TimelineManager manager) {
*/ */
public static final class HashHitsFilter extends TimelineFilter { public static final class HashHitsFilter extends TimelineFilter {
private final BooleanProperty eventSourcesHaveHashSetHits = new SimpleBooleanProperty(); private boolean eventSourcesHaveHashSetHits;
/** /**
* Constructs a timeline events filter used to query for events where * Constructs a timeline events filter used to query for events where
...@@ -903,7 +889,7 @@ public HashHitsFilter() { ...@@ -903,7 +889,7 @@ public HashHitsFilter() {
* have or do not have hash set hits. * have or do not have hash set hits.
*/ */
public HashHitsFilter(boolean hasHashHit) { public HashHitsFilter(boolean hasHashHit) {
eventSourcesHaveHashSetHits.set(hasHashHit); eventSourcesHaveHashSetHits = hasHashHit;
} }
/** /**
...@@ -913,7 +899,7 @@ public HashHitsFilter(boolean hasHashHit) { ...@@ -913,7 +899,7 @@ public HashHitsFilter(boolean hasHashHit) {
* @param hasHashHit True or false. * @param hasHashHit True or false.
*/ */
public synchronized void setEventSourcesHaveHashSetHits(boolean hasHashHit) { public synchronized void setEventSourcesHaveHashSetHits(boolean hasHashHit) {
eventSourcesHaveHashSetHits.set(hasHashHit); eventSourcesHaveHashSetHits = hasHashHit;
} }
/** /**
...@@ -923,7 +909,7 @@ public synchronized void setEventSourcesHaveHashSetHits(boolean hasHashHit) { ...@@ -923,7 +909,7 @@ public synchronized void setEventSourcesHaveHashSetHits(boolean hasHashHit) {
* @return True or false. * @return True or false.
*/ */
public synchronized boolean getEventSourcesHaveHashSetHits() { public synchronized boolean getEventSourcesHaveHashSetHits() {
return eventSourcesHaveHashSetHits.get(); return eventSourcesHaveHashSetHits;
} }
@Override @Override
...@@ -933,7 +919,7 @@ public String getDisplayName() { ...@@ -933,7 +919,7 @@ public String getDisplayName() {
@Override @Override
public HashHitsFilter copyOf() { public HashHitsFilter copyOf() {
return new HashHitsFilter(eventSourcesHaveHashSetHits.get()); return new HashHitsFilter(eventSourcesHaveHashSetHits);
} }
@Override @Override
...@@ -942,7 +928,7 @@ public boolean equals(Object obj) { ...@@ -942,7 +928,7 @@ public boolean equals(Object obj) {
return false; return false;
} }
return ((HashHitsFilter) obj).getEventSourcesHaveHashSetHits() == eventSourcesHaveHashSetHits.get(); return ((HashHitsFilter) obj).getEventSourcesHaveHashSetHits() == getEventSourcesHaveHashSetHits();
} }
@Override @Override
...@@ -955,7 +941,7 @@ public int hashCode() { ...@@ -955,7 +941,7 @@ public int hashCode() {
@Override @Override
String getSQLWhere(TimelineManager manager) { String getSQLWhere(TimelineManager manager) {
String whereStr = ""; String whereStr = "";
if (eventSourcesHaveHashSetHits.get()) { if (eventSourcesHaveHashSetHits) {
whereStr = "hash_hit = 1"; whereStr = "hash_hit = 1";
} else { } else {
whereStr = "hash_hit = 0"; whereStr = "hash_hit = 0";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment