Skip to content
Snippets Groups Projects
controls.tsx 1.4 KiB
Newer Older
David Sehnal's avatar
David Sehnal committed
/**
 * 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';
David Sehnal's avatar
David Sehnal committed
import { PluginCommands } from 'mol-plugin/command';
import { UpdateTrajectory } from 'mol-plugin/state/actions/basic';
import { PluginComponent } from './base';
export class Controls extends PluginComponent<{ }, { }> {
David Sehnal's avatar
David Sehnal committed
    render() {
David Sehnal's avatar
David Sehnal committed
        return <>

        </>;
David Sehnal's avatar
David Sehnal committed
}

export class TrajectoryControls extends PluginComponent {
David Sehnal's avatar
David Sehnal committed
    render() {
        return <div>
David Sehnal's avatar
David Sehnal committed
            <button className='msp-btn msp-btn-link' onClick={() => PluginCommands.State.ApplyAction.dispatch(this.plugin, {
                state: this.plugin.state.dataState,
David Sehnal's avatar
David Sehnal committed
                action: UpdateTrajectory.create({ action: 'advance', by: -1 })
David Sehnal's avatar
David Sehnal committed
            })}></button>
            <button className='msp-btn msp-btn-link' onClick={() => PluginCommands.State.ApplyAction.dispatch(this.plugin, {
                state: this.plugin.state.dataState,
David Sehnal's avatar
David Sehnal committed
                action: UpdateTrajectory.create({ action: 'reset' })
David Sehnal's avatar
David Sehnal committed
            })}></button>
            <button className='msp-btn msp-btn-link' onClick={() => PluginCommands.State.ApplyAction.dispatch(this.plugin, {
                state: this.plugin.state.dataState,
David Sehnal's avatar
David Sehnal committed
                action: UpdateTrajectory.create({ action: 'advance', by: +1 })
David Sehnal's avatar
David Sehnal committed
            })}></button><br />
David Sehnal's avatar
David Sehnal committed
        </div>
    }