|
|
@ -1,11 +1,13 @@ |
|
|
|
package com.fr.design.hyperlink.popup; |
|
|
|
package com.fr.design.hyperlink.popup; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.fine.theme.utils.FineUIStyle; |
|
|
|
|
|
|
|
import com.formdev.flatlaf.util.ScaledEmptyBorder; |
|
|
|
|
|
|
|
import com.fr.design.constants.LayoutConstants; |
|
|
|
import com.fr.design.dialog.BasicPane; |
|
|
|
import com.fr.design.dialog.BasicPane; |
|
|
|
import com.fr.design.gui.ibutton.UIRadioButton; |
|
|
|
import com.fr.design.gui.ibutton.UIRadioButton; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
import com.fr.design.gui.ispinner.UISpinner; |
|
|
|
import com.fr.design.gui.ispinner.UISpinner; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.design.layout.VerticalFlowLayout; |
|
|
|
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
import javax.swing.*; |
|
|
@ -13,6 +15,11 @@ import java.awt.*; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionListener; |
|
|
|
import java.awt.event.ActionListener; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.column; |
|
|
|
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.cell; |
|
|
|
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.row; |
|
|
|
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.flex; |
|
|
|
|
|
|
|
|
|
|
|
public class MobilePopupRegularPane extends BasicPane { |
|
|
|
public class MobilePopupRegularPane extends BasicPane { |
|
|
|
private String label; |
|
|
|
private String label; |
|
|
|
|
|
|
|
|
|
|
@ -35,13 +42,15 @@ public class MobilePopupRegularPane extends BasicPane { |
|
|
|
|
|
|
|
|
|
|
|
private void initComponent() { |
|
|
|
private void initComponent() { |
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
this.add(this.createRadioButtonGroupPane(), BorderLayout.NORTH); |
|
|
|
|
|
|
|
spinnerGroupPane = this.createSpinnerPane(); |
|
|
|
spinnerGroupPane = this.createSpinnerPane(); |
|
|
|
this.add(spinnerGroupPane, BorderLayout.CENTER); |
|
|
|
this.add(column(LayoutConstants.VERTICAL_GAP, |
|
|
|
|
|
|
|
cell(this.createRadioButtonGroupPane()), |
|
|
|
|
|
|
|
row(flex(1), cell(spinnerGroupPane).weight(3)) |
|
|
|
|
|
|
|
).getComponent()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private JPanel createRadioButtonGroupPane() { |
|
|
|
private JPanel createRadioButtonGroupPane() { |
|
|
|
radiosPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 5)); |
|
|
|
radiosPane = new JPanel(new BorderLayout()); |
|
|
|
|
|
|
|
|
|
|
|
customRadio = new UIRadioButton(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Custom")); |
|
|
|
customRadio = new UIRadioButton(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Custom")); |
|
|
|
customRadio.addActionListener(radioActionListener); |
|
|
|
customRadio.addActionListener(radioActionListener); |
|
|
@ -52,10 +61,8 @@ public class MobilePopupRegularPane extends BasicPane { |
|
|
|
radioButtons.add(customRadio); |
|
|
|
radioButtons.add(customRadio); |
|
|
|
radioButtons.add(autoRadio); |
|
|
|
radioButtons.add(autoRadio); |
|
|
|
|
|
|
|
|
|
|
|
radiosPane.add(customRadio); |
|
|
|
radiosPane.add(row(30, cell(customRadio), cell(autoRadio), flex()).getComponent()); |
|
|
|
radiosPane.add(autoRadio); |
|
|
|
return row(cell(new UILabel(this.label, FineUIStyle.LABEL_SECONDARY)).weight(1), cell(radiosPane).weight(3)).getComponent(); |
|
|
|
|
|
|
|
|
|
|
|
return MobilePopupUIUtils.createLeftTileRightContentPanel(this.label, radiosPane, Color.GRAY, 20); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private ActionListener radioActionListener = new ActionListener() { |
|
|
|
private ActionListener radioActionListener = new ActionListener() { |
|
|
@ -66,33 +73,25 @@ public class MobilePopupRegularPane extends BasicPane { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
private JPanel createSpinnerPane() { |
|
|
|
private JPanel createSpinnerPane() { |
|
|
|
JPanel spinnerPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 15, 5)); |
|
|
|
JPanel spinnerPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 15, 0)); |
|
|
|
spinnerPane.setBorder(BorderFactory.createEmptyBorder(0, MobilePopupUIUtils.Left_Title_width, 0, 0)); |
|
|
|
spinnerPane.setBorder(new ScaledEmptyBorder(0, 0, 0, 0)); |
|
|
|
widthSpinner = new UISpinner(0, 100, 1, 95); |
|
|
|
widthSpinner = new UISpinner(0, 100, 1, 95); |
|
|
|
widthSpinnerPane = this.createSpinnerLabelPane(widthSpinner, Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Width")); |
|
|
|
widthSpinnerPane = this.createSpinnerLabelPane(widthSpinner, Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Width")); |
|
|
|
heightSpinner = new UISpinner(0, 100, 1, 95); |
|
|
|
heightSpinner = new UISpinner(0, 100, 1, 95); |
|
|
|
heightSpinnerPane = this.createSpinnerLabelPane(heightSpinner, Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Height")); |
|
|
|
heightSpinnerPane = this.createSpinnerLabelPane(heightSpinner, Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Height")); |
|
|
|
|
|
|
|
spinnerPane.add(row(cell(widthSpinnerPane), cell(heightSpinnerPane)).getComponent()); |
|
|
|
spinnerPane.add(widthSpinnerPane); |
|
|
|
|
|
|
|
spinnerPane.add(heightSpinnerPane); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return spinnerPane; |
|
|
|
return spinnerPane; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private JPanel createSpinnerLabelPane(UISpinner spinner, String labelText) { |
|
|
|
private JPanel createSpinnerLabelPane(UISpinner spinner, String labelText) { |
|
|
|
JPanel spinnerLabelPane = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 5)); |
|
|
|
JPanel spinnerLabelPane = new JPanel(new BorderLayout()); |
|
|
|
|
|
|
|
|
|
|
|
JPanel spinnerPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 2,0)); |
|
|
|
|
|
|
|
UILabel percent = new UILabel("%"); |
|
|
|
UILabel percent = new UILabel("%"); |
|
|
|
spinnerPane.add(spinner); |
|
|
|
|
|
|
|
spinnerPane.add(percent); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UILabel label = new UILabel(labelText); |
|
|
|
UILabel label = new UILabel(labelText); |
|
|
|
label.setHorizontalAlignment(SwingConstants.CENTER); |
|
|
|
label.setHorizontalAlignment(SwingConstants.CENTER); |
|
|
|
|
|
|
|
spinnerLabelPane.add(column(LayoutConstants.VGAP_SMALL, |
|
|
|
spinnerLabelPane.add(spinnerPane); |
|
|
|
row(cell(spinner).weight(1), cell(percent)).weight(1), |
|
|
|
spinnerLabelPane.add(label); |
|
|
|
cell(label) |
|
|
|
|
|
|
|
).getComponent()); |
|
|
|
return spinnerLabelPane; |
|
|
|
return spinnerLabelPane; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|