-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the button for base pair display
- Loading branch information
Showing
8 changed files
with
107 additions
and
0 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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import 'dart:html'; | ||
|
||
import 'package:built_value/built_value.dart'; | ||
import 'package:built_value/serializer.dart'; | ||
import 'package:built_collection/built_collection.dart'; | ||
|
||
part 'base_pair_display_type.g.dart'; | ||
|
||
class BasePairDisplayType extends EnumClass { | ||
const BasePairDisplayType._(String name) : super(name); | ||
|
||
@memoized | ||
int get hashCode; | ||
|
||
static Serializer<BasePairDisplayType> get serializer => _$basePairDisplayTypeSerializer; | ||
|
||
/******************** end BuiltValue boilerplate *********************/ | ||
|
||
static const BasePairDisplayType none = _$none; | ||
static const BasePairDisplayType lines = _$lines; | ||
static const BasePairDisplayType rectangle = _$rectangle; // used to join two Domains with Crossover | ||
static BuiltList<BasePairDisplayType> types = const [none, lines, rectangle].toBuiltList(); | ||
|
||
static BuiltSet<BasePairDisplayType> get values => _$values; | ||
|
||
static BasePairDisplayType valueOf(String name) => _$valueOf(name); | ||
|
||
String to_json() => name; | ||
|
||
String display_name() { | ||
// edit this to display a different string than the identifier name above | ||
switch (this) { | ||
case none: | ||
return 'none'; | ||
case lines: | ||
return 'lines'; | ||
case rectangle: | ||
return 'rectangle'; | ||
} | ||
return super.toString(); | ||
} | ||
|
||
@override | ||
String toString() => display_name(); | ||
|
||
static BasePairDisplayType from_json(String the_name) { | ||
for (var val in values) { | ||
if (val.name == the_name) { | ||
return val; | ||
} | ||
} | ||
throw ArgumentError('there is no base pair display type with name "${the_name}"'); | ||
} | ||
} |
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
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