Browse Source

Pull request #6414: CHART-21418 fix bugs

Merge in DESIGN/design from ~ZHENG/c-design:release/10.0 to release/10.0

* commit 'c08b5b0213a60fbe15683f4516c56e0217f8bc92':
  update
  CHART-20951 fix:大屏模板中的图表 警戒线文字默认样式
  CHART-21418 fix:颜色控件弹框 如果是从displayComponent上面离开的,隐藏弹出界面。
zheng-1641779399395
zheng 3 years ago
parent
commit
87555fd274
  1. 43
      designer-base/src/main/java/com/fr/design/style/AbstractSelectBox.java
  2. 2
      designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleConstants.java
  3. 8
      designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java
  4. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/style/background/ChartNameObjectCreator.java

43
designer-base/src/main/java/com/fr/design/style/AbstractSelectBox.java

@ -1,30 +1,31 @@
package com.fr.design.style; package com.fr.design.style;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIButtonUI;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.style.background.BackgroundJComponent;
import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.stable.Constants;
import javax.swing.AbstractButton;
import javax.swing.JPanel;
import javax.swing.border.AbstractBorder;
import javax.swing.event.AncestorEvent;
import javax.swing.event.AncestorListener;
import javax.swing.plaf.ButtonUI;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.Insets; import java.awt.Insets;
import java.awt.Rectangle;
import java.awt.RenderingHints; import java.awt.RenderingHints;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.awt.event.MouseListener; import java.awt.event.MouseListener;
import javax.swing.AbstractButton;
import javax.swing.JPanel;
import javax.swing.border.AbstractBorder;
import javax.swing.event.AncestorEvent;
import javax.swing.event.AncestorListener;
import javax.swing.plaf.ButtonUI;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIButtonUI;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.design.style.background.BackgroundJComponent;
import com.fr.stable.Constants;
/** /**
* @author kunsnat E-mail:kunsnat@gmail.com * @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2011-10-31 下午03:28:31 类说明: 抽象出来的弹出box. 可以弹出颜色选择, 图案选择, 纹理选择. * @version 创建时间2011-10-31 下午03:28:31 类说明: 抽象出来的弹出box. 可以弹出颜色选择, 图案选择, 纹理选择.
@ -94,6 +95,18 @@ public abstract class AbstractSelectBox<T> extends AbstractPopBox implements Mou
hidePopupMenu(); hidePopupMenu();
} }
}); });
displayComponent.addMouseListener(new MouseAdapter() {
@Override
public void mouseExited(MouseEvent e) {
Rectangle rectangle = displayComponent.getBounds();
if (e.getY() < rectangle.y) {
//如果是从displayComponent上面离开的,隐藏弹出界面。
hidePopupMenu();
}
}
});
} }
public void setEnabled(boolean enabled) { public void setEnabled(boolean enabled) {

2
designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleConstants.java

@ -26,6 +26,8 @@ public class DefaultStyleConstants {
static final Color AXIS_LINE = new Color(46, 75, 102); static final Color AXIS_LINE = new Color(46, 75, 102);
static final Color GRID_LINE = new Color(30, 55, 78); static final Color GRID_LINE = new Color(30, 55, 78);
static final FRFont ALERT_FONT = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 9, new Color(255, 0, 0));
static final FRFont DATA_SHEET = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 9, new Color(159, 173, 191)); static final FRFont DATA_SHEET = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 9, new Color(159, 173, 191));
static final Color DATA_SHEET_BORDER = new Color(46, 75, 102); static final Color DATA_SHEET_BORDER = new Color(46, 75, 102);

8
designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java

@ -9,6 +9,7 @@ import com.fr.chart.chartglyph.DataSheet;
import com.fr.config.predefined.ColorFillStyle; import com.fr.config.predefined.ColorFillStyle;
import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.plugin.chart.PiePlot4VanChart; import com.fr.plugin.chart.PiePlot4VanChart;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
@ -69,6 +70,13 @@ public class DefaultStyleHelper4Van {
return axis; return axis;
} }
public static void dealAxisAlert(VanChartAlertValue vanChartAlertValue) {
if (!ChartEditContext.duchampMode()) {
return;
}
vanChartAlertValue.setAlertFont(DefaultStyleConstants.ALERT_FONT);
}
static void dealVanPlotCommonAttr(Plot plot) { static void dealVanPlotCommonAttr(Plot plot) {
if (!ChartEditContext.duchampMode()) { if (!ChartEditContext.duchampMode()) {
return; return;

4
designer-chart/src/main/java/com/fr/van/chart/designer/style/background/ChartNameObjectCreator.java

@ -3,10 +3,11 @@ package com.fr.van.chart.designer.style.background;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.UnrepeatedNameHelper; import com.fr.design.gui.controlpane.UnrepeatedNameHelper;
import com.fr.log.FineLoggerFactory;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue; import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import com.fr.van.chart.config.DefaultStyleHelper4Van;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
@ -37,6 +38,7 @@ public class ChartNameObjectCreator extends NameObjectCreator {
VanChartAlertValue vanChartAlertValue = constructor.newInstance(); VanChartAlertValue vanChartAlertValue = constructor.newInstance();
vanChartAlertValue.setAxisNamesArray((String[]) object); vanChartAlertValue.setAxisNamesArray((String[]) object);
vanChartAlertValue.setAxisName(((String[]) object)[0]); vanChartAlertValue.setAxisName(((String[]) object)[0]);
DefaultStyleHelper4Van.dealAxisAlert(vanChartAlertValue);
return new NameObject(helper.createUnrepeatedName(this.menuName()), vanChartAlertValue); return new NameObject(helper.createUnrepeatedName(this.menuName()), vanChartAlertValue);
} catch (NoSuchMethodException e) { } catch (NoSuchMethodException e) {

Loading…
Cancel
Save