Browse Source

Pull request #13538: REPORT-107973 修改frm 工具栏背景 && frm下点击报表块,报表块下移 && 西区按钮选中后,图标未切换

Merge in DESIGN/design from ~LEO.QIN/design:newui to newui

* commit 'f7bbaee0ba022ebcba0d73099146355af4774e16':
  REPORT-107973 西区按钮选中后,图标未切换
  REPORT-107973 修改选中、已编辑单元格的背景色
  REPORT-107973 修改frm 工具栏背景;frm下点击报表块,报表块下移  【问题原因】frm下点击报表块,报表块下移:修改了frm的工具栏布局,之前的方式调用setPreferredSize导致  【改动思路】
newui
Leo.Qin-覃宇攀 6 months ago
parent
commit
12851707a0
  1. 1
      designer-base/src/main/java/com/fine/theme/light/ui/FineLightIconSet.java
  2. 8
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIButton.java
  3. 2
      designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java
  4. 4
      designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties
  5. 39
      designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java
  6. 11
      designer-realize/src/main/java/com/fr/grid/GridColumnUI.java
  7. 9
      designer-realize/src/main/java/com/fr/grid/GridRowUI.java

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

@ -35,6 +35,7 @@ public class FineLightIconSet extends AbstractIconSet {
new SvgIconSource("drag_left", "com/fine/theme/icon/drag_left.svg", true),
new SvgIconSource("drag_right", "com/fine/theme/icon/drag_right.svg", true),
new SvgIconSource("down_arrow", "com/fine/theme/icon/down_arrow.svg", true),
new SvgIconSource("up_arrow", "com/fine/theme/icon/up_arrow.svg", true),
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),

8
designer-base/src/main/java/com/fr/design/gui/ibutton/UIButton.java

@ -25,7 +25,9 @@ import java.awt.event.ActionListener;
import java.awt.geom.RoundRectangle2D;
import static com.fine.theme.utils.FineUIStyle.STYLE_PRIMARY;
import static com.fine.theme.utils.FineUIStyle.STYLE_TEXT;
import static com.fine.theme.utils.FineUIStyle.hasStyle;
import static com.fine.theme.utils.FineUIStyle.setStyle;
public class UIButton extends JButton implements UIObserver, UITextComponent {
@ -91,7 +93,7 @@ public class UIButton extends JButton implements UIObserver, UITextComponent {
setRolloverIcon(rollOver);
setPressedIcon(pressed);
setExtraPainted(false);
setBackground(null);
setStyle(this, STYLE_TEXT);
setOpaque(false);
initListener();
}
@ -132,7 +134,7 @@ public class UIButton extends JButton implements UIObserver, UITextComponent {
public void set4ToolbarButton() {
setNormalPainted(false);
Dimension dim = getPreferredSize();
setBackground(null);
setStyle(this, STYLE_TEXT);
setOpaque(false);
setSize(dim);
setBorderPaintedOnlyWhenPressed(true);
@ -140,7 +142,7 @@ public class UIButton extends JButton implements UIObserver, UITextComponent {
public void set4LargeToolbarButton() {
setNormalPainted(false);
setBackground(null);
setStyle(this, STYLE_TEXT);
setOpaque(false);
setBorderPainted(false);
setSize(new Dimension(40, 40));

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

@ -987,8 +987,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
public void setTabButtonSelected() {
resetPropertyIcons();
if (StringUtils.isEmpty(iconBaseDir)) {
button.setIcon(new LazyIcon(getBtnIconId()));
iconSuffix = ICON_SUFFIX_SELECTED;
button.setIcon(new LazyIcon(getBtnIconId()));
} else {
iconSuffix = ICON_SUFFIX_SELECTED_DEPRECATED;
button.setIcon(IconUtils.readIcon(getBtnIconUrl()));

4
designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties

@ -1173,7 +1173,9 @@ North.coverPane.radius = 8
Center.OuterShadowColor = #F2F4F8
Center.ZoneBorderColor = #E6E9EF
Center.GridColumnRowColor = #F8F9FC
Center.GridColumnRowColor=#e8e8e9
Center.GridColumnRowSelectedColor=fade(@BrandColor, 12%)
Center.GridColumnRowEditedColor=#e9ecf1
Center.SpaceColor = #FFF
Center.border = 0, 10, 10, 10
Center.arc=10

39
designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe;
import com.fine.theme.icon.LazyIcon;
import com.fr.base.BaseUtils;
import com.fr.base.svg.IconUtils;
import com.fr.design.ExtraDesignClassManager;
@ -25,7 +26,6 @@ import com.fr.design.mainframe.share.ui.online.mini.MiniComponentShopDialog;
import com.fr.design.mainframe.share.util.OnlineShopUtils;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.ui.util.UIUtil;
import com.fr.design.utils.gui.LayoutUtils;
import com.fr.form.ui.UserDefinedWidgetConfig;
import com.fr.form.ui.Widget;
import com.fr.form.ui.WidgetConfig;
@ -50,8 +50,6 @@ import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
@ -142,26 +140,6 @@ public class FormParaWidgetPane extends UIToolbar {
public FormParaWidgetPane() {
setLayout(new FlowLayout(FlowLayout.LEFT));
DesignerContext.getDesignerFrame().getCenterTemplateCardPane().addComponentListener(new ComponentAdapter() {
@Override
public void componentResized(ComponentEvent e) {
if (FormParaWidgetPane.this.getParent() != null) {
JPanel parent = (JPanel) FormParaWidgetPane.this.getParent();
int deltaWidth = 0;
for (int i = 0; i < parent.getComponentCount() - 1; i++) {
deltaWidth += parent.getComponent(i).getWidth();
}
if (deltaWidth == 0) {
return;
}
Dimension d = parent.getSize();
setPreferredSize(new Dimension(d.width - deltaWidth, d.height));
LayoutUtils.layoutContainer(parent);
}
}
});
initFormParaComponent();
}
@ -306,6 +284,8 @@ public class FormParaWidgetPane extends UIToolbar {
jPanel.add(uiLabel, BorderLayout.NORTH);
jPanel.add(new UILabel(Toolkit.i18nText("Fine-Design_Component_Reuse_Apply_Widget")), BorderLayout.CENTER);
jPanel.setToolTipText(Toolkit.i18nText("Fine-Design_Share_Component"));
jPanel.setOpaque(false);
uiLabel.setOpaque(false);
return jPanel;
}
@ -360,6 +340,9 @@ public class FormParaWidgetPane extends UIToolbar {
labelPane.add(label, BorderLayout.CENTER);
reportPane.add(labelPane, BorderLayout.SOUTH);
reportPane.setPreferredSize(new Dimension((int) reportPane.getPreferredSize().getWidth(), (int) reportPane.getPreferredSize().getHeight()));
reportPane.setOpaque(false);
jComponent.setOpaque(false);
labelPane.setOpaque(false);
return reportPane;
}
@ -381,6 +364,9 @@ public class FormParaWidgetPane extends UIToolbar {
});
labelPane.add(chartPopUpButton, BorderLayout.EAST);
chartPane.add(labelPane, BorderLayout.SOUTH);
jComponent.setOpaque(false);
chartPane.setOpaque(false);
labelPane.setOpaque(false);
return chartPane;
}
@ -408,6 +394,9 @@ public class FormParaWidgetPane extends UIToolbar {
});
labelPane.add(chartPopUpButton, BorderLayout.EAST);
widgetPane.add(labelPane, BorderLayout.SOUTH);
jComponent.setOpaque(false);
widgetPane.setOpaque(false);
labelPane.setOpaque(false);
return widgetPane;
}
@ -435,13 +424,13 @@ public class FormParaWidgetPane extends UIToolbar {
}
private UIButton createPopUpButton() {
UIButton popUpButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/buttonicon/arrowdown.png"));
UIButton popUpButton = new UIButton(new LazyIcon("down_arrow"));
popUpButton.set4ToolbarButton();
return popUpButton;
}
private UIButton createPopDownButton() {
UIButton popUpButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/buttonicon/arrowup.png"));
UIButton popUpButton = new UIButton(new LazyIcon("up_arrow"));
popUpButton.set4ToolbarButton();
return popUpButton;
}

11
designer-realize/src/main/java/com/fr/grid/GridColumnUI.java

@ -31,7 +31,10 @@ import java.awt.geom.Rectangle2D;
* @since 2012-3-22下午5:51:10
*/
public class GridColumnUI extends ComponentUI {
protected Color withoutDetailsBackground = UIManager.getColor("Center.GridColumnRowColor");
protected Color backgroundColor = UIManager.getColor("Center.GridColumnRowColor");
protected Color editedBackground = UIManager.getColor("Center.GridColumnRowEditedColor");
protected Color selectedBackground = UIManager.getColor("Center.GridColumnRowSelectedColor");
private int resolution ;
public GridColumnUI(int resolution){
@ -74,8 +77,8 @@ public class GridColumnUI extends ComponentUI {
columnLeftWidth = columnWidthList.getRangeValue(horizontalBeginValue, columnCount).toPixD(resolution);
}
columnLeftWidth = Math.min(verticalLineWidth, columnLeftWidth);
if (gridColumn.getBackground() != null) {
g2d.setPaint(this.withoutDetailsBackground);
if (editedBackground != null) {
g2d.setPaint(editedBackground);
GraphHelper.fill(g2d, new Rectangle2D.Double(0, 0, columnLeftWidth, size.getHeight()));
}
// draw left border line.
@ -114,7 +117,7 @@ public class GridColumnUI extends ComponentUI {
Selection sel = reportPane.getSelection();
int[] selectedColumn = sel.getSelectedColumns();
if (IntList.asList(selectedColumn).contain(i)) {
g2d.setColor(gridColumn.getSelectedBackground());
g2d.setColor(selectedBackground);
GraphHelper.fill(g2d, new Rectangle2D.Double(tmpWidth1 + 1, 0, tmpIncreaseWidth - 1, size.height));
isSelectedBounds = true;
} else {

9
designer-realize/src/main/java/com/fr/grid/GridRowUI.java

@ -32,6 +32,9 @@ import java.awt.geom.Rectangle2D;
*/
public class GridRowUI extends ComponentUI {
private Color detailsBackground = UIManager.getColor("Center.GridColumnRowColor");
protected Color editedBackground = UIManager.getColor("Center.GridColumnRowEditedColor");
protected Color selectedBackground = UIManager.getColor("Center.GridColumnRowSelectedColor");
private int resolution ;
GridRowUI(int resolution){
@ -74,8 +77,8 @@ public class GridRowUI extends ComponentUI {
rowTopHeight = rowHeightList.getRangeValue(verticalBeginValue, rowCount).toPixD(resolution);
}
rowTopHeight = Math.min(horizontalLineHeight, rowTopHeight);
if (gridRow.getBackground() != null) {
g2d.setPaint(this.detailsBackground);
if (editedBackground != null) {
g2d.setPaint(editedBackground);
GraphHelper.fill(g2d, new Rectangle2D.Double(0, 0, size.getWidth(), rowTopHeight));
}
// draw top border line.
@ -110,7 +113,7 @@ public class GridRowUI extends ComponentUI {
Selection sel = reportPane.getSelection();
int[] selectedRows = sel.getSelectedRows();
if (IntList.asList(selectedRows).contain(i)) {
g2d.setPaint(gridRow.getSelectedBackground());
g2d.setPaint(selectedBackground);
GraphHelper.fill(g2d, new Rectangle2D.Double(0, tmpHeight1 + 1, size.width, tmpIncreaseHeight - 1));
isSelectedBounds = true;
} else {

Loading…
Cancel
Save