package com.dwave.gui;
import javax.swing.*;
import com.javaworld.BrowserControl;
/**
* A JCheckBox which uses the Lucida Sans font by
* default because fonts on linux are wierd
*/
public class DCheckBox extends JCheckBox {
/**
* Creates an initially unselected check box button with no text, no icon.
*/
public DCheckBox () {
this(null, null, false);
}
/**
* Creates an initially unselected check box with an icon.
*
* @param icon the Icon image to display
*/
public DCheckBox(Icon icon) {
this(null, icon, false);
}
/**
* Creates a check box with an icon and specifies whether
* or not it is initially selected.
*
* @param icon the Icon image to display
* @param selected a boolean value indicating the initial selection
* state. If true the check box is selected
*/
public DCheckBox(Icon icon, boolean selected) {
this(null, icon, selected);
}
/**
* Creates an initially unselected check box with text.
*
* @param text the text of the check box.
*/
public DCheckBox (String text) {
this(text, null, false);
}
/**
* Creates a check box where properties are taken from the
* Action supplied.
*
* @since 1.3
*/
public DCheckBox(Action a) {
this();
setAction(a);
}
/**
* Creates a check box with text and specifies whether
* or not it is initially selected.
*
* @param text the text of the check box.
* @param selected a boolean value indicating the initial selection
* state. If true the check box is selected
*/
public DCheckBox (String text, boolean selected) {
this(text, null, selected);
}
/**
* Creates an initially unselected check box with
* the specified text and icon.
*
* @param text the text of the check box.
* @param icon the Icon image to display
*/
public DCheckBox(String text, Icon icon) {
this(text, icon, false);
}
/**
* Creates a check box with text and icon,
* and specifies whether or not it is initially selected.
*
* @param text the text of the check box.
* @param icon the Icon image to display
* @param selected a boolean value indicating the initial selection
* state. If true the check box is selected
*/
public DCheckBox (String text, Icon icon, boolean selected) {
super(text, icon, selected);
setBorderPainted(false);
setHorizontalAlignment(LEFT);
if(!BrowserControl.isWindowsPlatform())
this.setFont(new java.awt.Font("Lucida Sans", 0, 12));
}
}