Browse Source

Pull request #5416: REPORT-56548 视觉修改

Merge in DESIGN/design from ~KERRY/design_10.0:feature/x to feature/x

* commit '1a6d9db38d4f29f7bfbc8818bf49b451d28c7d73':
  REPORT-56548  视觉修改
research/11.0
kerry 3 years ago
parent
commit
8168279f5c
  1. 3
      designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java
  2. 3
      designer-base/src/main/java/com/fr/design/style/color/ColorAdjustPane.java
  3. 3
      designer-base/src/main/java/com/fr/design/style/color/ColorButton.java
  4. 13
      designer-base/src/main/java/com/fr/design/style/color/ColorFactory.java
  5. 4
      designer-base/src/main/java/com/fr/design/style/color/FineColorCell.java
  6. 68
      designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java
  7. 11
      designer-chart/src/main/java/com/fr/design/module/ChartPreStyleAction.java
  8. 3
      designer-chart/src/main/java/com/fr/van/chart/range/component/LegendGradientBar.java
  9. 10
      designer-realize/src/main/java/com/fr/design/actions/server/WidgetManagerAction.java

3
designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java

@ -107,7 +107,8 @@ public class GradientBar extends JComponent implements UIObserver, ColorSelectab
if (select >= 0) {
ColorSelectDetailPane pane = new ColorSelectDetailPane(Color.WHITE);
ColorSelectDialog.showDialog(DesignerContext.getDesignerFrame(), pane, Color.WHITE, GradientBar.this);
Color selectColor = list.get(select).getColorInner() == null ? Color.WHITE : list.get(select).getColorInner();
ColorSelectDialog.showDialog(DesignerContext.getDesignerFrame(), pane, selectColor, GradientBar.this);
Color color = GradientBar.this.getColor();
if (color != null) {
DesignerEnvManager.getEnvManager().getColorConfigManager().addToColorQueue(color);

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

@ -6,6 +6,7 @@ import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.VerticalFlowLayout;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.style.AbstractSelectBox;
import javax.swing.JPanel;
@ -202,7 +203,7 @@ public class ColorAdjustPane extends JPanel implements UIObserver {
public JPanel initWindowPane(double preferredWidth) {
// 下拉的时候重新生成面板,刷新最近使用颜色
NewColorSelectPane colorPane = new NewColorSelectPane(false) {
NewColorSelectPane colorPane = new NewColorSelectPane(false, !DesignerContext.getDesignerFrame().isServerConfig()) {
protected boolean selectRealTime() {
return false;

3
designer-base/src/main/java/com/fr/design/style/color/ColorButton.java

@ -2,6 +2,7 @@ package com.fr.design.style.color;
import com.fr.base.BaseUtils;
import com.fr.base.background.ColorBackground;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.style.AbstractSelectBox;
import javax.swing.JPanel;
@ -121,7 +122,7 @@ public class ColorButton extends AbstractSelectBox<Color> {
public JPanel initWindowPane(double preferredWidth) {
// 下拉的时候重新生成面板,刷新最近使用颜色
colorPane = new NewColorSelectPane(false) {
colorPane = new NewColorSelectPane(false, !DesignerContext.getDesignerFrame().isServerConfig()) {
@Override
protected boolean selectRealTime() {

13
designer-base/src/main/java/com/fr/design/style/color/ColorFactory.java

@ -71,5 +71,18 @@ public interface ColorFactory {
new Color(0, 0, 255)
};
public static final Color STANDARD_COLORS[] = {
new Color(166, 89, 66),
new Color(166, 123, 66),
new Color(166, 66, 66),
new Color(103, 166, 66),
new Color(66, 121, 166),
new Color(68, 66, 166),
new Color(98, 66, 166),
new Color(146, 66, 166),
new Color(75, 18, 89),
new Color(89, 18, 51)
};
}

4
designer-base/src/main/java/com/fr/design/style/color/FineColorCell.java

@ -8,6 +8,10 @@ public class FineColorCell extends ColorCell {
private final int x;
private final int y;
public FineColorCell(Color color, ColorSelectable colorSelectable) {
this(color, colorSelectable, -1, -1);
}
public FineColorCell(Color color, ColorSelectable colorSelectable, int x, int y) {
super(color, colorSelectable);
this.x = x;

68
designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java

@ -84,15 +84,22 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
initMenuColorPane(menuColorPane1);
}
JPanel standardColorPane = new JPanel(new BorderLayout(0, 5));
standardColorPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
standardColorPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Standard_Color")), BorderLayout.CENTER);
centerPane.add(standardColorPane);
JPanel colorSelectPane = createStandardColorPane();
standardColorPane.add(colorSelectPane, BorderLayout.SOUTH);
// 增加最近使用 pane
JPanel row1Pane = new JPanel(new BorderLayout(0, 5));
row1Pane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
row1Pane.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Used")), BorderLayout.NORTH);
row1Pane.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Used")), BorderLayout.CENTER);
centerPane.add(row1Pane);
// 最近使用
usedColorPane = new NewUsedColorPane(8, this, selectRealTime());
usedColorPane.setPreferredSize(new Dimension(168, 16));
row1Pane.add(usedColorPane.getPane(), BorderLayout.CENTER);
row1Pane.add(usedColorPane.getPane(), BorderLayout.SOUTH);
// mod by anchore 16/11/16
final UIButton customButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_More_Color"));
@ -116,43 +123,68 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
centerPane.add(centerPane1);
}
private JPanel createStandardColorPane(){
JPanel jPanel = new JPanel(new GridLayout(1, 10, 3, 0));
Color[] colorArray = ColorFactory.STANDARD_COLORS;
for (int i = 0; i < colorArray.length; i++) {
jPanel.add(new ColorCell(colorArray[i], this));
}
return jPanel;
}
private void initThemeColorPane(JPanel menuColorPane){
menuColorPane.setLayout(new GridLayout(1, 8, 3, 0));
menuColorPane.setLayout(new BorderLayout(0, 10));
JPanel northPane = new JPanel(new GridLayout(1, 8, 3, 0));
JPanel centerPane = new JPanel(new GridLayout(1, 8, 3, 0));
menuColorPane.add(northPane, BorderLayout.NORTH);
menuColorPane.add(centerPane, BorderLayout.CENTER);
//todo 暂时先写死,后续对接的时候从主体里面拿主题配色
Color[] colorArray = new Color[]{Color.decode("#FFFFFF"), Color.decode("#CCCCCC"),
Color.decode("#E6A48A"), Color.decode("#E68A8A"), Color.gray, Color.green, Color.DARK_GRAY, Color.CYAN, Color.YELLOW, Color.lightGray};
for (int i = 0; i < colorArray.length; i++) {
Color color = colorArray[i];
boolean isDefaultColor = (i == 0 || i == 1);
northPane.add(createFineColorCell(color, isDefaultColor, i, 0));
}
for (int i = 0; i < colorArray.length; i++) {
Color color = colorArray[i];
boolean isDefaultColor = (i == 0 || i == 1);
JPanel jPanel = new JPanel(new GridLayout(5, 1, 0, 3));
jPanel.add(new FineColorCell(color, this, i, 0));
jPanel.add(new FineColorCell(color = saturationDown(color, isDefaultColor), this, i, 1));
jPanel.add(new FineColorCell(color = saturationDown(color, isDefaultColor), this, i, 2));
jPanel.add(new FineColorCell(color = saturationDown(color, isDefaultColor), this, i, 3));
jPanel.add(new FineColorCell(saturationDown(color, isDefaultColor), this, i, 4));
menuColorPane.add(jPanel);
JPanel jPanel = new JPanel(new GridLayout(4, 1, 0, 3));
jPanel.add(createFineColorCell(color = saturationDown(color, isDefaultColor, true), isDefaultColor, i, 1));
jPanel.add(createFineColorCell(saturationDown(color, isDefaultColor, true), isDefaultColor, i, 2));
color = colorArray[i];
jPanel.add(createFineColorCell(color = saturationDown(color, isDefaultColor, false), isDefaultColor, i, 3));
jPanel.add(createFineColorCell(saturationDown(color, isDefaultColor, false), isDefaultColor, i, 4));
centerPane.add(jPanel);
}
}
private FineColorCell createFineColorCell(Color color, boolean isDefaultColor, int x, int y) {
return isDefaultColor ? new FineColorCell(color, this) : new FineColorCell(color, this, x - 2, y);
}
/**
* 调整明度和纯度默认色只调整明度
* @param color
* @param isDefaultColor
* @return
*/
public static Color saturationDown(Color color, boolean isDefaultColor) {
public static Color saturationDown(Color color, boolean isDefaultColor, boolean isLight) {
float[] hsb = Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), new float[3]);
if (!isDefaultColor) {
hsb[1] += PURITY_VALUE;
hsb[1] = isLight ? Math.max(0, hsb[1] - PURITY_VALUE) : Math.min(1, hsb[1] + PURITY_VALUE);
}
hsb[2] -= BRIGHTNESS_VALUE;
return Color.getHSBColor(hsb[0], hsb[1], hsb[2]);
hsb[2] = isLight ? Math.min(1, hsb[2] + BRIGHTNESS_VALUE) : Math.max(0, hsb[2] - BRIGHTNESS_VALUE);
Color color1 = Color.getHSBColor(hsb[0], hsb[1], hsb[2]);
return color1;
}
private void initMenuColorPane(JPanel menuColorPane) {
menuColorPane.setLayout(new GridLayout(5, 8, 1, 1));
menuColorPane.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 8));
menuColorPane.setLayout(new GridLayout(5, 8, 3, 3));
Color[] colorArray = this.getColorArray();
for (int i = 0; i < colorArray.length; i++) {
Color color = colorArray[i] == null ? UsedColorPane.DEFAULT_COLOR : colorArray[i];
@ -280,9 +312,9 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
@Override
public Dimension getPreferredSize() {
if (isSupportTransparent) {
return new Dimension(197, 207);
return new Dimension(197, 265);
}
return new Dimension(197, 192);
return new Dimension(197, 250);
}
/**

11
designer-chart/src/main/java/com/fr/design/module/ChartPreStyleAction.java

@ -16,6 +16,8 @@ import com.fr.transaction.WorkerFacade;
import com.fr.van.chart.designer.component.VanChartFillStylePane;
import javax.swing.KeyStroke;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.concurrent.ExecutorService;
import java.awt.event.ActionEvent;
@ -43,6 +45,7 @@ public class ChartPreStyleAction extends UpdateAction {
*/
public void actionPerformed(ActionEvent e) {
DesignerFrame designerFrame = DesignerContext.getDesignerFrame();
DesignerContext.getDesignerFrame().setServerConfig(true);
final ChartPreStyleManagerPane pane = new ChartPreStyleManagerPane();
BasicDialog dialog = pane.showWindow(designerFrame);
dialog.addDialogActionListener(new DialogActionAdapter() {
@ -79,7 +82,13 @@ public class ChartPreStyleAction extends UpdateAction {
}));
}
});
dialog.addWindowListener(new WindowAdapter() {
@Override
public void windowClosed(WindowEvent e) {
super.windowClosed(e);
DesignerContext.getDesignerFrame().setServerConfig(false);
}
});
pane.populateBean();
dialog.setVisible(true);

3
designer-chart/src/main/java/com/fr/van/chart/range/component/LegendGradientBar.java

@ -274,7 +274,8 @@ public class LegendGradientBar extends JComponent implements ColorSelectable, UI
private void dealClick(SelectColorPointBtn selectColorPointBtn) {
ColorSelectDetailPane pane = new ColorSelectDetailPane(Color.WHITE);
this.setColor(selectColorPointBtn.getColorInner());
ColorSelectDialog.showDialog(DesignerContext.getDesignerFrame(), pane, Color.WHITE, LegendGradientBar.this);
Color selectColor = selectColorPointBtn.getColorInner() == null ? Color.WHITE : selectColorPointBtn.getColorInner();
ColorSelectDialog.showDialog(DesignerContext.getDesignerFrame(), pane, selectColor, LegendGradientBar.this);
Color color = this.getColor();
if (color != null) {
DesignerEnvManager.getEnvManager().getColorConfigManager().addToColorQueue(color);

10
designer-realize/src/main/java/com/fr/design/actions/server/WidgetManagerAction.java

@ -17,6 +17,8 @@ import com.fr.transaction.WorkerFacade;
import javax.swing.KeyStroke;
import java.awt.event.ActionEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
public class WidgetManagerAction extends UpdateAction {
public WidgetManagerAction() {
@ -33,6 +35,7 @@ public class WidgetManagerAction extends UpdateAction {
*/
public void actionPerformed(ActionEvent e) {
final DesignerFrame designerFrame = DesignerContext.getDesignerFrame();
DesignerContext.getDesignerFrame().setServerConfig(true);
final WidgetInfoConfig widgetManager = WidgetInfoConfig.getInstance();
final WidgetManagerPane widgetManagerPane = new WidgetManagerPane() {
@Override
@ -63,6 +66,13 @@ public class WidgetManagerAction extends UpdateAction {
}));
}
});
widgetConfigDialog.addWindowListener(new WindowAdapter() {
@Override
public void windowClosed(WindowEvent e) {
super.windowClosed(e);
DesignerContext.getDesignerFrame().setServerConfig(false);
}
});
widgetConfigDialog.setVisible(true);
}

Loading…
Cancel
Save