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

Code Review: tik/proxy-view #129

Merged
merged 49 commits into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
3b9f865
Initial commit, added properties and hacky fix for fonts
May 23, 2022
8649530
Updated to support the proxy-view API
May 31, 2022
675a8d1
Added a type check
May 31, 2022
4a781d0
add basic semantic structure to create semantic filters
Eddykasp Jun 23, 2022
771e38a
add different concrete building blocks for filters
Eddykasp Jun 24, 2022
74c9fc2
Added a property for hierarchical off-screen depth
fight4day Jun 25, 2022
446ad44
add documentation for semantic filters
Eddykasp Jun 27, 2022
51dc926
Preparation for semantic filtering
fight4day Jun 30, 2022
9ff28c4
Merge remote-tracking branch 'origin/mka/semantic-filtering' into tik…
fight4day Jun 30, 2022
a37ba4c
Added numeric operators to semantic filters. Should mostly be working
fight4day Jul 1, 2022
7485a99
Cleared up javadocs
fight4day Jul 2, 2022
63d55f5
Added some util methods - big operators, constants, etc
fight4day Jul 4, 2022
2f73680
Rename
fight4day Jul 4, 2022
93ea87f
Merge remote-tracking branch 'origin/master' into tik/proxy-view
fight4day Jul 5, 2022
e6b3b68
mka code review first change
fight4day Jul 6, 2022
5251ccf
Some of the code review
fight4day Jul 6, 2022
1f09038
Code review + default values
fight4day Jul 20, 2022
791a1a1
semantic filtering specifics
Eddykasp Jul 25, 2022
d522bbc
add utility connectives and fix bundle version
Eddykasp Jul 26, 2022
aad7110
add properties api to add filter tags and rules to graphs
Eddykasp Jul 26, 2022
0b1faa8
add >=, <= and != numeric connectives
Eddykasp Jul 26, 2022
b9f7fc8
add numeric connectives
Eddykasp Jul 29, 2022
ac1af70
organize imports
Eddykasp Jul 29, 2022
5853dc5
rename numeric connectives
Eddykasp Jul 29, 2022
6614980
Merge remote-tracking branch 'origin/master' into tik/proxy-view
fight4day Aug 2, 2022
7758564
Merge remote-tracking branch 'origin/mka/semantic-filtering-v2' into
fight4day Aug 2, 2022
d829608
make comparator connectives binary
Eddykasp Aug 2, 2022
9f96a57
add numeric constant
Eddykasp Aug 2, 2022
00a7068
Merge remote-tracking branch 'origin/mka/semantic-filtering-v2' into …
fight4day Aug 2, 2022
e41ed10
add parser with tests and update some type checks that were missing
Eddykasp Aug 29, 2022
e21c273
Update buildAndTest.yml
Eddykasp Aug 29, 2022
56c84f4
Update pom.xml
Eddykasp Aug 29, 2022
1725769
Merge pull request #140 from kieler/Eddykasp-patch-1
Eddykasp Aug 29, 2022
b13abc2
Rename
fight4day Aug 29, 2022
4112c91
Merge remote-tracking branch 'origin/mka/semantic-filtering-v2' into …
fight4day Aug 29, 2022
6c2b6e7
Wrote a util for parsing
fight4day Aug 29, 2022
315479c
Merge branch 'tik/semantic-filtering-parse-util' into tik/proxy-view
fight4day Aug 29, 2022
18215bc
klighd: moved example code for semantic filtering rules here.
NiklasRentzCAU Mar 3, 2023
82e3577
removed some unused imports
NiklasRentzCAU Mar 3, 2023
3fd2b14
add documentation for semantic filter rule parser and syntax
Eddykasp Mar 6, 2023
b8cf0c2
add documentation for InvalidSyntaxException
Eddykasp Mar 6, 2023
ba0dc30
Merge remote-tracking branch 'origin/master' into tik/proxy-view
NiklasRentzCAU Mar 15, 2023
5de0dd4
add comment
Eddykasp Mar 15, 2023
dec5607
replaced some Java 9-requiring code in klighd with a Java 8-compatible
NiklasRentzCAU Mar 15, 2023
f3b6b51
make Maven happy, as '<>' cannot be used with anonymous classes.
NiklasRentzCAU Mar 15, 2023
ae58b85
Merge remote-tracking branch 'origin/master' into tik/proxy-view
NiklasRentzCAU Apr 21, 2023
6941984
lsp: calculate size and layout of proxies.
NiklasRentzCAU Apr 25, 2023
28284d1
Merge branch 'master' into tik/proxy-view
Eddykasp Aug 31, 2023
8180323
update javadoc to fix errors
Eddykasp Sep 1, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import de.cau.cs.kieler.klighd.microlayout.DecoratorPlacementUtil
import de.cau.cs.kieler.klighd.microlayout.DecoratorPlacementUtil.Decoration
import de.cau.cs.kieler.klighd.microlayout.GridPlacementUtil
import de.cau.cs.kieler.klighd.microlayout.PlacementUtil
import de.cau.cs.kieler.klighd.util.KlighdProperties
import java.awt.geom.Point2D
import java.util.ArrayList
import java.util.HashMap
Expand Down Expand Up @@ -130,6 +131,42 @@ final class RenderingPreparer {
prepareRendering(port)
}
}

// Also calculate the sizes of all proxy-renderings
val proxyRendering = element.getProperty(KlighdProperties.PROXY_VIEW_PROXY_RENDERING)
if (element.getProperty(KlighdProperties.PROXY_VIEW_RENDER_NODE_AS_PROXY) && proxyRendering !== null) {
for (data : proxyRendering) {
switch(data) {
KRenderingRef: {
// all references to KRenderings need to place a map with the ids of the renderings and their
// sizes and their decoration in this case in the properties of the reference.
var boundsMap = new HashMap<String, Bounds>
var decorationMap = new HashMap<String, Decoration>
handleKRendering(element, data.rendering, boundsMap, decorationMap)
// add new Property to contain the boundsMap
data.properties.put(CALCULATED_BOUNDS_MAP, boundsMap)
// and the decorationMap
data.properties.put(CALCULATED_DECORATION_MAP, decorationMap)
// remember the id of the rendering in the reference
data.renderingId = data.rendering.renderingId

}
KRendering: {
// every rendering needs an ID, generate it here
KRenderingIdGenerator.generateIdsRecursive(data)
if (data.eContainer instanceof KNode) {
// Calculate the size and layout of the proxy first.
val parent = data.eContainer as KNode
val minSize = parent.getProperty(KlighdProperties.MINIMAL_NODE_SIZE)
val bounds = PlacementUtil.basicEstimateSize(data, new Bounds(minSize.x, minSize.y))
parent.width = bounds.width
parent.height = bounds.height
handleKRendering(parent, data, null, null)
}
}
}
}
}
}

/**
Expand Down
2 changes: 2 additions & 0 deletions plugins/de.cau.cs.kieler.klighd/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ 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.filtering.parser,
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
@@ -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,62 @@
/*
* 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 False Connective always evaluates to false.
*
* @author mka
*
*/
public class FalseConnective extends NullaryConnective {

protected static final String NAME = "FALSE";

/**
* Constructor for unnamed rule.
*/
public FalseConnective() {
this(null, null);
}

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

/**
* Constructor for named rule.
* @param ruleName
*/
public FalseConnective(String ruleName) {
this(null, ruleName);
}

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

}
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;

/**
* A GreaterEquals Connective takes two numeric rules R1 and R2 and evaluates to true
* iff
* R1 >= R2
*
* @author mka
*
*/
public class GreaterEqualsConnective extends BinaryConnective {
protected static final String NAME = "GREATEREQUALS";

/**
* Constructor for unnamed rule.
* @param leftOperand left operand
* @param rightOperand right operand
*/
public GreaterEqualsConnective(NumericResult leftOperand, NumericResult 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 GreaterEqualsConnective(NumericResult leftOperand, NumericResult 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 GreaterEqualsConnective(NumericResult leftOperand, NumericResult 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 GreaterEqualsConnective(NumericResult leftOperand, NumericResult rightOperand, Boolean defaultValue, String ruleName) {
super(defaultValue, ruleName);
this.name = NAME;
this.leftOperand = (SemanticFilterRule) leftOperand;
this.rightOperand = (SemanticFilterRule) rightOperand;
}

}
Loading
Loading