Fix lint errors on _ for files

This commit is contained in:
Paulo Gustavo Veiga 2021-10-04 17:17:02 -07:00
parent 9457ca6047
commit 7e2ef09295
13 changed files with 118 additions and 118 deletions

View File

@ -40,23 +40,23 @@ const Arrow = new Class({
},
setFrom(x, y) {
this._peer.setFrom(x, y);
this.peer.setFrom(x, y);
},
setControlPoint(point) {
this._peer.setControlPoint(point);
this.peer.setControlPoint(point);
},
setStrokeColor(color) {
this._peer.setStrokeColor(color);
this.peer.setStrokeColor(color);
},
setStrokeWidth(width) {
this._peer.setStrokeWidth(width);
this.peer.setStrokeWidth(width);
},
setDashed(isDashed, length, spacing) {
this._peer.setDashed(isDashed, length, spacing);
this.peer.setDashed(isDashed, length, spacing);
},
});

View File

@ -39,82 +39,82 @@ const CurvedLine = new Class({
$assert(!isNaN(x), 'x must be defined');
$assert(!isNaN(y), 'y must be defined');
this._peer.setFrom(x, y);
this.peer.setFrom(x, y);
},
setTo(x, y) {
$assert(!isNaN(x), 'x must be defined');
$assert(!isNaN(y), 'y must be defined');
this._peer.setTo(x, y);
this.peer.setTo(x, y);
},
getFrom() {
return this._peer.getFrom();
return this.peer.getFrom();
},
getTo() {
return this._peer.getTo();
return this.peer.getTo();
},
setShowEndArrow(visible) {
this._peer.setShowEndArrow(visible);
this.peer.setShowEndArrow(visible);
},
isShowEndArrow() {
return this._peer.isShowEndArrow();
return this.peer.isShowEndArrow();
},
setShowStartArrow(visible) {
this._peer.setShowStartArrow(visible);
this.peer.setShowStartArrow(visible);
},
isShowStartArrow() {
return this._peer.isShowStartArrow();
return this.peer.isShowStartArrow();
},
setSrcControlPoint(control) {
this._peer.setSrcControlPoint(control);
this.peer.setSrcControlPoint(control);
},
setDestControlPoint(control) {
this._peer.setDestControlPoint(control);
this.peer.setDestControlPoint(control);
},
getControlPoints() {
return this._peer.getControlPoints();
return this.peer.getControlPoints();
},
isSrcControlPointCustom() {
return this._peer.isSrcControlPointCustom();
return this.peer.isSrcControlPointCustom();
},
isDestControlPointCustom() {
return this._peer.isDestControlPointCustom();
return this.peer.isDestControlPointCustom();
},
setIsSrcControlPointCustom(isCustom) {
this._peer.setIsSrcControlPointCustom(isCustom);
this.peer.setIsSrcControlPointCustom(isCustom);
},
setIsDestControlPointCustom(isCustom) {
this._peer.setIsDestControlPointCustom(isCustom);
this.peer.setIsDestControlPointCustom(isCustom);
},
updateLine(avoidControlPointFix) {
return this._peer.updateLine(avoidControlPointFix);
return this.peer.updateLine(avoidControlPointFix);
},
setStyle(style) {
this._peer.setLineStyle(style);
this.peer.setLineStyle(style);
},
getStyle() {
return this._peer.getLineStyle();
return this.peer.getLineStyle();
},
setDashed(length, spacing) {
this._peer.setDashed(length, spacing);
this.peer.setDashed(length, spacing);
},
});

View File

@ -18,7 +18,7 @@
const Element = new Class({ // eslint-disable-line no-undef
initialize(peer, attributes) {
this._peer = peer;
this.peer = peer;
if (peer == null) {
throw new Error('Element peer can not be null');
}
@ -60,11 +60,11 @@ const Element = new Class({ // eslint-disable-line no-undef
},
setSize(width, height) {
this._peer.setSize(width, height);
this.peer.setSize(width, height);
},
setPosition(cx, cy) {
this._peer.setPosition(cx, cy);
this.peer.setPosition(cx, cy);
},
/**
@ -78,15 +78,15 @@ const Element = new Class({ // eslint-disable-line no-undef
*
*/
addEvent(type, listener) {
this._peer.addEvent(type, listener);
this.peer.addEvent(type, listener);
},
trigger(type, event) {
this._peer.trigger(type, event);
this.peer.trigger(type, event);
},
cloneEvents(from) {
this._peer.cloneEvents(from);
this.peer.cloneEvents(from);
},
/**
*
@ -100,7 +100,7 @@ const Element = new Class({ // eslint-disable-line no-undef
* This interace will be invoked passing an event as argument and the 'this' referece in the function will be the element.
*/
removeEvent(type, listener) {
this._peer.removeEvent(type, listener);
this.peer.removeEvent(type, listener);
},
/**
@ -117,7 +117,7 @@ const Element = new Class({ // eslint-disable-line no-undef
* Todo: Doc
*/
getFill() {
return this._peer.getFill();
return this.peer.getFill();
},
/**
@ -126,15 +126,15 @@ const Element = new Class({ // eslint-disable-line no-undef
* opacity: Opacity of the fill. It must be less than 1.
*/
setFill(color, opacity) {
this._peer.setFill(color, opacity);
this.peer.setFill(color, opacity);
},
getPosition() {
return this._peer.getPosition();
return this.peer.getPosition();
},
getNativePosition() {
return this._peer.getNativePosition();
return this.peer.getNativePosition();
},
/*
@ -156,7 +156,7 @@ const Element = new Class({ // eslint-disable-line no-undef
) {
throw new Error(`Unsupported stroke style: '${style}'`);
}
this._peer.setStroke(width, style, color, opacity);
this.peer.setStroke(width, style, color, opacity);
},
_attributeNameToFuncName(attributeKey, prefix) {
@ -235,42 +235,42 @@ const Element = new Class({ // eslint-disable-line no-undef
* opacity: A value between 0 and 1.
*/
setOpacity(opacity) {
this._peer.setStroke(null, null, null, opacity);
this._peer.setFill(null, opacity);
this.peer.setStroke(null, null, null, opacity);
this.peer.setFill(null, opacity);
},
setVisibility(isVisible) {
this._peer.setVisibility(isVisible);
this.peer.setVisibility(isVisible);
},
isVisible() {
return this._peer.isVisible();
return this.peer.isVisible();
},
/**
* Move the element to the front
*/
moveToFront() {
this._peer.moveToFront();
this.peer.moveToFront();
},
/**
* Move the element to the back
*/
moveToBack() {
this._peer.moveToBack();
this.peer.moveToBack();
},
getStroke() {
return this._peer.getStroke();
return this.peer.getStroke();
},
setCursor(type) {
this._peer.setCursor(type);
this.peer.setCursor(type);
},
getParent() {
return this._peer.getParent();
return this.peer.getParent();
},
});

View File

@ -36,7 +36,7 @@ const Elipse = new Class({
},
getSize() {
return this._peer.getSize();
return this.peer.getSize();
},
});

View File

@ -21,18 +21,18 @@ const TransformUtil = require('./peer/utils/TransformUtils').default;
const Font = new Class({
initialize(fontFamily, textPeer) {
const font = `Toolkit.default.create${fontFamily}Font();`;
this._peer = eval(font);
this.peer = eval(font);
this._textPeer = textPeer;
},
getHtmlSize() {
const scale = TransformUtil.workoutScale(this._textPeer);
return this._peer.getHtmlSize(scale);
return this.peer.getHtmlSize(scale);
},
getGraphSize() {
const scale = TransformUtil.workoutScale(this._textPeer);
return this._peer.getGraphSize(scale);
return this.peer.getGraphSize(scale);
},
getFontScale() {
@ -40,39 +40,39 @@ const Font = new Class({
},
getSize() {
return this._peer.getSize();
return this.peer.getSize();
},
getStyle() {
return this._peer.getStyle();
return this.peer.getStyle();
},
getWeight() {
return this._peer.getWeight();
return this.peer.getWeight();
},
getFontFamily() {
return this._peer.getFontFamily();
return this.peer.getFontFamily();
},
setSize(size) {
return this._peer.setSize(size);
return this.peer.setSize(size);
},
setStyle(style) {
return this._peer.setStyle(style);
return this.peer.setStyle(style);
},
setWeight(weight) {
return this._peer.setWeight(weight);
return this.peer.setWeight(weight);
},
getFont() {
return this._peer.getFont();
return this.peer.getFont();
},
getWidthMargin() {
return this._peer.getWidthMargin();
return this.peer.getWidthMargin();
},
});

View File

@ -39,19 +39,19 @@ const Group = new Class({
*/
removeChild(element) {
if (!$defined(element)) {
throw 'Child element can not be null';
throw new Error('Child element can not be null');
}
if (element == this) {
throw "It's not possible to add the group as a child of itself";
throw new Error("It's not possible to add the group as a child of itself");
}
const elementType = element.getType();
if (elementType == null) {
throw `It seems not to be an element ->${element}`;
throw new Error(`It seems not to be an element ->${element}`);
}
this._peer.removeChild(element._peer);
this.peer.removeChild(element.peer);
},
/**
@ -59,23 +59,23 @@ const Group = new Class({
*/
append(element) {
if (!$defined(element)) {
throw 'Child element can not be null';
throw Error('Child element can not be null');
}
if (element == this) {
throw "It's not posible to add the group as a child of itself";
throw new Error("It's not posible to add the group as a child of itself");
}
const elementType = element.getType();
if (elementType == null) {
throw `It seems not to be an element ->${element}`;
throw new Error(`It seems not to be an element ->${element}`);
}
if (elementType == 'Workspace') {
throw 'A group can not have a workspace as a child';
throw new Error('A group can not have a workspace as a child');
}
this._peer.append(element._peer);
this.peer.append(element.peer);
},
getType() {
@ -90,46 +90,46 @@ const Group = new Class({
* they are simple numbers, not CSS length quantities.
*/
setCoordSize(width, height) {
this._peer.setCoordSize(width, height);
this.peer.setCoordSize(width, height);
},
setCoordOrigin(x, y) {
this._peer.setCoordOrigin(x, y);
this.peer.setCoordOrigin(x, y);
},
getCoordOrigin() {
return this._peer.getCoordOrigin();
return this.peer.getCoordOrigin();
},
getSize() {
return this._peer.getSize();
return this.peer.getSize();
},
setFill(color, opacity) {
throw 'Unsupported operation. Fill can not be set to a group';
setFill() {
throw new Error('Unsupported operation. Fill can not be set to a group');
},
setStroke(width, style, color, opacity) {
throw 'Unsupported operation. Stroke can not be set to a group';
setStroke() {
throw new Error('Unsupported operation. Stroke can not be set to a group');
},
getCoordSize() {
return this._peer.getCoordSize();
return this.peer.getCoordSize();
},
appendDomChild(DomElement) {
if (!$defined(DomElement)) {
throw 'Child element can not be null';
throw new Error('Child element can not be null');
}
if (DomElement == this) {
throw "It's not possible to add the group as a child of itself";
throw new Error('Its not possible to add the group as a child of itself');
}
this._peer._native.append(DomElement);
this.peer._native.append(DomElement);
},
setOpacity(value) {
this._peer.setOpacity(value);
this.peer.setOpacity(value);
},
});

View File

@ -30,15 +30,15 @@ const Image = new Class({
},
setHref(href) {
this._peer.setHref(href);
this.peer.setHref(href);
},
getHref() {
return this._peer.getHref();
return this.peer.getHref();
},
getSize() {
return this._peer.getSize();
return this.peer.getSize();
},
});

View File

@ -34,19 +34,19 @@ const Line = new Class({
},
setFrom(x, y) {
this._peer.setFrom(x, y);
this.peer.setFrom(x, y);
},
setTo(x, y) {
this._peer.setTo(x, y);
this.peer.setTo(x, y);
},
getFrom() {
return this._peer.getFrom();
return this.peer.getFrom();
},
getTo() {
return this._peer.getTo();
return this.peer.getTo();
},
/**
@ -54,7 +54,7 @@ const Line = new Class({
* Can have values "none | block | classic | diamond | oval | open | chevron | doublechevron"
* */
setArrowStyle(startStyle, endStyle) {
this._peer.setArrowStyle(startStyle, endStyle);
this.peer.setArrowStyle(startStyle, endStyle);
},
setPosition(cx, cy) {

View File

@ -36,19 +36,19 @@ const PolyLine = new Class({
},
setFrom(x, y) {
this._peer.setFrom(x, y);
this.peer.setFrom(x, y);
},
setTo(x, y) {
this._peer.setTo(x, y);
this.peer.setTo(x, y);
},
setStyle(style) {
this._peer.setStyle(style);
this.peer.setStyle(style);
},
getStyle() {
return this._peer.getStyle();
return this.peer.getStyle();
},
buildCurvedPath(dist, x1, y1, x2, y2) {

View File

@ -50,7 +50,7 @@ const Rect = new Class({
},
getSize() {
return this._peer.getSize();
return this.peer.getSize();
},
});

View File

@ -30,68 +30,68 @@ const Text = new Class({
},
setText(text) {
this._peer.setText(text);
this.peer.setText(text);
},
setTextAlignment(align) {
$assert(align, 'align can not be null');
this._peer.setTextAlignment(align);
this.peer.setTextAlignment(align);
},
setTextSize(width, height) {
this._peer.setContentSize(width, height);
this.peer.setContentSize(width, height);
},
getText() {
return this._peer.getText();
return this.peer.getText();
},
setFont(font, size, style, weight) {
this._peer.setFont(font, size, style, weight);
this.peer.setFont(font, size, style, weight);
},
setColor(color) {
this._peer.setColor(color);
this.peer.setColor(color);
},
getColor() {
return this._peer.getColor();
return this.peer.getColor();
},
setStyle(style) {
this._peer.setStyle(style);
this.peer.setStyle(style);
},
setWeight(weight) {
this._peer.setWeight(weight);
this.peer.setWeight(weight);
},
setFontFamily(family) {
this._peer.setFontFamily(family);
this.peer.setFontFamily(family);
},
getFont() {
return this._peer.getFont();
return this.peer.getFont();
},
setSize(size) {
this._peer.setSize(size);
this.peer.setSize(size);
},
getHtmlFontSize() {
return this._peer.getHtmlFontSize();
return this.peer.getHtmlFontSize();
},
getWidth() {
return this._peer.getWidth();
return this.peer.getWidth();
},
getHeight() {
return parseInt(this._peer.getHeight());
return parseInt(this.peer.getHeight());
},
getFontHeight() {
const lines = this._peer.getText().split('\n').length;
const lines = this.peer.getText().split('\n').length;
return Math.round(this.getHeight() / lines);
},
});

View File

@ -36,7 +36,7 @@ const Workspace = new Class({
defaultAttributes[key] = attributes[key];
}
this.parent(peer, defaultAttributes);
this._htmlContainer.append(this._peer._native);
this._htmlContainer.append(this.peer._native);
},
getType() {
@ -59,7 +59,7 @@ const Workspace = new Class({
throw 'A workspace can not have a workspace as a child';
}
this._peer.append(element._peer);
this.peer.append(element.peer);
},
addItAsChildTo(element) {
@ -102,7 +102,7 @@ const Workspace = new Class({
if ($defined(height)) {
this._htmlContainer.css('height', height);
}
this._peer.setSize(width, height);
this.peer.setSize(width, height);
},
/**
@ -113,21 +113,21 @@ const Workspace = new Class({
* they are simple numbers, not CSS length quantities.
*/
setCoordSize(width, height) {
this._peer.setCoordSize(width, height);
this.peer.setCoordSize(width, height);
},
/**
* @Todo: Complete Doc
*/
setCoordOrigin(x, y) {
this._peer.setCoordOrigin(x, y);
this.peer.setCoordOrigin(x, y);
},
/**
* @Todo: Complete Doc
*/
getCoordOrigin() {
return this._peer.getCoordOrigin();
return this.peer.getCoordOrigin();
},
// Private method declaration area
@ -168,7 +168,7 @@ const Workspace = new Class({
},
getCoordSize() {
return this._peer.getCoordSize();
return this.peer.getCoordSize();
},
/**
@ -188,7 +188,7 @@ const Workspace = new Class({
throw `It seems not to be an element ->${element}`;
}
this._peer.removeChild(element._peer);
this.peer.removeChild(element.peer);
},
dumpNativeChart() {

View File

@ -40,7 +40,7 @@
var text = new web2d.Text();
overflowWorkspace.append(text);
var scale = web2d.TransformUtils.workoutScale(text._peer);
var scale = web2d.TransformUtils.workoutScale(text.peer);
text.setText(textval + " " + scale.height);
text.setFont(font, fontSizeval, style, modifier);
text.setPosition(0, 0);