Skip to content

Conversation

@shavkunov
Copy link

No description provided.

anastasia143 and others added 27 commits February 23, 2017 11:25
Few fixes for requirejs config to make JointJS load properly.
Also jQuery updated to 2.2.4.
Copy link
Contributor

@TanVD TanVD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good. Minor fixes requested.

private imagePath: string;
private propertyEditElement: PropertyEditElement;
private propertyEditElements: PropertyEditElement[];
private delta = 20;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delta of what? Not very helpful name.

private propertyEditElement: PropertyEditElement;
private propertyEditElements: PropertyEditElement[];
private delta = 20;
private topIndent = 30;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This name too.

setPropertyEditElementsPosition(x : number, y : number) : void {
let propertiesCount = 0;

for (let i in this.propertyEditElements) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can either use here for ... of construction or use i variable also as propertiesCount

this.propertyEditElement.setPosition(propertyEditElementX, propertyEditElementY);
var propertyEditElementY = parentPosition.y + this.boundingBox.height - this.topIndent;

for (var propertyKey in this.changeableProperties) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As IDEA reminds: it's better to use let instead of var cause it behaves more strictly.

var parentPosition = this.getJointObjectPagePosition(zoom);
this.propertyEditElement = new PropertyEditElement(this.logicalId, this.jointObject.id,
this.changeableProperties);
var propertyEditElementX = parentPosition.x + (<number> (this.boundingBox.width - 50)/2);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extract magic number to appropriate constant.

node.getPropertyEditElement().getHtmlElement().remove();
if (node.getPropertyEditElements()) {
var editElements = node.getPropertyEditElements();
for (let i in editElements) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for ... of here maybe?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And everywhere below

node.getJointObject().remove();
if (node.getPropertyEditElement()) {
node.getPropertyEditElement().getHtmlElement().remove();
if (node.getPropertyEditElements()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it mean? Is it check for null or what? Use explicit syntax.

node.initPropertyEditElements(this.zoom);
if (node.getPropertyEditElement()) {
node.getPropertyEditElement().getHtmlElement().insertBefore("#" + this.getId());
if (node.getPropertyEditElements()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here also be more explicit.

shavkunov added 2 commits May 5, 2017 23:01
…ties

# Conflicts:
#	editor-core/src/main/webapp/app/core/editorCore/model/DefaultDiagramNode.ts
#	editor-core/src/main/webapp/app/core/editorCore/model/DiagramNode.ts
Copy link
Contributor

@TanVD TanVD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please repair:

  • Changing of proprerty will move it to default postion
  • Saving of property will move it to default position
    Fixes requested.

changeTextPosition() : void {
var dx = this.getX() - this.lastPointermoveCursor.x;
var dy = this.getY() - this.lastPointermoveCursor.y;
console.log("Diagram pos in changeTextPosition : " + this.getX() + ", " + this.getY());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not use log levels, so it's better to remove unnecessary logs before merge to master.

private jointObject: ImageWithPorts;

/**
* Name and type of diagramm.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Write one doc per one field.

private constPropertiesPack: PropertiesPack;

/**
* Properties, which can be changes by user.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changeD

private changeableProperties: Map<String, Property>;

/**
* Path to image.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really helpful. What kind of path? Filepath, url?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea.

private parentNode: DiagramContainer;

/**
* Graph, where diagram is located. Used to set new properties on the screen.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't understand it.

var diffY = y - this.lastMousePosition.y;
this.lastPointermoveCursor.x = this.getX();
this.lastPointermoveCursor.y = this.getY();
this.lastDiagramPosition.x = this.getX();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Position of the whole diagram? Maybe lastCursorPosition?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Position of the whole diagram? -- Yes. Coordinates of underlying joint object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants