From 052c4f704ea286f8db1db3a7b055c9447369c0c2 Mon Sep 17 00:00:00 2001 From: Fabian Stemmler Date: Wed, 17 Jul 2019 12:42:12 +0200 Subject: [PATCH] Fixed issues with WirePointHandle - fixed issue with adding WPHs - fixed issue with removing WPHs - updated .json files in components --- .../components/GUI_rsLatch.json | 4 ++-- .../components/GUIand.json | 4 ++-- .../components/GUIand41.json | 4 ++-- .../components/GUIandor414.json | 4 ++-- .../components/GUIdemux2.json | 4 ++-- .../components/GUIdff.json | 4 ++-- .../components/GUIdlatch.json | 4 ++-- .../components/GUIdlatch4.json | 4 ++-- .../components/GUIfulladder.json | 4 ++-- .../components/GUIhalfadder.json | 4 ++-- .../components/GUImux1.json | 4 ++-- .../components/GUImux1_4.json | 4 ++-- .../components/GUInand3.json | 4 ++-- .../components/GUInot4.json | 4 ++-- .../components/GUIor4.json | 4 ++-- .../components/GUIor_4.json | 4 ++-- .../components/GUIram2.json | 4 ++-- .../components/GUIram4.json | 4 ++-- .../components/GUIsel2_4.json | 4 ++-- .../components/GUIsel3_4.json | 4 ++-- .../components/GUIxor.json | 4 ++-- .../components/am2901/GUIAm2901.json | 4 ++-- .../components/am2901/GUIAm2901ALUFuncDecode.json | 4 ++-- .../components/am2901/GUIAm2901ALUInclDecode.json | 4 ++-- ...2901ALUInclSourceDecodeInclFunctionDecode.json | 4 ++-- .../components/am2901/GUIAm2901ALUOneBit.json | 4 ++-- .../components/am2901/GUIAm2901DestDecode.json | 4 ++-- .../components/am2901/GUIAm2901QReg.json | 4 ++-- .../components/am2901/GUIAm2901SourceDecode.json | 4 ++-- .../logic/model/editor/handles/HandleManager.java | 15 +++++++++------ .../model/editor/handles/WirePointHandle.java | 1 + .../logic/model/editor/ui/EditorCanvas.java | 12 ++++++++++-- .../mograsim/logic/model/model/wires/GUIWire.java | 4 ++++ 33 files changed, 82 insertions(+), 66 deletions(-) diff --git a/net.mograsim.logic.model.editor/components/GUI_rsLatch.json b/net.mograsim.logic.model.editor/components/GUI_rsLatch.json index a91b8159..1e846c44 100644 --- a/net.mograsim.logic.model.editor/components/GUI_rsLatch.json +++ b/net.mograsim.logic.model.editor/components/GUI_rsLatch.json @@ -211,11 +211,11 @@ mograsim version: 0.1.3 } ] }, - "symbolRendererSnippetID": "SimpleRectangularLikeSymbolRenderer", + "symbolRendererSnippetID": "simpleRectangularLike", "symbolRendererParams": { "centerText": "_rsLatch", - "horizontalComponentCenter": 17.5, "centerTextHeight": 5.0, + "horizontalComponentCenter": 17.5, "pinLabelHeight": 3.5, "pinLabelMargin": 0.5 } diff --git a/net.mograsim.logic.model.editor/components/GUIand.json b/net.mograsim.logic.model.editor/components/GUIand.json index 58772918..c19d8f99 100644 --- a/net.mograsim.logic.model.editor/components/GUIand.json +++ b/net.mograsim.logic.model.editor/components/GUIand.json @@ -135,11 +135,11 @@ mograsim version: 0.1.3 } ] }, - "symbolRendererSnippetID": "SimpleRectangularLikeSymbolRenderer", + "symbolRendererSnippetID": "simpleRectangularLike", "symbolRendererParams": { "centerText": "GUIand", - "horizontalComponentCenter": 17.5, "centerTextHeight": 5.0, + "horizontalComponentCenter": 17.5, "pinLabelHeight": 3.5, "pinLabelMargin": 0.5 } diff --git a/net.mograsim.logic.model.editor/components/GUIand41.json b/net.mograsim.logic.model.editor/components/GUIand41.json index 973a4c9d..98ebfa1c 100644 --- a/net.mograsim.logic.model.editor/components/GUIand41.json +++ b/net.mograsim.logic.model.editor/components/GUIand41.json @@ -317,11 +317,11 @@ mograsim version: 0.1.3 } ] }, - "symbolRendererSnippetID": "SimpleRectangularLikeSymbolRenderer", + "symbolRendererSnippetID": "simpleRectangularLike", "symbolRendererParams": { "centerText": "GUIand41", - "horizontalComponentCenter": 17.5, "centerTextHeight": 5.0, + "horizontalComponentCenter": 17.5, "pinLabelHeight": 3.5, "pinLabelMargin": 0.5 } diff --git a/net.mograsim.logic.model.editor/components/GUIandor414.json b/net.mograsim.logic.model.editor/components/GUIandor414.json index 5cadf0f6..3042690a 100644 --- a/net.mograsim.logic.model.editor/components/GUIandor414.json +++ b/net.mograsim.logic.model.editor/components/GUIandor414.json @@ -476,11 +476,11 @@ mograsim version: 0.1.3 } ] }, - "symbolRendererSnippetID": "SimpleRectangularLikeSymbolRenderer", + "symbolRendererSnippetID": "simpleRectangularLike", "symbolRendererParams": { "centerText": "GUIandor414", - "horizontalComponentCenter": 17.5, "centerTextHeight": 5.0, + "horizontalComponentCenter": 17.5, "pinLabelHeight": 3.5, "pinLabelMargin": 0.5 } diff --git a/net.mograsim.logic.model.editor/components/GUIdemux2.json b/net.mograsim.logic.model.editor/components/GUIdemux2.json index 5ded84b7..29440a25 100644 --- a/net.mograsim.logic.model.editor/components/GUIdemux2.json +++ b/net.mograsim.logic.model.editor/components/GUIdemux2.json @@ -500,11 +500,11 @@ mograsim version: 0.1.3 } ] }, - "symbolRendererSnippetID": "SimpleRectangularLikeSymbolRenderer", + "symbolRendererSnippetID": "simpleRectangularLike", "symbolRendererParams": { "centerText": "GUIdemux2", - "horizontalComponentCenter": 17.5, "centerTextHeight": 5.0, + "horizontalComponentCenter": 17.5, "pinLabelHeight": 3.5, "pinLabelMargin": 0.5 } diff --git a/net.mograsim.logic.model.editor/components/GUIdff.json b/net.mograsim.logic.model.editor/components/GUIdff.json index 55151f8b..80794eec 100644 --- a/net.mograsim.logic.model.editor/components/GUIdff.json +++ b/net.mograsim.logic.model.editor/components/GUIdff.json @@ -317,11 +317,11 @@ mograsim version: 0.1.3 } ] }, - "symbolRendererSnippetID": "SimpleRectangularLikeSymbolRenderer", + "symbolRendererSnippetID": "simpleRectangularLike", "symbolRendererParams": { "centerText": "GUIdff", - "horizontalComponentCenter": 17.5, "centerTextHeight": 5.0, + "horizontalComponentCenter": 17.5, "pinLabelHeight": 3.5, "pinLabelMargin": 0.5 } diff --git a/net.mograsim.logic.model.editor/components/GUIdlatch.json b/net.mograsim.logic.model.editor/components/GUIdlatch.json index 69562cea..d83cc99b 100644 --- a/net.mograsim.logic.model.editor/components/GUIdlatch.json +++ b/net.mograsim.logic.model.editor/components/GUIdlatch.json @@ -227,11 +227,11 @@ mograsim version: 0.1.3 } ] }, - "symbolRendererSnippetID": "SimpleRectangularLikeSymbolRenderer", + "symbolRendererSnippetID": "simpleRectangularLike", "symbolRendererParams": { "centerText": "GUIdlatch", - "horizontalComponentCenter": 17.5, "centerTextHeight": 5.0, + "horizontalComponentCenter": 17.5, "pinLabelHeight": 3.5, "pinLabelMargin": 0.5 } diff --git a/net.mograsim.logic.model.editor/components/GUIdlatch4.json b/net.mograsim.logic.model.editor/components/GUIdlatch4.json index 29f4ac0f..c42e6d08 100644 --- a/net.mograsim.logic.model.editor/components/GUIdlatch4.json +++ b/net.mograsim.logic.model.editor/components/GUIdlatch4.json @@ -317,11 +317,11 @@ mograsim version: 0.1.3 } ] }, - "symbolRendererSnippetID": "SimpleRectangularLikeSymbolRenderer", + "symbolRendererSnippetID": "simpleRectangularLike", "symbolRendererParams": { "centerText": "GUIdlatch4", - "horizontalComponentCenter": 17.5, "centerTextHeight": 5.0, + "horizontalComponentCenter": 17.5, "pinLabelHeight": 3.5, "pinLabelMargin": 0.5 } diff --git a/net.mograsim.logic.model.editor/components/GUIfulladder.json b/net.mograsim.logic.model.editor/components/GUIfulladder.json index dc4c6162..c523394d 100644 --- a/net.mograsim.logic.model.editor/components/GUIfulladder.json +++ b/net.mograsim.logic.model.editor/components/GUIfulladder.json @@ -177,11 +177,11 @@ mograsim version: 0.1.3 } ] }, - "symbolRendererSnippetID": "SimpleRectangularLikeSymbolRenderer", + "symbolRendererSnippetID": "simpleRectangularLike", "symbolRendererParams": { "centerText": "GUIfulladder", - "horizontalComponentCenter": 17.5, "centerTextHeight": 5.0, + "horizontalComponentCenter": 17.5, "pinLabelHeight": 3.5, "pinLabelMargin": 0.5 } diff --git a/net.mograsim.logic.model.editor/components/GUIhalfadder.json b/net.mograsim.logic.model.editor/components/GUIhalfadder.json index 761d6ce1..dd070eaa 100644 --- a/net.mograsim.logic.model.editor/components/GUIhalfadder.json +++ b/net.mograsim.logic.model.editor/components/GUIhalfadder.json @@ -306,11 +306,11 @@ mograsim version: 0.1.3 } ] }, - "symbolRendererSnippetID": "SimpleRectangularLikeSymbolRenderer", + "symbolRendererSnippetID": "simpleRectangularLike", "symbolRendererParams": { "centerText": "GUIhalfadder", - "horizontalComponentCenter": 17.5, "centerTextHeight": 5.0, + "horizontalComponentCenter": 17.5, "pinLabelHeight": 3.5, "pinLabelMargin": 0.5 } diff --git a/net.mograsim.logic.model.editor/components/GUImux1.json b/net.mograsim.logic.model.editor/components/GUImux1.json index 7ce90023..60b22cde 100644 --- a/net.mograsim.logic.model.editor/components/GUImux1.json +++ b/net.mograsim.logic.model.editor/components/GUImux1.json @@ -219,11 +219,11 @@ mograsim version: 0.1.3 } ] }, - "symbolRendererSnippetID": "SimpleRectangularLikeSymbolRenderer", + "symbolRendererSnippetID": "simpleRectangularLike", "symbolRendererParams": { "centerText": "GUImux1", - "horizontalComponentCenter": 17.5, "centerTextHeight": 5.0, + "horizontalComponentCenter": 17.5, "pinLabelHeight": 3.5, "pinLabelMargin": 0.5 } diff --git a/net.mograsim.logic.model.editor/components/GUImux1_4.json b/net.mograsim.logic.model.editor/components/GUImux1_4.json index 21e2f213..7689ec72 100644 --- a/net.mograsim.logic.model.editor/components/GUImux1_4.json +++ b/net.mograsim.logic.model.editor/components/GUImux1_4.json @@ -457,11 +457,11 @@ mograsim version: 0.1.3 } ] }, - "symbolRendererSnippetID": "SimpleRectangularLikeSymbolRenderer", + "symbolRendererSnippetID": "simpleRectangularLike", "symbolRendererParams": { "centerText": "GUImux1_4", - "horizontalComponentCenter": 17.5, "centerTextHeight": 5.0, + "horizontalComponentCenter": 17.5, "pinLabelHeight": 3.5, "pinLabelMargin": 0.5 } diff --git a/net.mograsim.logic.model.editor/components/GUInand3.json b/net.mograsim.logic.model.editor/components/GUInand3.json index b3a6300f..f9fbb80b 100644 --- a/net.mograsim.logic.model.editor/components/GUInand3.json +++ b/net.mograsim.logic.model.editor/components/GUInand3.json @@ -193,11 +193,11 @@ mograsim version: 0.1.3 } ] }, - "symbolRendererSnippetID": "SimpleRectangularLikeSymbolRenderer", + "symbolRendererSnippetID": "simpleRectangularLike", "symbolRendererParams": { "centerText": "GUInand3", - "horizontalComponentCenter": 17.5, "centerTextHeight": 5.0, + "horizontalComponentCenter": 17.5, "pinLabelHeight": 3.5, "pinLabelMargin": 0.5 } diff --git a/net.mograsim.logic.model.editor/components/GUInot4.json b/net.mograsim.logic.model.editor/components/GUInot4.json index 7d575c84..98f4cbe8 100644 --- a/net.mograsim.logic.model.editor/components/GUInot4.json +++ b/net.mograsim.logic.model.editor/components/GUInot4.json @@ -363,11 +363,11 @@ mograsim version: 0.1.3 } ] }, - "symbolRendererSnippetID": "SimpleRectangularLikeSymbolRenderer", + "symbolRendererSnippetID": "simpleRectangularLike", "symbolRendererParams": { "centerText": "GUInot4", - "horizontalComponentCenter": 17.5, "centerTextHeight": 5.0, + "horizontalComponentCenter": 17.5, "pinLabelHeight": 3.5, "pinLabelMargin": 0.5 } diff --git a/net.mograsim.logic.model.editor/components/GUIor4.json b/net.mograsim.logic.model.editor/components/GUIor4.json index d4bcd579..47755a32 100644 --- a/net.mograsim.logic.model.editor/components/GUIor4.json +++ b/net.mograsim.logic.model.editor/components/GUIor4.json @@ -514,11 +514,11 @@ mograsim version: 0.1.3 } ] }, - "symbolRendererSnippetID": "SimpleRectangularLikeSymbolRenderer", + "symbolRendererSnippetID": "simpleRectangularLike", "symbolRendererParams": { "centerText": "GUIor4", - "horizontalComponentCenter": 17.5, "centerTextHeight": 5.0, + "horizontalComponentCenter": 17.5, "pinLabelHeight": 3.5, "pinLabelMargin": 0.5 } diff --git a/net.mograsim.logic.model.editor/components/GUIor_4.json b/net.mograsim.logic.model.editor/components/GUIor_4.json index 86b44135..0e886905 100644 --- a/net.mograsim.logic.model.editor/components/GUIor_4.json +++ b/net.mograsim.logic.model.editor/components/GUIor_4.json @@ -835,11 +835,11 @@ mograsim version: 0.1.3 } ] }, - "symbolRendererSnippetID": "SimpleRectangularLikeSymbolRenderer", + "symbolRendererSnippetID": "simpleRectangularLike", "symbolRendererParams": { "centerText": "GUIor_4", - "horizontalComponentCenter": 17.5, "centerTextHeight": 5.0, + "horizontalComponentCenter": 17.5, "pinLabelHeight": 3.5, "pinLabelMargin": 0.5 } diff --git a/net.mograsim.logic.model.editor/components/GUIram2.json b/net.mograsim.logic.model.editor/components/GUIram2.json index 3cb8583f..a3e9e765 100644 --- a/net.mograsim.logic.model.editor/components/GUIram2.json +++ b/net.mograsim.logic.model.editor/components/GUIram2.json @@ -2818,11 +2818,11 @@ mograsim version: 0.1.3 } ] }, - "symbolRendererSnippetID": "SimpleRectangularLikeSymbolRenderer", + "symbolRendererSnippetID": "simpleRectangularLike", "symbolRendererParams": { "centerText": "GUIram2", - "horizontalComponentCenter": 17.5, "centerTextHeight": 5.0, + "horizontalComponentCenter": 17.5, "pinLabelHeight": 3.5, "pinLabelMargin": 0.5 } diff --git a/net.mograsim.logic.model.editor/components/GUIram4.json b/net.mograsim.logic.model.editor/components/GUIram4.json index 99f606dd..d6d7ea80 100644 --- a/net.mograsim.logic.model.editor/components/GUIram4.json +++ b/net.mograsim.logic.model.editor/components/GUIram4.json @@ -3186,11 +3186,11 @@ mograsim version: 0.1.3 } ] }, - "symbolRendererSnippetID": "SimpleRectangularLikeSymbolRenderer", + "symbolRendererSnippetID": "simpleRectangularLike", "symbolRendererParams": { "centerText": "GUIram4", - "horizontalComponentCenter": 17.5, "centerTextHeight": 5.0, + "horizontalComponentCenter": 17.5, "pinLabelHeight": 3.5, "pinLabelMargin": 0.5 } diff --git a/net.mograsim.logic.model.editor/components/GUIsel2_4.json b/net.mograsim.logic.model.editor/components/GUIsel2_4.json index 219e1b9d..099fb5fe 100644 --- a/net.mograsim.logic.model.editor/components/GUIsel2_4.json +++ b/net.mograsim.logic.model.editor/components/GUIsel2_4.json @@ -801,11 +801,11 @@ mograsim version: 0.1.3 } ] }, - "symbolRendererSnippetID": "SimpleRectangularLikeSymbolRenderer", + "symbolRendererSnippetID": "simpleRectangularLike", "symbolRendererParams": { "centerText": "GUIsel2_4", - "horizontalComponentCenter": 17.5, "centerTextHeight": 5.0, + "horizontalComponentCenter": 17.5, "pinLabelHeight": 3.5, "pinLabelMargin": 0.5 } diff --git a/net.mograsim.logic.model.editor/components/GUIsel3_4.json b/net.mograsim.logic.model.editor/components/GUIsel3_4.json index 1cae789a..c85cf053 100644 --- a/net.mograsim.logic.model.editor/components/GUIsel3_4.json +++ b/net.mograsim.logic.model.editor/components/GUIsel3_4.json @@ -867,11 +867,11 @@ mograsim version: 0.1.3 } ] }, - "symbolRendererSnippetID": "SimpleRectangularLikeSymbolRenderer", + "symbolRendererSnippetID": "simpleRectangularLike", "symbolRendererParams": { "centerText": "GUIsel3_4", - "horizontalComponentCenter": 17.5, "centerTextHeight": 5.0, + "horizontalComponentCenter": 17.5, "pinLabelHeight": 3.5, "pinLabelMargin": 0.5 } diff --git a/net.mograsim.logic.model.editor/components/GUIxor.json b/net.mograsim.logic.model.editor/components/GUIxor.json index 9e3ec592..d4e28ed2 100644 --- a/net.mograsim.logic.model.editor/components/GUIxor.json +++ b/net.mograsim.logic.model.editor/components/GUIxor.json @@ -256,11 +256,11 @@ mograsim version: 0.1.3 } ] }, - "symbolRendererSnippetID": "SimpleRectangularLikeSymbolRenderer", + "symbolRendererSnippetID": "simpleRectangularLike", "symbolRendererParams": { "centerText": "GUIxor", - "horizontalComponentCenter": 17.5, "centerTextHeight": 5.0, + "horizontalComponentCenter": 17.5, "pinLabelHeight": 3.5, "pinLabelMargin": 0.5 } diff --git a/net.mograsim.logic.model.editor/components/am2901/GUIAm2901.json b/net.mograsim.logic.model.editor/components/am2901/GUIAm2901.json index 7563d838..b40848d1 100644 --- a/net.mograsim.logic.model.editor/components/am2901/GUIAm2901.json +++ b/net.mograsim.logic.model.editor/components/am2901/GUIAm2901.json @@ -3234,11 +3234,11 @@ mograsim version: 0.1.3 } ] }, - "symbolRendererSnippetID": "SimpleRectangularLikeSymbolRenderer", + "symbolRendererSnippetID": "simpleRectangularLike", "symbolRendererParams": { "centerText": "GUIAm2901", - "horizontalComponentCenter": 17.5, "centerTextHeight": 5.0, + "horizontalComponentCenter": 17.5, "pinLabelHeight": 3.5, "pinLabelMargin": 0.5 } diff --git a/net.mograsim.logic.model.editor/components/am2901/GUIAm2901ALUFuncDecode.json b/net.mograsim.logic.model.editor/components/am2901/GUIAm2901ALUFuncDecode.json index a24476b3..b9c44929 100644 --- a/net.mograsim.logic.model.editor/components/am2901/GUIAm2901ALUFuncDecode.json +++ b/net.mograsim.logic.model.editor/components/am2901/GUIAm2901ALUFuncDecode.json @@ -670,11 +670,11 @@ mograsim version: 0.1.3 } ] }, - "symbolRendererSnippetID": "SimpleRectangularLikeSymbolRenderer", + "symbolRendererSnippetID": "simpleRectangularLike", "symbolRendererParams": { "centerText": "GUIAm2901ALUFuncDecode", - "horizontalComponentCenter": 17.5, "centerTextHeight": 5.0, + "horizontalComponentCenter": 17.5, "pinLabelHeight": 3.5, "pinLabelMargin": 0.5 } diff --git a/net.mograsim.logic.model.editor/components/am2901/GUIAm2901ALUInclDecode.json b/net.mograsim.logic.model.editor/components/am2901/GUIAm2901ALUInclDecode.json index 62d78f1e..ee540ec5 100644 --- a/net.mograsim.logic.model.editor/components/am2901/GUIAm2901ALUInclDecode.json +++ b/net.mograsim.logic.model.editor/components/am2901/GUIAm2901ALUInclDecode.json @@ -1442,11 +1442,11 @@ mograsim version: 0.1.3 } ] }, - "symbolRendererSnippetID": "SimpleRectangularLikeSymbolRenderer", + "symbolRendererSnippetID": "simpleRectangularLike", "symbolRendererParams": { "centerText": "GUIAm2901ALUInclDecode", - "horizontalComponentCenter": 17.5, "centerTextHeight": 5.0, + "horizontalComponentCenter": 17.5, "pinLabelHeight": 3.5, "pinLabelMargin": 0.5 } diff --git a/net.mograsim.logic.model.editor/components/am2901/GUIAm2901ALUInclSourceDecodeInclFunctionDecode.json b/net.mograsim.logic.model.editor/components/am2901/GUIAm2901ALUInclSourceDecodeInclFunctionDecode.json index 75c63dd1..5e9bea03 100644 --- a/net.mograsim.logic.model.editor/components/am2901/GUIAm2901ALUInclSourceDecodeInclFunctionDecode.json +++ b/net.mograsim.logic.model.editor/components/am2901/GUIAm2901ALUInclSourceDecodeInclFunctionDecode.json @@ -1302,11 +1302,11 @@ mograsim version: 0.1.3 } ] }, - "symbolRendererSnippetID": "SimpleRectangularLikeSymbolRenderer", + "symbolRendererSnippetID": "simpleRectangularLike", "symbolRendererParams": { "centerText": "GUIAm2901ALUInclSourceDecodeInclFunctionDecode", - "horizontalComponentCenter": 17.5, "centerTextHeight": 5.0, + "horizontalComponentCenter": 17.5, "pinLabelHeight": 3.5, "pinLabelMargin": 0.5 } diff --git a/net.mograsim.logic.model.editor/components/am2901/GUIAm2901ALUOneBit.json b/net.mograsim.logic.model.editor/components/am2901/GUIAm2901ALUOneBit.json index b6b05e1d..1dffc507 100644 --- a/net.mograsim.logic.model.editor/components/am2901/GUIAm2901ALUOneBit.json +++ b/net.mograsim.logic.model.editor/components/am2901/GUIAm2901ALUOneBit.json @@ -510,11 +510,11 @@ mograsim version: 0.1.3 } ] }, - "symbolRendererSnippetID": "SimpleRectangularLikeSymbolRenderer", + "symbolRendererSnippetID": "simpleRectangularLike", "symbolRendererParams": { "centerText": "GUIAm2901ALUOneBit", - "horizontalComponentCenter": 17.5, "centerTextHeight": 5.0, + "horizontalComponentCenter": 17.5, "pinLabelHeight": 3.5, "pinLabelMargin": 0.5 } diff --git a/net.mograsim.logic.model.editor/components/am2901/GUIAm2901DestDecode.json b/net.mograsim.logic.model.editor/components/am2901/GUIAm2901DestDecode.json index d80d0806..3a755747 100644 --- a/net.mograsim.logic.model.editor/components/am2901/GUIAm2901DestDecode.json +++ b/net.mograsim.logic.model.editor/components/am2901/GUIAm2901DestDecode.json @@ -1024,11 +1024,11 @@ mograsim version: 0.1.3 } ] }, - "symbolRendererSnippetID": "SimpleRectangularLikeSymbolRenderer", + "symbolRendererSnippetID": "simpleRectangularLike", "symbolRendererParams": { "centerText": "GUIAm2901DestDecode", - "horizontalComponentCenter": 17.5, "centerTextHeight": 5.0, + "horizontalComponentCenter": 17.5, "pinLabelHeight": 3.5, "pinLabelMargin": 0.5 } diff --git a/net.mograsim.logic.model.editor/components/am2901/GUIAm2901QReg.json b/net.mograsim.logic.model.editor/components/am2901/GUIAm2901QReg.json index 6af804d7..ec0983e8 100644 --- a/net.mograsim.logic.model.editor/components/am2901/GUIAm2901QReg.json +++ b/net.mograsim.logic.model.editor/components/am2901/GUIAm2901QReg.json @@ -397,11 +397,11 @@ mograsim version: 0.1.3 } ] }, - "symbolRendererSnippetID": "SimpleRectangularLikeSymbolRenderer", + "symbolRendererSnippetID": "simpleRectangularLike", "symbolRendererParams": { "centerText": "GUIAm2901QReg", - "horizontalComponentCenter": 17.5, "centerTextHeight": 5.0, + "horizontalComponentCenter": 17.5, "pinLabelHeight": 3.5, "pinLabelMargin": 0.5 } diff --git a/net.mograsim.logic.model.editor/components/am2901/GUIAm2901SourceDecode.json b/net.mograsim.logic.model.editor/components/am2901/GUIAm2901SourceDecode.json index e36193d9..a995649e 100644 --- a/net.mograsim.logic.model.editor/components/am2901/GUIAm2901SourceDecode.json +++ b/net.mograsim.logic.model.editor/components/am2901/GUIAm2901SourceDecode.json @@ -1065,11 +1065,11 @@ mograsim version: 0.1.3 } ] }, - "symbolRendererSnippetID": "SimpleRectangularLikeSymbolRenderer", + "symbolRendererSnippetID": "simpleRectangularLike", "symbolRendererParams": { "centerText": "Am2901SourceDecode", - "horizontalComponentCenter": 17.5, "centerTextHeight": 5.0, + "horizontalComponentCenter": 17.5, "pinLabelHeight": 3.5, "pinLabelMargin": 0.5 } diff --git a/net.mograsim.logic.model.editor/src/net/mograsim/logic/model/editor/handles/HandleManager.java b/net.mograsim.logic.model.editor/src/net/mograsim/logic/model/editor/handles/HandleManager.java index 7e231607..ee755f92 100644 --- a/net.mograsim.logic.model.editor/src/net/mograsim/logic/model/editor/handles/HandleManager.java +++ b/net.mograsim.logic.model.editor/src/net/mograsim/logic/model/editor/handles/HandleManager.java @@ -121,7 +121,7 @@ public class HandleManager { Point[] newPath = w.getPath(); int newLength = newPath == null ? 0 : newPath.length; - int diff = oldLength.getAndSet(newLength) - newLength; + int diff = newLength - oldLength.getAndSet(newLength); if (diff != 0) { if (diff > 0) @@ -216,11 +216,14 @@ public class HandleManager void destroyWirePointHandle(GUIWire owner, WirePointHandle h) { - List handles = pointHandlesPerWire.get(owner); - int pointIndex = handles.indexOf(h); - handles.remove(pointIndex); - removeHandle(h); - owner.removePathPoint(pointIndex); + if (pointHandlesPerWire.containsKey(owner)) + { + List handles = pointHandlesPerWire.get(owner); + int pointIndex = handles.indexOf(h); + handles.remove(pointIndex); + removeHandle(h); + owner.removePathPoint(pointIndex); + } } private void removeWirePointHandles(GUIWire owner) diff --git a/net.mograsim.logic.model.editor/src/net/mograsim/logic/model/editor/handles/WirePointHandle.java b/net.mograsim.logic.model.editor/src/net/mograsim/logic/model/editor/handles/WirePointHandle.java index 8fd0acd2..48c7c227 100644 --- a/net.mograsim.logic.model.editor/src/net/mograsim/logic/model/editor/handles/WirePointHandle.java +++ b/net.mograsim.logic.model.editor/src/net/mograsim/logic/model/editor/handles/WirePointHandle.java @@ -32,6 +32,7 @@ public class WirePointHandle extends Handle { Point p = parent.getPathPoint(pointIndex); moveTo(p.x, p.y); + callRedrawListeners(); } @Override diff --git a/net.mograsim.logic.model.editor/src/net/mograsim/logic/model/editor/ui/EditorCanvas.java b/net.mograsim.logic.model.editor/src/net/mograsim/logic/model/editor/ui/EditorCanvas.java index 641aaa46..aedaa481 100644 --- a/net.mograsim.logic.model.editor/src/net/mograsim/logic/model/editor/ui/EditorCanvas.java +++ b/net.mograsim.logic.model.editor/src/net/mograsim/logic/model/editor/ui/EditorCanvas.java @@ -22,9 +22,17 @@ public class EditorCanvas extends LogicUICanvas super(parent, style, editor.toBeEdited.submodel); handles = editor.handleManager.getHandles(); - editor.handleManager.addHandleAddedListener(h -> h.addRedrawListener(this::redrawThreadsafe)); + editor.handleManager.addHandleAddedListener(h -> + { + redrawThreadsafe(); + h.addRedrawListener(this::redrawThreadsafe); + }); // TODO: Is this even necessary? The Handle should be finalized by the gc - editor.handleManager.addHandleRemovedListener(h -> h.removeRedrawListener(this::redrawThreadsafe)); + editor.handleManager.addHandleRemovedListener(h -> + { + redrawThreadsafe(); + h.removeRedrawListener(this::redrawThreadsafe); + }); addZoomedRenderer(gc -> { diff --git a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/wires/GUIWire.java b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/wires/GUIWire.java index f59355ce..144a1a38 100644 --- a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/wires/GUIWire.java +++ b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/wires/GUIWire.java @@ -421,6 +421,8 @@ public class GUIWire System.arraycopy(oldPath, index, path, index + 1, oldPath.length - index); path[index] = pointCopy(p); } + recalculateEffectivePath(); + callPathChangedListeners(); } public void removePathPoint(int index) @@ -435,6 +437,8 @@ public class GUIWire if (index < oldPath.length - 1) System.arraycopy(oldPath, index + 1, path, index, oldPath.length - index - 1); } + recalculateEffectivePath(); + callPathChangedListeners(); } public double[] getEffectivePath() -- 2.17.1