|
|
@ -6,6 +6,7 @@ import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable; |
|
|
|
import com.formdev.flatlaf.ui.FlatToggleButtonUI; |
|
|
|
import com.formdev.flatlaf.ui.FlatToggleButtonUI; |
|
|
|
import com.formdev.flatlaf.ui.FlatUIUtils; |
|
|
|
import com.formdev.flatlaf.ui.FlatUIUtils; |
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
|
|
|
|
import org.jetbrains.annotations.NotNull; |
|
|
|
import org.jetbrains.annotations.Nullable; |
|
|
|
import org.jetbrains.annotations.Nullable; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.AbstractButton; |
|
|
|
import javax.swing.AbstractButton; |
|
|
@ -156,6 +157,16 @@ public class FineToggleButtonUI extends FlatToggleButtonUI { |
|
|
|
FlatUIUtils.paintComponentBackground(g2, 0, 0, c.getWidth(), c.getHeight(), focusWidth, 0); |
|
|
|
FlatUIUtils.paintComponentBackground(g2, 0, 0, c.getWidth(), c.getHeight(), focusWidth, 0); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
float arc = FlatUIUtils.getBorderArc( c ) / 2; |
|
|
|
float arc = FlatUIUtils.getBorderArc( c ) / 2; |
|
|
|
|
|
|
|
Shape path2D = getGroupButtonPath2D(c, position, arc); |
|
|
|
|
|
|
|
g2.fill(path2D); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} finally { |
|
|
|
|
|
|
|
g2.dispose(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@NotNull |
|
|
|
|
|
|
|
private static Shape getGroupButtonPath2D(JComponent c, int position, float arc) { |
|
|
|
Shape path2D; |
|
|
|
Shape path2D; |
|
|
|
switch (position) { |
|
|
|
switch (position) { |
|
|
|
case GROUP_BUTTON_POSITION_LEFT: |
|
|
|
case GROUP_BUTTON_POSITION_LEFT: |
|
|
@ -179,11 +190,7 @@ public class FineToggleButtonUI extends FlatToggleButtonUI { |
|
|
|
default: |
|
|
|
default: |
|
|
|
path2D = new Rectangle(); |
|
|
|
path2D = new Rectangle(); |
|
|
|
} |
|
|
|
} |
|
|
|
g2.fill(path2D); |
|
|
|
return path2D; |
|
|
|
} |
|
|
|
|
|
|
|
} finally { |
|
|
|
|
|
|
|
g2.dispose(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|