Browse Source

Make less functions static in ComponentDemo.

pull/188/head
weisj 4 years ago
parent
commit
5fd3794c8b
  1. 14
      core/src/test/java/ui/ComponentDemo.java
  2. 2
      core/src/test/java/ui/button/HelpButtonDemo.java
  3. 2
      core/src/test/java/ui/checkBox/CheckBoxDemo.java
  4. 2
      core/src/test/java/ui/checkBox/TriCheckBoxDemo.java
  5. 3
      core/src/test/java/ui/internalFrame/InternalFrameDemo.java
  6. 2
      core/src/test/java/ui/popupMenu/PopupMenuDemo.java
  7. 2
      core/src/test/java/ui/radioButton/RadioButtonDemo.java

14
core/src/test/java/ui/ComponentDemo.java

@ -52,6 +52,10 @@ public interface ComponentDemo {
themeStyle.getColorToneRule()));
}
default Theme createTheme() {
return getTheme();
}
JComponent createComponent();
static void showDemo(final ComponentDemo demo) {
@ -169,10 +173,6 @@ public interface ComponentDemo {
}
default JMenuBar createMenuBar() {
return getDefaultMenuBar();
}
static JMenuBar getDefaultMenuBar() {
JMenuBar menuBar = new JMenuBar();
menuBar.add(createThemeMenu());
menuBar.add(createSettingsMenu());
@ -180,7 +180,7 @@ public interface ComponentDemo {
return menuBar;
}
static JMenu createDevSettings() {
default JMenu createDevSettings() {
JMenu dev = new JMenu("Dev");
JMenu logging = new JMenu("Logging");
ButtonGroup bg = new ButtonGroup();
@ -207,10 +207,6 @@ public interface ComponentDemo {
return dev;
}
default Theme createTheme() {
return getTheme();
}
String getTitle();
class ThemeMenuItem extends JRadioButtonMenuItem {

2
core/src/test/java/ui/button/HelpButtonDemo.java

@ -67,7 +67,7 @@ public class HelpButtonDemo implements ComponentDemo {
@Override
public JMenuBar createMenuBar() {
JMenuBar menuBar = ComponentDemo.getDefaultMenuBar();
JMenuBar menuBar = ComponentDemo.super.createMenuBar();
menuBar.add(new JMenu("Help") {
{
add(new HelpMenuItem("View Help"));

2
core/src/test/java/ui/checkBox/CheckBoxDemo.java

@ -86,7 +86,7 @@ public class CheckBoxDemo implements ComponentDemo {
@Override
public JMenuBar createMenuBar() {
JMenuBar menuBar = ComponentDemo.getDefaultMenuBar();
JMenuBar menuBar = ComponentDemo.super.createMenuBar();
menuBar.add(new JMenu("Demo") {
{
add(new JCheckBoxMenuItem("CheckBox menu item"));

2
core/src/test/java/ui/checkBox/TriCheckBoxDemo.java

@ -88,7 +88,7 @@ public class TriCheckBoxDemo implements ComponentDemo {
@Override
public JMenuBar createMenuBar() {
JMenuBar menuBar = ComponentDemo.getDefaultMenuBar();
JMenuBar menuBar = ComponentDemo.super.createMenuBar();
menuBar.add(new JMenu("Demo") {
{
add(new TristateCheckBoxMenuItem("TristateCheckBox menu item"));

3
core/src/test/java/ui/internalFrame/InternalFrameDemo.java

@ -64,14 +64,13 @@ public class InternalFrameDemo implements ActionListener, ComponentDemo {
createFrame();
// Make dragging a little faster but perhaps uglier.
desktop.setDragMode(JDesktopPane.LIVE_DRAG_MODE);
return new DemoPanel(desktop, new BorderLayout(), 10);
}
@Override
public JMenuBar createMenuBar() {
JMenuBar menuBar = ComponentDemo.getDefaultMenuBar();
JMenuBar menuBar = ComponentDemo.super.createMenuBar();
// Set up the lone menu.
JMenu menu = new JMenu("Document");

2
core/src/test/java/ui/popupMenu/PopupMenuDemo.java

@ -130,7 +130,7 @@ public class PopupMenuDemo implements ComponentDemo {
@Override
public JMenuBar createMenuBar() {
JMenuBar menuBar = ComponentDemo.getDefaultMenuBar();
JMenuBar menuBar = ComponentDemo.super.createMenuBar();
menuBar.add(new JMenu("CheckBoxes") {
{
for (int i = 0; i < 10; i++) {

2
core/src/test/java/ui/radioButton/RadioButtonDemo.java

@ -86,7 +86,7 @@ public class RadioButtonDemo implements ComponentDemo {
@Override
public JMenuBar createMenuBar() {
JMenuBar menuBar = ComponentDemo.getDefaultMenuBar();
JMenuBar menuBar = ComponentDemo.super.createMenuBar();
menuBar.add(new JMenu("Demo") {
{
add(new JRadioButtonMenuItem("RadioButton menu item"));

Loading…
Cancel
Save