com.alee.laf.checkbox.WebCheckBox Java Examples

The following examples show how to use com.alee.laf.checkbox.WebCheckBox. 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 6 votes vote down vote up
/**
 * React to action event.
 * @see java.awt.event.ActionListener
 * @param event the action event
 */
@Override
public void actionPerformed(ActionEvent event) {

	WebCheckBox check = (WebCheckBox) event.getSource();

	if (check == taskCheck)
		model.setDisplayTask(taskCheck.isSelected());
	else if (check == malfunctionCheck) 
		model.setDisplayMalfunction(malfunctionCheck.isSelected());
	else if (check == medicalCheck)
		model.setDisplayMedical(medicalCheck.isSelected());
	else if (check == missionCheck)
		model.setDisplayMission(missionCheck.isSelected());
	else if (check == transportCheck)
		model.setDisplayTransport(transportCheck.isSelected());
	else if (check == hazardCheck)
		model.setDisplayHazard(hazardCheck.isSelected());
}
 
Example #2
Source File: UISystemProxyConfirmationSupport.java    From weblaf with GNU General Public License v3.0 6 votes vote down vote up
@Override
public boolean shouldUseSystemProxy ()
{
    // Whether should save the choice or not
    alwaysDoTheSame = new WebCheckBox ();
    alwaysDoTheSame.setLanguage ( "weblaf.proxy.use.system.save" );
    alwaysDoTheSame.setSelected ( false );
    alwaysDoTheSame.setFocusable ( false );

    // Ask for settings replacement with system ones
    final String message = LM.get ( "weblaf.proxy.use.system.text" );
    final String title = LM.get ( "weblaf.proxy.use.system.title" );
    final int options = WebExtendedOptionPane.YES_NO_OPTION;
    final int type = WebExtendedOptionPane.QUESTION_MESSAGE;
    final WebExtendedOptionPane dialog =
            WebExtendedOptionPane.showConfirmDialog ( SwingUtils.getActiveWindow (), message, alwaysDoTheSame, title, options, type );

    return dialog.getResult () == WebOptionPane.YES_OPTION;
}
 
Example #3
Source File: ConfigurationDialog.java    From desktopclient-java with GNU General Public License v3.0 5 votes vote down vote up
private static WebCheckBox createCheckBox(String title, String tooltip, boolean selected) {
    WebCheckBox checkBox = new WebCheckBox(Tr.tr(title));
    checkBox.setAnimated(false);
    checkBox.setSelected(selected);
    if (!tooltip.isEmpty())
        TooltipManager.addTooltip(checkBox, tooltip);
    return checkBox;
}
 
Example #4
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);
    
}
 
Example #5
Source File: WeblafWrapper.java    From Spade with GNU General Public License v3.0 4 votes vote down vote up
public static JCheckBox createCheckBox()
{
	WebCheckBox c = new WebCheckBox();
	return c;
}
 
Example #6
Source File: WebBooleanEditor.java    From weblaf with GNU General Public License v3.0 4 votes vote down vote up
public WebBooleanEditor ()
{
    super ( new WebCheckBox () );
    setClickCountToStart ( 1 );
}
 
Example #7
Source File: WebTreeCellEditor.java    From weblaf with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Constructs tree cell editor with a specified check box as editor.
 *
 * @param checkBox editor checkbox
 */
public WebTreeCellEditor ( final WebCheckBox checkBox )
{
    super ( checkBox );
}