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