Browse Source

fixes, seq wrapper mark every loci, binding docs & cleanup

Alexander Rose 5 năm trước cách đây
mục cha
commit
8e1d44fabc

+ 1 - 1
src/mol-plugin/behavior/dynamic/camera.ts

@@ -16,7 +16,7 @@ const M = ModifiersKeys
 const Trigger = Binding.Trigger
 
 const DefaultFocusLociBindings = {
-    clickCenterFocus: Binding(Trigger(B.Flag.Primary, M.create()), 'Center and focus the clicked element.'),
+    clickCenterFocus: Binding(Trigger(B.Flag.Primary, M.create()), 'Center and focus the clicked element using ${trigger}.'),
 }
 const FocusLociParams = {
     minRadius: PD.Numeric(8, { min: 1, max: 50, step: 1 }),

+ 3 - 8
src/mol-plugin/behavior/dynamic/representation.ts

@@ -66,11 +66,10 @@ export const HighlightLoci = PluginBehavior.create({
 
 const DefaultSelectLociBindings = {
     clickSelect: Binding.Empty,
-    clickSelectExtend: Binding(Trigger(B.Flag.Primary, M.create({ shift: true })), 'Try to extend selection to clicked element along polymer.'),
-    clickSelectOnly: Binding(Trigger(B.Flag.Secondary, M.create({ control: true })), 'Select only the clicked element.'),
-    clickSelectToggle: Binding(Trigger(B.Flag.Primary, M.create({ control: true })), 'Toggle clicked element.'),
+    clickSelectExtend: Binding(Trigger(B.Flag.Primary, M.create({ shift: true })), 'Extend selection to clicked element along polymer using ${trigger}.'),
+    clickSelectOnly: Binding(Trigger(B.Flag.Secondary, M.create({ control: true })), 'Select only the clicked element using ${trigger}.'),
+    clickSelectToggle: Binding(Trigger(B.Flag.Primary, M.create({ control: true })), 'Toggle selection of clicked element using ${trigger}.'),
     clickDeselect: Binding.Empty,
-    clickDeselectAllOnEmpty: Binding(Trigger(B.Flag.Secondary, M.create({ control: true })), 'Clear the selection when the clicked element is empty.'),
 }
 const SelectLociParams = {
     bindings: PD.Value(DefaultSelectLociBindings, { isHidden: true }),
@@ -120,10 +119,6 @@ export const SelectLoci = PluginBehavior.create({
                 if (Binding.match(this.params.bindings.clickDeselect, buttons, modifiers)) {
                     this.ctx.interactivity.lociSelects.deselect(current)
                 }
-
-                if (Binding.match(this.params.bindings.clickDeselectAllOnEmpty, buttons, modifiers)) {
-                    this.ctx.interactivity.lociSelects.deselectAllOnEmpty(current)
-                }
             });
             this.ctx.interactivity.lociSelects.addProvider(this.lociMarkProvider)
 

+ 1 - 1
src/mol-plugin/behavior/dynamic/selection/structure-representation-interaction.ts

@@ -27,7 +27,7 @@ const M = ModifiersKeys
 const Trigger = Binding.Trigger
 
 const DefaultStructureRepresentationInteractionBindings = {
-    clickInteractionAroundOnly: Binding(Trigger(B.Flag.Secondary, M.create()), 'Show the structure interaction around only the clicked element.'),
+    clickInteractionAroundOnly: Binding(Trigger(B.Flag.Secondary, M.create()), 'Show the structure interaction around only the clicked element using ${trigger}.'),
 }
 const StructureRepresentationInteractionParams = {
     bindings: PD.Value(DefaultStructureRepresentationInteractionBindings, { isHidden: true }),

+ 1 - 1
src/mol-plugin/behavior/dynamic/volume-streaming/behavior.ts

@@ -50,7 +50,7 @@ export namespace VolumeStreaming {
     };
 
     const DefaultBindings = {
-        clickVolumeAroundOnly: Binding(Trigger(B.Flag.Secondary, M.create()), 'Show the volume around only the clicked element.'),
+        clickVolumeAroundOnly: Binding(Trigger(B.Flag.Secondary, M.create()), 'Show the volume around only the clicked element using ${trigger}.'),
     }
 
     export function createParams(data?: VolumeServerInfo.Data, defaultView?: ViewTypes) {

+ 9 - 5
src/mol-plugin/ui/sequence/wrapper.ts

@@ -4,8 +4,8 @@
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
  */
 
-import { OrderedSet } from '../../../mol-data/int';
-import { Loci } from '../../../mol-model/loci';
+import { OrderedSet, Interval } from '../../../mol-data/int';
+import { Loci, isEveryLoci } from '../../../mol-model/loci';
 import { MarkerAction, applyMarkerAction } from '../../../mol-util/marker-action';
 import { StructureElement, Structure, Unit } from '../../../mol-model/structure';
 import { Color } from '../../../mol-util/color';
@@ -22,9 +22,13 @@ abstract class SequenceWrapper<D> {
     abstract getLoci(seqIdx: number): StructureElement.Loci
 
     markResidue(loci: Loci, action: MarkerAction) {
-        return this.eachResidue(loci, (set: OrderedSet) => {
-            return applyMarkerAction(this.markerArray, set, action)
-        })
+        if (isEveryLoci(loci)) {
+            return applyMarkerAction(this.markerArray, Interval.ofLength(this.length), action)
+        } else {
+            return this.eachResidue(loci, (set: OrderedSet) => {
+                return applyMarkerAction(this.markerArray, set, action)
+            })
+        }
     }
 
     constructor(readonly data: D, readonly markerArray: Uint8Array, readonly length: number) {