OpenCores
URL https://opencores.org/ocsvn/adv_debug_sys/adv_debug_sys/trunk

Subversion Repositories adv_debug_sys

[/] [adv_debug_sys/] [trunk/] [Software/] [AdvancedWatchpointControl/] [src/] [advancedWatchpointControl/] [AdvancedWatchpointControl.java] - Blame information for rev 54

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 54 nyawn
////////////////////////////////////////////////////////////////
2
//
3
// AdvancedWatchpointControl.java
4
//
5
// Copyright (C) 2010 Nathan Yawn 
6
//                    (nyawn@opencores.org)
7
//
8
// This is the main class in the AdvancedWatchpointControl
9
// program.  It creates all the worker classes, then passes
10
// control off to the SWT to listen for events.
11
//
12
////////////////////////////////////////////////////////////////
13
//
14
// This source file may be used and distributed without
15
// restriction provided that this copyright statement is not
16
// removed from the file and that any derivative work contains
17
// the original copyright notice and the associated disclaimer.
18
// 
19
// This source file is free software; you can redistribute it
20
// and/or modify it under the terms of the GNU General
21
// Public License as published by the Free Software Foundation;
22
// either version 3.0 of the License, or (at your option) any
23
// later version.
24
//
25
// This source is distributed in the hope that it will be
26
// useful, but WITHOUT ANY WARRANTY; without even the implied 
27
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
28
// PURPOSE.  See the GNU Lesser General Public License for more
29
// details.
30
// 
31
// You should have received a copy of the GNU General
32
// Public License along with this source; if not, download it 
33
// from http://www.gnu.org/licenses/gpl.html
34
//
35
////////////////////////////////////////////////////////////////
36 51 nyawn
package advancedWatchpointControl;
37
 
38
import org.eclipse.swt.widgets.Composite;
39
import org.eclipse.swt.widgets.Display;
40
import org.eclipse.swt.widgets.Shell;
41
import org.eclipse.swt.custom.ScrolledComposite;
42
import org.eclipse.swt.SWT;
43
import org.eclipse.swt.layout.FillLayout;
44
import org.eclipse.swt.layout.RowLayout;
45
 
46
 
47
 
48
public class AdvancedWatchpointControl {
49
 
50
        private static Display mainDisplay = null;
51
        private static Shell mainShell = null;
52
        private static guiServerGroup gServerGroup = null;
53
        private static guiDCRGroup gDCRGroup = null;
54
        private static guiCountRegsGroup gCountGroup = null;
55
        private static guiControlGroup gControlGroup = null;
56
        private static mainControl mCtrl = null;
57
        private static ScrolledComposite mainSC = null;
58
        private static Composite mainComposite = null;
59
 
60
        /**
61
         * This method initializes mainShell
62
         *
63
         */
64
        private static void createMainShell(Display disp, mainControl mc) {
65
                RowLayout mainLayout = new RowLayout();
66
                mainLayout.center = true;
67
                mainLayout.fill = true;
68
                mainLayout.spacing = 5;
69
                mainLayout.wrap = false;
70
                mainLayout.pack = true;
71
                mainLayout.type = SWT.VERTICAL;
72
 
73
                mainShell = new Shell();
74
                mainShell.setText("Advanced Watchpoint Control");
75
                mainShell.setLayout(new FillLayout());
76
 
77
                mainSC = new ScrolledComposite(mainShell, SWT.H_SCROLL|SWT.V_SCROLL);
78
                mainComposite = new Composite(mainSC, SWT.NONE);
79
                mainComposite.setLayout(mainLayout);
80
 
81
                gServerGroup = new guiServerGroup(mainComposite, mc);
82
                gDCRGroup = new guiDCRGroup(mainComposite, mainDisplay, mc);
83
                gCountGroup = new guiCountRegsGroup(mainComposite, mainDisplay, mc);
84
                gControlGroup = new guiControlGroup(mainComposite, mc);
85
 
86
                mainSC.setContent(mainComposite);
87
                // Set the minimum size
88
            mainSC.setMinSize(770, 950);
89
            // Expand both horizontally and vertically
90
            mainSC.setExpandHorizontal(true);
91
            mainSC.setExpandVertical(true);
92
        }
93
 
94
 
95
        /**
96
         * @param args
97
         */
98
        public static void main(String[] args) {
99
 
100
                // Create the main control.
101
                // This also creates the network and RSP subsystems
102
                mCtrl = new mainControl();
103
 
104
                // Create the GUI.  Must be done after main control creation.
105
                mainDisplay = new Display();
106
                createMainShell(mainDisplay, mCtrl);
107
 
108
                // All ready, show the UI
109
                mainShell.pack();
110
                mainShell.open();
111
                while (!mainShell.isDisposed()) {
112
                if (!mainDisplay.readAndDispatch()) mainDisplay.sleep();
113
                }
114
                mainDisplay.dispose();
115
        }
116
 
117
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.