Browse Source

Pull request #14757: REPORT-132823 & REPORT-133174 & REPORT-132473 & REPORT-132468 & REPORT-132449 & REPORT-132716 & REPORT-132800 fix: 视觉修复

Merge in DESIGN/design from ~ZONGYU.WANG/design:fbp/release to fbp/release

* commit 'd8dc0e6e38c6e63b7b407a05123b4f73b60b8d75':
  fix: 调整规范问题
  newui fix: 视觉修复
fbp/merge
Zongyu.Wang-王宗雨 4 months ago
parent
commit
35dbf533e1
  1. 14
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java
  2. 2
      designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java
  3. 17
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  4. 8
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/ColorFillStylePane.java
  5. 11
      designer-base/src/main/java/com/fr/design/remote/ui/list/MemberList.java
  6. 2
      designer-base/src/main/java/com/fr/design/roleAuthority/ReportAndFSManagePane.java
  7. 24
      designer-base/src/main/java/com/fr/design/style/color/ColorAdjustPane.java
  8. 4
      designer-chart/src/main/java/com/fr/design/chart/comp/BorderAttriPane.java
  9. 10
      designer-chart/src/main/java/com/fr/van/chart/column/ColumnBorderAttriPane.java
  10. 22
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/StructureNodeStylePane.java

14
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java

@ -18,15 +18,16 @@ import com.fr.stable.StringUtils;
import javax.swing.DefaultCellEditor;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.UIManager;
import javax.swing.event.TableModelEvent;
import javax.swing.event.TableModelListener;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumn;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
@ -42,7 +43,7 @@ import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableData> {
private static final int MIN_CELL_WIDTH = FineUIScale.scale(30);
private static final int MIN_CELL_WIDTH = 30;
private static final int PREVIEW_TABLE_MIN_COLUMN_WIDTH = FineUIScale.scale(75);
private static final int PREVIEW_TABLE_WIDTH = FineUIScale.scale(860);
private JTable dataJTable ;
@ -250,7 +251,14 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
// 行号显示,每次dateJTable的表结构发生变化时都要调用
TableColumn tableColumn = dataJTable.getColumnModel().getColumn(0);
tableColumn.setCellRenderer(new CellRenderer());
tableColumn.setMaxWidth(Math.max(dataJTable.getColumnCount(), MIN_CELL_WIDTH));
tableColumn.setMaxWidth(FineUIScale.scale(Math.max(dataJTable.getColumnCount(), MIN_CELL_WIDTH)));
// 没有列数据的时候,压缩行号
if (dataJTable.getColumnModel().getColumnCount() > 1) {
dataJTable.getTableHeader().setPreferredSize(new Dimension(super.getWidth(), FineUIScale.scale((Integer) UIManager.get("Table.rowHeight"))));
} else {
dataJTable.getTableHeader().setPreferredSize(new Dimension(super.getWidth(), FineUIScale.scale(4)));
}
}
private class DoubleRenderer extends FineTableHeaderUI.TableRenderer {

2
designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java

@ -43,7 +43,7 @@ public class UIResizableContainer extends JPanel {
private int direction;
private boolean hasParameterPane;
private static final int MAX_WIDTH = FineUIScale.scale(300);
private static final int MAX_WIDTH = FineUIScale.scale(350);
private static final int ARROW_RANGE = FineUIScale.scale(35);
private static final int ARROW_RANGE_VERTICAL = FineUIScale.scale(25);

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

@ -1,6 +1,9 @@
package com.fr.design.mainframe;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseUtils;
import com.fr.base.extension.FileExtension;
import com.fr.base.vcs.DesignerMode;
@ -224,13 +227,15 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
JPanel panel = new JPanel(new BorderLayout());
if (WorkContext.getCurrent().isRoot()) {
rightToolBar = new UIToolbar(FlowLayout.RIGHT);
rightToolBar.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.TOOLBAR_BORDER_COLOR));
JPanel contentPane = FineLayoutBuilder.asBorderLayoutWrapped(rightToolBar);
contentPane.setBorder(BorderFactory.createCompoundBorder(new ScaledEmptyBorder(4, 8, 4, 8),
BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.TOOLBAR_BORDER_COLOR)));
rightToolBar.setBorderPainted(true);
UILabel tipLabel = new UILabel(Toolkit.i18nText("Fine_Design_Template_Lock_Status"));
tipLabel.setForeground(Color.GRAY);
FineUIStyle.setStyle(tipLabel, FineUIStyle.LABEL_TIP);
rightToolBar.add(tipLabel);
UIButton button = new UIButton(IOUtils.readIcon("/com/fr/design/images/toolbarbtn/lock.png"));
button.setRolloverIcon(IOUtils.readIcon("/com/fr/design/images/toolbarbtn/unlock.png"));
UIButton button = new UIButton(new LazyIcon("locked"));
button.setRolloverIcon(new LazyIcon("unlocked"));
button.setBorderPainted(false);
button.setContentAreaFilled(false);
button.set4ToolbarButton();
@ -243,7 +248,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
Toolkit.i18nText("Fine-Design_Basic_Alert"),
JOptionPane.YES_NO_OPTION,
JOptionPane.WARNING_MESSAGE,
IOUtils.readIcon("/com/fr/design/images/warnings/warning32.png"),
new LazyIcon("warning", 20),
new Object[] {Toolkit.i18nText("Fine_Design_Template_UnLock_I_Known"), Toolkit.i18nText("Fine-Design_Basic_Button_Cancel")}, null);
if (option == JOptionPane.YES_OPTION) {
String path = StableUtils.pathJoin(ProjectConstants.REPORTLETS_NAME, TemplateTreePane.getInstance().getTemplateFileTree().getSelectedTemplatePath());
@ -264,7 +269,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
});
rightToolBar.add(button);
refreshRightToolBarBy(TemplateTreePane.getInstance().getFileNode());
panel.add(rightToolBar, BorderLayout.EAST);
panel.add(contentPane, BorderLayout.EAST);
}
return panel;
}

8
designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/ColorFillStylePane.java

@ -86,6 +86,14 @@ public class ColorFillStylePane extends BasicBeanPane<ColorFillStyle> {
return customPane;
}
@Override
public void repaint() {
if (colorAdjustPane != null) {
colorAdjustPane.repaint();
}
super.repaint();
}
protected ColorSchemeComboBox createColorSchemeComboBox() {
return new ColorSchemeComboBox();
}

11
designer-base/src/main/java/com/fr/design/remote/ui/list/MemberList.java

@ -14,12 +14,13 @@ import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Vector;
import static com.fine.theme.utils.FineUIScale.scale;
public abstract class MemberList extends JList<RemoteDesignMember> {
static final int TRIGGER_AREA_X = 270;
static final int TRIGGER_AREA_Y_EACH = 25;
static final int TRIGGER_AREA_Y_EACH = scale(20);
static final int TRIGGER_AREA_WIDTH = 25;
static final int TRIGGER_AREA_HEIGHT = 25;
static final int TRIGGER_AREA_WIDTH = scale(20);
static final int TRIGGER_AREA_HEIGHT = scale(20);
public MemberList(DefaultListModel<RemoteDesignMember> dataModel) {
@ -91,7 +92,7 @@ public abstract class MemberList extends JList<RemoteDesignMember> {
int rX = point.x;
int rY = point.y;
int index = this.getSelectedIndex();
int x = TRIGGER_AREA_X;
int x = this.getWidth() - TRIGGER_AREA_WIDTH;
int y = TRIGGER_AREA_Y_EACH * index;
return x <= rX && rX <= x + TRIGGER_AREA_WIDTH && y <= rY && rY <= y + TRIGGER_AREA_HEIGHT;
}

2
designer-base/src/main/java/com/fr/design/roleAuthority/ReportAndFSManagePane.java

@ -106,7 +106,7 @@ public class ReportAndFSManagePane extends DockingView implements Prepare4DataSo
jPanel.add(column(
4,
row(cell(buttonGroup), flex()),
cell(scrollPane)
cell(scrollPane).weight(1)
).getComponent());
this.add(jPanel, BorderLayout.CENTER);
jPanel.setBorder(new ScaledEmptyBorder(0, 4, 4, 4));

24
designer-base/src/main/java/com/fr/design/style/color/ColorAdjustPane.java

@ -109,7 +109,7 @@ public class ColorAdjustPane extends JPanel implements UIObserver {
if (preferSize > size) {
maxCountOfRow = size / WIDTH;
} else {
maxCountOfRow = defaultMaxCountOfRow;
maxCountOfRow = Math.max(defaultMaxCountOfRow, size / WIDTH);
}
if (oldMaxCountOfRow != maxCountOfRow) {
@ -130,21 +130,25 @@ public class ColorAdjustPane extends JPanel implements UIObserver {
colorButtons.get(j).setLastButton(false);
panel.add(colorButtons.get(j));
}
if (i + maxCountOfRow > colorButtons.size()) {
panel.add(new AddColorButton());
this.add(panel);
} else if (i + maxCountOfRow == colorButtons.size() && colorButtons.size() != MAX_BUTTON) {
this.add(panel);
this.add(new AddColorButton());
} else {
this.add(panel);
}
addPanel(panel, i);
}
if (colorButtons.size() == 1) {
colorButtons.get(0).setLastButton(true);
}
}
private void addPanel(JPanel panel, int index) {
if (index + maxCountOfRow > colorButtons.size() && colorButtons.size() != MAX_BUTTON) {
panel.add(new AddColorButton());
this.add(panel);
} else if (index + maxCountOfRow == colorButtons.size() && colorButtons.size() != MAX_BUTTON) {
this.add(panel);
this.add(new AddColorButton());
} else {
this.add(panel);
}
}
private void createColorButton(Color[] colors) {
colorButtons.clear();
int size = Math.min(colors.length, MAX_BUTTON);

4
designer-chart/src/main/java/com/fr/design/chart/comp/BorderAttriPane.java

@ -27,11 +27,11 @@ public class BorderAttriPane extends BasicPane {
this.setLayout(new BorderLayout());
lineCombo = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART);
colorSelectBox = new ColorSelectBox(80);
colorSelectBox.setPreferredSize(FineUIScale.scale(new Dimension(60, 24)));
colorSelectBox.setPreferredSize(FineUIScale.scale(new Dimension(80, 24)));
colorSelectBox.setSelectObject(null);
this.add(row(10, row(cell(new UILabel(lineString + ":")), cell(lineCombo)),
row(cell(new UILabel(colorSting + ":"))), cell(colorSelectBox)).getComponent(), BorderLayout.WEST);
row(cell(new UILabel(colorSting + ":")), cell(colorSelectBox))).getComponent(), BorderLayout.WEST);
}
public void setLineColor(Color color) {

10
designer-chart/src/main/java/com/fr/van/chart/column/ColumnBorderAttriPane.java

@ -1,12 +1,13 @@
package com.fr.van.chart.column;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.chart.comp.BorderAttriPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.ispinner.chart.UISpinnerWithPx;
import java.awt.Dimension;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* Created by hufan on 2016/8/11.
@ -19,10 +20,9 @@ public class ColumnBorderAttriPane extends BorderAttriPane {
}
public ColumnBorderAttriPane(String radiusString) {
this.add(new UILabel(radiusString + ":"));
radius = new UISpinnerWithPx(0,1000,1,0);
this.add(radius);
radius.setPreferredSize(new Dimension(60, 18));
this.add(row(cell(new UILabel(radiusString + ":")), cell(radius).weight(1))
.weight(1).with(it -> it.setBorder(new ScaledEmptyBorder(0, 10, 0, 0))).getComponent());
}
public void setRadius(int value) {

22
designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/StructureNodeStylePane.java

@ -1,5 +1,6 @@
package com.fr.van.chart.structure.desinger.style;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.background.ImageBackground;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.frpane.UINumberDragPane;
@ -9,6 +10,7 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.ispinner.chart.UISpinnerWithPx;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.backgroundpane.ImageBackgroundQuickPane;
@ -59,10 +61,12 @@ public class StructureNodeStylePane extends BasicBeanPane<AttrNode> {
};
nodeOpacity = new UINumberDragPaneWithPercent(0, 100);
JPanel jPanel = new JPanel(new BorderLayout());
jPanel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Node_Radius"), nodeRadiusType), BorderLayout.NORTH);
nodeRadiusPane = TableLayout4VanChartHelper.createGapTableLayoutPane("", nodeRadius);
jPanel.add(nodeRadiusPane, BorderLayout.CENTER);
Component[][] nodeRadiusTypeCom = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Node_Radius")), nodeRadiusType},
new Component[]{null, nodeRadius},
};
JPanel jPanel = FineLayoutBuilder.compatibleTableLayout(10, nodeRadiusTypeCom, new double[]{1.2, 3});
Component[][] components1 = new Component[][]{
new Component[]{null, null},
@ -72,7 +76,7 @@ public class StructureNodeStylePane extends BasicBeanPane<AttrNode> {
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Alpha")), nodeOpacity}
};
JPanel panel1 = TableLayout4VanChartHelper.createGapTableLayoutPane(components1, rowSize, columnSize);
JPanel panel1 = FineLayoutBuilder.compatibleTableLayout(10, components1, new double[]{1.2, 3});
useImage = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_YES"),
Toolkit.i18nText("Fine-Design_Chart_NO")});
@ -81,9 +85,9 @@ public class StructureNodeStylePane extends BasicBeanPane<AttrNode> {
Component[][] components = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Filled_With_Image")), useImage},
};
JPanel useImagePane = TableLayoutHelper.createTableLayoutPane(components, new double[]{p}, columnSize);
JPanel useImagePane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
JPanel panel2 = new JPanel(new BorderLayout(0, 6));
JPanel panel2 = FRGUIPaneFactory.createScaledBorderLayout_S_Pane(0, 6);
panel2.add(useImagePane, BorderLayout.NORTH);
panel2.add(imagePane, BorderLayout.CENTER);
@ -101,13 +105,13 @@ public class StructureNodeStylePane extends BasicBeanPane<AttrNode> {
}
});
this.setLayout(new BorderLayout(0, 6));
this.setLayout(FRGUIPaneFactory.createScaledBorderLayout(0, 6));
this.add(panel1, BorderLayout.NORTH);
this.add(panel2, BorderLayout.CENTER);
}
private void checkRadius() {
nodeRadiusPane.setVisible(nodeRadiusType.getSelectedIndex() == 1);
nodeRadius.getParent().setVisible(nodeRadiusType.getSelectedIndex() == 1);
}
private void checkImagePane() {

Loading…
Cancel
Save