mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-14 07:47:12 -06:00
Extras: Renamed tri-state check box class from
`com.formdev.flatlaf.extras.TriStateCheckBox` to `com.formdev.flatlaf.extras.components.FlatTriStateCheckBox`
This commit is contained in:
@@ -7,7 +7,7 @@ This sub-project provides some additional components and classes:
|
||||
An icon that displays SVG using
|
||||
[svgSalamander](https://github.com/JFormDesigner/svgSalamander).\
|
||||

|
||||
- [TriStateCheckBox](https://www.javadoc.io/doc/com.formdev/flatlaf-extras/latest/com/formdev/flatlaf/extras/TriStateCheckBox.html):
|
||||
- [FlatTriStateCheckBox](https://www.javadoc.io/doc/com.formdev/flatlaf-extras/latest/com/formdev/flatlaf/extras/components/FlatTriStateCheckBox.html):
|
||||
A tri-state check box.\
|
||||

|
||||
- [FlatAnimatedLafChange](https://www.javadoc.io/doc/com.formdev/flatlaf-extras/latest/com/formdev/flatlaf/extras/FlatAnimatedLafChange.html):
|
||||
|
||||
@@ -14,8 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.formdev.flatlaf.extras;
|
||||
package com.formdev.flatlaf.extras.components;
|
||||
|
||||
import static com.formdev.flatlaf.FlatClientProperties.*;
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.event.ItemEvent;
|
||||
@@ -36,7 +37,7 @@ import com.formdev.flatlaf.FlatLaf;
|
||||
*
|
||||
* @author Karl Tauber
|
||||
*/
|
||||
public class TriStateCheckBox
|
||||
public class FlatTriStateCheckBox
|
||||
extends JCheckBox
|
||||
{
|
||||
public enum State { INDETERMINATE, SELECTED, UNSELECTED }
|
||||
@@ -44,15 +45,15 @@ public class TriStateCheckBox
|
||||
private State state;
|
||||
private boolean thirdStateEnabled = true;
|
||||
|
||||
public TriStateCheckBox() {
|
||||
public FlatTriStateCheckBox() {
|
||||
this( null );
|
||||
}
|
||||
|
||||
public TriStateCheckBox( String text ) {
|
||||
public FlatTriStateCheckBox( String text ) {
|
||||
this( text, State.INDETERMINATE );
|
||||
}
|
||||
|
||||
public TriStateCheckBox( String text, State initialState ) {
|
||||
public FlatTriStateCheckBox( String text, State initialState ) {
|
||||
super( text );
|
||||
|
||||
setModel( new ToggleButtonModel() {
|
||||
@@ -89,7 +90,7 @@ public class TriStateCheckBox
|
||||
State oldState = this.state;
|
||||
this.state = state;
|
||||
|
||||
putClientProperty( "JButton.selectedState", state == State.INDETERMINATE ? "indeterminate" : null );
|
||||
putClientProperty( SELECTED_STATE, state == State.INDETERMINATE ? SELECTED_STATE_INDETERMINATE : null );
|
||||
|
||||
firePropertyChange( "state", oldState, state );
|
||||
repaint();
|
||||
Reference in New Issue
Block a user