Browse Source

REPORT-12635

research/10.0
Mata.Li 6 years ago
parent
commit
585179f3e6
  1. 14
      designer-base/src/main/java/com/fr/design/web/CustomIconPane.java

14
designer-base/src/main/java/com/fr/design/web/CustomIconPane.java

@ -20,10 +20,13 @@ import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.WidgetInfoConfig; import com.fr.form.ui.WidgetInfoConfig;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.schedule.entry.Configuration;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.CoreGraphHelper; import com.fr.stable.CoreGraphHelper;
import com.fr.stable.ListMap; import com.fr.stable.ListMap;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.transaction.Configurations;
import com.fr.transaction.WorkerFacade;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
@ -39,9 +42,7 @@ import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
/** /**
*
* carl自定义Icon编辑 * carl自定义Icon编辑
*
*/ */
public class CustomIconPane extends BasicPane { public class CustomIconPane extends BasicPane {
private String selectedIconName = null; private String selectedIconName = null;
@ -55,7 +56,6 @@ public class CustomIconPane extends BasicPane {
private UIButton editButton; private UIButton editButton;
private static final int THE_WIDTH = 180; private static final int THE_WIDTH = 180;
private static final int HORIZONTAL_COUNT = 6; private static final int HORIZONTAL_COUNT = 6;
private static final int HEIGHT_PER = 29; private static final int HEIGHT_PER = 29;
@ -284,7 +284,13 @@ public class CustomIconPane extends BasicPane {
public String update() { public String update() {
//把图标信息入库 //把图标信息入库
Configurations.update(new WorkerFacade(WidgetInfoConfig.class) {
@Override
public void run() {
WidgetInfoConfig.getInstance().setIconManager(IconManager.getIconManager()); WidgetInfoConfig.getInstance().setIconManager(IconManager.getIconManager());
}
});
return selectedIconName; return selectedIconName;
} }
@ -311,6 +317,7 @@ public class CustomIconPane extends BasicPane {
private static final int ICON_BUTTON_SIZE = 24; private static final int ICON_BUTTON_SIZE = 24;
private static final int ICON_X = 4; private static final int ICON_X = 4;
private static final int ICON_Y = 4; private static final int ICON_Y = 4;
public IconButton(String name) { public IconButton(String name) {
this.iconName = name; this.iconName = name;
this.addActionListener(this); this.addActionListener(this);
@ -405,6 +412,7 @@ public class CustomIconPane extends BasicPane {
public void focusGained(FocusEvent e) { public void focusGained(FocusEvent e) {
// do nothing // do nothing
} }
public void focusLost(FocusEvent e) { public void focusLost(FocusEvent e) {
if (oldName != null && ComparatorUtils.equals(oldName, nameTextField.getText())) { if (oldName != null && ComparatorUtils.equals(oldName, nameTextField.getText())) {
return; return;

Loading…
Cancel
Save