From b6c607122cbe498f4e638239e1a1f611ad5ac898 Mon Sep 17 00:00:00 2001 From: momeak Date: Mon, 18 Sep 2017 15:21:15 +0800 Subject: [PATCH 1/3] =?UTF-8?q?REPORT-4604=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E8=A7=86=E8=A7=89=E4=BF=AE=E6=94=B9=201.=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=A0=91=E3=80=81=E6=95=B0=E6=8D=AE=E9=9B=86=E7=9A=84=E5=BA=95?= =?UTF-8?q?=E8=89=B2=E4=BF=AE=E6=94=B9=202.UIHEADGROUP=E7=9A=84=E9=85=8D?= =?UTF-8?q?=E8=89=B2=E4=BF=AE=E6=94=B9=EF=BC=8C=E6=8E=A7=E4=BB=B6=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E9=82=A3=E8=BE=B9=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E4=B8=8A=E8=BE=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer/src/com/fr/design/widget/CellWidgetCardPane.java | 4 +++- designer_base/src/com/fr/design/constants/UIConstants.java | 2 +- .../src/com/fr/design/mainframe/WidgetPropertyPane.java | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/designer/src/com/fr/design/widget/CellWidgetCardPane.java b/designer/src/com/fr/design/widget/CellWidgetCardPane.java index b3f5fef11b..043e3a7798 100644 --- a/designer/src/com/fr/design/widget/CellWidgetCardPane.java +++ b/designer/src/com/fr/design/widget/CellWidgetCardPane.java @@ -1,5 +1,6 @@ package com.fr.design.widget; +import com.fr.design.constants.UIConstants; import com.fr.design.data.DataCreatorUI; import com.fr.design.designer.IntervalConstants; import com.fr.design.dialog.BasicPane; @@ -91,7 +92,8 @@ public class CellWidgetCardPane extends BasicPane { tabbedPane.show(center, tabTitles[index]); } }; - tabsHeaderIconPane.setNeedLeftRightOutLine(false); + tabsHeaderIconPane.setNeedLeftRightOutLine(true); + tabsHeaderIconPane.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, UIConstants.SHADOW_GREY)); this.add(tabsHeaderIconPane, BorderLayout.NORTH); widgetPropertyPane = new BasicWidgetPropertySettingPane(); diff --git a/designer_base/src/com/fr/design/constants/UIConstants.java b/designer_base/src/com/fr/design/constants/UIConstants.java index 4d5a5cea5b..1074fd1f1e 100644 --- a/designer_base/src/com/fr/design/constants/UIConstants.java +++ b/designer_base/src/com/fr/design/constants/UIConstants.java @@ -74,7 +74,7 @@ public interface UIConstants { public static final Color OCEAN_BLUE = new Color(141, 179, 217); public static final Color DARK_BLUE = new Color(0, 88, 144); public static final Color NORMAL_BACKGROUND = new Color(212, 212, 216); - public static final Color TREE_BACKGROUND = new Color(240, 240, 243); + public static final Color TREE_BACKGROUND = new Color(245, 245, 247); public static final Color TOOL_PANE_BACKGROUND = new Color(232, 232, 223); public static final Color SELECT_TAB = new Color(245, 245, 247); public static final Color TOOLBARUI_BACKGROUND = new Color(255, 255, 255); diff --git a/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java b/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java index a01d4347a7..dab9b51481 100644 --- a/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java +++ b/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java @@ -2,6 +2,7 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; import com.fr.design.ExtraDesignClassManager; +import com.fr.design.constants.UIConstants; import com.fr.design.designer.beans.events.DesignerEditListener; import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.creator.*; @@ -275,7 +276,8 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope tabbedPane.show(center, tabTitles[index]); } }; - tabsHeaderIconPane.setNeedLeftRightOutLine(false); + tabsHeaderIconPane.setNeedLeftRightOutLine(true); + tabsHeaderIconPane.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, UIConstants.SHADOW_GREY)); this.add(tabsHeaderIconPane, BorderLayout.NORTH); } From d06e1b0219f719090bf8029b0c872d2767f1c355 Mon Sep 17 00:00:00 2001 From: MoMeak Date: Mon, 18 Sep 2017 16:29:51 +0800 Subject: [PATCH 2/3] =?UTF-8?q?REPORT-4604=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E8=A7=86=E8=A7=89=E4=BF=AE=E6=94=B9=20UIButtonGroup=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E5=AD=97=E4=BD=93=E9=A2=9C=E8=89=B2=E5=8F=98=E7=99=BD?= =?UTF-8?q?=20=EF=BC=8819=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/ibutton/UIButtonGroup.java | 21 +++++++++++++++++++ .../com/fr/design/gui/ibutton/UIButtonUI.java | 4 ++++ 2 files changed, 25 insertions(+) diff --git a/designer_base/src/com/fr/design/gui/ibutton/UIButtonGroup.java b/designer_base/src/com/fr/design/gui/ibutton/UIButtonGroup.java index 62fe66af08..0683fc7c2b 100644 --- a/designer_base/src/com/fr/design/gui/ibutton/UIButtonGroup.java +++ b/designer_base/src/com/fr/design/gui/ibutton/UIButtonGroup.java @@ -8,11 +8,14 @@ import com.fr.design.utils.gui.GUICoreUtils; import com.fr.stable.ArrayUtils; import com.fr.stable.Constants; import com.fr.stable.StringUtils; +import sun.swing.SwingUtilities2; import javax.swing.*; import javax.swing.border.Border; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import javax.swing.plaf.basic.BasicHTML; +import javax.swing.text.View; import java.awt.*; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; @@ -145,6 +148,24 @@ public class UIButtonGroup extends JPanel implements GlobalNameObserver { } }; + labelButton.setUI(new UIButtonUI() { + protected void paintText(Graphics g, AbstractButton b, String text, Rectangle textRec) { + View v = (View) b.getClientProperty(BasicHTML.propertyKey); + if (v != null) { + v.paint(g, textRec); + return; + } + FontMetrics fm = SwingUtilities2.getFontMetrics(b, g); + int mnemonicIndex = b.getDisplayedMnemonicIndex(); + if (isPressed(b)) { + g.setColor(Color.white); + } else { + g.setColor(Color.black); + } + + SwingUtilities2.drawStringUnderlineCharAt(b, g, text, mnemonicIndex, textRec.x + getTextShiftOffset(), textRec.y + fm.getAscent() + getTextShiftOffset()); + } + }); initButton(labelButton); } } diff --git a/designer_base/src/com/fr/design/gui/ibutton/UIButtonUI.java b/designer_base/src/com/fr/design/gui/ibutton/UIButtonUI.java index fb7605612c..74168e7d2c 100644 --- a/designer_base/src/com/fr/design/gui/ibutton/UIButtonUI.java +++ b/designer_base/src/com/fr/design/gui/ibutton/UIButtonUI.java @@ -68,6 +68,10 @@ public class UIButtonUI extends BasicButtonUI { } private void paintText(Graphics g, AbstractButton b, String text) { + paintText(g, b, text ,textRec); + } + + protected void paintText(Graphics g, AbstractButton b, String text, Rectangle textRec) { View v = (View) b.getClientProperty(BasicHTML.propertyKey); if (v != null) { v.paint(g, textRec); From 39bdb7e62851a594c522a1b2d3231d97324d5e17 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Tue, 19 Sep 2017 10:33:24 +0800 Subject: [PATCH 3/3] =?UTF-8?q?REPORT-4605=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=88=A0=E9=99=A4=E5=85=88=E5=B0=9D=E8=AF=95?= =?UTF-8?q?=E6=94=BE=E5=9B=9E=E6=94=B6=E7=AB=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/file/TemplateTreePane.java | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/designer_base/src/com/fr/design/file/TemplateTreePane.java b/designer_base/src/com/fr/design/file/TemplateTreePane.java index e9009ff9fa..3c690a5c6b 100644 --- a/designer_base/src/com/fr/design/file/TemplateTreePane.java +++ b/designer_base/src/com/fr/design/file/TemplateTreePane.java @@ -5,8 +5,8 @@ package com.fr.design.file; import com.fr.base.FRContext; import com.fr.dav.LocalEnv; -import com.fr.design.gui.itree.filetree.TemplateFileTree; import com.fr.design.gui.icontainer.UIScrollPane; +import com.fr.design.gui.itree.filetree.TemplateFileTree; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; @@ -17,16 +17,18 @@ import com.fr.file.filetree.IOFileNodeFilter; import com.fr.general.ComparatorUtils; import com.fr.general.FRLogger; import com.fr.general.Inter; -import com.fr.stable.ProductConstants; import com.fr.stable.CoreConstants; +import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; import com.fr.stable.project.ProjectConstants; +import com.sun.jna.platform.FileUtils; import javax.swing.*; import javax.swing.tree.DefaultMutableTreeNode; import java.awt.*; import java.awt.event.*; import java.io.File; +import java.io.IOException; import java.util.ArrayList; import java.util.logging.Level; @@ -177,7 +179,7 @@ public class TemplateTreePane extends JPanel implements FileOperations { } if (nodeFile.exists()) { String path = StableUtils.pathJoin(new String[]{nodeFile.getEnvPath(), nodeFile.getPath()}); - FRContext.getCurrentEnv().deleteFile(nodeFile.getPath()); + moveToTrash(nodeFile); deleteHistory(path.replaceAll("/", "\\\\")); } else { JOptionPane.showMessageDialog(this, Inter.getLocText("Warning-Template_Do_Not_Exsit"), ProductConstants.PRODUCT_NAME, @@ -187,7 +189,6 @@ public class TemplateTreePane extends JPanel implements FileOperations { reportletsTree.refresh(); } - private void deleteHistory(String fileName) { int index = HistoryTemplateListPane.getInstance().contains(fileName); int size = HistoryTemplateListPane.getInstance().getHistoryCount(); @@ -304,4 +305,24 @@ public class TemplateTreePane extends JPanel implements FileOperations { } } + /** + * 文件回收 + * + * @param nodeFile 节点文件 + */ + private void moveToTrash(FileNodeFILE nodeFile) { + FileUtils fileUtils = FileUtils.getInstance(); + if (fileUtils.hasTrash()) { + try { + fileUtils.moveToTrash(new File[]{new File(StableUtils.pathJoin(nodeFile.getEnvPath(), nodeFile.getPath()))}); + } catch (IOException e) { + FRLogger.getLogger().info(e.getMessage()); + FRContext.getCurrentEnv().deleteFile(nodeFile.getPath()); + } + } else { + FRLogger.getLogger().info("No Trash Available"); + FRContext.getCurrentEnv().deleteFile(nodeFile.getPath()); + } + } + } \ No newline at end of file