Skip to content

Commit 13d2189

Browse files
committed
Standardize naming
1 parent 6c2f633 commit 13d2189

File tree

4 files changed

+23
-19
lines changed

4 files changed

+23
-19
lines changed

src/factory.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,26 @@ import {
44
DocumentModel
55
} from '@jupyterlab/docregistry';
66

7-
import { UrdfWidget, UrdfPanel } from './widget';
7+
import { URDFWidget, URDFPanel } from './widget';
88

99
/**
10-
* A widget factory to create new instances of UrdfWidgets
10+
* A widget factory to create new instances of URDFWidgets
1111
*/
12-
export class UrdfWidgetFactory extends ABCWidgetFactory<
13-
UrdfWidget,
12+
export class URDFWidgetFactory extends ABCWidgetFactory<
13+
URDFWidget,
1414
DocumentModel
1515
> {
1616
constructor(options: DocumentRegistry.IWidgetFactoryOptions) {
1717
super(options);
1818
}
1919

20-
// Create new UrdfWidget given a context (file info)
20+
// Create new URDFWidget given a context (file info)
2121
protected createNewWidget(
2222
context: DocumentRegistry.IContext<DocumentModel>
23-
): UrdfWidget {
24-
return new UrdfWidget({
23+
): URDFWidget {
24+
return new URDFWidget({
2525
context,
26-
content: new UrdfPanel(context)
26+
content: new URDFPanel(context)
2727
});
2828
}
2929
}

src/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ import { Menu } from '@lumino/widgets';
2020

2121
import { Token } from '@lumino/coreutils';
2222

23-
import { UrdfWidget } from './widget';
23+
import { URDFWidget } from './widget';
2424

25-
import { UrdfWidgetFactory } from './factory';
25+
import { URDFWidgetFactory } from './factory';
2626

2727
import { urdf_icon } from './icons';
2828

@@ -33,7 +33,7 @@ import { IEditorLanguageRegistry } from '@jupyterlab/codemirror';
3333
const FACTORY = 'URDF Widget Factory';
3434

3535
// Export token so other extensions can require it
36-
export const IUrdfTracker = new Token<IWidgetTracker<UrdfWidget>>(
36+
export const IURDFTracker = new Token<IWidgetTracker<URDFWidget>>(
3737
'urdf-tracker'
3838
);
3939

@@ -65,7 +65,7 @@ const extension: JupyterFrontEndPlugin<void> = {
6565

6666
// Tracker
6767
const namespace = 'jupyterlab-urdf';
68-
const tracker = new WidgetTracker<UrdfWidget>({ namespace });
68+
const tracker = new WidgetTracker<URDFWidget>({ namespace });
6969

7070
// State restoration: reopen document if it was open previously
7171
if (restorer) {
@@ -80,7 +80,7 @@ const extension: JupyterFrontEndPlugin<void> = {
8080
}
8181

8282
// Create widget factory so that manager knows about widget
83-
const widgetFactory = new UrdfWidgetFactory({
83+
const widgetFactory = new URDFWidgetFactory({
8484
name: FACTORY,
8585
fileTypes: ['urdf'],
8686
defaultFor: ['urdf']

src/robot.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ export class URDFLoadingManager extends LoadingManager {
7979
}
8080
}
8181

82+
dispose(): void {
83+
this._robotModel = {} as URDFRobot;
84+
}
85+
8286
get robotModel() {
8387
return this._robotModel;
8488
}

src/widget.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ import { Signal } from '@lumino/signaling';
1313
import { URDFLayout } from './layout';
1414

1515
/**
16-
* UrdfWidget: widget that represents the view for a urdf (file).
16+
* URDFWidget: widget that represents the view for a urdf (file).
1717
*/
18-
export class UrdfWidget extends DocumentWidget<UrdfPanel, DocumentModel> {
19-
constructor(options: DocumentWidget.IOptions<UrdfPanel, DocumentModel>) {
18+
export class URDFWidget extends DocumentWidget<URDFPanel, DocumentModel> {
19+
constructor(options: DocumentWidget.IOptions<URDFPanel, DocumentModel>) {
2020
super(options);
2121
}
2222

@@ -28,13 +28,13 @@ export class UrdfWidget extends DocumentWidget<UrdfPanel, DocumentModel> {
2828
}
2929

3030
/**
31-
* UrdfPanel: widget that contains the main view of the UrdfWidget.
31+
* URDFPanel: widget that contains the main view of the URDFWidget.
3232
*/
33-
export class UrdfPanel extends Panel {
33+
export class URDFPanel extends Panel {
3434
private _context: DocumentRegistry.IContext<DocumentModel>;
3535

3636
/**
37-
* Construct a UrdfPanel
37+
* Construct a URDFPanel
3838
*
3939
* @param context - The documents context
4040
*/

0 commit comments

Comments
 (0)