Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Semantic filtering and tagging API #137

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion plugins/de.cau.cs.kieler.klighd/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: KIELER Lightweight Diagrams (KLighD)
Bundle-SymbolicName: de.cau.cs.kieler.klighd;singleton:=true
Bundle-Version: 2.2.1.qualifier
Bundle-Version: 2.1.1.qualifier
Eddykasp marked this conversation as resolved.
Show resolved Hide resolved
Bundle-Vendor: Kiel University
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: de.cau.cs.kieler.klighd.kgraph,
Expand All @@ -21,6 +21,7 @@ Bundle-ActivationPolicy: lazy
Bundle-Activator: de.cau.cs.kieler.klighd.KlighdPlugin
Export-Package: de.cau.cs.kieler.klighd,
de.cau.cs.kieler.klighd.actions,
de.cau.cs.kieler.klighd.filtering,
de.cau.cs.kieler.klighd.internal;x-friends:="de.cau.cs.kieler.klighd.piccolo,de.cau.cs.kieler.klighd.ui,de.cau.cs.kieler.klighd.lsp",
de.cau.cs.kieler.klighd.internal.macrolayout;x-friends:="de.cau.cs.kieler.klighd.ui,de.cau.cs.kieler.klighd.piccolo",
de.cau.cs.kieler.klighd.internal.preferences;x-internal:=true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,18 @@
*/
package de.cau.cs.kieler.klighd;

import java.util.Collection;
import java.util.EnumSet;
import java.util.List;

import org.eclipse.elk.core.data.ILayoutMetaDataProvider;
import org.eclipse.elk.core.data.LayoutOptionData;
import org.eclipse.elk.core.math.KVector;
import org.eclipse.elk.graph.properties.IProperty;
import org.eclipse.elk.graph.properties.Property;

import de.cau.cs.kieler.klighd.filtering.SemanticFilterRule;
import de.cau.cs.kieler.klighd.filtering.SemanticFilterTag;
import de.cau.cs.kieler.klighd.labels.management.LabelManagementResult;
import de.cau.cs.kieler.klighd.util.ExpansionAwareLayoutOption;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
* KIELER - Kiel Integrated Environment for Layout Eclipse RichClient
*
* http://rtsys.informatik.uni-kiel.de/kieler
*
* Copyright 2022 by
* + Kiel University
* + Department of Computer Science
* + Real-Time and Embedded Systems Group
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*/
package de.cau.cs.kieler.klighd.filtering;

/**
* An And Connective takes two rules R1 and R2 and evaluates to true
* iff
* R1 and R2 evaluate to true.
*
* @author mka
* @author tik
*
*/
public class AndConnective extends BinaryConnective {
protected static final String NAME = "AND";

/**
* Constructor for unnamed rule.
* @param leftOperand left operand
* @param rightOperand right operand
*/
public AndConnective(SemanticFilterRule leftOperand, SemanticFilterRule rightOperand) {
this(leftOperand, rightOperand, null, null);
}

/**
* Constructor for unnamed rule with default value.
* @param leftOperand left operand
* @param rightOperand right operand
* @param defaultValue the default value
*/
public AndConnective(SemanticFilterRule leftOperand, SemanticFilterRule rightOperand, Boolean defaultValue) {
this(leftOperand, rightOperand, defaultValue, null);
}

/**
* Constructor for named rule.
* @param leftOperand left operand
* @param rightOperand right operand
* @param ruleName rule name
*/
public AndConnective(SemanticFilterRule leftOperand, SemanticFilterRule rightOperand, String ruleName) {
this(leftOperand, rightOperand, null, ruleName);
}

/**
* Constructor for named rule with default value.
* @param leftOperand left operand
* @param rightOperand right operand
* @param defaultValue the default value
* @param ruleName rule name
*/
public AndConnective(SemanticFilterRule leftOperand, SemanticFilterRule rightOperand, Boolean defaultValue, String ruleName) {
super(defaultValue, ruleName);
this.name = NAME;
this.leftOperand = leftOperand;
this.rightOperand = rightOperand;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* KIELER - Kiel Integrated Environment for Layout Eclipse RichClient
*
* http://rtsys.informatik.uni-kiel.de/kieler
*
* Copyright 2022 by
* + Kiel University
* + Department of Computer Science
* + Real-Time and Embedded Systems Group
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*/
package de.cau.cs.kieler.klighd.filtering;

/**
* A binary connective C takes two filter rules R1 and R2 as operands and creates the new rule R1 C R2.
* @author mka
* @author tik
*
*/
public abstract class BinaryConnective extends SemanticFilterRule {

protected String name;
protected SemanticFilterRule leftOperand;
protected SemanticFilterRule rightOperand;

/**
* {@inheritDoc}
*/
public BinaryConnective() {

}

/**
* {@inheritDoc}
*/
public BinaryConnective(Boolean defaultValue) {
super(defaultValue);
}

/**
* {@inheritDoc}
*/
public BinaryConnective(String ruleName) {
super(ruleName);
}

/**
* {@inheritDoc}
*/
public BinaryConnective(Boolean defaultValue, String ruleName) {
super(defaultValue, ruleName);
}

/**
* Returns a string representation of the rule of the form 'C(R1, R2)'.
* @return the rule string
*/
public String toString() {
return name + "(" + leftOperand + ", " + rightOperand + ")";
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* KIELER - Kiel Integrated Environment for Layout Eclipse RichClient
*
* http://rtsys.informatik.uni-kiel.de/kieler
*
* Copyright 2022 by
* + Kiel University
* + Department of Computer Science
* + Real-Time and Embedded Systems Group
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*/
package de.cau.cs.kieler.klighd.filtering;

/**
* A GreaterThan Connective takes one rule R and evaluates to true
* iff
* R.num > correspondingTag.num.
* @author tik
*
*/
public class GreaterThanConnective extends UnaryConnective {
Eddykasp marked this conversation as resolved.
Show resolved Hide resolved
protected static final String NAME = "GREATERTHAN";

/**
* Constructor for unnamed rule.
* @param operand the operand
*/
public GreaterThanConnective(SemanticFilterTag operand) {
this(operand, null, null);
}

/**
* Constructor for unnamed rule with default value.
* @param operand the operand
* @param defaultValue the default value
*/
public GreaterThanConnective(SemanticFilterTag operand, Boolean defaultValue) {
this(operand, defaultValue, null);
}

/**
* Constructor for named rule.
* @param operand the operand
* @param ruleName rule name
*/
public GreaterThanConnective(SemanticFilterTag operand, String ruleName) {
this(operand, null, ruleName);
}

/**
* Constructor for named rule with default value.
* @param operand the operand
* @param defaultValue the default value
* @param ruleName rule name
*/
public GreaterThanConnective(SemanticFilterTag operand, Boolean defaultValue, String ruleName) {
super(defaultValue, ruleName);
this.name = NAME;
this.operand = operand;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
* KIELER - Kiel Integrated Environment for Layout Eclipse RichClient
*
* http://rtsys.informatik.uni-kiel.de/kieler
*
* Copyright 2022 by
* + Kiel University
* + Department of Computer Science
* + Real-Time and Embedded Systems Group
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*/
package de.cau.cs.kieler.klighd.filtering;

/**
* An IfThen Connective takes two rules R1 and R2 and evaluates to true
* iff
* R1 evaluates to false or R2 evaluates to true.
*
* @author tik
*
*/
public class IfThenConnective extends BinaryConnective {
protected static final String NAME = "IFTHEN";

/**
* Constructor for unnamed rule.
* @param leftOperand left operand
* @param rightOperand right operand
*/
public IfThenConnective(SemanticFilterRule leftOperand, SemanticFilterRule rightOperand) {
this(leftOperand, rightOperand, null, null);
}

/**
* Constructor for unnamed rule with default value.
* @param leftOperand left operand
* @param rightOperand right operand
* @param defaultValue the default value
*/
public IfThenConnective(SemanticFilterRule leftOperand, SemanticFilterRule rightOperand, Boolean defaultValue) {
this(leftOperand, rightOperand, defaultValue, null);
}

/**
* Constructor for named rule.
* @param leftOperand left operand
* @param rightOperand right operand
* @param ruleName rule name
*/
public IfThenConnective(SemanticFilterRule leftOperand, SemanticFilterRule rightOperand, String ruleName) {
this(leftOperand, rightOperand, null, ruleName);
}

/**
* Constructor for named rule with default value.
* @param leftOperand left operand
* @param rightOperand right operand
* @param defaultValue the default value
* @param ruleName rule name
*/
public IfThenConnective(SemanticFilterRule leftOperand, SemanticFilterRule rightOperand, Boolean defaultValue, String ruleName) {
super(defaultValue, ruleName);
this.name = NAME;
this.leftOperand = leftOperand;
this.rightOperand = rightOperand;
}

}
Loading