aboutsummaryrefslogtreecommitdiff
path: root/src/documents/Documents.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/documents/Documents.ts')
-rw-r--r--src/documents/Documents.ts90
1 files changed, 45 insertions, 45 deletions
diff --git a/src/documents/Documents.ts b/src/documents/Documents.ts
index b69b79dd3..252ee9766 100644
--- a/src/documents/Documents.ts
+++ b/src/documents/Documents.ts
@@ -22,35 +22,35 @@ interface DocumentOptions {
export namespace Documents {
function setupOptions(doc: Document, options: DocumentOptions): void {
if (options.x) {
- doc.SetFieldValue(KeyStore.X, options.x, NumberField);
+ doc.SetData(KeyStore.X, options.x, NumberField);
}
if (options.y) {
- doc.SetFieldValue(KeyStore.Y, options.y, NumberField);
+ doc.SetData(KeyStore.Y, options.y, NumberField);
}
if (options.width) {
- doc.SetFieldValue(KeyStore.Width, options.width, NumberField);
+ doc.SetData(KeyStore.Width, options.width, NumberField);
}
if (options.height) {
- doc.SetFieldValue(KeyStore.Height, options.height, NumberField);
+ doc.SetData(KeyStore.Height, options.height, NumberField);
}
if (options.title) {
- doc.SetFieldValue(KeyStore.Title, options.title, TextField);
+ doc.SetData(KeyStore.Title, options.title, TextField);
}
- doc.SetFieldValue(KeyStore.Scale, 1, NumberField);
- doc.SetFieldValue(KeyStore.PanX, 0, NumberField);
- doc.SetFieldValue(KeyStore.PanY, 0, NumberField);
+ doc.SetData(KeyStore.Scale, 1, NumberField);
+ doc.SetData(KeyStore.PanX, 0, NumberField);
+ doc.SetData(KeyStore.PanY, 0, NumberField);
}
let textProto: Document;
function GetTextPrototype(): Document {
if (!textProto) {
textProto = new Document();
- textProto.SetField(KeyStore.X, new NumberField(0));
- textProto.SetField(KeyStore.Y, new NumberField(0));
- textProto.SetField(KeyStore.Width, new NumberField(300));
- textProto.SetField(KeyStore.Height, new NumberField(150));
- textProto.SetField(KeyStore.Layout, new TextField(FormattedTextBox.LayoutString()));
- textProto.SetField(KeyStore.LayoutKeys, new ListField([KeyStore.Data]));
+ textProto.Set(KeyStore.X, new NumberField(0));
+ textProto.Set(KeyStore.Y, new NumberField(0));
+ textProto.Set(KeyStore.Width, new NumberField(300));
+ textProto.Set(KeyStore.Height, new NumberField(150));
+ textProto.Set(KeyStore.Layout, new TextField(FormattedTextBox.LayoutString()));
+ textProto.Set(KeyStore.LayoutKeys, new ListField([KeyStore.Data]));
}
return textProto;
}
@@ -66,12 +66,12 @@ export namespace Documents {
function GetSchemaPrototype(): Document {
if (!schemaProto) {
schemaProto = new Document();
- schemaProto.SetField(KeyStore.X, new NumberField(0));
- schemaProto.SetField(KeyStore.Y, new NumberField(0));
- schemaProto.SetField(KeyStore.Width, new NumberField(300));
- schemaProto.SetField(KeyStore.Height, new NumberField(150));
- schemaProto.SetField(KeyStore.Layout, new TextField(CollectionSchemaView.LayoutString()));
- schemaProto.SetField(KeyStore.LayoutKeys, new ListField([KeyStore.Data]));
+ schemaProto.Set(KeyStore.X, new NumberField(0));
+ schemaProto.Set(KeyStore.Y, new NumberField(0));
+ schemaProto.Set(KeyStore.Width, new NumberField(300));
+ schemaProto.Set(KeyStore.Height, new NumberField(150));
+ schemaProto.Set(KeyStore.Layout, new TextField(CollectionSchemaView.LayoutString()));
+ schemaProto.Set(KeyStore.LayoutKeys, new ListField([KeyStore.Data]));
}
return schemaProto;
}
@@ -79,7 +79,7 @@ export namespace Documents {
export function SchemaDocument(documents: Array<Document>, options: DocumentOptions = {}): Document {
let doc = GetSchemaPrototype().MakeDelegate();
setupOptions(doc, options);
- doc.SetField(KeyStore.Data, new ListField(documents));
+ doc.Set(KeyStore.Data, new ListField(documents));
return doc;
}
@@ -88,12 +88,12 @@ export namespace Documents {
function GetDockPrototype(): Document {
if (!dockProto) {
dockProto = new Document();
- dockProto.SetField(KeyStore.X, new NumberField(0));
- dockProto.SetField(KeyStore.Y, new NumberField(0));
- dockProto.SetField(KeyStore.Width, new NumberField(300));
- dockProto.SetField(KeyStore.Height, new NumberField(150));
- dockProto.SetField(KeyStore.Layout, new TextField(CollectionDockingView.LayoutString()));
- dockProto.SetField(KeyStore.LayoutKeys, new ListField([KeyStore.Data]));
+ dockProto.Set(KeyStore.X, new NumberField(0));
+ dockProto.Set(KeyStore.Y, new NumberField(0));
+ dockProto.Set(KeyStore.Width, new NumberField(300));
+ dockProto.Set(KeyStore.Height, new NumberField(150));
+ dockProto.Set(KeyStore.Layout, new TextField(CollectionDockingView.LayoutString()));
+ dockProto.Set(KeyStore.LayoutKeys, new ListField([KeyStore.Data]));
}
return dockProto;
}
@@ -101,7 +101,7 @@ export namespace Documents {
export function DockDocument(documents: Array<Document>, options: DocumentOptions = {}): Document {
let doc = GetDockPrototype().MakeDelegate();
setupOptions(doc, options);
- doc.SetField(KeyStore.Data, new ListField(documents));
+ doc.Set(KeyStore.Data, new ListField(documents));
return doc;
}
@@ -110,13 +110,13 @@ export namespace Documents {
function GetImagePrototype(): Document {
if (!imageProto) {
imageProto = new Document();
- imageProto.SetField(KeyStore.X, new NumberField(0));
- imageProto.SetField(KeyStore.Y, new NumberField(0));
- imageProto.SetField(KeyStore.Width, new NumberField(300));
- imageProto.SetField(KeyStore.Height, new NumberField(300));
- imageProto.SetField(KeyStore.Layout, new TextField(ImageBox.LayoutString()));
+ imageProto.Set(KeyStore.X, new NumberField(0));
+ imageProto.Set(KeyStore.Y, new NumberField(0));
+ imageProto.Set(KeyStore.Width, new NumberField(300));
+ imageProto.Set(KeyStore.Height, new NumberField(300));
+ imageProto.Set(KeyStore.Layout, new TextField(ImageBox.LayoutString()));
// imageProto.SetField(KeyStore.Layout, new TextField('<div style={"background-image: " + {Data}} />'));
- imageProto.SetField(KeyStore.LayoutKeys, new ListField([KeyStore.Data]));
+ imageProto.Set(KeyStore.LayoutKeys, new ListField([KeyStore.Data]));
}
return imageProto;
}
@@ -124,7 +124,7 @@ export namespace Documents {
export function ImageDocument(url: string, options: DocumentOptions = {}): Document {
let doc = GetImagePrototype().MakeDelegate();
setupOptions(doc, options);
- doc.SetField(KeyStore.Data, new ImageField(new URL(url)));
+ doc.Set(KeyStore.Data, new ImageField(new URL(url)));
return doc;
}
@@ -132,15 +132,15 @@ export namespace Documents {
function GetCollectionPrototype(): Document {
if (!collectionProto) {
collectionProto = new Document();
- collectionProto.SetField(KeyStore.X, new NumberField(0));
- collectionProto.SetField(KeyStore.Y, new NumberField(0));
- collectionProto.SetField(KeyStore.Scale, new NumberField(1));
- collectionProto.SetField(KeyStore.PanX, new NumberField(0));
- collectionProto.SetField(KeyStore.PanY, new NumberField(0));
- collectionProto.SetField(KeyStore.Width, new NumberField(300));
- collectionProto.SetField(KeyStore.Height, new NumberField(300));
- collectionProto.SetField(KeyStore.Layout, new TextField(CollectionFreeFormView.LayoutString()));
- collectionProto.SetField(KeyStore.LayoutKeys, new ListField([KeyStore.Data]));
+ collectionProto.Set(KeyStore.X, new NumberField(0));
+ collectionProto.Set(KeyStore.Y, new NumberField(0));
+ collectionProto.Set(KeyStore.Scale, new NumberField(1));
+ collectionProto.Set(KeyStore.PanX, new NumberField(0));
+ collectionProto.Set(KeyStore.PanY, new NumberField(0));
+ collectionProto.Set(KeyStore.Width, new NumberField(300));
+ collectionProto.Set(KeyStore.Height, new NumberField(300));
+ collectionProto.Set(KeyStore.Layout, new TextField(CollectionFreeFormView.LayoutString()));
+ collectionProto.Set(KeyStore.LayoutKeys, new ListField([KeyStore.Data]));
}
return collectionProto;
}
@@ -148,7 +148,7 @@ export namespace Documents {
export function CollectionDocument(documents: Array<Document>, options: DocumentOptions = {}): Document {
let doc = GetCollectionPrototype().MakeDelegate();
setupOptions(doc, options);
- doc.SetField(KeyStore.Data, new ListField(documents));
+ doc.Set(KeyStore.Data, new ListField(documents));
return doc;
}
} \ No newline at end of file