|
|
|
@ -11,7 +11,6 @@ import com.fr.base.background.ColorBackground;
|
|
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
import javax.swing.SwingUtilities; |
|
|
|
|
import javax.swing.border.TitledBorder; |
|
|
|
|
|
|
|
|
|
import com.fr.base.background.ImageBackground; |
|
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
@ -19,22 +18,18 @@ import com.fr.design.layout.FRGUIPaneFactory;
|
|
|
|
|
import com.fr.design.dialog.BasicDialog; |
|
|
|
|
import com.fr.design.dialog.BasicPane; |
|
|
|
|
import com.fr.design.dialog.DialogActionAdapter; |
|
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
|
import com.fr.design.mainframe.widget.accessibles.AccessibleBackgroundEditor; |
|
|
|
|
import com.fr.design.style.background.BackgroundButtonPane; |
|
|
|
|
import com.fr.form.ui.FreeButton; |
|
|
|
|
import com.fr.general.Background; |
|
|
|
|
import com.fr.general.Inter; |
|
|
|
|
|
|
|
|
|
public class ButtonSytleDefinedPane extends BasicPane { |
|
|
|
|
|
|
|
|
|
// private UIComboBox buttonStyleComboBox;
|
|
|
|
|
// private JPanel card;
|
|
|
|
|
// private CardLayout cardLayout;
|
|
|
|
|
private BackgroundPane initBackgroundPane; |
|
|
|
|
private BackgroundPane overBackgroundPane; |
|
|
|
|
private BackgroundPane clickBackgroundPane; |
|
|
|
|
private Background initBackground; |
|
|
|
|
private Background overBackground; |
|
|
|
|
private Background clickBackground; |
|
|
|
|
protected AccessibleBackgroundEditor initBackgroundPane; |
|
|
|
|
protected AccessibleBackgroundEditor overBackgroundPane; |
|
|
|
|
protected AccessibleBackgroundEditor clickBackgroundPane; |
|
|
|
|
|
|
|
|
|
public ButtonSytleDefinedPane() { |
|
|
|
|
this.initComponents(); |
|
|
|
@ -42,21 +37,22 @@ public class ButtonSytleDefinedPane extends BasicPane {
|
|
|
|
|
|
|
|
|
|
protected void initComponents() { |
|
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
|
|
|
|
|
|
JPanel buttonStylePane = new JPanel(); |
|
|
|
|
buttonStylePane.setLayout(new BorderLayout()); |
|
|
|
|
initBackgroundPane = new BackgroundPane(Inter.getLocText("FR-Designer_Background-Initial") + ":", Inter.getLocText("FR-Designer_Initial_Background_Tips")); |
|
|
|
|
overBackgroundPane = new BackgroundPane(Inter.getLocText("FR-Designer_Background-Over") + ":", Inter.getLocText("FR-Designer_Mouse_Move_Tips")); |
|
|
|
|
clickBackgroundPane = new BackgroundPane(Inter.getLocText("FR-Designer_Background-Click") + ":", Inter.getLocText("FR-Designer_Mouse_Click_Tips")); |
|
|
|
|
|
|
|
|
|
JPanel table = FRGUIPaneFactory.createYBoxEmptyBorderPane(); |
|
|
|
|
table.setBorder(new TitledBorder(Inter.getLocText(new String[]{"Custom", "Form-Button", "Style"}))); |
|
|
|
|
table.add(initBackgroundPane); |
|
|
|
|
table.add(overBackgroundPane); |
|
|
|
|
table.add(clickBackgroundPane); |
|
|
|
|
buttonStylePane.add(table, BorderLayout.WEST); |
|
|
|
|
|
|
|
|
|
this.add(buttonStylePane, BorderLayout.CENTER); |
|
|
|
|
initBackgroundPane = new AccessibleBackgroundEditor(); |
|
|
|
|
overBackgroundPane = new AccessibleBackgroundEditor(); |
|
|
|
|
clickBackgroundPane = new AccessibleBackgroundEditor(); |
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
final double p = TableLayout.PREFERRED; |
|
|
|
|
double[] rowSize = {p, p, p}; |
|
|
|
|
double[] columnSize = {p, f}; |
|
|
|
|
int[][] rowCount = {{1, 1},{1, 1},{1, 1}}; |
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background-Initial")), initBackgroundPane}, |
|
|
|
|
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background-Over")), overBackgroundPane}, |
|
|
|
|
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background-Click")), clickBackgroundPane}, |
|
|
|
|
}; |
|
|
|
|
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 7, 7); |
|
|
|
|
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); |
|
|
|
|
this.add(panel, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -64,16 +60,16 @@ public class ButtonSytleDefinedPane extends BasicPane {
|
|
|
|
|
if (button == null) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
initBackgroundPane.populate(button.getInitialBackground()); |
|
|
|
|
overBackgroundPane.populate(button.getOverBackground()); |
|
|
|
|
clickBackgroundPane.populate(button.getClickBackground()); |
|
|
|
|
initBackgroundPane.setValue(button.getInitialBackground()); |
|
|
|
|
overBackgroundPane.setValue(button.getOverBackground()); |
|
|
|
|
clickBackgroundPane.setValue(button.getClickBackground()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public FreeButton update(FreeButton button) { |
|
|
|
|
button.setCustomStyle(true); |
|
|
|
|
button.setInitialBackground(initBackgroundPane.update()); |
|
|
|
|
button.setOverBackground(overBackgroundPane.update()); |
|
|
|
|
button.setClickBackground(clickBackgroundPane.update()); |
|
|
|
|
button.setInitialBackground((Background) initBackgroundPane.getValue()); |
|
|
|
|
button.setOverBackground((Background) overBackgroundPane.getValue()); |
|
|
|
|
button.setClickBackground((Background) clickBackgroundPane.getValue()); |
|
|
|
|
|
|
|
|
|
return button; |
|
|
|
|
} |
|
|
|
|