Browse Source

Merge branch 'release/9.0' of http://www.finedevelop.com:2015/scm/~plough/design into release/9.0

master
plough 7 years ago
parent
commit
26841248ea
  1. 4
      designer/src/com/fr/design/widget/CellWidgetCardPane.java
  2. 2
      designer_base/src/com/fr/design/constants/UIConstants.java
  3. 29
      designer_base/src/com/fr/design/file/TemplateTreePane.java
  4. 21
      designer_base/src/com/fr/design/gui/ibutton/UIButtonGroup.java
  5. 4
      designer_base/src/com/fr/design/gui/ibutton/UIButtonUI.java
  6. 4
      designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java

4
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();

2
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);

29
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());
}
}
}

21
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<T> 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);
}
}

4
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);

4
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);
}

Loading…
Cancel
Save