Browse Source

Merge remote-tracking branch 'origin/release/9.0' into release/9.0

master
mengao 7 years ago
parent
commit
57ed50242a
  1. 10
      designer/src/com/fr/design/expand/SortExpandAttrPane.java
  2. 8
      designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java
  3. 8
      designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java
  4. 32
      designer/src/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java
  5. 1
      designer/src/com/fr/poly/creator/ECBlockEditor.java
  6. 29
      designer_base/src/com/fr/design/file/TemplateTreePane.java
  7. 40
      designer_base/src/com/fr/design/gui/ibutton/UIButtonGroup.java
  8. 24
      designer_base/src/com/fr/design/gui/ibutton/UIToggleButton.java
  9. 2
      designer_base/src/com/fr/design/gui/style/FormatPane.java
  10. BIN
      designer_base/src/com/fr/design/images/expand/asc_selected.png
  11. BIN
      designer_base/src/com/fr/design/images/expand/des_selected.png
  12. BIN
      designer_base/src/com/fr/design/images/expand/landspace_selected@1x.png
  13. BIN
      designer_base/src/com/fr/design/images/expand/none16x16_selected@1x.png
  14. BIN
      designer_base/src/com/fr/design/images/expand/vertical_selected@1x.png
  15. 8
      designer_base/src/com/fr/design/roleAuthority/ReportAndFSManagePane.java

10
designer/src/com/fr/design/expand/SortExpandAttrPane.java

@ -24,11 +24,11 @@ public class SortExpandAttrPane extends JPanel {
public SortExpandAttrPane() {
this.setLayout(new BorderLayout(0, 4));
Icon[] iconArray = {
BaseUtils.readIcon("/com/fr/design/images/expand/none16x16.png"),
BaseUtils.readIcon("/com/fr/design/images/expand/asc.png"),
BaseUtils.readIcon("/com/fr/design/images/expand/des.png")
};
Icon[][] iconArray = {
{BaseUtils.readIcon("/com/fr/design/images/expand/none16x16.png"), BaseUtils.readIcon("/com/fr/design/images/expand/none16x16_selected@1x.png")},
{BaseUtils.readIcon("/com/fr/design/images/expand/asc.png"), BaseUtils.readIcon("/com/fr/design/images/expand/asc_selected.png")},
{BaseUtils.readIcon("/com/fr/design/images/expand/des.png"), BaseUtils.readIcon("/com/fr/design/images/expand/des_selected.png")}
};
String[] nameArray = { Inter.getLocText("Sort-Original"), Inter.getLocText("Sort-Ascending"), Inter.getLocText("Sort-Descending") };
sort_type_pane = new UIButtonGroup(iconArray);
sort_type_pane.setAllToolTips(nameArray);

8
designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java

@ -50,18 +50,18 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
if (!isEditable() && !BaseUtils.isAuthorityEditing()) {
return;
}
doOnSelectionChanged(e);
refreshPropertyPanes();
}
});
this.addTargetModifiedListener(new TargetModifiedListener() {
@Override
public void targetModified(TargetModifiedEvent e) {
CellElementPropertyPane.getInstance().populate(ElementCasePaneDelegate.this);
refreshPropertyPanes();
}
});
}
private void doOnSelectionChanged(SelectionEvent e) {
private void refreshPropertyPanes() {
//在编辑权限,所以要更新权限编辑面板
if (BaseUtils.isAuthorityEditing()) {
AuthorityPropertyPane authorityPropertyPane = new AuthorityPropertyPane(ElementCasePaneDelegate.this);
@ -76,7 +76,7 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
QuickEditorRegion.getInstance().populate(getCurrentEditor());
JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (editingTemplate != null && !editingTemplate.isUpMode()) {
Selection editingSelection = ((ElementCasePaneDelegate)e.getSource()).getSelection();
Selection editingSelection = getSelection();
// 模板初始化完成后,才能初始化超级链接面板
HyperlinkGroupPane hyperlinkGroupPane = editingTemplate.getHyperLinkPane(HyperlinkGroupPaneActionImpl.getInstance());
hyperlinkGroupPane.populate(ElementCasePaneDelegate.this);

8
designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java

@ -45,10 +45,10 @@ public class CellExpandAttrPane extends AbstractCellAttrPane {
*/
public JPanel createContentPane() {
String[] nameArray = {Inter.getLocText("ExpandD-Not_Expand"), Inter.getLocText("Utils-Top_to_Bottom"), Inter.getLocText("Utils-Left_to_Right")};
Icon[] iconArray = {
BaseUtils.readIcon("/com/fr/design/images/expand/none16x16.png"),
BaseUtils.readIcon("/com/fr/design/images/expand/vertical.png"),
BaseUtils.readIcon("/com/fr/design/images/expand/landspace.png")
Icon[][] iconArray = {
{BaseUtils.readIcon("/com/fr/design/images/expand/none16x16.png"), BaseUtils.readIcon("/com/fr/design/images/expand/none16x16_selected@1x.png")},
{BaseUtils.readIcon("/com/fr/design/images/expand/vertical.png"), BaseUtils.readIcon("/com/fr/design/images/expand/vertical_selected@1x.png")},
{BaseUtils.readIcon("/com/fr/design/images/expand/landspace.png"), BaseUtils.readIcon("/com/fr/design/images/expand/landspace_selected@1x.png")}
};
Byte[] valueArray = {Constants.NONE, Constants.TOP_TO_BOTTOM, Constants.LEFT_TO_RIGHT};
expandDirectionButton = new UIButtonGroup<Byte>(iconArray, valueArray);

32
designer/src/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java

@ -36,32 +36,30 @@ public class FormElementCasePaneDelegate extends ElementCasePane<FormElementCase
this.addSelectionChangeListener(new SelectionListener() {
@Override
public void selectionChanged(SelectionEvent e) {
CellElementPropertyPane.getInstance().populate(FormElementCasePaneDelegate.this);
QuickEditorRegion.getInstance().populate(getCurrentEditor());
// 超级链接
HyperlinkGroupPane hyperlinkGroupPane = DesignerContext.getDesignerFrame().getSelectedJTemplate().
getHyperLinkPane(HyperlinkGroupPaneActionImpl.getInstance());
hyperlinkGroupPane.populate(FormElementCasePaneDelegate.this);
// 条件属性
ConditionAttributesGroupPane conditionAttributesGroupPane = ConditionAttributesGroupPane.getInstance();
conditionAttributesGroupPane.populate(FormElementCasePaneDelegate.this);
EastRegionContainerPane.getInstance().updateCellElementState(isSelectedOneCell());
refreshPropertyPanes();
}
});
this.addTargetModifiedListener(new TargetModifiedListener() {
@Override
public void targetModified(TargetModifiedEvent e) {
CellElementPropertyPane.getInstance().populate(FormElementCasePaneDelegate.this);
refreshPropertyPanes();
}
});
}
// private void populateHyperLinkGroupPane() {
// final TemplateElementCase report = this.getEditingElementCase();
// NameJavaScriptGroup nameHyperlinks = ReportHyperlinkGroupPane.getNameJSGroup(this, report);
// HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getHyperLinkPane().populate(nameHyperlinks);
// }
private void refreshPropertyPanes() {
CellElementPropertyPane.getInstance().populate(FormElementCasePaneDelegate.this);
QuickEditorRegion.getInstance().populate(getCurrentEditor());
// 超级链接
HyperlinkGroupPane hyperlinkGroupPane = DesignerContext.getDesignerFrame().getSelectedJTemplate().
getHyperLinkPane(HyperlinkGroupPaneActionImpl.getInstance());
hyperlinkGroupPane.populate(FormElementCasePaneDelegate.this);
// 条件属性
ConditionAttributesGroupPane conditionAttributesGroupPane = ConditionAttributesGroupPane.getInstance();
conditionAttributesGroupPane.populate(FormElementCasePaneDelegate.this);
EastRegionContainerPane.getInstance().updateCellElementState(isSelectedOneCell());
}
@Override
protected boolean supportRepeatedHeaderFooter() {

1
designer/src/com/fr/poly/creator/ECBlockEditor.java

@ -47,6 +47,7 @@ public class ECBlockEditor extends BlockEditor<ECBlockPane, PolyECBlock> {
@Override
public void targetModified(TargetModifiedEvent e) {
designer.fireTargetModified();
resetSelectionAndChooseState();
}
});
}

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

40
designer_base/src/com/fr/design/gui/ibutton/UIButtonGroup.java

@ -44,6 +44,10 @@ public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver {
this(iconArray, null);
}
public UIButtonGroup(Icon[][] iconArray) {
this(iconArray, null);
}
public UIButtonGroup(Icon[] iconArray, T[] objects) {
if (!ArrayUtils.isEmpty(objects) && iconArray.length == objects.length) {
this.objectList = Arrays.asList(objects);
@ -80,6 +84,42 @@ public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver {
}
}
public UIButtonGroup(Icon[][] iconArray, T[] objects) {
if (!ArrayUtils.isEmpty(objects) && iconArray.length == objects.length) {
this.objectList = Arrays.asList(objects);
}
labelButtonList = new ArrayList<UIToggleButton>(iconArray.length);
this.setLayout(getGridLayout(iconArray.length));
this.setBorder(getGroupBorder());
for (int i = 0; i < iconArray.length; i++) {
final int index = i;
Icon[] icon = iconArray[i];
final UIToggleButton labelButton = new UIToggleButton(icon) {
@Override
protected MouseListener getMouseListener() {
return new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
isClick = true;
if (!isEnabled()) {
return;
}
if (globalNameListener != null) {
globalNameListener.setGlobalName(buttonGroupName);
}
setSelectedWithFireChanged(index);
}
};
}
public boolean shouldResponseNameListener() {
return false;
}
};
initButton(labelButton);
}
}
public boolean hasClick() {
return isClick;
}

24
designer_base/src/com/fr/design/gui/ibutton/UIToggleButton.java

@ -3,12 +3,13 @@ package com.fr.design.gui.ibutton;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.event.ActionEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.geom.RoundRectangle2D;
import javax.swing.Icon;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
@ -46,6 +47,26 @@ public class UIToggleButton extends UIButton implements GlobalNameObserver{
addMouseListener(getMouseListener());
}
/**
* 需要反白的按钮接口
* support icons[normalIcon, selectedIcon]
* @param icons
*/
public UIToggleButton(Icon[] icons) {
super(icons[0], null, icons[1]);
setSelectedIcon(icons[1]);
setExtraPainted(true);
addActionListener(new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
if (!UIToggleButton.super.isSelected()) {
UIToggleButton.super.setSelected(!UIToggleButton.super.isSelected());
}
}
});
addMouseListener(getMouseListener());
}
public void setGlobalName(String name){
toggleButtonName = name ;
}
@ -66,6 +87,7 @@ public class UIToggleButton extends UIButton implements GlobalNameObserver{
@Override
public void setSelected(boolean isSelected) {
super.setSelected(isSelected);
if (this.isSelected != isSelected) {
this.isSelected = isSelected;
repaint();

2
designer_base/src/com/fr/design/gui/style/FormatPane.java

@ -323,7 +323,7 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObs
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
int contents = getFormatContents();
String[] items = FormatField.getInstance().getFormatArray(contents);
String[] items = FormatField.getInstance().getFormatArray(contents, false);
CardLayout cardLayout = (CardLayout) centerPane.getLayout();
if (isTextOrNull()) {

BIN
designer_base/src/com/fr/design/images/expand/asc_selected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

BIN
designer_base/src/com/fr/design/images/expand/des_selected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

BIN
designer_base/src/com/fr/design/images/expand/landspace_selected@1x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

BIN
designer_base/src/com/fr/design/images/expand/none16x16_selected@1x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 383 B

BIN
designer_base/src/com/fr/design/images/expand/vertical_selected@1x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 B

8
designer_base/src/com/fr/design/roleAuthority/ReportAndFSManagePane.java

@ -265,9 +265,11 @@ public class ReportAndFSManagePane extends DockingView implements Prepare4DataSo
DesignTableDataManager.addDsChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
roleTree.refreshTreeNode();
expandTree(roleTree, true);
roleTree.updateUI();
if (BaseUtils.isAuthorityEditing()) {
roleTree.refreshTreeNode();
expandTree(roleTree, true);
roleTree.updateUI();
}
}
});

Loading…
Cancel
Save