mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-18 14:58:15 +00:00
Small refactor
This commit is contained in:
@ -7,7 +7,7 @@ import {select, Selection} from 'd3-selection';
|
|||||||
import { Node } from "../shared/models/node";
|
import { Node } from "../shared/models/node";
|
||||||
import { Link } from "../shared/models/link";
|
import { Link } from "../shared/models/link";
|
||||||
import { GraphLayout } from "../shared/widgets/graph.widget";
|
import { GraphLayout } from "../shared/widgets/graph.widget";
|
||||||
import { Context } from "../../map/models/context";
|
import { Context } from "../shared/models/context";
|
||||||
import { Size } from "../shared/models/size";
|
import { Size } from "../shared/models/size";
|
||||||
import { Drawing } from "../shared/models/drawing";
|
import { Drawing } from "../shared/models/drawing";
|
||||||
import {Symbol} from "../shared/models/symbol";
|
import {Symbol} from "../shared/models/symbol";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import {Size} from "../../cartography/shared/models/size";
|
import {Size} from "./size";
|
||||||
import {Selection} from "d3-selection";
|
import {Point} from "./point";
|
||||||
import {Point} from "../../cartography/shared/models/point";
|
|
||||||
|
|
||||||
export class Context {
|
export class Context {
|
||||||
private size: Size;
|
private size: Size;
|
@ -1,4 +1,4 @@
|
|||||||
import {SVGSelection} from "../../map/models/types";
|
import {SVGSelection} from "./models/types";
|
||||||
|
|
||||||
export interface Tool {
|
export interface Tool {
|
||||||
connect(selection: SVGSelection);
|
connect(selection: SVGSelection);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { select } from "d3-selection";
|
import { select } from "d3-selection";
|
||||||
import { Context } from "../../../map/models/context";
|
import { Context } from "../models/context";
|
||||||
import { SVGSelection } from "../../../map/models/types";
|
import { SVGSelection } from "../models/types";
|
||||||
import { MovingTool } from "./moving-tool";
|
import { MovingTool } from "./moving-tool";
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import {SVGSelection} from "../../../map/models/types";
|
import {SVGSelection} from "../models/types";
|
||||||
import {Context} from "../../../map/models/context";
|
import {Context} from "../models/context";
|
||||||
import {D3ZoomEvent, zoom, ZoomBehavior} from "d3-zoom";
|
import {D3ZoomEvent, zoom, ZoomBehavior} from "d3-zoom";
|
||||||
import { event } from "d3-selection";
|
import { event } from "d3-selection";
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { select } from "d3-selection";
|
import { select } from "d3-selection";
|
||||||
|
|
||||||
import { SelectionTool } from "./selection-tool";
|
import { SelectionTool } from "./selection-tool";
|
||||||
import { Context } from "../../../map/models/context";
|
import { Context } from "../models/context";
|
||||||
import { SVGSelection } from "../../../map/models/types";
|
import { SVGSelection } from "../models/types";
|
||||||
import { Rectangle } from "../models/rectangle";
|
import { Rectangle } from "../models/rectangle";
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
import {SVGSelection} from "../../../map/models/types";
|
import { Injectable } from "@angular/core";
|
||||||
import {mouse, select} from "d3-selection";
|
import { mouse, select } from "d3-selection";
|
||||||
import {Context} from "../../../map/models/context";
|
import { Subject } from "rxjs/Subject";
|
||||||
import {Subject} from "rxjs/Subject";
|
|
||||||
import {Rectangle} from "../models/rectangle";
|
import { SVGSelection } from "../models/types";
|
||||||
import {Injectable} from "@angular/core";
|
import { Context } from "../models/context";
|
||||||
|
import { Rectangle } from "../models/rectangle";
|
||||||
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@ -83,7 +84,6 @@ export class SelectionTool {
|
|||||||
private moveSelection(start, move) {
|
private moveSelection(start, move) {
|
||||||
this.path.attr("d", this.rect(start[0], start[1], move[0] - start[0], move[1] - start[1]));
|
this.path.attr("d", this.rect(start[0], start[1], move[0] - start[0], move[1] - start[1]));
|
||||||
this.selectedEvent(start, move);
|
this.selectedEvent(start, move);
|
||||||
// this.getSelectedItems(start, move);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private endSelection(start, end) {
|
private endSelection(start, end) {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import {DrawingLine} from "../models/drawing-line";
|
import {DrawingLine} from "../models/drawing-line";
|
||||||
import {SVGSelection} from "../../../map/models/types";
|
import {SVGSelection} from "../models/types";
|
||||||
import {Point} from "../models/point";
|
import {Point} from "../models/point";
|
||||||
import {line} from "d3-shape";
|
import {line} from "d3-shape";
|
||||||
import {mouse} from "d3-selection";
|
import {mouse} from "d3-selection";
|
||||||
import {Context} from "../../../map/models/context";
|
import {Context} from "../models/context";
|
||||||
|
|
||||||
export class DrawingLineWidget {
|
export class DrawingLineWidget {
|
||||||
private drawingLine: DrawingLine = new DrawingLine();
|
private drawingLine: DrawingLine = new DrawingLine();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import {Widget} from "./widget";
|
import {Widget} from "./widget";
|
||||||
import {Drawing} from "../models/drawing";
|
import {Drawing} from "../models/drawing";
|
||||||
import {SVGSelection} from "../../../map/models/types";
|
import {SVGSelection} from "../models/types";
|
||||||
|
|
||||||
|
|
||||||
export class DrawingsWidget implements Widget {
|
export class DrawingsWidget implements Widget {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import {Widget} from "./widget";
|
import {Widget} from "./widget";
|
||||||
import {SVGSelection} from "../../../map/models/types";
|
import {SVGSelection} from "../models/types";
|
||||||
|
|
||||||
import { line } from "d3-shape";
|
import { line } from "d3-shape";
|
||||||
import {Link} from "../models/link";
|
import {Link} from "../models/link";
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import { Context } from "../../../map/models/context";
|
import { Context } from "../models/context";
|
||||||
import { Node } from "../models/node";
|
import { Node } from "../models/node";
|
||||||
import { Link } from "../models/link";
|
import { Link } from "../models/link";
|
||||||
import { NodesWidget } from "./nodes.widget";
|
import { NodesWidget } from "./nodes.widget";
|
||||||
import { Widget } from "./widget";
|
import { Widget } from "./widget";
|
||||||
import { SVGSelection } from "../../../map/models/types";
|
import { SVGSelection } from "../models/types";
|
||||||
import { LinksWidget } from "./links.widget";
|
import { LinksWidget } from "./links.widget";
|
||||||
import { Drawing } from "../models/drawing";
|
import { Drawing } from "../models/drawing";
|
||||||
import { DrawingsWidget } from "./drawings.widget";
|
import { DrawingsWidget } from "./drawings.widget";
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import {BaseType, select, Selection} from "d3-selection";
|
import {BaseType, select, Selection} from "d3-selection";
|
||||||
|
|
||||||
import { Widget } from "./widget";
|
import { Widget } from "./widget";
|
||||||
import { SVGSelection } from "../../../map/models/types";
|
import { SVGSelection } from "../models/types";
|
||||||
import { Link } from "../models/link";
|
import { Link } from "../models/link";
|
||||||
import { LinkStatus } from "../models/link-status";
|
import { LinkStatus } from "../models/link-status";
|
||||||
import { MultiLinkCalculatorHelper } from "../../map/helpers/multi-link-calculator-helper";
|
import { MultiLinkCalculatorHelper } from "../../map/helpers/multi-link-calculator-helper";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Widget } from "./widget";
|
import { Widget } from "./widget";
|
||||||
import { Node } from "../models/node";
|
import { Node } from "../models/node";
|
||||||
import { SVGSelection } from "../../../map/models/types";
|
import { SVGSelection } from "../models/types";
|
||||||
import {event, select} from "d3-selection";
|
import {event, select} from "d3-selection";
|
||||||
import {D3DragEvent, drag} from "d3-drag";
|
import {D3DragEvent, drag} from "d3-drag";
|
||||||
import {Symbol} from "../models/symbol";
|
import {Symbol} from "../models/symbol";
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import {Widget} from "./widget";
|
import {Widget} from "./widget";
|
||||||
import {SVGSelection} from "../../../map/models/types";
|
import {SVGSelection} from "../models/types";
|
||||||
import {Link} from "../models/link";
|
import {Link} from "../models/link";
|
||||||
import { path } from "d3-path";
|
import { path } from "d3-path";
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user