Java Code Examples for com.alee.laf.checkbox.WebCheckBox#addActionListener()

The following examples show how to use com.alee.laf.checkbox.WebCheckBox#addActionListener() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EventFilter.java    From mars-sim with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Constructor.
 * @param model the event table model
 * @param desktop the main desktop
 */
public EventFilter(EventTableModel model, MainDesktopPane desktop) {

	// Use JInternalFrame constructor.
	super(Msg.getString("EventFilter.title"), false, true); //$NON-NLS-1$

	// Initialize data members.
	this.model = model;

	// Prepare content pane
	WebPanel mainPane = new WebPanel();
	mainPane.setLayout(new BorderLayout());
	mainPane.setBorder(MainDesktopPane.newEmptyBorder());
	setContentPane(mainPane);

	// Create category pane
	WebPanel categoryPane = new WebPanel(new GridLayout(5, 1));
	categoryPane.setBorder(new MarsPanelBorder());
	mainPane.add(categoryPane, BorderLayout.CENTER);

	// Create transport events checkbox.
	hazardCheck = new WebCheckBox(HistoricalEventCategory.HAZARD.getName());
	hazardCheck.setSelected(model.getDisplayHazard());
	hazardCheck.addActionListener(this);
	categoryPane.add(hazardCheck);
	
	// Create mechanical events checkbox.
	malfunctionCheck = new WebCheckBox(HistoricalEventCategory.MALFUNCTION.getName());
	malfunctionCheck.setSelected(model.getDisplayMalfunction());
	malfunctionCheck.addActionListener(this);
	categoryPane.add(malfunctionCheck);

	// Create medical events checkbox.
	medicalCheck = new WebCheckBox(HistoricalEventCategory.MEDICAL.getName());
	medicalCheck.setSelected(model.getDisplayMedical());
	medicalCheck.addActionListener(this);
	categoryPane.add(medicalCheck);

	// Create mission events checkbox.
	missionCheck = new WebCheckBox(HistoricalEventCategory.MISSION.getName());
	missionCheck.setSelected(model.getDisplayMission());
	missionCheck.addActionListener(this);
	categoryPane.add(missionCheck);

	// Create task events checkbox.
	taskCheck = new WebCheckBox(HistoricalEventCategory.TASK.getName());
	taskCheck.setSelected(model.getDisplayTask());
	taskCheck.addActionListener(this);
	categoryPane.add(taskCheck);

	// Create transport events checkbox.
	transportCheck = new WebCheckBox(HistoricalEventCategory.TRANSPORT.getName());
	transportCheck.setSelected(model.getDisplayTransport());
	transportCheck.addActionListener(this);
	categoryPane.add(transportCheck);

	pack();
	
       desktop.add(this);
    
}