OpenCores
URL https://opencores.org/ocsvn/fpga-cf/fpga-cf/trunk

Subversion Repositories fpga-cf

[/] [fpga-cf/] [trunk/] [java/] [src/] [edu/] [byu/] [cc/] [plieber/] [fpgaenet/] [modmod/] [AvailableModulesWidget.java] - Blame information for rev 10

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 peteralieb
package edu.byu.cc.plieber.fpgaenet.modmod;
2
import java.util.ArrayList;
3
 
4
import com.trolltech.qt.core.Qt.AlignmentFlag;
5
import com.trolltech.qt.gui.*;
6
 
7
public class AvailableModulesWidget extends QWidget implements ModuleContainer {
8
 
9
    public static void main(String[] args) {
10
        QApplication.initialize(args);
11
 
12
        AvailableModulesWidget testAvailableModulesWidget = new AvailableModulesWidget(null);
13
        testAvailableModulesWidget.show();
14
 
15
        QApplication.exec();
16
    }
17
 
18
    private QVBoxLayout layout;
19
 
20
    public AvailableModulesWidget(QWidget parent){
21
        super(parent);
22
        /*QLabel background = new QLabel(this);
23
        background.setPixmap(new QPixmap("classpath:edu/byu/cc/plieber/fpgaenet/modmod/g/availProto.png"));
24
        QBoxLayout layout = new QVBoxLayout();
25
        this.setLayout(layout);
26
        layout.addWidget(background);*/
27
        availableModules = new ArrayList<AvailableModule>();
28
        layout = new QVBoxLayout(this);
29
        QLabel label = new QLabel("Available Modules");
30
        label.font().setPixelSize(30);
31
        layout.addWidget(label);
32
        layout.addStretch();
33
    }
34
 
35
    private ArrayList<AvailableModule> availableModules;
36
 
37
        @Override
38
        public void addModule(AvailableModule module) {
39
                availableModules.add(module);
40
                module.setParentContainer(this);
41
                module.setAvailable(true);
42
                layout.insertWidget(availableModules.size(), module);
43
        }
44
 
45
        @Override
46
        public void removeModule(AvailableModule module) {
47
                availableModules.remove(module);
48
                layout.removeWidget(module);
49
                module.close();
50
        }
51
}

powered by: WebSVN 2.1.0

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