Browse Source

Pull request #13941: REPORT-111995 【NewUI】修复测试验收问题

Merge in DESIGN/design from ~LEVY.XIE/design:newui to newui

* commit '7d717e353c6b73c05c24a0fc6a7d6069de4253b4':
  REPORT-111995 【NewUI】修复测试验收问题
newui
Levy.Xie-解安森 8 months ago
parent
commit
299995f71b
  1. 1
      designer-base/src/main/java/com/fine/theme/light/ui/FineLightIconSet.java
  2. 14
      designer-base/src/main/java/com/fr/design/gui/itree/refreshabletree/RefreshableJTree.java
  3. 20
      designer-base/src/main/java/com/fr/design/gui/style/TextFormatPane.java
  4. 2
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  5. 3
      designer-base/src/main/java/com/fr/design/mainframe/vcs/RecycleAction.java
  6. 8
      designer-base/src/main/resources/com/fine/theme/icon/recycle.svg
  7. 26
      designer-realize/src/main/java/com/fr/design/expand/ExpandFatherPane.java
  8. 14
      designer-realize/src/main/java/com/fr/design/widget/CellWidgetCardPane.java
  9. 7
      designer-realize/src/main/java/com/fr/design/widget/WidgetEventPane.java

1
designer-base/src/main/java/com/fine/theme/light/ui/FineLightIconSet.java

@ -39,6 +39,7 @@ public class FineLightIconSet extends AbstractIconSet {
new SvgIconSource("down_arrow_12", "com/fine/theme/icon/down_arrow.svg", true, 12),
new SvgIconSource("up_arrow_12", "com/fine/theme/icon/up_arrow.svg", true, 12),
new SvgIconSource("select", "com/fine/theme/icon/select.svg", true),
new SvgIconSource("recycle", "com/fine/theme/icon/recycle.svg", true),
// 数据集相关Icon
new SvgIconSource("database", "com/fine/theme/icon/dataset/database.svg", true),

14
designer-base/src/main/java/com/fr/design/gui/itree/refreshabletree/RefreshableJTree.java

@ -104,23 +104,21 @@ public abstract class RefreshableJTree extends CheckBoxTree {
@Override
protected Long doInBackground() throws Exception {
long startTime = System.currentTimeMillis();
return System.currentTimeMillis() - startTime;
}
@Override
protected void done() {
ExpandMutableTreeNode[] nodes = RefreshableJTree.this.loadChildTreeNodes(treeNode);
for (int i = 0; i < nodes.length; i++) {
treeNode.add(nodes[i]);
}
DefaultTreeModel treeModel = (DefaultTreeModel) RefreshableJTree.this.getModel();
// 主要耗时是用在了treeUI的渲染上了,所以把这个放到工作线程里面
if (treeNode.getChildCount() >= 1 && ((ExpandMutableTreeNode) treeNode.getFirstChild()).getUserObject() == PENDING) {
treeNode.remove(0);
}
DefaultTreeModel treeModel = (DefaultTreeModel) RefreshableJTree.this.getModel();
treeModel.nodeStructureChanged(treeNode);
return System.currentTimeMillis() - startTime;
}
@Override
protected void done() {
RefreshableJTree.this.updateUI();
// 恢复Tree的可用性
RefreshableJTree.this.setEnabled(true);

20
designer-base/src/main/java/com/fr/design/gui/style/TextFormatPane.java

@ -1,5 +1,6 @@
package com.fr.design.gui.style;
import com.fine.theme.utils.FineUIStyle;
import com.fine.theme.utils.FineUIUtils;
import com.fr.base.CoreDecimalFormat;
import com.fr.base.GraphHelper;
@ -116,23 +117,10 @@ public class TextFormatPane extends AbstractBasicStylePane implements GlobalName
Border interBorder = new UIRoundedBorder(UIConstants.LINE_COLOR, 0, 4);
String title = Toolkit.i18nText("Fine-Design_Report_Base_StyleFormat_Sample");
Border border = BorderFactory.createTitledBorder(interBorder, title, TitledBorder.ABOVE_TOP, 0, null, labelColor);
previewLabel = new UILabel(FormatField.getInstance().getFormatValue()) {
@Override
public void paint(Graphics g) {
super.paint(g);
int width = getWidth();
Color original = g.getColor();
g.setColor(getBackground());
g.fillRect(LABEL_X, LABEL_Y, width - LABEL_DELTA_WIDTH, LABEL_HEIGHT);
g.setColor(labelColor);
FontMetrics cellFM = g.getFontMetrics();
int textWidth = cellFM.stringWidth(getText());
GraphHelper.drawString(g, getText(), (width - textWidth) / 2F, 26);
g.setColor(original);
}
};
previewLabel = new UILabel(FormatField.getInstance().getFormatValue());
previewLabel.setHorizontalAlignment(UILabel.CENTER);
previewLabel.setBorder(border);
FineUIStyle.setStyle(previewLabel, FineUIStyle.LABEL_TIP);
}
protected void initLayout() {
@ -286,7 +274,7 @@ public class TextFormatPane extends AbstractBasicStylePane implements GlobalName
*/
private void refreshPreviewLabel() {
this.previewLabel.setText(FormatField.getInstance().getFormatValue());
this.previewLabel.setForeground(UIManager.getColor("Label.foreground"));
FineUIStyle.setStyle(previewLabel, FineUIStyle.LABEL_TIP);
try {
isRightFormat = true;
if (StringUtils.isEmpty(String.valueOf(textField.getSelectedItem()))) {

2
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java

@ -324,7 +324,6 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
*/
private void addVcsAction(ToolBarDef toolbarDef) {
if (VcsHelper.getInstance().needInit()) {
vcsAction = new VcsAction();
if (!isLegacyOnCluster()) {
vcsAction.setName(Toolkit.i18nText("Fine-Design_Vcs_Title"));
@ -334,7 +333,6 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
toolbarDef.addShortCut(vcsAction);
//11.0.19及其之后加入回收站逻辑
if (VcsHelper.getInstance().checkV2FunctionSupport()) {
recycleAction = new RecycleAction();
toolbarDef.addShortCut(recycleAction);
}
}

3
designer-base/src/main/java/com/fr/design/mainframe/vcs/RecycleAction.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.vcs;
import com.fine.theme.icon.LazyIcon;
import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.i18n.Toolkit;
@ -18,7 +19,7 @@ import java.awt.event.ActionEvent;
public class RecycleAction extends UpdateAction {
public RecycleAction() {
this.setSmallIcon("/com/fr/design/standard/vcslist/vcs_recycle", false);
this.setSmallIcon(new LazyIcon("recycle"));
this.setName(Toolkit.i18nText("Fine-Design_Vcs_Recycle"));
}

8
designer-base/src/main/resources/com/fine/theme/icon/recycle.svg

@ -0,0 +1,8 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="icon &#229;&#155;&#158;&#230;&#148;&#182;&#231;&#171;&#153;">
<g id="icon/delete">
<path id="Combined-Shape" d="M11 1V3H15V4H13V15H3V4H1V3H5V1H11ZM12 4H4V14H12V4ZM10 2H6V3H10V2Z" fill="#333334"/>
</g>
<path id="Subtract" fill-rule="evenodd" clip-rule="evenodd" d="M9.4255 7.5425L8.5 6H7.5L5.93265 8.61225L6.79415 8.84308L8 6.83333L8.8005 8.1675L9.4255 7.5425ZM9.95583 8.42638L9.33083 9.05138L10.5 11H8.86391L9.09598 11.8661L11 11.8661L11.5 11L9.95583 8.42638ZM8.06071 11.8661L7.82864 11H5.5L6.25902 9.73497L5.39752 9.50413L4.5 11L5 11.8672L5.00064 11.8661L8.06071 11.8661Z" fill="#333334"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 706 B

26
designer-realize/src/main/java/com/fr/design/expand/ExpandFatherPane.java

@ -1,12 +1,10 @@
package com.fr.design.expand;
import com.fine.swing.ui.layout.Layouts;
import com.fine.theme.icon.LazyIcon;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver;
import com.fr.design.gui.columnrow.ColumnRowPane;
import com.fr.design.gui.core.ReactiveCardPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.mainframe.ElementCasePane;
@ -18,12 +16,13 @@ import com.fr.grid.selection.Selection;
import com.fr.report.cell.cellattr.CellExpandAttr;
import com.fr.stable.ColumnRow;
import javax.swing.*;
import java.awt.*;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
public abstract class ExpandFatherPane extends JPanel implements GlobalNameObserver {
@ -35,7 +34,6 @@ public abstract class ExpandFatherPane extends JPanel implements GlobalNameObser
private String expandFatherName = "";
private GlobalNameListener globalNameListener = null;
private boolean isAlreadyAddListener = false;
private ReactiveCardPane cardPane;
public ExpandFatherPane() {
this.setLayout(new BorderLayout());
@ -55,20 +53,12 @@ public abstract class ExpandFatherPane extends JPanel implements GlobalNameObser
JPanel cc = new JPanel(new BorderLayout(LayoutConstants.HGAP_SMALL, 0));
cc.add(customParentColumnRowPane, BorderLayout.CENTER);
cc.add(imageButton, BorderLayout.EAST);
cardPane = ReactiveCardPane.create()
.addSupplier("content", () -> Layouts.column(LayoutConstants.VERTICAL_GAP,
cell(comboBox),
cell(cc)).getComponent())
.addSupplier("none", () -> Layouts.cell(comboBox).getComponent());
cardPane.select("none").populate();
this.add(cardPane);
this.add(column(LayoutConstants.VERTICAL_GAP,
cell(comboBox),
cell(cc)
).getComponent());
comboBox.addItemListener(e -> {
if (comboBox.getSelectedIndex() == 2) {
cardPane.select("content").populate();
} else {
cardPane.select("none").populate();
}
cc.setVisible(comboBox.getSelectedIndex() == 2);
if (globalNameListener != null && shouldResponseNameListener()) {
globalNameListener.setGlobalName(expandFatherName);
}

14
designer-realize/src/main/java/com/fr/design/widget/CellWidgetCardPane.java

@ -23,7 +23,6 @@ import java.util.ArrayList;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.swing.ui.layout.Layouts.row;
/*
* carl :单独弄出来
@ -76,14 +75,11 @@ public class CellWidgetCardPane extends BasicPane {
}
};
this.add(column(
row(
fix(10),
cell(tabsHeaderIconPane).weight(1),
fix(10)
),
cell(center).with(it -> it.setBorder(new ScaledEmptyBorder(0, 10, 0, 10)))
).getComponent());
JPanel wrapperPane = new JPanel(new BorderLayout());
wrapperPane.add(tabsHeaderIconPane, BorderLayout.NORTH);
wrapperPane.add(center, BorderLayout.CENTER);
wrapperPane.setBorder(new ScaledEmptyBorder(0, 10, 0, 10));
this.add(wrapperPane, BorderLayout.CENTER);
// 属性
attriTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane();

7
designer-realize/src/main/java/com/fr/design/widget/WidgetEventPane.java

@ -1,6 +1,7 @@
package com.fr.design.widget;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.NameableCreator;
@ -24,6 +25,7 @@ import com.fr.stable.AssistUtils;
import com.fr.stable.Nameable;
import com.fr.write.JavaScriptResourceInfo;
import java.awt.Dimension;
import java.lang.reflect.Constructor;
public class WidgetEventPane extends UIListGroupControlPane {
@ -203,6 +205,11 @@ public class WidgetEventPane extends UIListGroupControlPane {
}
}
@Override
public Dimension getPreferredSize() {
return FineUIScale.scale(new Dimension(200, 950));
}
protected String getWrapperLabelText() {
return Toolkit.i18nText("Fine-Design_Report_Event");
}

Loading…
Cancel
Save