Browse Source

Pull request #13314: REPORT-99485 RadioButtonStoryBoard

Merge in DESIGN/design from ~VITO/c-design:newui to newui

* commit '127fe12d5ba9eb7ec508b0143f2d0db34df12bf4':
  无jira任务 漏提交
  REPORT-99485 RadioButtonStoryBoard
newui
vito-刘恒霖 11 months ago
parent
commit
6ef97469b3
  1. 8
      designer-base/src/test/java/com/fr/design/gui/storybook/Storybook.java
  2. 10
      designer-base/src/test/java/com/fr/design/gui/storybook/components/ButtonTabStoryBoard.java
  3. 3
      designer-base/src/test/java/com/fr/design/gui/storybook/components/CheckBoxStoryBoard.java
  4. 3
      designer-base/src/test/java/com/fr/design/gui/storybook/components/ComboBoxStoryBoard.java
  5. 50
      designer-base/src/test/java/com/fr/design/gui/storybook/components/RadioButtonStoryBoard.java

8
designer-base/src/test/java/com/fr/design/gui/storybook/Storybook.java

@ -9,9 +9,13 @@ import com.formdev.flatlaf.extras.FlatAnimatedLafChange;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.gui.UILookAndFeel;
import com.fr.design.gui.storybook.components.ButtonStoryBoard;
import com.fr.design.gui.storybook.components.ButtonTabStoryBoard;
import com.fr.design.gui.storybook.components.CheckBoxStoryBoard;
import com.fr.design.gui.storybook.components.ComboBoxStoryBoard;
import com.fr.design.gui.storybook.components.EastRegionContainer;
import com.fr.design.gui.storybook.components.ExpandablePaneStoryBoard;
import com.fr.design.gui.storybook.components.InputStoryBoard;
import com.fr.design.gui.storybook.components.RadioButtonStoryBoard;
import com.fr.design.gui.storybook.components.SliderStoryBoard;
import com.fr.design.gui.storybook.components.ToggleButtonStoryBoard;
import com.fr.design.gui.storybook.components.ToolTipStoryBoard;
@ -36,7 +40,8 @@ import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import java.util.ArrayList;
import static com.fine.swing.ui.layout.Layouts.*;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.theme.utils.FineUIScale.scale;
/**
@ -98,6 +103,7 @@ public class Storybook {
components.add(new StoryBookComponent("ButtonTabGroup", new ButtonTabStoryBoard()));
components.add(new StoryBookComponent("CheckBox", new CheckBoxStoryBoard()));
components.add(new StoryBookComponent("ComboBox", new ComboBoxStoryBoard()));
components.add(new StoryBookComponent("RadioButton", new RadioButtonStoryBoard()));
components.add(new StoryBookComponent("Input", new InputStoryBoard()));
components.add(new StoryBookComponent("Slider", new SliderStoryBoard()));
components.add(new StoryBookComponent("ToolTip", new ToolTipStoryBoard()));

10
designer-base/src/test/java/com/fr/design/gui/storybook/ButtonTabStoryBoard.java → designer-base/src/test/java/com/fr/design/gui/storybook/components/ButtonTabStoryBoard.java

@ -1,16 +1,16 @@
package com.fr.design.gui.storybook;
package com.fr.design.gui.storybook.components;
import com.fine.theme.icon.LazyIcon;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ibutton.UITabGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.theme.edit.ui.TabbedPane;
import com.fr.design.gui.storybook.StoryBoard;
import com.fr.stable.ArrayUtils;
import javax.swing.Icon;
import javax.swing.*;
import static com.fine.swing.ui.layout.Layouts.*;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.flex;
/**
* Tab按钮组

3
designer-base/src/test/java/com/fr/design/gui/storybook/CheckBoxStoryBoard.java → designer-base/src/test/java/com/fr/design/gui/storybook/components/CheckBoxStoryBoard.java

@ -1,8 +1,9 @@
package com.fr.design.gui.storybook;
package com.fr.design.gui.storybook.components;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.storybook.StoryBoard;
import java.awt.*;

3
designer-base/src/test/java/com/fr/design/gui/storybook/ComboBoxStoryBoard.java → designer-base/src/test/java/com/fr/design/gui/storybook/components/ComboBoxStoryBoard.java

@ -1,7 +1,8 @@
package com.fr.design.gui.storybook;
package com.fr.design.gui.storybook.components;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.storybook.StoryBoard;
import com.fr.stable.ArrayUtils;
import java.awt.*;

50
designer-base/src/test/java/com/fr/design/gui/storybook/components/RadioButtonStoryBoard.java

@ -0,0 +1,50 @@
package com.fr.design.gui.storybook.components;
import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.storybook.StoryBoard;
import javax.swing.ButtonGroup;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* RadioButton
*
* @author vito
* @since 11.0
* Created on 2023/12/14
*/
public class RadioButtonStoryBoard extends StoryBoard {
ButtonGroup buttonGroup = new ButtonGroup();
ButtonGroup buttonGroup1 = new ButtonGroup();
public RadioButtonStoryBoard() {
super("单选按钮");
add(
cell(new UILabel("普通")).with(it -> it.setFont(labelFont.deriveFont(14f))),
row(10,
cell(new UIRadioButton("选项一")).with(it -> {
buttonGroup.add(it);
buttonGroup.setSelected(it.getModel(), true);
}),
cell(new UIRadioButton("选项二")).with(it -> buttonGroup.add(it)),
cell(new UIRadioButton("选项三")).with(it -> buttonGroup.add(it))
),
cell(new UILabel("禁用状态")).with(it -> it.setFont(labelFont.deriveFont(14f))),
row(10,
cell(new UIRadioButton("选项一")).with(it -> {
buttonGroup1.add(it);
buttonGroup1.setSelected(it.getModel(), true);
}),
cell(new UIRadioButton("选项二")).with(it -> buttonGroup1.add(it)),
cell(new UIRadioButton("选项三")).with(it -> {
buttonGroup1.add(it);
it.setEnabled(false);
})
)
);
}
}
Loading…
Cancel
Save