diff --git a/.gitignore b/.gitignore index 93afadc..a58073b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -/target/ +target/ .git-versioned-pom.xml xslt .konveyor diff --git a/inez.model.tests/.eclipse-pmd b/inez.model.tests/.eclipse-pmd new file mode 100644 index 0000000..5324655 --- /dev/null +++ b/inez.model.tests/.eclipse-pmd @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/inez.model.tests/.gitignore b/inez.model.tests/.gitignore deleted file mode 100644 index b83d222..0000000 --- a/inez.model.tests/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target/ diff --git a/inez.model.tests/.project b/inez.model.tests/.project index 2ce9497..a5c1cc5 100644 --- a/inez.model.tests/.project +++ b/inez.model.tests/.project @@ -25,10 +25,16 @@ + + ch.acanda.eclipse.pmd.builder.PMDBuilder + + + org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature org.eclipse.m2e.core.maven2Nature + ch.acanda.eclipse.pmd.builder.PMDNature diff --git a/inez.model.tests/build.properties b/inez.model.tests/build.properties index 5fc538b..b9d25ac 100644 --- a/inez.model.tests/build.properties +++ b/inez.model.tests/build.properties @@ -1,4 +1,4 @@ -source.. = src/main/java/ +source.. = src/main/java/,src/main/resources output.. = target/classes/ bin.includes = META-INF/,\ . diff --git a/inez.model.tests/src/main/java/io/github/magwas/inez/element/BridiElementEndToEndTest.java b/inez.model.tests/src/main/java/io/github/magwas/inez/element/BridiElementEndToEndTest.java index 3f57895..e25ee05 100644 --- a/inez.model.tests/src/main/java/io/github/magwas/inez/element/BridiElementEndToEndTest.java +++ b/inez.model.tests/src/main/java/io/github/magwas/inez/element/BridiElementEndToEndTest.java @@ -4,7 +4,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.IOException; -import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; @@ -79,19 +78,6 @@ void test() throws IOException { assertTrue(element.isInstance(THING_ID)); } - private List ancestry(String x) { - if (x == null) - return List.of(""); - if (x.equals(THING_ID)) - return List.of(THING_ID); - if (x.equals(ROOT_ID)) - return List.of(ROOT_ID); - BridiElement element = bridiElementFactory.apply(x); - List ancestry = new ArrayList<>(ancestry(element.getParent().id)); - ancestry.add(0, x); - return ancestry; - } - private String loadResourceAsString(String definitionName) throws IOException { ClassLoader classloader = Thread.currentThread().getContextClassLoader(); diff --git a/inez.model.tests/src/main/java/io/github/magwas/inez/element/CreateBridiElementServiceTest.java b/inez.model.tests/src/main/java/io/github/magwas/inez/element/CreateBridiElementServiceTest.java index 608cef5..bb74c1c 100644 --- a/inez.model.tests/src/main/java/io/github/magwas/inez/element/CreateBridiElementServiceTest.java +++ b/inez.model.tests/src/main/java/io/github/magwas/inez/element/CreateBridiElementServiceTest.java @@ -29,7 +29,8 @@ public class CreateBridiElementServiceTest extends TestBase @Override public void setUp() { super.setUp(); - element = createBridiElement.apply(MY_MODEL_ID, HUMAN_ID, ALICE_REPR, null); + element = createBridiElement.apply(MY_MODEL_ID, HUMAN_ID, ALICE_REPR); + @SuppressWarnings("unchecked") ArgumentCaptor> argument = ArgumentCaptor.forClass(List.class); verify(createBridiElement.saveBridi).apply(argument.capture()); saved = argument.getValue(); @@ -94,6 +95,7 @@ void test5_1() { void test6() { createBridiElement.apply(MY_MODEL_ID, HUMAN_ID, ALICE_REPR, IS_A_ID, ALICE_ID, GOD_ID); + @SuppressWarnings("unchecked") ArgumentCaptor> argument = ArgumentCaptor.forClass(List.class); verify(createBridiElement.saveBridi, times(2)).apply(argument.capture()); List saved = argument.getValue(); diff --git a/inez.model.tests/src/main/java/io/github/magwas/inez/query/QueryProcessorEndToEndTest.java b/inez.model.tests/src/main/java/io/github/magwas/inez/query/QueryProcessorEndToEndTest.java index 01d804e..9f41096 100644 --- a/inez.model.tests/src/main/java/io/github/magwas/inez/query/QueryProcessorEndToEndTest.java +++ b/inez.model.tests/src/main/java/io/github/magwas/inez/query/QueryProcessorEndToEndTest.java @@ -36,17 +36,15 @@ class QueryProcessorEndToEndTest implements BridiTestData { @Autowired InezImpl inez; - @Autowired - SpringBootBundleActivator springBootBundleActivator; @BeforeEach - private void setUp() { - ServiceReference sr = mock(ServiceReference.class); + void setUp() { + ServiceReference sr = mock(ServiceReference.class); BundleContext ctx = mock(BundleContext.class); - when(ctx.getServiceReference("io.github.magwas.inez.functions.Save")) + when((ServiceReference)ctx.getServiceReference("io.github.magwas.inez.functions.Save")) .thenReturn(sr); when(ctx.getService(sr)).thenReturn(new Save()); - springBootBundleActivator.bundleContext = ctx; + SpringBootBundleActivator.bundleContext = ctx; inez.initialize(); } diff --git a/inez.model.tests/src/main/java/io/github/magwas/inez/storage/SaveBridiServiceStub.java b/inez.model.tests/src/main/java/io/github/magwas/inez/storage/SaveBridiServiceStub.java index 66d442e..0ea6cba 100644 --- a/inez.model.tests/src/main/java/io/github/magwas/inez/storage/SaveBridiServiceStub.java +++ b/inez.model.tests/src/main/java/io/github/magwas/inez/storage/SaveBridiServiceStub.java @@ -3,7 +3,7 @@ import static org.mockito.Mockito.mock; public class SaveBridiServiceStub { - private static SaveBridiService stub() { + static SaveBridiService stub() { SaveBridiService mock = mock(SaveBridiService.class); return mock; } diff --git a/inez.model/.eclipse-pmd b/inez.model/.eclipse-pmd index 2e196fe..5324655 100644 --- a/inez.model/.eclipse-pmd +++ b/inez.model/.eclipse-pmd @@ -2,7 +2,7 @@ - - + + \ No newline at end of file diff --git a/inez.model/.gitignore b/inez.model/.gitignore deleted file mode 100644 index 51510ec..0000000 --- a/inez.model/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/target/ -bin/ diff --git a/inez.model/build.properties b/inez.model/build.properties index 978ed08..7c101ac 100644 --- a/inez.model/build.properties +++ b/inez.model/build.properties @@ -1,5 +1,4 @@ bin.includes = META-INF/,\ - plugin.xml,\ . output.. = target/classes/ source.. = src/main/java diff --git a/inez.model/plugin.xml b/inez.model/plugin.xml deleted file mode 100644 index 5535690..0000000 --- a/inez.model/plugin.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/inez.model/src/main/java/io/github/magwas/inez/Main.java b/inez.model/src/main/java/io/github/magwas/inez/Main.java deleted file mode 100644 index b1f6391..0000000 --- a/inez.model/src/main/java/io/github/magwas/inez/Main.java +++ /dev/null @@ -1,18 +0,0 @@ -package io.github.magwas.inez; - -import java.io.IOException; - -import org.springframework.context.annotation.AnnotationConfigApplicationContext; - -import io.github.magwas.runtime.Config; - -public class Main { - public static void main(String[] args) throws IOException { - Thread.currentThread().setContextClassLoader(Main.class.getClassLoader()); - AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext( - Config.class); -// Inez.getInstance().create("{osgi} is a {bitch}") -// .forEach(x -> System.out.println(x)); - } - -} diff --git a/inez.model/src/main/java/io/github/magwas/inez/osgi/SpringBootBundleActivator.java b/inez.model/src/main/java/io/github/magwas/inez/osgi/SpringBootBundleActivator.java index 7b2f03c..c955163 100644 --- a/inez.model/src/main/java/io/github/magwas/inez/osgi/SpringBootBundleActivator.java +++ b/inez.model/src/main/java/io/github/magwas/inez/osgi/SpringBootBundleActivator.java @@ -15,10 +15,12 @@ import io.github.magwas.inez.Inez; import io.github.magwas.inez.InezImpl; import io.github.magwas.inez.query.BridiFunction; +import io.github.magwas.kodekonveyorannotations.Glue; @SpringBootApplication @EnableMapRepositories("io.github.magwas.inez.storage") @ComponentScan(basePackages = { "io.github.magwas" }) +@Glue public class SpringBootBundleActivator implements BundleActivator { public static BundleContext bundleContext; diff --git a/inez.parser.tests/.classpath b/inez.parser.tests/.classpath index 26c99ff..20af785 100644 --- a/inez.parser.tests/.classpath +++ b/inez.parser.tests/.classpath @@ -7,5 +7,5 @@ - + diff --git a/inez.parser.tests/.eclipse-pmd b/inez.parser.tests/.eclipse-pmd new file mode 100644 index 0000000..5324655 --- /dev/null +++ b/inez.parser.tests/.eclipse-pmd @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/inez.parser.tests/.gitignore b/inez.parser.tests/.gitignore deleted file mode 100644 index 0f63015..0000000 --- a/inez.parser.tests/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/target/ -/bin/ diff --git a/inez.parser.tests/.project b/inez.parser.tests/.project index 6344a26..bad35e8 100644 --- a/inez.parser.tests/.project +++ b/inez.parser.tests/.project @@ -25,10 +25,16 @@ + + ch.acanda.eclipse.pmd.builder.PMDBuilder + + + org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature org.eclipse.m2e.core.maven2Nature + ch.acanda.eclipse.pmd.builder.PMDNature diff --git a/inez.parser/.eclipse-pmd b/inez.parser/.eclipse-pmd index 9696c0b..5324655 100644 --- a/inez.parser/.eclipse-pmd +++ b/inez.parser/.eclipse-pmd @@ -1,8 +1,8 @@ - + - - + + \ No newline at end of file diff --git a/inez.parser/.gitignore b/inez.parser/.gitignore deleted file mode 100644 index b83d222..0000000 --- a/inez.parser/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target/ diff --git a/inez.parser/.project b/inez.parser/.project index 66e64b9..5eef9cf 100644 --- a/inez.parser/.project +++ b/inez.parser/.project @@ -25,10 +25,16 @@ + + ch.acanda.eclipse.pmd.builder.PMDBuilder + + + org.eclipse.jdt.core.javanature org.eclipse.m2e.core.maven2Nature org.eclipse.pde.PluginNature + ch.acanda.eclipse.pmd.builder.PMDNature diff --git a/inez.target/.gitignore b/inez.target/.gitignore deleted file mode 100644 index 2f7896d..0000000 --- a/inez.target/.gitignore +++ /dev/null @@ -1 +0,0 @@ -target/ diff --git a/inez.ui.product/.gitignore b/inez.ui.product/.gitignore deleted file mode 100644 index 4dc0091..0000000 --- a/inez.ui.product/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/target -/bin diff --git a/inez.ui.tests/.eclipse-pmd b/inez.ui.tests/.eclipse-pmd new file mode 100644 index 0000000..5324655 --- /dev/null +++ b/inez.ui.tests/.eclipse-pmd @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/inez.ui.tests/.gitignore b/inez.ui.tests/.gitignore deleted file mode 100644 index 09e3bc9..0000000 --- a/inez.ui.tests/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/bin/ -/target/ diff --git a/inez.ui.tests/.project b/inez.ui.tests/.project index b77c13b..976f5e1 100644 --- a/inez.ui.tests/.project +++ b/inez.ui.tests/.project @@ -25,10 +25,16 @@ + + ch.acanda.eclipse.pmd.builder.PMDBuilder + + + org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature org.eclipse.m2e.core.maven2Nature + ch.acanda.eclipse.pmd.builder.PMDNature diff --git a/inez.ui/.eclipse-pmd b/inez.ui/.eclipse-pmd new file mode 100644 index 0000000..5324655 --- /dev/null +++ b/inez.ui/.eclipse-pmd @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/inez.ui/.gitignore b/inez.ui/.gitignore deleted file mode 100644 index 4dc0091..0000000 --- a/inez.ui/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/target -/bin diff --git a/inez.ui/.project b/inez.ui/.project index cd182cd..b8972d1 100644 --- a/inez.ui/.project +++ b/inez.ui/.project @@ -25,10 +25,16 @@ + + ch.acanda.eclipse.pmd.builder.PMDBuilder + + + org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature org.eclipse.m2e.core.maven2Nature + ch.acanda.eclipse.pmd.builder.PMDNature diff --git a/inez.ui/build.properties b/inez.ui/build.properties index 2b0d95b..4eaea8e 100644 --- a/inez.ui/build.properties +++ b/inez.ui/build.properties @@ -1,5 +1,5 @@ source.. = src/ -output.. = bin/ +output.. = target/classes bin.includes = plugin.xml,\ META-INF/,\ . diff --git a/inez.ui/src/io/github/magwas/inez/ui/Application.java b/inez.ui/src/io/github/magwas/inez/ui/Application.java index f06f875..8b7b152 100644 --- a/inez.ui/src/io/github/magwas/inez/ui/Application.java +++ b/inez.ui/src/io/github/magwas/inez/ui/Application.java @@ -25,9 +25,9 @@ public Object start(IApplicationContext context) { int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor()); if (returnCode == PlatformUI.RETURN_RESTART) { - return IApplication.EXIT_RESTART; + return EXIT_RESTART; } - return IApplication.EXIT_OK; + return EXIT_OK; } finally { display.dispose(); } diff --git a/inez.ui/src/io/github/magwas/inez/ui/Perspective.java b/inez.ui/src/io/github/magwas/inez/ui/Perspective.java index 4b06d2d..11e43e6 100644 --- a/inez.ui/src/io/github/magwas/inez/ui/Perspective.java +++ b/inez.ui/src/io/github/magwas/inez/ui/Perspective.java @@ -51,16 +51,4 @@ public void createInitialLayout(IPageLayout layout) { } - private void addFolderLayouts(IPageLayout layout) { - // The declared order of these matters - folderLayoutLeftTop = layout.createFolder(LEFT_TOP, IPageLayout.LEFT, .23f, - IPageLayout.ID_EDITOR_AREA); - folderLayoutLeftBottom = layout.createFolder("Left bottom", - IPageLayout.BOTTOM, .6f, LEFT_TOP); - folderLayoutRight = layout.createPlaceholderFolder("right", - IPageLayout.RIGHT, .85f, IPageLayout.ID_EDITOR_AREA); - folderLayoutBottom = layout.createFolder("bottom", IPageLayout.BOTTOM, .7f, - IPageLayout.ID_EDITOR_AREA); - } - } diff --git a/inez.ui/src/io/github/magwas/inez/ui/mindmap/MindMapNode.java b/inez.ui/src/io/github/magwas/inez/ui/mindmap/MindMapNode.java index eb249fd..1110907 100644 --- a/inez.ui/src/io/github/magwas/inez/ui/mindmap/MindMapNode.java +++ b/inez.ui/src/io/github/magwas/inez/ui/mindmap/MindMapNode.java @@ -41,8 +41,8 @@ public class MindMapNode extends AbstractMindMapItem implements Serializable { */ private Rectangle bounds; - private List incomingConnections = new ArrayList(); - private List outgoingConnections = new ArrayList(); + private List incomingConnections = new ArrayList<>(); + private List outgoingConnections = new ArrayList<>(); public void addIncomingConnection(MindMapConnection conn) { incomingConnections.add(conn); @@ -90,19 +90,19 @@ public void removeOutgoingConnection(MindMapConnection conn) { public void setBounds(Rectangle bounds) { pcs.firePropertyChange(PROP_BOUNDS, this.bounds, - (this.bounds = bounds.getCopy())); + this.bounds = bounds.getCopy()); } public void setColor(Color color) { - pcs.firePropertyChange(PROP_COLOR, this.color, (this.color = color)); + pcs.firePropertyChange(PROP_COLOR, this.color, this.color = color); } public void setDescription(String description) { pcs.firePropertyChange(PROP_DESCRIPTION, this.description, - (this.description = description)); + this.description = description); } public void setTitle(String title) { - pcs.firePropertyChange(PROP_TITLE, this.title, (this.title = title)); + pcs.firePropertyChange(PROP_TITLE, this.title, this.title = title); } } \ No newline at end of file diff --git a/inez.ui/src/io/github/magwas/inez/ui/mindmap/visuals/ArrowHead.java b/inez.ui/src/io/github/magwas/inez/ui/mindmap/visuals/ArrowHead.java new file mode 100644 index 0000000..9da79af --- /dev/null +++ b/inez.ui/src/io/github/magwas/inez/ui/mindmap/visuals/ArrowHead.java @@ -0,0 +1,9 @@ +package io.github.magwas.inez.ui.mindmap.visuals; + +import javafx.scene.shape.Polygon; + +public class ArrowHead extends Polygon { + public ArrowHead() { + super(0, 0, 10, 3, 10, -3); + } +} \ No newline at end of file diff --git a/inez.ui/src/io/github/magwas/inez/ui/mindmap/visuals/MindMapConnectionVisual.java b/inez.ui/src/io/github/magwas/inez/ui/mindmap/visuals/MindMapConnectionVisual.java index d3d06ec..8e8e16c 100644 --- a/inez.ui/src/io/github/magwas/inez/ui/mindmap/visuals/MindMapConnectionVisual.java +++ b/inez.ui/src/io/github/magwas/inez/ui/mindmap/visuals/MindMapConnectionVisual.java @@ -3,16 +3,9 @@ import org.eclipse.gef.fx.nodes.Connection; import javafx.scene.paint.Color; -import javafx.scene.shape.Polygon; public class MindMapConnectionVisual extends Connection { - public static class ArrowHead extends Polygon { - public ArrowHead() { - super(0, 0, 10, 3, 10, -3); - } - } - public MindMapConnectionVisual() { ArrowHead endDecoration = new ArrowHead(); endDecoration.setFill(Color.BLACK); diff --git a/inez.ui/src/io/github/magwas/inez/ui/tree/NewDiagramAction.java b/inez.ui/src/io/github/magwas/inez/ui/tree/NewDiagramAction.java index b8095e2..d37c79c 100644 --- a/inez.ui/src/io/github/magwas/inez/ui/tree/NewDiagramAction.java +++ b/inez.ui/src/io/github/magwas/inez/ui/tree/NewDiagramAction.java @@ -2,7 +2,6 @@ import org.eclipse.jface.action.Action; import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.PartInitException; @@ -45,9 +44,8 @@ public void run() { IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow() .getActivePage(); MyEditorInput input = new MyEditorInput(model); - IEditorPart editor; try { - editor = page.openEditor(input, ModelEditorView.ID); + page.openEditor(input, ModelEditorView.ID); } catch (PartInitException e) { throw new Error(e); } diff --git a/pom.xml b/pom.xml index 7eaf52b..856baa8 100644 --- a/pom.xml +++ b/pom.xml @@ -11,6 +11,7 @@ 0.4.1 JavaSE-21 + ignore inez