Skip to content

Commit

Permalink
KOGITO-9961: Node coloring stopped working on runtime tools (apache#2065
Browse files Browse the repository at this point in the history
)

Co-authored-by: Dmitrii Tikhomirov <[email protected]>
  • Loading branch information
2 people authored and thiagoelg committed Dec 6, 2023
1 parent 0246536 commit c519c32
Show file tree
Hide file tree
Showing 12 changed files with 65 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* under the License.
*/


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,13 @@ private void initializeJsCanvas(AbstractSession session) {
LienzoCanvas canvas = (LienzoCanvas) session.getCanvasHandler().getCanvas();
LienzoPanel panel = (LienzoPanel) canvas.getView().getPanel();
LienzoBoundsPanel lienzoPanel = panel.getView();
JsCanvas jsCanvas = new JsCanvas(lienzoPanel, lienzoPanel.getLayer(), new StunnerStateApplier() {
JsCanvas jsCanvas = JsCanvas.getInstance().init(lienzoPanel, lienzoPanel.getLayer(), new StunnerStateApplier() {
@Override
public Shape getShape(String uuid) {
return canvas.getShape(uuid);
}
});
JsCanvasWrapper jsCanvasWrapper = new JsCanvasWrapper().setWrapper(jsCanvas);
JsCanvasWrapper jsCanvasWrapper = new JsCanvasWrapper();
JsWindow.setCanvas(jsCanvasWrapper);
JsWindow.getEditor().setCanvas(jsCanvasWrapper);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,7 @@
@GWT3Export
public class JsCanvasWrapper {

private JsCanvas wrapper;

public JsCanvasWrapper setWrapper(JsCanvas wrapper) {
this.wrapper = wrapper;
return this;
}
private JsCanvas wrapper = JsCanvas.getInstance();

public Layer getLayer() {
return wrapper.getLayer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@
import org.kie.workbench.common.stunner.core.graph.content.definition.Definition;
import org.kie.workbench.common.stunner.core.graph.content.view.View;
import org.kie.workbench.common.stunner.core.graph.processing.index.Index;
import org.treblereel.j2cl.processors.annotations.GWT3Export;

@JsType
@GWT3Export
public class JsStunnerSession {

@JsIgnore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@
<artifactId>uberfire-api</artifactId>
</dependency>

<dependency>
<groupId>org.treblereel.j2cl.processors</groupId>
<artifactId>annotations</artifactId>
</dependency>

<dependency>
<groupId>org.treblereel.j2cl.processors</groupId>
<artifactId>processors</artifactId>
<scope>provided</scope>
</dependency>

<!-- Test scope. -->

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* under the License.
*/


Expand All @@ -27,8 +27,10 @@
import jsinterop.annotations.JsType;
import org.kie.workbench.common.stunner.core.graph.content.Bounds;
import org.kie.workbench.common.stunner.core.util.HashUtil;
import org.treblereel.j2cl.processors.annotations.GWT3Export;

@JsType
@GWT3Export
public final class ViewConnectorImpl<W> implements ViewConnector<W> {

protected W definition;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,26 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* under the License.
*/


package org.kie.workbench.common.stunner.core.graph.content.view;

import jsinterop.annotations.JsType;
import org.kie.workbench.common.stunner.core.graph.content.Bounds;
import org.treblereel.j2cl.processors.annotations.GWT3Export;

@JsType
@GWT3Export
public final class ViewImpl<W> implements View<W> {

protected W definition;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* under the License.
*/


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* under the License.
*/


Expand All @@ -23,8 +23,10 @@
import jsinterop.annotations.JsType;
import org.kie.workbench.common.stunner.core.graph.Edge;
import org.kie.workbench.common.stunner.core.graph.Node;
import org.treblereel.j2cl.processors.annotations.GWT3Export;

@JsType
@GWT3Export
public class EdgeImpl<C> extends AbstractElement<C> implements Edge<C, Node> {

private Node sourceNode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* under the License.
*/


Expand All @@ -23,17 +23,21 @@
import java.util.ArrayList;
import java.util.List;

import jsinterop.annotations.JsType;
import org.kie.workbench.common.stunner.core.graph.Edge;
import org.kie.workbench.common.stunner.core.graph.Node;
import org.kie.workbench.common.stunner.core.graph.content.view.ViewConnector;
import org.treblereel.j2cl.processors.annotations.GWT3Export;

@JsType
@GWT3Export
public class NodeImpl<C> extends AbstractElement<C> implements Node<C, Edge> {

private final List<Edge> inEdges = new ArrayList<Edge>();
private final List<Edge> outEdges = new ArrayList<Edge>();

public NodeImpl() {
super("default");
}

public NodeImpl(String uuid) {
super(uuid);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* under the License.
*/

package com.ait.lienzo.client.core.types;
Expand Down Expand Up @@ -43,18 +43,32 @@
@JsType
public class JsCanvas implements JsCanvasNodeLister {

private static JsCanvas INSTANCE = null;

public static JsCanvasEvents events;
public static JsCanvasAnimations animations;
public static JsCanvasLogger logger;
protected JSShapeStateApplier stateApplier;
LienzoPanel panel;
Layer layer;

public JsCanvas(LienzoPanel panel, Layer layer, JSShapeStateApplier stateApplier) {
private JsCanvas() {

}

public static JsCanvas getInstance() {
if (INSTANCE == null) {
INSTANCE = new JsCanvas();
}
return INSTANCE;
}

public JsCanvas init(LienzoPanel panel, Layer layer, JSShapeStateApplier stateApplier) {
this.panel = panel;
this.layer = layer;
this.stateApplier = stateApplier;
this.events = null;
return this;
}

@SuppressWarnings("all")
Expand Down
2 changes: 1 addition & 1 deletion packages/serverless-workflow-diagram-editor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@
<version.org.uberfire.patternfly>7.74.1.Final</version.org.uberfire.patternfly>

<version.io.crysknife>0.6</version.io.crysknife>
<version.org.gwt3.processors>0.6.3</version.org.gwt3.processors>
<version.org.gwt3.processors>0.6.4</version.org.gwt3.processors>
<version.j2cl>0.11.0-9336533b6</version.j2cl>
<version.j2cl.maven.plugin>0.21.0</version.j2cl.maven.plugin>

Expand Down

0 comments on commit c519c32

Please sign in to comment.