|
|
|
@ -1,9 +1,11 @@
|
|
|
|
|
package com.fr.design.web; |
|
|
|
|
|
|
|
|
|
import com.fine.theme.light.ui.FineRoundBorder; |
|
|
|
|
import com.fr.base.BaseUtils; |
|
|
|
|
import com.fr.base.GraphHelper; |
|
|
|
|
import com.fr.base.Icon; |
|
|
|
|
import com.fr.base.IconManager; |
|
|
|
|
import com.fr.design.border.FineBorderFactory; |
|
|
|
|
import com.fr.design.dialog.BasicPane; |
|
|
|
|
import com.fr.design.dialog.DialogActionAdapter; |
|
|
|
|
import com.fr.design.dialog.FineJOptionPane; |
|
|
|
@ -41,6 +43,7 @@ import java.awt.Graphics;
|
|
|
|
|
import java.awt.Graphics2D; |
|
|
|
|
import java.awt.Image; |
|
|
|
|
import java.awt.Window; |
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
import javax.swing.ButtonGroup; |
|
|
|
|
import javax.swing.ImageIcon; |
|
|
|
|
import javax.swing.JComponent; |
|
|
|
@ -60,6 +63,10 @@ import java.awt.event.FocusListener;
|
|
|
|
|
import java.awt.geom.Rectangle2D; |
|
|
|
|
import java.awt.image.BufferedImage; |
|
|
|
|
|
|
|
|
|
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; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* carl:自定义Icon编辑 |
|
|
|
|
*/ |
|
|
|
@ -86,11 +93,11 @@ public class CustomIconPane extends BasicPane {
|
|
|
|
|
|
|
|
|
|
private void initComponents() { |
|
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
|
UILabel iconLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon")); |
|
|
|
|
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
|
centerPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon"))); |
|
|
|
|
JPanel noNamePane = FRGUIPaneFactory.createCenterFlowInnerContainer_S_Pane(); |
|
|
|
|
centerPane.add(noNamePane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
JPanel noNamePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
|
noNamePane.setBorder(new FineRoundBorder()); |
|
|
|
|
noNamePane.setBackground(Color.WHITE); |
|
|
|
|
iconPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); |
|
|
|
|
|
|
|
|
|
// 开始加图标选择按钮
|
|
|
|
@ -100,14 +107,14 @@ public class CustomIconPane extends BasicPane {
|
|
|
|
|
refreshIconPane(false); |
|
|
|
|
jsPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); |
|
|
|
|
|
|
|
|
|
jsPane.setPreferredSize(new Dimension(200, 180)); |
|
|
|
|
noNamePane.add(jsPane); |
|
|
|
|
|
|
|
|
|
DescriptionTextArea des = new DescriptionTextArea(2); |
|
|
|
|
des.setText(createDescriptionText()); |
|
|
|
|
centerPane.add(des, BorderLayout.SOUTH); |
|
|
|
|
|
|
|
|
|
this.add(centerPane, BorderLayout.CENTER); |
|
|
|
|
UILabel desLabel = new UILabel(createDescriptionText()); |
|
|
|
|
desLabel.setForeground(Color.GRAY); |
|
|
|
|
centerPane.add(column( |
|
|
|
|
cell(noNamePane).weight(0.9), |
|
|
|
|
cell(desLabel).weight(0.1) |
|
|
|
|
).getComponent()); |
|
|
|
|
|
|
|
|
|
JPanel eastPane = FRGUIPaneFactory.createCenterFlowInnerContainer_S_Pane(); |
|
|
|
|
JPanel buttonPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1); |
|
|
|
@ -118,8 +125,10 @@ public class CustomIconPane extends BasicPane {
|
|
|
|
|
initEditButton(buttonPane); |
|
|
|
|
|
|
|
|
|
eastPane.add(buttonPane); |
|
|
|
|
this.add(eastPane, BorderLayout.EAST); |
|
|
|
|
|
|
|
|
|
this.add(column(10, |
|
|
|
|
cell(iconLabel), |
|
|
|
|
row(10, cell(centerPane).weight(0.9), cell(eastPane).weight(0.1)).weight(1.0) |
|
|
|
|
).getComponent()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -369,7 +378,7 @@ public class CustomIconPane extends BasicPane {
|
|
|
|
|
g2d.drawImage(iconImage, ICON_X, ICON_Y, IconManager.DEFAULT_ICONWIDTH, IconManager.DEFAULT_ICONHEIGHT, null); |
|
|
|
|
} |
|
|
|
|
if (this.iconName != null && ComparatorUtils.equals(this.iconName, selectedIconName)) { |
|
|
|
|
g2d.setPaint(Color.RED); |
|
|
|
|
g2d.setPaint(Color.BLUE); |
|
|
|
|
} else { |
|
|
|
|
g2d.setPaint(Color.LIGHT_GRAY); |
|
|
|
|
} |
|
|
|
|