-
Notifications
You must be signed in to change notification settings - Fork 13
/
actions.dart
4581 lines (3244 loc) · 163 KB
/
actions.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
@JS()
library actions2;
import 'dart:math';
import 'package:built_value/built_value.dart';
import 'package:built_value/serializer.dart';
import 'package:color/color.dart';
import 'package:js/js.dart';
import 'package:built_collection/built_collection.dart';
import 'package:scadnano/src/dna_file_type.dart';
import 'package:scadnano/src/state/dna_assign_options.dart';
import 'package:scadnano/src/state/dna_extensions_move.dart';
import 'package:scadnano/src/state/domains_move.dart';
import 'package:scadnano/src/state/export_dna_format_strand_order.dart';
import 'package:scadnano/src/state/geometry.dart';
import 'package:scadnano/src/state/helix_group_move.dart';
import 'package:scadnano/src/state/vendor_fields.dart';
import 'package:scadnano/src/state/linker.dart';
import 'package:scadnano/src/state/substrand.dart';
import 'package:scadnano/src/util.dart';
import '../state/address.dart';
import '../state/app_ui_state_storables.dart';
import '../state/domain.dart';
import '../state/design.dart';
import '../state/group.dart';
import '../state/context_menu.dart';
import '../state/crossover.dart';
import '../state/dialog.dart';
import '../state/dna_end.dart';
import '../state/dna_ends_move.dart';
import '../state/export_dna_format.dart';
import '../state/grid.dart';
import '../state/helix.dart';
import '../state/local_storage_design_choice.dart';
import '../state/loopout.dart';
import '../state/extension.dart';
import '../state/modification.dart';
import '../state/position3d.dart';
import '../state/potential_crossover.dart';
import '../state/selectable.dart';
import '../state/selection_box.dart';
import '../state/strand.dart';
import '../state/strand_part.dart';
import '../state/strands_move.dart';
import '../state/edit_mode.dart';
import '../serializers.dart';
import '../state/select_mode.dart';
import '../state/grid_position.dart';
import '../state/mouseover_data.dart';
import '../middleware/local_storage.dart';
part 'actions.g.dart';
/// [Action]s don't have to implement BuiltValue, but if they do, and they use the serialization mechanism,
/// this this toJson method will work automatically.
abstract class Action {
dynamic toJson();
}
// Actions that affect the DNADesign (i.e., not purely UIAppState-affecting actions such as selecting items).
// Only Undo and Redo implement this directly; all others implement the subtype UndoableAction.
abstract class DesignChangingAction implements StorableAction, SvgPngCacheInvalidatingAction {
Iterable<Storable> storables() => [Storable.design];
}
/// Undoable actions, which must affect the DNADesign, and can be undone by Ctrl+Z.
/// Previously, whether an action was a subtype of UndoableAction was used to check whether to write
/// the design to localStorage. Now, we just check whether the Design changed, but print a warning
/// if the action is not a subtype of UndoableAction. However, this subtype relationship IS still
/// currently used to detect whether to affect the undo stack.
abstract class UndoableAction implements DesignChangingAction {
Iterable<Storable> storables() => [Storable.design];
String short_description();
}
/// Fast actions are not dispatched to normal store for optimization
abstract class FastAction extends Action {}
// Wrap an UndoableAction in a SkipUndo in order to apply it, but skip its effect on the undo/redo stacks.
abstract class SkipUndo with BuiltJsonSerializable implements Action, Built<SkipUndo, SkipUndoBuilder> {
UndoableAction get undoable_action;
/************************ begin BuiltValue boilerplate ************************/
factory SkipUndo(UndoableAction undoable_action) =>
SkipUndo.from((b) => b..undoable_action = undoable_action);
factory SkipUndo.from([void Function(SkipUndoBuilder) updates]) = _$SkipUndo;
SkipUndo._();
static Serializer<SkipUndo> get serializer => _$skipUndoSerializer;
}
/// [Action] that should trigger storing of certain [Storable]s to localStorage.
abstract class StorableAction extends Action {
Iterable<Storable> storables();
}
/// [Action] that should invalidate the svg png cache.
abstract class SvgPngCacheInvalidatingAction extends Action {}
/// [Action] that should invalidate the svg png cache only if
/// `app.ui_state.only_display_selected_helices` is on.
///
/// This is useful for helix select actions because the svg-png-cache only
/// needs to be invalidated while `only_display_selected_helices` is true.
/// Otherwise, when `only_display_selected_helices` is false, the main view
/// does not get affected from selecting helices.
abstract class HelixSelectSvgPngCacheInvalidatingAction extends Action {}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Undo/Redo
abstract class Undo with BuiltJsonSerializable, DesignChangingAction implements Built<Undo, UndoBuilder> {
int get num_undos;
/************************ begin BuiltValue boilerplate ************************/
factory Undo(int num_undos) => Undo.from((b) => b..num_undos = num_undos);
factory Undo.from([void Function(UndoBuilder) updates]) = _$Undo;
Undo._();
static Serializer<Undo> get serializer => _$undoSerializer;
}
abstract class Redo with BuiltJsonSerializable, DesignChangingAction implements Built<Redo, RedoBuilder> {
int get num_redos;
/************************ begin BuiltValue boilerplate ************************/
factory Redo(int num_redos) => Redo.from((b) => b..num_redos = num_redos);
factory Redo.from([void Function(RedoBuilder) updates]) = _$Redo;
Redo._();
static Serializer<Redo> get serializer => _$redoSerializer;
}
abstract class UndoRedoClear
with BuiltJsonSerializable
implements Action, Built<UndoRedoClear, UndoRedoClearBuilder> {
/************************ begin BuiltValue boilerplate ************************/
factory UndoRedoClear() => UndoRedoClear.from((b) => b);
factory UndoRedoClear.from([void Function(UndoRedoClearBuilder) updates]) = _$UndoRedoClear;
UndoRedoClear._();
static Serializer<UndoRedoClear> get serializer => _$undoRedoClearSerializer;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Batch action
/// [Action] intended for applying >= 2 other [UndoableAction]s at once,
/// which can be undone/redone in a single step by [UndoRedo].
abstract class BatchAction
with BuiltJsonSerializable, UndoableAction
implements Built<BatchAction, BatchActionBuilder> {
BuiltList<UndoableAction> get actions;
String get short_description_value;
/************************ begin BuiltValue boilerplate ************************/
factory BatchAction(Iterable<UndoableAction> actions, String short_description_value) =>
BatchAction.from((b) => b
..actions.replace(actions)
..short_description_value = short_description_value);
factory BatchAction.from([void Function(BatchActionBuilder) updates]) = _$BatchAction;
BatchAction._();
static Serializer<BatchAction> get serializer => _$batchActionSerializer;
@override
dynamic toJson() => {'actions': actions.toList()};
@override
String short_description() => short_description_value;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Throttle
//XXX: Originally all ThrottledActions were FastActions because anything that would need to be throttled
// (>= 60 fps) was too fast to be handled by the normal React/Redux store updates. Now that we have trimmed
// the rendering time significantly (https://github.com/UC-Davis-molecular-computing/scadnano/issues/87),
// this is no longer the case. But FastAction is still used to avoid
// dispatching actions to the main store. So we need ThrottledActionNonFast to throttle actions that we still
// would like to be dispatched to the main store.
abstract class ThrottledAction implements Action {
Action get action;
num get interval_sec;
}
abstract class ThrottledActionFast
with BuiltJsonSerializable
implements ThrottledAction, FastAction, Built<ThrottledActionFast, ThrottledActionFastBuilder> {
Action get action;
num get interval_sec;
/************************ begin BuiltValue boilerplate ************************/
factory ThrottledActionFast(Action action, num interval_sec) => ThrottledActionFast.from((b) => b
..action = action
..interval_sec = interval_sec);
factory ThrottledActionFast.from([void Function(ThrottledActionFastBuilder) updates]) =
_$ThrottledActionFast;
ThrottledActionFast._();
static Serializer<ThrottledActionFast> get serializer => _$throttledActionFastSerializer;
}
abstract class ThrottledActionNonFast
with BuiltJsonSerializable
implements ThrottledAction, Built<ThrottledActionNonFast, ThrottledActionNonFastBuilder> {
Action get action;
num get interval_sec;
/************************ begin BuiltValue boilerplate ************************/
factory ThrottledActionNonFast(Action action, num interval_sec) => ThrottledActionNonFast.from((b) => b
..action = action
..interval_sec = interval_sec);
factory ThrottledActionNonFast.from([void Function(ThrottledActionNonFastBuilder) updates]) =
_$ThrottledActionNonFast;
ThrottledActionNonFast._();
static Serializer<ThrottledActionNonFast> get serializer => _$throttledActionNonFastSerializer;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// set options for when to write design to localStorage
abstract class LocalStorageDesignChoiceSet
with BuiltJsonSerializable
implements Action, Built<LocalStorageDesignChoiceSet, LocalStorageDesignChoiceSetBuilder> {
LocalStorageDesignChoice get choice;
/************************ begin BuiltValue boilerplate ************************/
factory LocalStorageDesignChoiceSet({LocalStorageDesignChoice choice}) = _$LocalStorageDesignChoiceSet._;
LocalStorageDesignChoiceSet._();
static Serializer<LocalStorageDesignChoiceSet> get serializer => _$localStorageDesignChoiceSetSerializer;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// erase localStorage stored design and storable UI settings
abstract class ResetLocalStorage
with BuiltJsonSerializable
implements Action, Built<ResetLocalStorage, ResetLocalStorageBuilder> {
/************************ begin BuiltValue boilerplate ************************/
factory ResetLocalStorage() = _$ResetLocalStorage._;
ResetLocalStorage._();
static Serializer<ResetLocalStorage> get serializer => _$resetLocalStorageSerializer;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Clear helix selection when loading new design
abstract class ClearHelixSelectionWhenLoadingNewDesignSet
with BuiltJsonSerializable
implements
Action,
Built<ClearHelixSelectionWhenLoadingNewDesignSet, ClearHelixSelectionWhenLoadingNewDesignSetBuilder> {
bool get clear;
/************************ begin BuiltValue boilerplate ************************/
factory ClearHelixSelectionWhenLoadingNewDesignSet({bool clear}) =
_$ClearHelixSelectionWhenLoadingNewDesignSet._;
ClearHelixSelectionWhenLoadingNewDesignSet._();
static Serializer<ClearHelixSelectionWhenLoadingNewDesignSet> get serializer =>
_$clearHelixSelectionWhenLoadingNewDesignSetSerializer;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Edit modes
abstract class EditModeToggle
with BuiltJsonSerializable
implements Action, Built<EditModeToggle, EditModeToggleBuilder> {
EditModeChoice get mode;
/************************ begin BuiltValue boilerplate ************************/
factory EditModeToggle(EditModeChoice mode) => EditModeToggle.from((b) => b..mode = mode);
factory EditModeToggle.from([void Function(EditModeToggleBuilder) updates]) = _$EditModeToggle;
EditModeToggle._();
static Serializer<EditModeToggle> get serializer => _$editModeToggleSerializer;
}
abstract class EditModesSet
with BuiltJsonSerializable
implements Action, Built<EditModesSet, EditModesSetBuilder> {
BuiltSet<EditModeChoice> get edit_modes;
/************************ begin BuiltValue boilerplate ************************/
factory EditModesSet(Iterable<EditModeChoice> edit_modes) =>
EditModesSet.from((b) => b..edit_modes.replace(edit_modes));
factory EditModesSet.from([void Function(EditModesSetBuilder) updates]) = _$EditModesSet;
EditModesSet._();
static Serializer<EditModesSet> get serializer => _$editModesSetSerializer;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Select modes
abstract class SelectModeToggle
with BuiltJsonSerializable
implements Action, Built<SelectModeToggle, SelectModeToggleBuilder> {
SelectModeChoice get select_mode_choice;
/************************ begin BuiltValue boilerplate ************************/
factory SelectModeToggle(SelectModeChoice select_mode_choice) =>
SelectModeToggle.from((b) => b..select_mode_choice = select_mode_choice);
factory SelectModeToggle.from([void Function(SelectModeToggleBuilder) updates]) = _$SelectModeToggle;
SelectModeToggle._();
static Serializer<SelectModeToggle> get serializer => _$selectModeToggleSerializer;
}
abstract class SelectModesAdd
with BuiltJsonSerializable
implements Action, Built<SelectModesAdd, SelectModesAddBuilder> {
BuiltList<SelectModeChoice> get modes;
/************************ begin BuiltValue boilerplate ************************/
factory SelectModesAdd({BuiltList<SelectModeChoice> modes}) = _$SelectModesAdd._;
SelectModesAdd._();
static Serializer<SelectModesAdd> get serializer => _$selectModesAddSerializer;
}
abstract class SelectModesSet
with BuiltJsonSerializable
implements Action, Built<SelectModesSet, SelectModesSetBuilder> {
BuiltSet<SelectModeChoice> get select_mode_choices;
/************************ begin BuiltValue boilerplate ************************/
factory SelectModesSet(Iterable<SelectModeChoice> select_mode_choices) =>
SelectModesSet.from((b) => b..select_mode_choices.replace(select_mode_choices));
factory SelectModesSet.from([void Function(SelectModesSetBuilder) updates]) = _$SelectModesSet;
SelectModesSet._();
static Serializer<SelectModesSet> get serializer => _$selectModesSetSerializer;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Strand/domain/loopout names/labels
// used to set or remove (set name=null to remove)
abstract class StrandNameSet
with BuiltJsonSerializable, UndoableAction
implements SingleStrandAction, Built<StrandNameSet, StrandNameSetBuilder> {
@nullable
String get name;
Strand get strand;
/************************ begin BuiltValue boilerplate ************************/
factory StrandNameSet({String name, Strand strand}) = _$StrandNameSet._;
StrandNameSet._();
static Serializer<StrandNameSet> get serializer => _$strandNameSetSerializer;
@memoized
int get hashCode;
@override
String short_description() => "set strand name";
}
// used to set or remove (set name=null to remove)
abstract class StrandLabelSet
with BuiltJsonSerializable, UndoableAction
implements SingleStrandAction, Built<StrandLabelSet, StrandLabelSetBuilder> {
@nullable
String get label;
Strand get strand;
/************************ begin BuiltValue boilerplate ************************/
factory StrandLabelSet({String label, Strand strand}) = _$StrandLabelSet._;
StrandLabelSet._();
static Serializer<StrandLabelSet> get serializer => _$strandLabelSetSerializer;
@memoized
int get hashCode;
@override
String short_description() => "set strand label";
}
// used to set or remove (set name=null to remove)
// used for Domains, Loopouts, and Extensions
abstract class SubstrandNameSet
with BuiltJsonSerializable, UndoableAction
implements StrandPartAction, Built<SubstrandNameSet, SubstrandNameSetBuilder> {
@nullable
String get name;
Substrand get substrand;
StrandPart get strand_part => substrand;
/************************ begin BuiltValue boilerplate ************************/
factory SubstrandNameSet({String name, Substrand substrand}) = _$SubstrandNameSet._;
SubstrandNameSet._();
static Serializer<SubstrandNameSet> get serializer => _$substrandNameSetSerializer;
@memoized
int get hashCode;
@override
String short_description() => "set ${substrand.type_description()} name";
}
// used to set or remove (set name=null to remove)
// used for Domains, Loopouts, and Extensions
abstract class SubstrandLabelSet
with BuiltJsonSerializable, UndoableAction
implements StrandPartAction, Built<SubstrandLabelSet, SubstrandLabelSetBuilder> {
@nullable
String get label;
Substrand get substrand;
StrandPart get strand_part => substrand;
/************************ begin BuiltValue boilerplate ************************/
factory SubstrandLabelSet({String label, Substrand substrand}) = _$SubstrandLabelSet._;
SubstrandLabelSet._();
static Serializer<SubstrandLabelSet> get serializer => _$substrandLabelSetSerializer;
@memoized
int get hashCode;
@override
String short_description() => "set ${substrand.type_description()} label";
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Show/hide DNA/modifications/mismatches/domain labels/editor
abstract class SetAppUIStateStorable
with BuiltJsonSerializable
implements Action, Built<SetAppUIStateStorable, SetAppUIStateStorableBuilder> {
AppUIStateStorables get storables;
factory SetAppUIStateStorable(AppUIStateStorables storables) =>
SetAppUIStateStorable.from((b) => b..storables = storables.toBuilder());
/************************ begin BuiltValue boilerplate ************************/
factory SetAppUIStateStorable.from([void Function(SetAppUIStateStorableBuilder) updates]) =
_$SetAppUIStateStorable;
SetAppUIStateStorable._();
static Serializer<SetAppUIStateStorable> get serializer => _$setAppUIStateStorableSerializer;
}
abstract class ShowDNASet with BuiltJsonSerializable implements Action, Built<ShowDNASet, ShowDNASetBuilder> {
bool get show;
factory ShowDNASet(bool show) => ShowDNASet.from((b) => b..show = show);
/************************ begin BuiltValue boilerplate ************************/
factory ShowDNASet.from([void Function(ShowDNASetBuilder) updates]) = _$ShowDNASet;
ShowDNASet._();
static Serializer<ShowDNASet> get serializer => _$showDNASetSerializer;
}
abstract class ShowDomainNamesSet
with BuiltJsonSerializable
implements Action, Built<ShowDomainNamesSet, ShowDomainNamesSetBuilder> {
bool get show;
factory ShowDomainNamesSet(bool show) => ShowDomainNamesSet.from((b) => b..show = show);
/************************ begin BuiltValue boilerplate ************************/
factory ShowDomainNamesSet.from([void Function(ShowDomainNamesSetBuilder) updates]) = _$ShowDomainNamesSet;
ShowDomainNamesSet._();
static Serializer<ShowDomainNamesSet> get serializer => _$showDomainNamesSetSerializer;
}
abstract class ShowStrandNamesSet
with BuiltJsonSerializable
implements Action, Built<ShowStrandNamesSet, ShowStrandNamesSetBuilder> {
bool get show;
factory ShowStrandNamesSet(bool show) => ShowStrandNamesSet.from((b) => b..show = show);
/************************ begin BuiltValue boilerplate ************************/
factory ShowStrandNamesSet.from([void Function(ShowStrandNamesSetBuilder) updates]) = _$ShowStrandNamesSet;
ShowStrandNamesSet._();
static Serializer<ShowStrandNamesSet> get serializer => _$showStrandNamesSetSerializer;
}
abstract class ShowStrandLabelsSet
with BuiltJsonSerializable
implements Action, Built<ShowStrandLabelsSet, ShowStrandLabelsSetBuilder> {
bool get show;
factory ShowStrandLabelsSet(bool show) => ShowStrandLabelsSet.from((b) => b..show = show);
/************************ begin BuiltValue boilerplate ************************/
factory ShowStrandLabelsSet.from([void Function(ShowStrandLabelsSetBuilder) updates]) =
_$ShowStrandLabelsSet;
ShowStrandLabelsSet._();
static Serializer<ShowStrandLabelsSet> get serializer => _$showStrandLabelsSetSerializer;
}
abstract class ShowDomainLabelsSet
with BuiltJsonSerializable
implements Action, Built<ShowDomainLabelsSet, ShowDomainLabelsSetBuilder> {
bool get show;
factory ShowDomainLabelsSet(bool show) => ShowDomainLabelsSet.from((b) => b..show = show);
/************************ begin BuiltValue boilerplate ************************/
factory ShowDomainLabelsSet.from([void Function(ShowDomainLabelsSetBuilder) updates]) =
_$ShowDomainLabelsSet;
ShowDomainLabelsSet._();
static Serializer<ShowDomainLabelsSet> get serializer => _$showDomainLabelsSetSerializer;
}
abstract class ShowModificationsSet
with BuiltJsonSerializable
implements Action, Built<ShowModificationsSet, ShowModificationsSetBuilder> {
bool get show;
factory ShowModificationsSet(bool show) => ShowModificationsSet.from((b) => b..show = show);
/************************ begin BuiltValue boilerplate ************************/
factory ShowModificationsSet.from([void Function(ShowModificationsSetBuilder) updates]) =
_$ShowModificationsSet;
ShowModificationsSet._();
static Serializer<ShowModificationsSet> get serializer => _$showModificationsSetSerializer;
}
abstract class DomainNameFontSizeSet
with BuiltJsonSerializable
implements Action, Built<DomainNameFontSizeSet, DomainNameFontSizeSetBuilder> {
num get font_size;
/************************ begin BuiltValue boilerplate ************************/
factory DomainNameFontSizeSet({num font_size}) = _$DomainNameFontSizeSet._;
DomainNameFontSizeSet._();
static Serializer<DomainNameFontSizeSet> get serializer => _$domainNameFontSizeSetSerializer;
}
abstract class DomainLabelFontSizeSet
with BuiltJsonSerializable
implements Action, Built<DomainLabelFontSizeSet, DomainLabelFontSizeSetBuilder> {
num get font_size;
/************************ begin BuiltValue boilerplate ************************/
factory DomainLabelFontSizeSet({num font_size}) = _$DomainLabelFontSizeSet._;
DomainLabelFontSizeSet._();
static Serializer<DomainLabelFontSizeSet> get serializer => _$domainLabelFontSizeSetSerializer;
}
abstract class StrandNameFontSizeSet
with BuiltJsonSerializable
implements Action, Built<StrandNameFontSizeSet, StrandNameFontSizeSetBuilder> {
num get font_size;
/************************ begin BuiltValue boilerplate ************************/
factory StrandNameFontSizeSet({num font_size}) = _$StrandNameFontSizeSet._;
StrandNameFontSizeSet._();
static Serializer<StrandNameFontSizeSet> get serializer => _$strandNameFontSizeSetSerializer;
}
abstract class StrandLabelFontSizeSet
with BuiltJsonSerializable
implements Action, Built<StrandLabelFontSizeSet, StrandLabelFontSizeSetBuilder> {
num get font_size;
/************************ begin BuiltValue boilerplate ************************/
factory StrandLabelFontSizeSet({num font_size}) = _$StrandLabelFontSizeSet._;
StrandLabelFontSizeSet._();
static Serializer<StrandLabelFontSizeSet> get serializer => _$strandLabelFontSizeSetSerializer;
}
abstract class ModificationFontSizeSet
with BuiltJsonSerializable
implements Action, Built<ModificationFontSizeSet, ModificationFontSizeSetBuilder> {
num get font_size;
factory ModificationFontSizeSet(num font_size) =>
ModificationFontSizeSet.from((b) => b..font_size = font_size);
/************************ begin BuiltValue boilerplate ************************/
factory ModificationFontSizeSet.from([void Function(ModificationFontSizeSetBuilder) updates]) =
_$ModificationFontSizeSet;
ModificationFontSizeSet._();
static Serializer<ModificationFontSizeSet> get serializer => _$modificationFontSizeSetSerializer;
}
abstract class MajorTickOffsetFontSizeSet
with BuiltJsonSerializable
implements Action, Built<MajorTickOffsetFontSizeSet, MajorTickOffsetFontSizeSetBuilder> {
num get font_size;
factory MajorTickOffsetFontSizeSet(num font_size) =>
MajorTickOffsetFontSizeSet.from((b) => b..font_size = font_size);
/************************ begin BuiltValue boilerplate ************************/
factory MajorTickOffsetFontSizeSet.from([void Function(MajorTickOffsetFontSizeSetBuilder) updates]) =
_$MajorTickOffsetFontSizeSet;
MajorTickOffsetFontSizeSet._();
static Serializer<MajorTickOffsetFontSizeSet> get serializer => _$majorTickOffsetFontSizeSetSerializer;
}
abstract class MajorTickWidthFontSizeSet
with BuiltJsonSerializable
implements Action, Built<MajorTickWidthFontSizeSet, MajorTickWidthFontSizeSetBuilder> {
num get font_size;
factory MajorTickWidthFontSizeSet(num font_size) =>
MajorTickWidthFontSizeSet.from((b) => b..font_size = font_size);
/************************ begin BuiltValue boilerplate ************************/
factory MajorTickWidthFontSizeSet.from([void Function(MajorTickWidthFontSizeSetBuilder) updates]) =
_$MajorTickWidthFontSizeSet;
MajorTickWidthFontSizeSet._();
static Serializer<MajorTickWidthFontSizeSet> get serializer => _$majorTickWidthFontSizeSetSerializer;
}
abstract class SetModificationDisplayConnector
with BuiltJsonSerializable
implements Action, Built<SetModificationDisplayConnector, SetModificationDisplayConnectorBuilder> {
bool get show;
factory SetModificationDisplayConnector(bool show) =>
SetModificationDisplayConnector.from((b) => b..show = show);
/************************ begin BuiltValue boilerplate ************************/
factory SetModificationDisplayConnector.from(
[void Function(SetModificationDisplayConnectorBuilder) updates]) = _$SetModificationDisplayConnector;
SetModificationDisplayConnector._();
static Serializer<SetModificationDisplayConnector> get serializer =>
_$setModificationDisplayConnectorSerializer;
}
abstract class ShowMismatchesSet
with BuiltJsonSerializable
implements Action, Built<ShowMismatchesSet, ShowMismatchesSetBuilder> {
bool get show;
factory ShowMismatchesSet(bool show) => ShowMismatchesSet.from((b) => b..show = show);
/************************ begin BuiltValue boilerplate ************************/
factory ShowMismatchesSet.from([void Function(ShowMismatchesSetBuilder) updates]) = _$ShowMismatchesSet;
ShowMismatchesSet._();
static Serializer<ShowMismatchesSet> get serializer => _$showMismatchesSetSerializer;
}
abstract class ShowDomainNameMismatchesSet
with BuiltJsonSerializable
implements Action, Built<ShowDomainNameMismatchesSet, ShowDomainNameMismatchesSetBuilder> {
bool get show_domain_name_mismatches;
factory ShowDomainNameMismatchesSet(bool show_domain_name_mismatches) =>
ShowDomainNameMismatchesSet.from((b) => b..show_domain_name_mismatches = show_domain_name_mismatches);
/************************ begin BuiltValue boilerplate ************************/
factory ShowDomainNameMismatchesSet.from([void Function(ShowDomainNameMismatchesSetBuilder) updates]) =
_$ShowDomainNameMismatchesSet;
ShowDomainNameMismatchesSet._();
static Serializer<ShowDomainNameMismatchesSet> get serializer => _$showDomainNameMismatchesSetSerializer;
}
abstract class ShowUnpairedInsertionDeletionsSet
with BuiltJsonSerializable
implements Action, Built<ShowUnpairedInsertionDeletionsSet, ShowUnpairedInsertionDeletionsSetBuilder> {
bool get show_unpaired_insertion_deletions;
factory ShowUnpairedInsertionDeletionsSet(bool show_unpaired_insertion_deletions) =>
ShowUnpairedInsertionDeletionsSet.from(
(b) => b..show_unpaired_insertion_deletions = show_unpaired_insertion_deletions);
/************************ begin BuiltValue boilerplate ************************/
factory ShowUnpairedInsertionDeletionsSet.from(
[void Function(ShowUnpairedInsertionDeletionsSetBuilder) updates]) =
_$ShowUnpairedInsertionDeletionsSet;
ShowUnpairedInsertionDeletionsSet._();
static Serializer<ShowUnpairedInsertionDeletionsSet> get serializer =>
_$showUnpairedInsertionDeletionsSetSerializer;
}
abstract class OxviewShowSet
with BuiltJsonSerializable
implements Action, Built<OxviewShowSet, OxviewShowSetBuilder> {
bool get show;
factory OxviewShowSet(bool show) => OxviewShowSet.from((b) => b..show = show);
/************************ begin BuiltValue boilerplate ************************/
factory OxviewShowSet.from([void Function(OxviewShowSetBuilder) updates]) = _$OxviewShowSet;
OxviewShowSet._();
static Serializer<OxviewShowSet> get serializer => _$oxviewShowSetSerializer;
}
abstract class SetDisplayBaseOffsetsOfMajorTicksOnlyFirstHelix
with
BuiltJsonSerializable
implements
Action,
Built<SetDisplayBaseOffsetsOfMajorTicksOnlyFirstHelix,
SetDisplayBaseOffsetsOfMajorTicksOnlyFirstHelixBuilder> {
bool get show;
factory SetDisplayBaseOffsetsOfMajorTicksOnlyFirstHelix(bool show) =>
SetDisplayBaseOffsetsOfMajorTicksOnlyFirstHelix.from((b) => b..show = show);
/************************ begin BuiltValue boilerplate ************************/
factory SetDisplayBaseOffsetsOfMajorTicksOnlyFirstHelix.from(
[void Function(SetDisplayBaseOffsetsOfMajorTicksOnlyFirstHelixBuilder) updates]) =
_$SetDisplayBaseOffsetsOfMajorTicksOnlyFirstHelix;
SetDisplayBaseOffsetsOfMajorTicksOnlyFirstHelix._();
static Serializer<SetDisplayBaseOffsetsOfMajorTicksOnlyFirstHelix> get serializer =>
_$setDisplayBaseOffsetsOfMajorTicksOnlyFirstHelixSerializer;
}
abstract class DisplayMajorTicksOffsetsSet
with BuiltJsonSerializable
implements Action, Built<DisplayMajorTicksOffsetsSet, DisplayMajorTicksOffsetsSetBuilder> {
bool get show;
factory DisplayMajorTicksOffsetsSet(bool show) => DisplayMajorTicksOffsetsSet.from((b) => b..show = show);
/************************ begin BuiltValue boilerplate ************************/
factory DisplayMajorTicksOffsetsSet.from([void Function(DisplayMajorTicksOffsetsSetBuilder) updates]) =
_$DisplayMajorTicksOffsetsSet;
DisplayMajorTicksOffsetsSet._();
static Serializer<DisplayMajorTicksOffsetsSet> get serializer => _$displayMajorTicksOffsetsSetSerializer;
}
abstract class SetDisplayMajorTickWidthsAllHelices
with BuiltJsonSerializable
implements
Action,
Built<SetDisplayMajorTickWidthsAllHelices, SetDisplayMajorTickWidthsAllHelicesBuilder> {
bool get show;
factory SetDisplayMajorTickWidthsAllHelices(bool show) =>
SetDisplayMajorTickWidthsAllHelices.from((b) => b..show = show);
/************************ begin BuiltValue boilerplate ************************/
factory SetDisplayMajorTickWidthsAllHelices.from(
[void Function(SetDisplayMajorTickWidthsAllHelicesBuilder) updates]) =
_$SetDisplayMajorTickWidthsAllHelices;
SetDisplayMajorTickWidthsAllHelices._();
static Serializer<SetDisplayMajorTickWidthsAllHelices> get serializer =>
_$setDisplayMajorTickWidthsAllHelicesSerializer;
}
abstract class SetDisplayMajorTickWidths
with BuiltJsonSerializable
implements Action, Built<SetDisplayMajorTickWidths, SetDisplayMajorTickWidthsBuilder> {
bool get show;
factory SetDisplayMajorTickWidths(bool show) => SetDisplayMajorTickWidths.from((b) => b..show = show);
/************************ begin BuiltValue boilerplate ************************/
factory SetDisplayMajorTickWidths.from([void Function(SetDisplayMajorTickWidthsBuilder) updates]) =
_$SetDisplayMajorTickWidths;
SetDisplayMajorTickWidths._();
static Serializer<SetDisplayMajorTickWidths> get serializer => _$setDisplayMajorTickWidthsSerializer;
}
abstract class SetOnlyDisplaySelectedHelices
with BuiltJsonSerializable
implements
Action,
SvgPngCacheInvalidatingAction,
Built<SetOnlyDisplaySelectedHelices, SetOnlyDisplaySelectedHelicesBuilder> {
bool get only_display_selected_helices;
factory SetOnlyDisplaySelectedHelices(bool only_display_selected_helices) =>
SetOnlyDisplaySelectedHelices.from(
(b) => b..only_display_selected_helices = only_display_selected_helices);
/************************ begin BuiltValue boilerplate ************************/
factory SetOnlyDisplaySelectedHelices.from([void Function(SetOnlyDisplaySelectedHelicesBuilder) updates]) =
_$SetOnlyDisplaySelectedHelices;
SetOnlyDisplaySelectedHelices._();
static Serializer<SetOnlyDisplaySelectedHelices> get serializer =>
_$setOnlyDisplaySelectedHelicesSerializer;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// invert y-axis
abstract class InvertYSet
with BuiltJsonSerializable
implements Action, SvgPngCacheInvalidatingAction, Built<InvertYSet, InvertYSetBuilder> {
bool get invert_y;
/************************ begin BuiltValue boilerplate ************************/
factory InvertYSet({bool invert_y}) = _$InvertYSet._;
InvertYSet._();
static Serializer<InvertYSet> get serializer => _$invertYSetSerializer;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// dynamically update helices
abstract class DynamicHelixUpdateSet
with BuiltJsonSerializable
implements
Action,
SvgPngCacheInvalidatingAction,
Built<DynamicHelixUpdateSet, DynamicHelixUpdateSetBuilder> {
bool get dynamically_update_helices;
/************************ begin BuiltValue boilerplate ************************/
factory DynamicHelixUpdateSet({bool dynamically_update_helices}) = _$DynamicHelixUpdateSet._;
DynamicHelixUpdateSet._();
static Serializer<DynamicHelixUpdateSet> get serializer => _$dynamicHelixUpdateSetSerializer;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// warn on exit if unsaved
abstract class WarnOnExitIfUnsavedSet
with BuiltJsonSerializable
implements Action, Built<WarnOnExitIfUnsavedSet, WarnOnExitIfUnsavedSetBuilder> {
bool get warn;
/************************ begin BuiltValue boilerplate ************************/
factory WarnOnExitIfUnsavedSet({bool warn}) = _$WarnOnExitIfUnsavedSet._;
WarnOnExitIfUnsavedSet._();
static Serializer<WarnOnExitIfUnsavedSet> get serializer => _$warnOnExitIfUnsavedSetSerializer;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// loading DNA files
abstract class LoadingDialogShow
with BuiltJsonSerializable
implements Action, Built<LoadingDialogShow, LoadingDialogShowBuilder> {
/************************ begin BuiltValue boilerplate ************************/
factory LoadingDialogShow() = _$LoadingDialogShow._;
LoadingDialogShow._();
static Serializer<LoadingDialogShow> get serializer => _$loadingDialogShowSerializer;
}
abstract class LoadingDialogHide
with BuiltJsonSerializable
implements Action, Built<LoadingDialogHide, LoadingDialogHideBuilder> {
/************************ begin BuiltValue boilerplate ************************/
factory LoadingDialogHide() = _$LoadingDialogHide._;
LoadingDialogHide._();
static Serializer<LoadingDialogHide> get serializer => _$loadingDialogHideSerializer;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copy SVG to clipboard
abstract class CopySelectedStandsToClipboardImage
with BuiltJsonSerializable
implements Action, Built<CopySelectedStandsToClipboardImage, CopySelectedStandsToClipboardImageBuilder> {
/************************ begin BuiltValue boilerplate ************************/
factory CopySelectedStandsToClipboardImage(
[void Function(CopySelectedStandsToClipboardImageBuilder) updates]) =
_$CopySelectedStandsToClipboardImage;
CopySelectedStandsToClipboardImage._();
static Serializer<CopySelectedStandsToClipboardImage> get serializer =>
_$copySelectedStandsToClipboardImageSerializer;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Save/load files
abstract class SaveDNAFile
with BuiltJsonSerializable
implements Action, Built<SaveDNAFile, SaveDNAFileBuilder> {
/************************ begin BuiltValue boilerplate ************************/
factory SaveDNAFile([void Function(SaveDNAFileBuilder) updates]) = _$SaveDNAFile;
SaveDNAFile._();
static Serializer<SaveDNAFile> get serializer => _$saveDNAFileSerializer;
}
abstract class LoadDNAFile
with BuiltJsonSerializable, DesignChangingAction
implements Action, Built<LoadDNAFile, LoadDNAFileBuilder> {
String get content;
bool get write_local_storage;
bool get unit_testing;
DNAFileType get dna_file_type;
// set to null when getting file from another source such as localStorage
@nullable
String get filename;
/************************ begin BuiltValue boilerplate ************************/
factory LoadDNAFile(
{String content,
String filename,
bool write_local_storage = true,
bool unit_testing = false,
DNAFileType dna_file_type = DNAFileType.scadnano_file}) {
return LoadDNAFile.from((b) => b
..content = content