Newer
Older
/**
* Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author David Sehnal <david.sehnal@gmail.com>
*/
import * as React from 'react';
import { PluginCommands } from 'mol-plugin/command';
import { UpdateTrajectory } from 'mol-plugin/state/actions/basic';
export class Controls extends PluginComponent<{ }, { }> {
export class TrajectoryControls extends PluginComponent {
<button onClick={() => PluginCommands.State.ApplyAction.dispatch(this.plugin, {
state: this.plugin.state.data,
action: UpdateTrajectory.create({ action: 'advance', by: -1 })
})}><<</button>
<button onClick={() => PluginCommands.State.ApplyAction.dispatch(this.plugin, {
state: this.plugin.state.data,
action: UpdateTrajectory.create({ action: 'reset' })
})}>Reset</button>
<button onClick={() => PluginCommands.State.ApplyAction.dispatch(this.plugin, {
state: this.plugin.state.data,
action: UpdateTrajectory.create({ action: 'advance', by: +1 })
})}>>></button><br />
</div>
}