-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c1c22d2
commit 7364969
Showing
20 changed files
with
621 additions
and
624 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,101 +1,101 @@ | ||
import { | ||
IAnnotationModel, | ||
IJupyterCadDoc, | ||
JupyterCadModel | ||
} from '@jupytercad/schema'; | ||
import { DocumentRegistry } from '@jupyterlab/docregistry'; | ||
import { Contents } from '@jupyterlab/services'; | ||
// import { | ||
// IAnnotationModel, | ||
// IJupyterCadDoc, | ||
// JupyterCadModel | ||
// } from '@jupytercad/schema'; | ||
// import { DocumentRegistry } from '@jupyterlab/docregistry'; | ||
// import { Contents } from '@jupyterlab/services'; | ||
|
||
/** | ||
* A Model factory to create new instances of JupyterCadModel. | ||
*/ | ||
export class JupyterCadFCModelFactory | ||
implements DocumentRegistry.IModelFactory<JupyterCadModel> | ||
{ | ||
constructor(options: JupyterCadFCModelFactory.IOptions) { | ||
this._annotationModel = options.annotationModel; | ||
} | ||
// /** | ||
// * A Model factory to create new instances of JupyterCadModel. | ||
// */ | ||
// export class JupyterCadFCModelFactory | ||
// implements DocumentRegistry.IModelFactory<JupyterCadModel> | ||
// { | ||
// constructor(options: JupyterCadFCModelFactory.IOptions) { | ||
// this._annotationModel = options.annotationModel; | ||
// } | ||
|
||
/** | ||
* Whether the model is collaborative or not. | ||
*/ | ||
readonly collaborative = true; | ||
// /** | ||
// * Whether the model is collaborative or not. | ||
// */ | ||
// readonly collaborative = true; | ||
|
||
/** | ||
* The name of the model. | ||
* | ||
* @returns The name | ||
*/ | ||
get name(): string { | ||
return 'jupytercad-fcmodel'; | ||
} | ||
// /** | ||
// * The name of the model. | ||
// * | ||
// * @returns The name | ||
// */ | ||
// get name(): string { | ||
// return 'jupytercad-fcmodel'; | ||
// } | ||
|
||
/** | ||
* The content type of the file. | ||
* | ||
* @returns The content type | ||
*/ | ||
get contentType(): Contents.ContentType { | ||
return 'FCStd'; | ||
} | ||
// /** | ||
// * The content type of the file. | ||
// * | ||
// * @returns The content type | ||
// */ | ||
// get contentType(): Contents.ContentType { | ||
// return 'FCStd'; | ||
// } | ||
|
||
/** | ||
* The format of the file. | ||
* | ||
* @returns the file format | ||
*/ | ||
get fileFormat(): Contents.FileFormat { | ||
return 'base64'; | ||
} | ||
// /** | ||
// * The format of the file. | ||
// * | ||
// * @returns the file format | ||
// */ | ||
// get fileFormat(): Contents.FileFormat { | ||
// return 'base64'; | ||
// } | ||
|
||
/** | ||
* Get whether the model factory has been disposed. | ||
* | ||
* @returns disposed status | ||
*/ | ||
get isDisposed(): boolean { | ||
return this._disposed; | ||
} | ||
// /** | ||
// * Get whether the model factory has been disposed. | ||
// * | ||
// * @returns disposed status | ||
// */ | ||
// get isDisposed(): boolean { | ||
// return this._disposed; | ||
// } | ||
|
||
/** | ||
* Dispose the model factory. | ||
*/ | ||
dispose(): void { | ||
this._disposed = true; | ||
} | ||
// /** | ||
// * Dispose the model factory. | ||
// */ | ||
// dispose(): void { | ||
// this._disposed = true; | ||
// } | ||
|
||
/** | ||
* Get the preferred language given the path on the file. | ||
* | ||
* @param path path of the file represented by this document model | ||
* @returns The preferred language | ||
*/ | ||
preferredLanguage(path: string): string { | ||
return ''; | ||
} | ||
// /** | ||
// * Get the preferred language given the path on the file. | ||
// * | ||
// * @param path path of the file represented by this document model | ||
// * @returns The preferred language | ||
// */ | ||
// preferredLanguage(path: string): string { | ||
// return ''; | ||
// } | ||
|
||
/** | ||
* Create a new instance of JupyterCadModel. | ||
* | ||
* @returns The model | ||
*/ | ||
createNew( | ||
options: DocumentRegistry.IModelOptions<IJupyterCadDoc> | ||
): JupyterCadModel { | ||
const model = new JupyterCadModel({ | ||
sharedModel: options.sharedModel, | ||
languagePreference: options.languagePreference, | ||
annotationModel: this._annotationModel | ||
}); | ||
return model; | ||
} | ||
// /** | ||
// * Create a new instance of JupyterCadModel. | ||
// * | ||
// * @returns The model | ||
// */ | ||
// createNew( | ||
// options: DocumentRegistry.IModelOptions<IJupyterCadDoc> | ||
// ): JupyterCadModel { | ||
// const model = new JupyterCadModel({ | ||
// sharedModel: options.sharedModel, | ||
// languagePreference: options.languagePreference, | ||
// annotationModel: this._annotationModel | ||
// }); | ||
// return model; | ||
// } | ||
|
||
private _annotationModel: IAnnotationModel; | ||
private _disposed = false; | ||
} | ||
// private _annotationModel: IAnnotationModel; | ||
// private _disposed = false; | ||
// } | ||
|
||
export namespace JupyterCadFCModelFactory { | ||
export interface IOptions { | ||
annotationModel: IAnnotationModel; | ||
} | ||
} | ||
// export namespace JupyterCadFCModelFactory { | ||
// export interface IOptions { | ||
// annotationModel: IAnnotationModel; | ||
// } | ||
// } |
Oops, something went wrong.