File size: 5,387 Bytes
71174bc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<template>
    <PluginComponent v-model="open" :infoPayload="infoPayload" @onUserArgChanged="onUserArgChanged"
        @onMolCountsChanged="onMolCountsChanged"></PluginComponent>
</template>

<script lang="ts">
import PluginComponent from "@/Plugins/Parents/PluginComponent/PluginComponent.vue";
import { PluginParentClass } from "@/Plugins/Parents/PluginParentClass/PluginParentClass";
import {
    IContributorCredit,
    ISoftwareCredit,
} from "@/Plugins/PluginInterfaces";
import { ITest } from "@/Testing/TestInterfaces";
import { UserArg } from "@/UI/Forms/FormFull/FormFullInterfaces";
import { Options } from "vue-class-component";
import { switchToGoldenLayoutPanel } from "./Common";
import { Tag } from "@/Plugins/Core/ActivityFocus/ActivityFocusUtils";
import { TestCmdList } from "@/Testing/TestCmdList";

/**
 * StylesWindowPlugin
 */
@Options({
    components: {
        PluginComponent,
    },
})
export default class StylesWindowPlugin extends PluginParentClass {
    menuPath = ["[8] Window", "Molecules", "[5] Styles"];
    title = "Styles Panel";
    softwareCredits: ISoftwareCredit[] = [];
    contributorCredits: IContributorCredit[] = [
        // {
        //   name: "Jacob D. Durrant",
        //   url: "http://durrantlab.com/",
        // },
    ];
    pluginId = "styleswindow";
    noPopup = true;
    userArgDefaults: UserArg[] = [];

    logJob = false;
    intro = `Switch to the Styles panel.`;
    details = "This plugin brings the Styles panel into focus, where you can change the visual representation of molecules.";
    tags = [Tag.All];

    /**
     * Every plugin runs some job. This is the function that does the job running.
     * 
     * @returns {Promise<void>}  A promise that resolves when the job is done.
     */
    runJobInBrowser(): Promise<void> {
        switchToGoldenLayoutPanel("Styles");
        return Promise.resolve();
    }

    /**
     * Gets the test commands for the plugin. For advanced use.
     *
     * @gooddefault
     * @document
     * @returns {ITest[]}  The selenium test commands.
     */
    async getTests(): Promise<ITest[]> {
        const colorSchemeSelector = "#colorscheme-colorscheme-form-item";

        return [
            {
                beforePluginOpens: () => new TestCmdList().loadExampleMolecule(true).selectMoleculeInTree("Protein"),
                pluginOpen: () => new TestCmdList()
                    // --- Test Protein Styles ---
                    // Atoms Style
                    .text("#atoms-protein", "Atoms: Spheres").wait(1)
                    .text(colorSchemeSelector, "Color by Chain").wait(1)
                    .text("#atoms-protein", "Atoms: Sticks").wait(1)
                    .text(colorSchemeSelector, "Color by Element").wait(1)
                    .text("#atoms-protein", "Atoms: Lines").wait(1)
                    .text("#atoms-protein", "Atoms: Hidden").wait(1)
                    // Backbone Style
                    .text("#protein-protein", "Backbone: Cartoon").wait(1)
                    .text(colorSchemeSelector, "Color by Spectrum").wait(1)
                    .text(colorSchemeSelector, "Color by Chain").wait(1)
                    .text("#protein-protein", "Backbone: Hidden").wait(1)
                    // Surface Style
                    .text("#surface-protein", "Surface").wait(1)
                    .text(colorSchemeSelector, "Color by Solid").wait(1)
                    .text("#surface-protein", "Surface: Hidden").wait(1)
                    // Hydrogens
                    .text("#hydrogens", "Polar Only").wait(1)
                    .text("#hydrogens", "Hide All").wait(1)
                    .text("#hydrogens", "Show All").wait(1)

                    // --- Test Compound Styles ---
                    .selectMoleculeInTree("Compounds")
                    // Atoms Style
                    .text("#atoms-compound", "Atoms: Spheres").wait(1)
                    .text(colorSchemeSelector, "Color by Solid").wait(1)
                    .text("#atoms-compound", "Atoms: Sticks").wait(1)
                    .text(colorSchemeSelector, "Color Carbons").wait(1)
                    // Surface Style
                    .text("#surface-compound", "Surface").wait(1)
                    .text(colorSchemeSelector, "Color by Element").wait(1)
                    .text("#surface-compound", "Surface: Hidden").wait(1)
                    // Reset to standard
                    .text("#atoms-compound", "Atoms: Sticks").wait(1)

                    // --- Test Solvent Styles ---
                    .selectMoleculeInTree("Solvent")
                    // Atoms Style
                    .text("#atoms-solvent", "Atoms: Spheres").wait(1)
                    .text(colorSchemeSelector, "Color by Solid").wait(1)
                    .text("#atoms-solvent", "Atoms: Lines").wait(1)
                    .text("#atoms-solvent", "Atoms: Hidden").wait(1)
                    // Surface Style
                    .text("#surface-solvent", "Surface").wait(1)
                    .text(colorSchemeSelector, "Color by Element").wait(1)
                    .text("#surface-solvent", "Surface: Hidden").wait(1)
                    // Reset to standard (usually sticks or spheres for solvent)
                    .text("#atoms-solvent", "Atoms: Sticks").wait(1)
            }
        ];
    }
}
</script>

<style scoped lang="scss"></style>