Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/qualicen/specmate into d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
junkerm committed May 29, 2021
2 parents 6fa3273 + 9fc5a96 commit 96cb838
Show file tree
Hide file tree
Showing 19 changed files with 430 additions and 569 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ public abstract class ConnectorBase implements IConnector {

private IProject project;

public ConnectorBase(IProject project) {
this.project = project;
}

@Override
public IProject getProject() {
return project;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public Void answer(InvocationOnMock inv) throws Throwable {
private abstract class TestRequirementSourceBase extends ConnectorBase {

public TestRequirementSourceBase(IProject project) {
super(project);
setProject(project);
}

public static final String REQ_NAME = "req";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public String getID() {
/** Returns a connector that does nothing and authorizes every user. */
@Override
public IConnector getConnector() {
return new ConnectorBase(this) {
ConnectorBase conn = new ConnectorBase() {

@Override
public Collection<Requirement> getRequirements() throws SpecmateException {
Expand Down Expand Up @@ -64,6 +64,9 @@ public Requirement getRequirementById(String id) throws SpecmateException {
}

};
conn.setProject(this);
;
return conn;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ public class FileConnector extends ConnectorBase {
/** id of the project folder */
private String id;

public FileConnector(IProject project) {
super(project);
}

@Activate
public void activate(Map<String, Object> properties) throws SpecmateException {
validateConfig(properties);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public String getID() {

@Override
public IConnector getConnector() {
return new ConnectorBase(this) {
ConnectorBase conn = new ConnectorBase() {

@Override
public Collection<Requirement> getRequirements() throws SpecmateException {
Expand All @@ -57,6 +57,8 @@ public Requirement getRequirementById(String id) throws SpecmateException {
return null;
}
};
conn.setProject(this);
return conn;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ public class TrelloConnector extends ConnectorBase {
private String token;
private String id;

public TrelloConnector(IProject project) {
super(project);
}

@Activate
public void activate(Map<String, Object> properties) throws SpecmateException {
validateConfig(properties);
Expand Down
2 changes: 1 addition & 1 deletion web/src/app/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class Config {
public static GRAPHICAL_EDITOR_ZOOM_STEP = 0.1;
public static GRAPHICAL_EDITOR_ZOOM_MAX = 5;

public static CEG_NODE_WIDTH = 150;
public static CEG_NODE_WIDTH = 180;
public static CEG_NODE_HEIGHT = 90;
public static CEG_NODE_ARC_DIST: number = 17 +
Math.sqrt((Config.CEG_NODE_WIDTH / 2.0) * (Config.CEG_NODE_WIDTH / 2.0) +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import { mxgraph } from 'mxgraph';
import { CEGConnection } from 'src/app/model/CEGConnection';
import { StyleChanger } from '../util/style-changer';
import { EditorStyle } from './editor-style';
import { SpecmateDataService } from 'src/app/modules/data/modules/data-service/services/specmate-data.service';
import { Type } from 'src/app/util/type';
import { replaceClass } from '../util/css-utils';
import { TranslateService } from '@ngx-translate/core';
import { IContainer } from 'src/app/model/IContainer';

Expand Down Expand Up @@ -38,20 +36,19 @@ export class EditorPopup {
}

let element: IContainer = undefined;
let currentCell = cell;
while (element === undefined) {
element = this.contents.find(element => element.url === currentCell.id);
currentCell = currentCell.parent;
element = this.contents.find(element => element.url === cell.id);
}

currentCell = this.graph.getModel().getChildCells(this.graph.getDefaultParent()).find(graphCell => graphCell.id === element.url);
let selectedCells = this.graph.getSelectionCells();
selectedCells = selectedCells.filter(element => element.parent == this.graph.getDefaultParent());

const deleteText = this.translate.instant('delete');
menu.addItem(deleteText, null, () => {
this.graph.removeCells([currentCell]);
this.graph.removeCells(selectedCells);
}, undefined, 'fa fa-trash-o', undefined, undefined);

if (Type.is(element, CEGConnection)) {
if (Type.is(element, CEGConnection) && selectedCells.length === 1) {

const connection = element as CEGConnection;
const icon = connection.negate ? 'fa fa-check' : 'fa fa-circle-o';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,32 +46,13 @@ export class EditorStyle {
public static readonly INNER_STYLE: Style = {};
public static readonly EFFECT_STYLE: Style = {};

public static readonly TEXT_INPUT_STYLE = 'BASE_TEXT_INPUT';
private static readonly TEXT_INPUT_STYLE_STR = 'shape=rectangle;rounded=0;strokeColor=none;align=center;fillColor=none;fontColor=#000000;autosize=1;whiteSpace=wrap';
private static readonly TEXT_INPUT_STYLE_OBJ: Style = EditorStyle.createStyle(EditorStyle.TEXT_INPUT_STYLE_STR);
public static readonly VARIABLE_NAME_STYLE = 'BASE_VARIABLE_NAME_STYLE';
private static readonly VARIABLE_NAME_STYLE_STR = 'shape=rectangle;rounded=0;strokeColor=none;fillColor=none;fontColor=#000000;autosize=1;whiteSpace=wrap;fontStyle=' + mx.mxConstants.FONT_BOLD;
private static readonly VARIABLE_NAME_STYLE_OBJ: Style = EditorStyle.createStyle(EditorStyle.VARIABLE_NAME_STYLE_STR);
public static readonly TEXT_INPUT_DISABLED_STYLE = 'BASE_TEXT_DISABLED_INPUT';
private static readonly TEXT_INPUT_DISABLED_STYLE_STR = 'shape=rectangle;rounded=0;align=center;strokeColor=none;fillColor=none;editable=0;fontColor=#666666;autosize=1;whiteSpace=wrap';
private static readonly TEXT_INPUT_DISABLED_STYLE_OBJ: Style = EditorStyle.createStyle(EditorStyle.TEXT_INPUT_DISABLED_STYLE_STR);
public static readonly VARIABLE_NAME_DISABLED_STYLE = 'BASE_VARIABLE_NAME_DISABLED_STYLE';
private static readonly VARIABLE_NAME_DISABLED_STYLE_STR = 'shape=rectangle;rounded=0;align=center;strokeColor=none;fillColor=none;fontColor=#666666;editable=0;autosize=1;whiteSpace=wrap;fontStyle=' + mx.mxConstants.FONT_BOLD;
private static readonly VARIABLE_NAME_DISABLED_STYLE_OBJ: Style = EditorStyle.createStyle(EditorStyle.VARIABLE_NAME_DISABLED_STYLE_STR);
public static readonly ICON_STYLE = 'ICON_INPUT';
private static readonly ICON_STYLE_STR = 'shape=rectangle;rounded=0;align=left;strokeColor=none;fillColor=none;fontColor=#000000;resizable=0;movable=0;editable=0;connectable=0;recursiveResize=0;rotatable=0;cloneable=0;deletable=0;';
private static readonly ICON_STYLE_OBJ: Style = EditorStyle.createStyle(EditorStyle.ICON_STYLE_STR);

public static readonly BASE_CEG_NODE_STYLE = 'BASE_CEG_NODE';
private static readonly BASE_CEG_NODE_STYLE_STR = 'shape=rectangle;rounded=1;arcSize=10;align=center;perimeter=rectanglePerimeter;dashed=0;textOpacity=0;autosize=1;whiteSpace=wrap';
private static readonly BASE_CEG_NODE_STYLE_STR = 'shape=rectangle;rounded=1;arcSize=10;whiteSpace=wrap';
private static readonly BASE_CEG_NODE_STYLE_OBJ: Style = EditorStyle.createStyle(EditorStyle.BASE_CEG_NODE_STYLE_STR);
public static readonly TYPE_NAME_STYLE = 'TYPE_NAME_STYLE';
private static readonly TYPE_NAME_STYLE_STR = 'shape=rectangle;autosize=0;strokeColor=none;fillColor=none';
private static readonly TYPE_NAME_STYLE_OBJ: Style = EditorStyle.createStyle(EditorStyle.TYPE_NAME_STYLE_STR);

public static readonly BASE_CEG_LINKED_NODE_STYLE = 'BASE_CEG_LINKED_NODE';
private static readonly BASE_CEG_LINKED_NODE_STYLE_STR = 'shape=rectangle;rounded=1;arcSize=10;align=center;perimeter=rectanglePerimeter;dashed=1;dashPattern=1 1;opacity=75;editable=0;textOpacity=0';
private static readonly BASE_CEG_LINKED_NODE_STYLE_STR = 'shape=rectangle;rounded=1;arcSize=10;align=center;perimeter=rectanglePerimeter;dashed=1;dashPattern=1 1;opacity=75;editable=0;whiteSpace=wrap';
private static readonly BASE_CEG_LINKED_NODE_STYLE_OBJ: Style = EditorStyle.createStyle(EditorStyle.BASE_CEG_LINKED_NODE_STYLE_STR);

public static readonly BASE_PROCESS_START_STYLE = 'BASE_PROCESS_START_STYLE';
private static readonly BASE_PROCESS_START_STYLE_STR = 'shape=ellipse;whiteSpace=wrap;html=1;aspect=fixed;align=center;perimeter=ellipsePerimeter;editable=0;dashed=0;fontColor=#000000';
private static readonly BASE_PROCESS_START_STYLE_OBJ: Style = EditorStyle.createStyle(EditorStyle.BASE_PROCESS_START_STYLE_STR);
Expand Down Expand Up @@ -118,12 +99,6 @@ export class EditorStyle {

const stylesheet = graph.getStylesheet();

stylesheet.putCellStyle(EditorStyle.TEXT_INPUT_STYLE, EditorStyle.TEXT_INPUT_STYLE_OBJ);
stylesheet.putCellStyle(EditorStyle.VARIABLE_NAME_STYLE, EditorStyle.VARIABLE_NAME_STYLE_OBJ);
stylesheet.putCellStyle(EditorStyle.TEXT_INPUT_DISABLED_STYLE, EditorStyle.TEXT_INPUT_DISABLED_STYLE_OBJ);
stylesheet.putCellStyle(EditorStyle.VARIABLE_NAME_DISABLED_STYLE, EditorStyle.VARIABLE_NAME_DISABLED_STYLE_OBJ);
stylesheet.putCellStyle(EditorStyle.ICON_STYLE, EditorStyle.ICON_STYLE_OBJ);
stylesheet.putCellStyle(EditorStyle.TYPE_NAME_STYLE, EditorStyle.TYPE_NAME_STYLE_OBJ);

stylesheet.putCellStyle(EditorStyle.BASE_CEG_NODE_STYLE, EditorStyle.BASE_CEG_NODE_STYLE_OBJ);
stylesheet.putCellStyle(EditorStyle.BASE_CEG_LINKED_NODE_STYLE, EditorStyle.BASE_CEG_LINKED_NODE_STYLE_OBJ);
Expand Down
Loading

0 comments on commit 96cb838

Please sign in to comment.