-
Notifications
You must be signed in to change notification settings - Fork 7
Structured Programming #84
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
Changes from 11 commits
9a31c53
f20a15d
1908f1a
5685b1a
99e0789
0848409
25b58c3
90478a6
187659a
78f2f93
8c89954
49543d3
8581bb2
8dbbe29
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,7 @@ import org.eclipse.xtext.Constants | |
| import org.eclipse.xtext.IGrammarAccess | ||
| import org.eclipse.xtext.ide.server.ILanguageServerExtension | ||
| import org.eclipse.xtext.util.Modules2 | ||
| import de.cau.cs.kieler.klighd.lsp.structuredProgramming.sccharts.StructuredProgScchartLanguageServerExtension | ||
|
||
|
|
||
| /** | ||
| * Provides methods to create a LS. | ||
|
|
@@ -37,6 +38,8 @@ class LSCreator extends AbstractLsCreator { | |
|
|
||
| RectpackingInteractiveLanguageServerExtension rectPack | ||
|
|
||
| StructuredProgScchartLanguageServerExtension structProgScchart | ||
|
|
||
| List<ILSDiagramHighlighter> diagramHighlighters | ||
|
|
||
| List<ILanguageServerExtension> iLanguageServerExtensions | ||
|
|
@@ -54,7 +57,9 @@ class LSCreator extends AbstractLsCreator { | |
| override getLanguageServerExtensions() { | ||
| constraints = injector.getInstance(LayeredInteractiveLanguageServerExtension) | ||
| rectPack = injector.getInstance(RectpackingInteractiveLanguageServerExtension) | ||
| iLanguageServerExtensions = newArrayList(constraints, rectPack) | ||
| structProgScchart = injector.getInstance(StructuredProgScchartLanguageServerExtension) | ||
|
|
||
| iLanguageServerExtensions = newArrayList(constraints, rectPack, structProgScchart) | ||
| for (lse : KielerServiceLoader.load(ILanguageServerContribution)) { | ||
| iLanguageServerExtensions.add(lse.getLanguageServerExtension(injector)) | ||
| } | ||
|
|
@@ -75,6 +80,8 @@ class LSCreator extends AbstractLsCreator { | |
| } | ||
| constraints.client = languageClient as KGraphLanguageClient | ||
| rectPack.client = languageClient as KGraphLanguageClient | ||
| structProgScchart.client = languageClient as KGraphLanguageClient | ||
|
|
||
| diagramHighlighters = newArrayList | ||
| for (iLSdhc : KielerServiceLoader.load(ILSDiagramHighlighterContribution)) { | ||
| var highlighter = iLSdhc.getHighlighter(injector) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,7 +41,8 @@ Require-Bundle: de.cau.cs.kieler.klighd, | |
| org.eclipse.jdt.core;bundle-version="3.19.0", | ||
| de.cau.cs.kieler.kicool.ide, | ||
| de.cau.cs.kieler.annotations.ide, | ||
| org.eclipse.elk.core.service | ||
| org.eclipse.elk.core.service, | ||
| de.cau.cs.kieler.klighd.lsp;bundle-version="2.2.1" | ||
|
||
| Bundle-Vendor: Kiel University | ||
| Bundle-ActivationPolicy: lazy | ||
| Export-Package: de.cau.cs.kieler.sccharts.ui, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,49 +35,70 @@ final class GeneralSynthesisOptions { | |
| /** | ||
| * The appearance category | ||
| */ | ||
| public static final SynthesisOption APPEARANCE = SynthesisOption.createCategory(GeneralSynthesisOptions, "Appearance") | ||
| public static final SynthesisOption APPEARANCE = SynthesisOption.createCategory(GeneralSynthesisOptions, | ||
| "Appearance") | ||
| /** | ||
| * The navigation category | ||
| */ | ||
| public static final SynthesisOption NAVIGATION = SynthesisOption.createCategory(GeneralSynthesisOptions, "Navigation", false) | ||
| public static final SynthesisOption NAVIGATION = SynthesisOption.createCategory(GeneralSynthesisOptions, | ||
| "Navigation", false) | ||
| /** | ||
| * The debugging category | ||
| */ | ||
| public static final SynthesisOption DEBUGGING = SynthesisOption.createCategory(GeneralSynthesisOptions, "Analysis / Debugging", false) | ||
| public static final SynthesisOption DEBUGGING = SynthesisOption.createCategory(GeneralSynthesisOptions, | ||
| "Analysis / Debugging", false) | ||
| /** | ||
| * The layout category | ||
| */ | ||
| public static final SynthesisOption LAYOUT = SynthesisOption.createCategory(GeneralSynthesisOptions, "Layout", false) | ||
| public static final SynthesisOption LAYOUT = SynthesisOption.createCategory(GeneralSynthesisOptions, "Layout", | ||
| false) | ||
| /** | ||
| * Dataflow category | ||
| */ | ||
| public static final SynthesisOption DATAFLOW = SynthesisOption.createCategory(GeneralSynthesisOptions, "Dataflow", false).setCategory(APPEARANCE) | ||
| public static final SynthesisOption DATAFLOW = SynthesisOption.createCategory(GeneralSynthesisOptions, "Dataflow", | ||
| false).setCategory(APPEARANCE) | ||
| /** | ||
| * References and OO / Inheritance | ||
| */ | ||
| public static final SynthesisOption OO = SynthesisOption.createCategory(GeneralSynthesisOptions, "Object Orientation / References", false).setCategory(APPEARANCE) | ||
|
|
||
| public static final SynthesisOption OO = SynthesisOption.createCategory(GeneralSynthesisOptions, | ||
| "Object Orientation / References", false).setCategory(APPEARANCE) | ||
|
|
||
| // -- OPTIONS -- | ||
| /** | ||
| * Option for setting the KLayLayered layout | ||
| */ | ||
| public static final SynthesisOption USE_KLAY = SynthesisOption.createCheckOption(GeneralSynthesisOptions, "KLayLayered", true).setCategory(LAYOUT) | ||
| public static final SynthesisOption SHOW_ALL_SCCHARTS = SynthesisOption.createCheckOption(GeneralSynthesisOptions, "All SCCharts", false).setCategory(APPEARANCE) | ||
| public static final SynthesisOption SHOW_COMMENTS = SynthesisOption.createCheckOption(GeneralSynthesisOptions, "Comment Nodes", true).setCategory(APPEARANCE) | ||
| public static final SynthesisOption SHOW_USER_LABELS = SynthesisOption.createCheckOption(GeneralSynthesisOptions, "User Labels", true).setCategory(APPEARANCE) | ||
| public static final SynthesisOption USE_KLAY = SynthesisOption.createCheckOption(GeneralSynthesisOptions, | ||
| "KLayLayered", true).setCategory(LAYOUT) | ||
| public static final SynthesisOption SHOW_ALL_SCCHARTS = SynthesisOption.createCheckOption(GeneralSynthesisOptions, | ||
| "All SCCharts", false).setCategory(APPEARANCE) | ||
| public static final SynthesisOption SHOW_COMMENTS = SynthesisOption.createCheckOption(GeneralSynthesisOptions, | ||
| "Comment Nodes", true).setCategory(APPEARANCE) | ||
| public static final SynthesisOption SHOW_USER_LABELS = SynthesisOption.createCheckOption(GeneralSynthesisOptions, | ||
| "User Labels", true).setCategory(APPEARANCE) | ||
| /** | ||
| * Scope call parameters synthesis option | ||
| */ | ||
| public static final SynthesisOption SHOW_BINDINGS = SynthesisOption.createCheckOption(GeneralSynthesisOptions, "Binding Parameters", true).setCategory(OO) | ||
| public static final SynthesisOption SHOW_BINDINGS = SynthesisOption.createCheckOption(GeneralSynthesisOptions, | ||
| "Binding Parameters", true).setCategory(OO) | ||
| /** | ||
| * inherited declarations and regions synthesis option | ||
| */ | ||
| public static final SynthesisOption SHOW_INHERITANCE = SynthesisOption.createCheckOption(GeneralSynthesisOptions, "Inheritance Preview", true).setCategory(OO) | ||
| public static final SynthesisOption SHOW_INHERITANCE_EDGES = SynthesisOption.createCheckOption(GeneralSynthesisOptions, "Inheritance Hierarchy", false).setCategory(OO) | ||
| public static final SynthesisOption SHOW_AGGREGATION_EDGES = SynthesisOption.createCheckOption(GeneralSynthesisOptions, "Aggregation", false).setCategory(OO) | ||
| public static final SynthesisOption SHOW_METHOD_BODY = SynthesisOption.createCheckOption(GeneralSynthesisOptions, "Method Implementation", true).setCategory(OO) | ||
| public static final SynthesisOption SHOW_INHERITANCE = SynthesisOption.createCheckOption(GeneralSynthesisOptions, | ||
| "Inheritance Preview", true).setCategory(OO) | ||
| public static final SynthesisOption SHOW_INHERITANCE_EDGES = SynthesisOption.createCheckOption( | ||
| GeneralSynthesisOptions, "Inheritance Hierarchy", false).setCategory(OO) | ||
| public static final SynthesisOption SHOW_AGGREGATION_EDGES = SynthesisOption.createCheckOption( | ||
| GeneralSynthesisOptions, "Aggregation", false).setCategory(OO) | ||
| public static final SynthesisOption SHOW_METHOD_BODY = SynthesisOption.createCheckOption(GeneralSynthesisOptions, | ||
| "Method Implementation", true).setCategory(OO) | ||
| /** | ||
| * inherited declarations and regions synthesis option | ||
| */ | ||
| public static final SynthesisOption SHOW_CAUSAL_DATAFLOW = SynthesisOption.createCheckOption(GeneralSynthesisOptions, "Causal Dataflow",false).setCategory(DEBUGGING) | ||
| public static final SynthesisOption SHOW_CAUSAL_DATAFLOW = SynthesisOption.createCheckOption( | ||
| GeneralSynthesisOptions, "Causal Dataflow", false).setCategory(DEBUGGING) | ||
| /** | ||
| * Enables the structured programming mode on the client | ||
| */ | ||
| public static final SynthesisOption ENABLE_STRUCTURED_PROGRAMMING = SynthesisOption.createCheckOption( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess this is the only real change, the other ones are whitespace changes? |
||
| GeneralSynthesisOptions, "Structured Programming", true).setCategory(APPEARANCE) | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,6 +55,10 @@ import org.eclipse.elk.graph.properties.IProperty | |
| import org.eclipse.elk.graph.properties.Property | ||
|
|
||
| import static de.cau.cs.kieler.sccharts.ui.synthesis.GeneralSynthesisOptions.* | ||
| import de.cau.cs.kieler.klighd.filtering.SemanticFilterRule | ||
| import de.cau.cs.kieler.klighd.filtering.SemanticFilterTag | ||
| import de.cau.cs.kieler.klighd.KlighdOptions | ||
| import de.cau.cs.kieler.sccharts.ui.synthesis.filtering.SCChartsSemanticFilterRules | ||
|
|
||
| /** | ||
| * Main diagram synthesis for SCCharts. | ||
|
|
@@ -125,7 +129,8 @@ class SCChartsSynthesis extends AbstractDiagramSynthesis<SCCharts> { | |
| SHOW_METHOD_BODY, | ||
| SHOW_COMMENTS, | ||
| SHOW_USER_LABELS, | ||
| SHOW_CAUSAL_DATAFLOW | ||
| SHOW_CAUSAL_DATAFLOW, | ||
| ENABLE_STRUCTURED_PROGRAMMING | ||
| ) | ||
|
|
||
| // Adaptive Zoom | ||
|
|
@@ -167,6 +172,12 @@ class SCChartsSynthesis extends AbstractDiagramSynthesis<SCCharts> { | |
| } else sccharts | ||
|
|
||
| val rootNode = createNode | ||
|
|
||
| // Set semantic filter rules | ||
| val rules = SCChartsSemanticFilterRules.fields.map[ | ||
| get(null) as SemanticFilterRule | ||
| ] | ||
| rootNode.setLayoutOption(KlighdOptions.SEMANTIC_FILTER_RULES, rules) | ||
|
|
||
| // If dot is used draw edges first to prevent overlapping with states when layout is bad | ||
| usedContext.setProperty(KlighdProperties.EDGES_FIRST, !USE_KLAY.booleanValue) | ||
|
|
@@ -187,7 +198,12 @@ class SCChartsSynthesis extends AbstractDiagramSynthesis<SCCharts> { | |
| if (scc.hasPragma(PRAGMA_SKINPATH)) { | ||
| setSkinPath(scc.getStringPragmas(PRAGMA_SKINPATH).head.values.head, usedContext) | ||
| } | ||
|
|
||
|
|
||
| //Enables or disables the display of the contextmenu on the client. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Space after // |
||
| //We want this on the server since not all languages are suported and the contextmenu should only be generated if there is a server implementation for it | ||
| rootNode.setProperty(KlighdProperties.SHOW_STRUCTURED_EDITING_MENU, ENABLE_STRUCTURED_PROGRAMMING.booleanValue) | ||
|
|
||
|
|
||
| if (SHOW_ALL_SCCHARTS.booleanValue) { | ||
| val rootStateNodes = <State, KNode> newHashMap | ||
| val rootStates = newLinkedHashSet | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be empty. I guess this is in here because you want to use a service interface?