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] - Rev 2

Compare with Previous | Blame | View Log

package edu.byu.cc.plieber.fpgaenet.modmod;
import java.util.ArrayList;
 
import com.trolltech.qt.core.Qt.AlignmentFlag;
import com.trolltech.qt.gui.*;
 
public class AvailableModulesWidget extends QWidget implements ModuleContainer {
 
    public static void main(String[] args) {
        QApplication.initialize(args);
 
        AvailableModulesWidget testAvailableModulesWidget = new AvailableModulesWidget(null);
        testAvailableModulesWidget.show();
 
        QApplication.exec();
    }
 
    private QVBoxLayout layout;
 
    public AvailableModulesWidget(QWidget parent){
        super(parent);
        /*QLabel background = new QLabel(this);
        background.setPixmap(new QPixmap("classpath:edu/byu/cc/plieber/fpgaenet/modmod/g/availProto.png"));
        QBoxLayout layout = new QVBoxLayout();
        this.setLayout(layout);
        layout.addWidget(background);*/
        availableModules = new ArrayList<AvailableModule>();
        layout = new QVBoxLayout(this);
        QLabel label = new QLabel("Available Modules");
        label.font().setPixelSize(30);
        layout.addWidget(label);
        layout.addStretch();
    }
 
    private ArrayList<AvailableModule> availableModules;
 
	@Override
	public void addModule(AvailableModule module) {
		availableModules.add(module);
		module.setParentContainer(this);
		module.setAvailable(true);
		layout.insertWidget(availableModules.size(), module);
	}
 
	@Override
	public void removeModule(AvailableModule module) {
		availableModules.remove(module);
		layout.removeWidget(module);
		module.close();
	}
}
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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