hvFrameUI.py 12.9 KB
Newer Older
Russ Fish's avatar
Russ Fish committed
1 2
#!/usr/bin/env python
# generated by wxGlade 0.3.1 on Fri May 14 10:24:08 2004
Russ Fish's avatar
Russ Fish committed
3 4 5 6 7
#
# EMULAB-COPYRIGHT
# Copyright (c) 2004 University of Utah and the Flux Group.
# All rights reserved.
#
Russ Fish's avatar
Russ Fish committed
8 9 10 11 12 13 14 15 16
# Permission to use, copy, modify and distribute this software is hereby
# granted provided that (1) source code retains these copyright, permission,
# and disclaimer notices, and (2) redistributions including binaries
# reproduce the notices in supporting documentation.
#
# THE UNIVERSITY OF UTAH ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
# CONDITION.  THE UNIVERSITY OF UTAH DISCLAIMS ANY LIABILITY OF ANY KIND
# FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
#
Russ Fish's avatar
Russ Fish committed
17
from wxPython.wx import *
Russ Fish's avatar
Russ Fish committed
18 19 20 21 22 23 24 25 26 27 28 29
from wxPython.glcanvas import *

class hvGLCanvas(wxGLCanvas):
    def __init__(self, *args, **kwds):
        ## The PyOpenGL canvas initialization is broken.
        ## The following doesn't yet work on Windows, although
        ## it is needed for picking, and seg-faults on FreeBSD.
        ##kwds["attribList"] = [WX_GL_DOUBLEBUFFER, WX_GL_RGBA,
        ##                      WX_GL_DEPTH_SIZE, 32, 0]
        wxGLCanvas.__init__(self, *args, **kwds)
        pass
    pass
Russ Fish's avatar
Russ Fish committed
30 31 32 33 34 35

class UsageDialogUI(wxDialog):
    def __init__(self, *args, **kwds):
        # begin wxGlade: UsageDialogUI.__init__
        kwds["style"] = wxDEFAULT_DIALOG_STYLE
        wxDialog.__init__(self, *args, **kwds)
36
        self.Usage = wxStaticText(self, -1, "\n  HyperViewer mouse usage:\n  -----------------------------------\n\n  Objects close to the center of the sphere are largest.  \n\n  Left mouse drag: X,Y movement in hyperbolic space.  \n\n  Control- or Shift- Left mouse, or Middle mouse, drag:\n  Rotate the hyperbolic space.  \n\n  Pickable nodes under the cursor turn bright  green.    \n  Left-click to bring them to the center.  \n\n")
Russ Fish's avatar
Russ Fish committed
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

        self.__set_properties()
        self.__do_layout()
        # end wxGlade

    def __set_properties(self):
        # begin wxGlade: UsageDialogUI.__set_properties
        self.SetTitle("wxHyperViewer usage")
        # end wxGlade

    def __do_layout(self):
        # begin wxGlade: UsageDialogUI.__do_layout
        sizer_5 = wxBoxSizer(wxVERTICAL)
        sizer_5.Add(self.Usage, 0, 0, 10)
        sizer_5.Add(20, 1, 0, 0, 0)
        self.SetAutoLayout(1)
        self.SetSizer(sizer_5)
        sizer_5.Fit(self)
        sizer_5.SetSizeHints(self)
        self.Layout()
        # end wxGlade

# end of class UsageDialogUI


class OpenDialogUI(wxDialog):
    def __init__(self, *args, **kwds):
        # begin wxGlade: OpenDialogUI.__init__
65
        kwds["style"] = wxCAPTION|wxRESIZE_BORDER|wxTHICK_FRAME
Russ Fish's avatar
Russ Fish committed
66
        wxDialog.__init__(self, *args, **kwds)
67
        self.FileToOpen = wxTextCtrl(self, -1, "", style=wxTE_PROCESS_ENTER)
Russ Fish's avatar
Russ Fish committed
68
        self.OpenFile = wxButton(self, -1, "Open Data File")
69
        self.FileMsg = wxStaticText(self, -1, "")
70 71
        self.label_3 = wxStaticText(self, -1, "SSH login name:", style=wxALIGN_RIGHT)
        self.LoginName = wxTextCtrl(self, -1, "", style=wxTE_PROCESS_ENTER)
Russ Fish's avatar
Russ Fish committed
72
        self.label_2 = wxStaticText(self, -1, "Project name:", style=wxALIGN_RIGHT)
73
        self.ProjectName = wxTextCtrl(self, -1, "", style=wxTE_PROCESS_ENTER)
Russ Fish's avatar
Russ Fish committed
74
        self.label_7 = wxStaticText(self, -1, "Experiment name:")
75
        self.ExperimentName = wxTextCtrl(self, -1, "", style=wxTE_PROCESS_ENTER)
Russ Fish's avatar
Russ Fish committed
76
        self.label_8 = wxStaticText(self, -1, "Root (optional):")
77
        self.ExperimentRoot = wxTextCtrl(self, -1, "", style=wxTE_PROCESS_ENTER)
Russ Fish's avatar
Russ Fish committed
78
        self.OpenExperiment = wxButton(self, -1, "Retrieve experiment")
Russ Fish's avatar
Russ Fish committed
79
        self.ExperimentMsg = wxStaticText(self, -1, " \n ")
Russ Fish's avatar
Russ Fish committed
80 81 82 83 84 85 86 87

        self.__set_properties()
        self.__do_layout()
        # end wxGlade

    def __set_properties(self):
        # begin wxGlade: OpenDialogUI.__set_properties
        self.SetTitle("Open HyperViewer Data")
88
        self.SetSize((430, 372))
89
        self.FileToOpen.SetFocus()
Russ Fish's avatar
Russ Fish committed
90 91 92 93 94 95
        # end wxGlade

    def __do_layout(self):
        # begin wxGlade: OpenDialogUI.__do_layout
        sizer_4 = wxBoxSizer(wxVERTICAL)
        ExperimentOpening = wxStaticBoxSizer(wxStaticBox(self, -1, "Experiment to retrieve:"), wxVERTICAL)
96
        grid_sizer_1 = wxFlexGridSizer(4, 2, 10, 10)
Russ Fish's avatar
Russ Fish committed
97
        FileOpening = wxStaticBoxSizer(wxStaticBox(self, -1, "File for HyperViewer data:"), wxVERTICAL)
98
        FileOpening.Add(self.FileToOpen, 0, wxTOP|wxEXPAND, 5)
99
        FileOpening.Add(self.OpenFile, 0, wxTOP|wxALIGN_CENTER_HORIZONTAL, 10)
100
        FileOpening.Add(self.FileMsg, 0, 0, 0)
101
        sizer_4.Add(FileOpening, 0, wxALL|wxEXPAND, 10)
102 103 104
        grid_sizer_1.Add(self.label_3, 0, wxALIGN_CENTER_VERTICAL, 0)
        grid_sizer_1.Add(self.LoginName, 0, wxTOP|wxEXPAND, 5)
        grid_sizer_1.Add(self.label_2, 0, wxALIGN_CENTER_VERTICAL, 0)
105
        grid_sizer_1.Add(self.ProjectName, 0, wxEXPAND, 0)
106
        grid_sizer_1.Add(self.label_7, 0, wxALIGN_CENTER_VERTICAL, 0)
107
        grid_sizer_1.Add(self.ExperimentName, 0, wxEXPAND, 0)
108
        grid_sizer_1.Add(self.label_8, 0, wxALIGN_CENTER_VERTICAL, 0)
109 110
        grid_sizer_1.Add(self.ExperimentRoot, 0, wxEXPAND, 0)
        grid_sizer_1.AddGrowableCol(1)
Russ Fish's avatar
Russ Fish committed
111
        ExperimentOpening.Add(grid_sizer_1, 0, wxEXPAND, 0)
112
        ExperimentOpening.Add(self.OpenExperiment, 0, wxTOP|wxALIGN_CENTER_HORIZONTAL, 10)
113
        ExperimentOpening.Add(self.ExperimentMsg, 0, 0, 0)
114
        sizer_4.Add(ExperimentOpening, 0, wxALL|wxEXPAND, 10)
Russ Fish's avatar
Russ Fish committed
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
        self.SetAutoLayout(1)
        self.SetSizer(sizer_4)
        self.Layout()
        # end wxGlade

# end of class OpenDialogUI


class hvFrameUI(wxFrame):
    def __init__(self, *args, **kwds):
        # begin wxGlade: hvFrameUI.__init__
        kwds["style"] = wxDEFAULT_FRAME_STYLE
        wxFrame.__init__(self, *args, **kwds)
        self.window_1 = wxSplitterWindow(self, -1)
        self.Controls = wxPanel(self.window_1, -1)
        self.panel_1 = wxPanel(self.window_1, -1)
        
        # Menu Bar
        self.Menu = wxMenuBar()
        self.SetMenuBar(self.Menu)
        wxglade_tmp_menu = wxMenu()
        wxglade_tmp_menu.Append(1, "&Open...\tCtrl+O", "", wxITEM_NORMAL)
        wxglade_tmp_menu.Append(2, "E&xit\tCtrl+Q", "", wxITEM_NORMAL)
        self.Menu.Append(wxglade_tmp_menu, "&File")
        wxglade_tmp_menu = wxMenu()
        wxglade_tmp_menu.Append(3, "&Usage\tCtrl+H", "", wxITEM_NORMAL)
        self.Menu.Append(wxglade_tmp_menu, "&Help")
        # Menu Bar end
Russ Fish's avatar
Russ Fish committed
143
        self.hypView = hvGLCanvas(self.panel_1, -1)
Russ Fish's avatar
Russ Fish committed
144
        self.GoToTop = wxButton(self.Controls, -1, "go to top")
145
        self.LabelNodeName = wxStaticText(self.Controls, -1, "Node name:")
146
        self.NodeName = wxTextCtrl(self.Controls, -1, "", style=wxTE_PROCESS_ENTER)
147
        self.LabelChildCount = wxStaticText(self.Controls, -1, "Child count:  ")
Russ Fish's avatar
-  
Russ Fish committed
148
        self.ChildCount = wxStaticText(self.Controls, -1, " 0  ")
149
        self.LabelLinksIn = wxStaticText(self.Controls, -1, "Non-tree Links in:   0")
Russ Fish's avatar
Russ Fish committed
150 151 152
        self.ShowLinksIn = wxButton(self.Controls, -1, "show")
        self.HideLinksIn = wxButton(self.Controls, -1, "hide")
        self.DescendLinksIn = wxCheckBox(self.Controls, -1, "descend")
153
        self.LabelLinksOut = wxStaticText(self.Controls, -1, "Non-tree Links out:  0")
Russ Fish's avatar
Russ Fish committed
154 155 156 157 158 159 160 161 162
        self.ShowLinksOut = wxButton(self.Controls, -1, "show")
        self.HideLinksOut = wxButton(self.Controls, -1, "hide")
        self.DescendLinksOut = wxCheckBox(self.Controls, -1, "descend")
        self.static_line_1 = wxStaticLine(self.Controls, -1)
        self.DrawSphere = wxCheckBox(self.Controls, -1, "Draw sphere")
        self.DrawNodes = wxCheckBox(self.Controls, -1, "Draw nodes")
        self.DrawLinks = wxCheckBox(self.Controls, -1, "Draw links")
        self.KeepAspect = wxCheckBox(self.Controls, -1, "Keep aspect")
        self.LabelToRight = wxCheckBox(self.Controls, -1, "Label to right")
163
        self.LabelsMode = wxChoice(self.Controls, -1, choices=["None", "Short", "Long"])
Russ Fish's avatar
Russ Fish committed
164 165 166 167 168
        self.label_3 = wxStaticText(self.Controls, -1, "  Labels")
        self.CountGenNode = wxSpinCtrl(self.Controls, -1, "30", min=1, max=30)
        self.label_4 = wxStaticText(self.Controls, -1, "  Node depth")
        self.CountGenLink = wxSpinCtrl(self.Controls, -1, "30", min=1, max=30)
        self.label_5 = wxStaticText(self.Controls, -1, "  Link depth")
Russ Fish's avatar
Russ Fish committed
169
        self.AnimStepCount = wxSlider(self.Controls, -1, 12, 1, 100, style=wxSL_HORIZONTAL|wxSL_LABELS)
Russ Fish's avatar
Russ Fish committed
170 171 172 173 174 175 176 177 178 179 180
        self.label_6 = wxStaticText(self.Controls, -1, "    Animation frames")
        self.static_line_2 = wxStaticLine(self.Controls, -1)
        self.HelpButton = wxButton(self.Controls, -1, "Help")

        self.__set_properties()
        self.__do_layout()
        # end wxGlade

    def __set_properties(self):
        # begin wxGlade: hvFrameUI.__set_properties
        self.SetTitle("wxHyperViewer")
181 182 183
        self.SetSize((760, 651))
        self.ShowLinksIn.Enable(0)
        self.HideLinksIn.Enable(0)
Russ Fish's avatar
Russ Fish committed
184
        self.DescendLinksIn.SetValue(1)
185 186
        self.ShowLinksOut.Enable(0)
        self.HideLinksOut.Enable(0)
Russ Fish's avatar
Russ Fish committed
187 188 189 190 191
        self.DescendLinksOut.SetValue(1)
        self.DrawSphere.SetValue(1)
        self.DrawNodes.SetValue(1)
        self.DrawLinks.SetValue(1)
        self.KeepAspect.SetValue(1)
192
        self.LabelsMode.SetSize((70, 25))
Russ Fish's avatar
Russ Fish committed
193
        self.LabelsMode.SetSelection(2)
194
        self.CountGenNode.SetSize((70, 25))
Russ Fish's avatar
Russ Fish committed
195 196
        self.CountGenNode.SetToolTipString("Generation Node Limit")
        self.label_4.SetToolTipString("Generation Link Limit")
197
        self.CountGenLink.SetSize((70, 25))
Russ Fish's avatar
Russ Fish committed
198 199 200
        self.CountGenLink.SetToolTipString("Generation Link Limit")
        self.label_5.SetToolTipString("Generation Link Limit")
        self.AnimStepCount.SetSize((150, 40))
Russ Fish's avatar
Russ Fish committed
201
        self.AnimStepCount.SetToolTipString("Number of frames per second in animated moves")
Russ Fish's avatar
Russ Fish committed
202
        self.label_6.SetToolTipString("Number of frames per animation")
203
        self.window_1.SetSize((760, 619))
Russ Fish's avatar
-  
Russ Fish committed
204
        self.window_1.SplitVertically(self.panel_1, self.Controls, 560)
Russ Fish's avatar
Russ Fish committed
205
        # end wxGlade
Russ Fish's avatar
-  
Russ Fish committed
206
        self.window_1.SetMinimumPaneSize(21) # Keep the controls or viewer from disappearing.
Russ Fish's avatar
Russ Fish committed
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222

    def __do_layout(self):
        # begin wxGlade: hvFrameUI.__do_layout
        sizer_1 = wxBoxSizer(wxVERTICAL)
        sizer_2 = wxBoxSizer(wxVERTICAL)
        Modes = wxBoxSizer(wxVERTICAL)
        AnimSteps = wxBoxSizer(wxVERTICAL)
        GenLinkLimit = wxBoxSizer(wxHORIZONTAL)
        GenNodeLimit = wxBoxSizer(wxHORIZONTAL)
        Labels = wxBoxSizer(wxHORIZONTAL)
        Nodes = wxBoxSizer(wxVERTICAL)
        sizer_9 = wxBoxSizer(wxHORIZONTAL)
        sizer_8 = wxBoxSizer(wxHORIZONTAL)
        sizer_7 = wxBoxSizer(wxHORIZONTAL)
        sizer_6 = wxBoxSizer(wxHORIZONTAL)
        sizer_3 = wxBoxSizer(wxVERTICAL)
Russ Fish's avatar
-  
Russ Fish committed
223
        sizer_3.Add(self.hypView, 99, wxEXPAND, 0)
Russ Fish's avatar
Russ Fish committed
224 225
        self.panel_1.SetAutoLayout(1)
        self.panel_1.SetSizer(sizer_3)
Russ Fish's avatar
-  
Russ Fish committed
226 227
        sizer_3.Fit(self.panel_1)
        sizer_3.SetSizeHints(self.panel_1)
228 229 230
        Nodes.Add(self.GoToTop, 0, 0, 15)
        sizer_6.Add(self.LabelNodeName, 0, 0, 10)
        sizer_6.Add(self.NodeName, 1, wxLEFT|wxEXPAND, 5)
Russ Fish's avatar
Russ Fish committed
231
        Nodes.Add(sizer_6, 1, wxEXPAND, 0)
232
        sizer_7.Add(self.LabelChildCount, 0, 0, 10)
Russ Fish's avatar
Russ Fish committed
233 234
        sizer_7.Add(self.ChildCount, 0, 0, 0)
        Nodes.Add(sizer_7, 1, wxEXPAND, 0)
235 236
        Nodes.Add(self.LabelLinksIn, 0, 0, 10)
        sizer_8.Add(self.ShowLinksIn, 0, wxLEFT, 15)
Russ Fish's avatar
Russ Fish committed
237
        sizer_8.Add(self.HideLinksIn, 0, 0, 0)
238
        Nodes.Add(sizer_8, 1, 0, 0)
Russ Fish's avatar
Russ Fish committed
239
        Nodes.Add(self.DescendLinksIn, 0, wxALIGN_CENTER_HORIZONTAL, 0)
240 241
        Nodes.Add(self.LabelLinksOut, 0, wxTOP, 10)
        sizer_9.Add(self.ShowLinksOut, 0, wxLEFT, 15)
Russ Fish's avatar
Russ Fish committed
242
        sizer_9.Add(self.HideLinksOut, 0, 0, 0)
243
        Nodes.Add(sizer_9, 1, 0, 0)
Russ Fish's avatar
Russ Fish committed
244
        Nodes.Add(self.DescendLinksOut, 0, wxALIGN_CENTER_HORIZONTAL, 0)
245 246 247
        sizer_2.Add(Nodes, 0, wxALL|wxEXPAND, 10)
        sizer_2.Add(self.static_line_1, 0, wxEXPAND, 10)
        Modes.Add(self.DrawSphere, 0, 0, 10)
Russ Fish's avatar
Russ Fish committed
248 249 250
        Modes.Add(self.DrawNodes, 0, 0, 0)
        Modes.Add(self.DrawLinks, 0, 0, 0)
        Modes.Add(self.KeepAspect, 0, 0, 0)
251
        Modes.Add(self.LabelToRight, 0, wxTOP, 10)
Russ Fish's avatar
Russ Fish committed
252 253 254
        Labels.Add(self.LabelsMode, 0, 0, 0)
        Labels.Add(self.label_3, 0, 0, 0)
        Modes.Add(Labels, 0, 0, 0)
255
        GenNodeLimit.Add(self.CountGenNode, 0, 0, 10)
Russ Fish's avatar
Russ Fish committed
256
        GenNodeLimit.Add(self.label_4, 0, 0, 0)
257
        Modes.Add(GenNodeLimit, 0, wxTOP, 15)
Russ Fish's avatar
Russ Fish committed
258 259 260 261 262
        GenLinkLimit.Add(self.CountGenLink, 0, 0, 0)
        GenLinkLimit.Add(self.label_5, 0, 0, 0)
        Modes.Add(GenLinkLimit, 0, 0, 0)
        AnimSteps.Add(self.AnimStepCount, 0, wxBOTTOM, 0)
        AnimSteps.Add(self.label_6, 0, 0, 0)
263 264 265 266
        Modes.Add(AnimSteps, 0, wxTOP, 10)
        sizer_2.Add(Modes, 0, wxALL, 10)
        sizer_2.Add(self.static_line_2, 0, wxTOP|wxBOTTOM|wxEXPAND, 10)
        sizer_2.Add(self.HelpButton, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 10)
Russ Fish's avatar
Russ Fish committed
267 268 269 270 271 272 273 274 275 276 277 278 279
        self.Controls.SetAutoLayout(1)
        self.Controls.SetSizer(sizer_2)
        sizer_2.Fit(self.Controls)
        sizer_2.SetSizeHints(self.Controls)
        sizer_1.Add(self.window_1, 1, wxEXPAND, 0)
        self.SetAutoLayout(1)
        self.SetSizer(sizer_1)
        self.Layout()
        # end wxGlade

# end of class hvFrameUI