浏览代码

changing workbench name

msDestiny14 4 年之前
父节点
当前提交
5dadcad675

+ 3 - 3
guiEditor/src/diagram/graphNode.ts

@@ -2,7 +2,7 @@ import { NodeMaterialBlock } from 'babylonjs/Materials/Node/nodeMaterialBlock';
 import { GlobalState } from '../globalState';
 import { Nullable } from 'babylonjs/types';
 import { Observer } from 'babylonjs/Misc/observable';
-import { GraphCanvasComponent, FramePortData } from './workbench';
+import { WorkbenchComponent, FramePortData } from './workbench';
 import { PropertyGuiLedger } from './propertyLedger';
 import * as React from 'react';
 import { GenericPropertyComponent } from './properties/genericNodePropertyComponent';
@@ -26,7 +26,7 @@ export class GraphNode {
     private _onSelectionChangedObserver: Nullable<Observer<Nullable<GraphNode | FramePortData>>>;  
     private _onSelectionBoxMovedObserver: Nullable<Observer<ClientRect | DOMRect>>;   
     private _onUpdateRequiredObserver: Nullable<Observer<void>>;  
-    private _ownerCanvas: GraphCanvasComponent; 
+    private _ownerCanvas: WorkbenchComponent; 
     private _isSelected: boolean;
     private _displayManager: Nullable<IDisplayManager> = null;
     private _isVisible = true;
@@ -297,7 +297,7 @@ export class GraphNode {
         }
     }
 
-    public appendVisual(root: HTMLDivElement, owner: GraphCanvasComponent) {
+    public appendVisual(root: HTMLDivElement, owner: WorkbenchComponent) {
         this._ownerCanvas = owner;
 
         // Display manager

+ 3 - 13
guiEditor/src/diagram/workbench.tsx

@@ -16,7 +16,7 @@ import { Container, Rectangle } from 'babylonjs-gui';
 
 require("./graphCanvas.scss");
 
-export interface IGraphCanvasComponentProps {
+export interface IWorkbenchComponentProps {
     globalState: GlobalState
 }
 
@@ -30,7 +30,7 @@ export const isFramePortData = (variableToCheck: any): variableToCheck is FrameP
     else return false;
 }
 
-export class GraphCanvasComponent extends React.Component<IGraphCanvasComponentProps> {
+export class WorkbenchComponent extends React.Component<IWorkbenchComponentProps> {
     private readonly MinZoom = 0.1;
     private readonly MaxZoom = 4;
 
@@ -146,7 +146,7 @@ export class GraphCanvasComponent extends React.Component<IGraphCanvasComponentP
         return this._frameContainer;
     }
 
-    constructor(props: IGraphCanvasComponentProps) {
+    constructor(props: IWorkbenchComponentProps) {
         super(props);
 
         props.globalState.onSelectionChangedObservable.add(selection => {  
@@ -557,9 +557,6 @@ export class GraphCanvasComponent extends React.Component<IGraphCanvasComponentP
                 minY = node.y;
             }
         });
-
-
-
         // Restore to 0
 
         this._nodes.forEach(node => {
@@ -578,19 +575,12 @@ export class GraphCanvasComponent extends React.Component<IGraphCanvasComponentP
         this.y = 0;
     }
 
-
     processEditorData(editorData: IEditorData) {
-
-
         this.x = editorData.x || 0;
         this.y = editorData.y || 0;
         this.zoom = editorData.zoom || 1;
-
-        // Frames
-
     }
 
-
     public createGUICanvas()
     {
         // Get the canvas element from the DOM.

+ 2 - 2
guiEditor/src/globalState.ts

@@ -8,7 +8,7 @@ import { DataStorage } from 'babylonjs/Misc/dataStorage';
 import { Color4 } from 'babylonjs/Maths/math.color';
 import { GraphNode } from './diagram/graphNode';
 import { Vector2 } from 'babylonjs/Maths/math.vector';
-import { FramePortData, GraphCanvasComponent } from './diagram/workbench';
+import { FramePortData, WorkbenchComponent } from './diagram/workbench';
 import { NodeMaterialModes } from 'babylonjs/Materials/Node/Enums/nodeMaterialModes';
 
 export class GlobalState {
@@ -52,7 +52,7 @@ export class GlobalState {
     directionalLight0: boolean;
     directionalLight1: boolean;
     controlCamera: boolean;
-    workbench: GraphCanvasComponent;
+    workbench: WorkbenchComponent;
     storeEditorData: (serializationObject: any, frame?: Nullable<null>) => void;
     _mode: NodeMaterialModes;
 

+ 4 - 4
guiEditor/src/graphEditor.tsx

@@ -17,7 +17,7 @@ import { IEditorData } from './nodeLocationInfo';
 import { PreviewMeshControlComponent } from './components/preview/previewMeshControlComponent';
 import { PreviewAreaComponent } from './components/preview/previewAreaComponent';
 import { SerializationTools } from './serializationTools';
-import { GraphCanvasComponent } from './diagram/workbench';
+import { WorkbenchComponent } from './diagram/workbench';
 import { GraphNode } from './diagram/graphNode';
 import * as ReactDOM from 'react-dom';
 import { IInspectorOptions } from "babylonjs/Debug/debugLayer";
@@ -43,7 +43,7 @@ interface IInternalPreviewAreaOptions extends IInspectorOptions {
 }
 
 export class GraphEditor extends React.Component<IGraphEditorProps, IGraphEditorState> {
-    private _graphCanvas: GraphCanvasComponent;
+    private _graphCanvas: WorkbenchComponent;
 
     private _startX: number;
     private _moveInProgress: boolean;
@@ -105,7 +105,7 @@ export class GraphEditor extends React.Component<IGraphEditorProps, IGraphEditor
 
     componentDidMount() {
         if (this.props.globalState.hostDocument) {
-            this._graphCanvas = (this.refs["graphCanvas"] as GraphCanvasComponent);
+            this._graphCanvas = (this.refs["graphCanvas"] as WorkbenchComponent);
             this._previewManager = new PreviewManager(this.props.globalState.hostDocument.getElementById("preview-canvas") as HTMLCanvasElement, this.props.globalState);
         }
 
@@ -747,7 +747,7 @@ export class GraphEditor extends React.Component<IGraphEditorProps, IGraphEditor
                             event.preventDefault();
                         }}
                     >                        
-                        <GraphCanvasComponent ref={"graphCanvas"} globalState={this.props.globalState}/>
+                        <WorkbenchComponent ref={"graphCanvas"} globalState={this.props.globalState}/>
                     </div>
 
                     <div id="rightGrab"