Browse Source

修改雷达图警戒线、间隔背景bug

聚合报表和表单中,添加对超链下拉选项的过滤
更换不透明度控件,修改组件bug
master
mengao 7 years ago
parent
commit
df9381bb8f
  1. 8
      designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java
  2. 6
      designer_base/src/com/fr/design/gui/style/NumberDragBar.java
  3. 35
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/LabelAlphaPane.java
  4. 41
      designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java
  5. 11
      designer_chart/src/com/fr/plugin/chart/designer/style/background/AlertLineListControlPane.java
  6. 11
      designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundListControlPane.java
  7. 12
      designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java
  8. 22
      designer_chart/src/com/fr/plugin/chart/designer/style/background/radar/VanChartRadarAxisAreaPane.java

8
designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java

@ -162,11 +162,15 @@ public abstract class UIListControlPane extends UIControlPane {
if (creators.length == 1) {
addItemShortCut = new AddItemUpdateAction(creators);
} else {
addItemShortCut = new AddItemMenuDef(creators);
addItemShortCut = getAddItemMenuDef(creators);
}
return new AbsoluteEnableShortCut(addItemShortCut);
}
protected AddItemMenuDef getAddItemMenuDef (NameableCreator[] creators) {
return new AddItemMenuDef(creators);
}
@Override
protected ShortCut4JControlPane removeItemShortCut() {
return new NormalEnableShortCut(new RemoveItemAction());
@ -557,7 +561,7 @@ public abstract class UIListControlPane extends UIControlPane {
}
}
private boolean whetherAdd(String itemName) {
protected boolean whetherAdd(String itemName){
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (jTemplate == null) {
return false;

6
designer_base/src/com/fr/design/gui/style/NumberDragBar.java

@ -53,6 +53,8 @@ public class NumberDragBar extends JComponent {
@Override
protected void paintComponent(Graphics g) {
int width = this.getWidth();
//x值在这里计算,setValue时,有时会因为组件还没画,获取到的是0
x = (value - minValue) * (width - WIDTH_ADJUST) / (maxValue - minValue) + X_ADJUST;
Graphics2D g2 = (Graphics2D)g;
RenderingHints qualityHints = new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
qualityHints.put(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
@ -118,8 +120,8 @@ public class NumberDragBar extends JComponent {
if(getWidth() <= 0) {
Thread.sleep(500);
}
int width = getWidth();
x = (value - minValue) * (width - WIDTH_ADJUST) / (maxValue - minValue) + X_ADJUST;
// int width = getWidth();
// x = (value - minValue) * (width - WIDTH_ADJUST) / (maxValue - minValue) + X_ADJUST;
validate();
repaint();
revalidate();

35
designer_chart/src/com/fr/design/chart/series/SeriesCondition/LabelAlphaPane.java

@ -4,20 +4,26 @@ import com.fr.chart.base.AttrAlpha;
import com.fr.chart.base.DataSeriesCondition;
import com.fr.design.condition.ConditionAttrSingleConditionPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.style.AlphaPane;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/**
* @author richie
* @date 2015-03-26
* @since 8.0
*/
* @author richie
* @date 2015-03-26
* @since 8.0
*/
public class LabelAlphaPane extends ConditionAttrSingleConditionPane<DataSeriesCondition> {
private static final int ALPHASIZE = 100;
private static final double ALPHASIZE = 100.0;
private static final int PANEL_WIDTH = 200;
private static final int PANEL_HIGHT = 20;
private UILabel nameLabel;
private AlphaPane alphaPane;
private UINumberDragPane alphaPane;
private AttrAlpha attrAlpha = new AttrAlpha();
@ -25,10 +31,17 @@ public class LabelAlphaPane extends ConditionAttrSingleConditionPane<DataSeriesC
super(conditionAttributesPane, true);
nameLabel = new UILabel(Inter.getLocText("ChartF-Alpha"));
alphaPane = new AlphaPane();
UILabel label = new UILabel(Inter.getLocText("ChartF-Alpha") + ":");
alphaPane = new UINumberDragPane(0, ALPHASIZE);
JPanel panel = new JPanel(new BorderLayout());
panel.add(label, BorderLayout.WEST);
panel.add(alphaPane, BorderLayout.CENTER);
panel.setPreferredSize(new Dimension(PANEL_WIDTH, PANEL_HIGHT));
this.add(nameLabel);
this.add(alphaPane);
this.add(panel);
}
@Override
@ -44,12 +57,12 @@ public class LabelAlphaPane extends ConditionAttrSingleConditionPane<DataSeriesC
public void populate(DataSeriesCondition condition) {
if (condition instanceof AttrAlpha) {
attrAlpha = (AttrAlpha) condition;
alphaPane.populate((int) (attrAlpha.getAlpha() * ALPHASIZE));
alphaPane.populateBean(attrAlpha.getAlpha() * ALPHASIZE);
}
}
public DataSeriesCondition update() {
attrAlpha.setAlpha(this.alphaPane.update());
attrAlpha.setAlpha((float) (this.alphaPane.updateBean() / ALPHASIZE));
return attrAlpha;
}

41
designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java

@ -7,11 +7,15 @@ import com.fr.chart.web.ChartHyperRelateFloatLink;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.designer.TargetComponent;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.fun.HyperlinkProvider;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.imenutable.UIMenuNameableCreator;
import com.fr.design.mainframe.BaseJForm;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.module.DesignModuleFactory;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.general.NameObject;
import com.fr.js.EmailJavaScript;
@ -75,6 +79,11 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane {
return Inter.getLocText("FR-Designer_Add_Hyperlink");
}
@Override
protected AddItemMenuDef getAddItemMenuDef (NameableCreator[] creators) {
return new AddVanChartItemMenuDef(creators);
}
public void populate(NameJavaScriptGroup nameHyperlink_array) {
java.util.List<NameObject> list = new ArrayList<NameObject>();
if (nameHyperlink_array != null) {
@ -218,4 +227,36 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane {
}
return null;
}
protected class AddVanChartItemMenuDef extends AddItemMenuDef{
public AddVanChartItemMenuDef(NameableCreator[] creators) {
super(creators);
}
@Override
protected boolean whetherAdd(String itemName){
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (jTemplate == null) {
return false;
}
//先屏蔽掉这个,之后还有别的
String[] names = {Inter.getLocText("FR-Hyperlink_Chart_Float"), Inter.getLocText("FR-Hyperlink_Chart_Cell")};
for (String name : names){
if(!jTemplate.isJWorkBook() && ComparatorUtils.equals(itemName,name)){
if(jTemplate.getEditingReportIndex() == BaseJForm.ELEMENTCASE_TAB && ComparatorUtils.equals(itemName, names[0])){
//表单报表块中图表悬浮元素超链,只屏蔽联动悬浮元素
return false;
} else if(jTemplate.getEditingReportIndex() == BaseJForm.FORM_TAB) {
//表单图表超链屏蔽掉联动悬浮元素和联动单元格
return false;
}
}
}
String formName = Inter.getLocText("Hyperlink-Form_link");
return !(jTemplate.isJWorkBook() && ComparatorUtils.equals(itemName, formName));
}
}
}

11
designer_chart/src/com/fr/plugin/chart/designer/style/background/AlertLineListControlPane.java

@ -1,6 +1,7 @@
package com.fr.plugin.chart.designer.style.background;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.ShortCut4JControlPane;
import com.fr.general.ComparatorUtils;
@ -52,7 +53,7 @@ public class AlertLineListControlPane extends VanChartUIListControlPane {
List<VanChartAxis> yAxisList = rectanglePlot.getYAxisList();
String[] axisNames = DefaultAxisHelper.getAllAxisNames(xAxisList, yAxisList);
ChartNameObjectCreator[] creators = {new ChartNameObjectCreator(axisNames, Inter.getLocText("Plugin-ChartF_AlertLine"), VanChartAlertValue.class, VanChartAlertValuePane.class)};
ChartNameObjectCreator[] creators = {new ChartNameObjectCreator(getAlertAxisName(axisNames), Inter.getLocText("Plugin-ChartF_AlertLine"), VanChartAlertValue.class, getAlertPaneClass())};
refreshNameableCreator(creators);
@ -111,4 +112,12 @@ public class AlertLineListControlPane extends VanChartUIListControlPane {
axis.setAlertValues(axisAlerts);
}
}
protected Class<? extends BasicBeanPane> getAlertPaneClass() {
return VanChartAlertValuePane.class;
}
protected String[] getAlertAxisName(String[] axisNames) {
return axisNames;
}
}

11
designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundListControlPane.java

@ -1,6 +1,7 @@
package com.fr.plugin.chart.designer.style.background;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.ShortCut4JControlPane;
import com.fr.general.ComparatorUtils;
@ -54,7 +55,7 @@ public class BackgroundListControlPane extends VanChartUIListControlPane {
List<VanChartAxis> yAxisList = rectanglePlot.getYAxisList();
String[] axisNames = DefaultAxisHelper.getAllAxisNames(xAxisList, yAxisList);
BackgroundNameObjectCreator[] creators = {new BackgroundNameObjectCreator(axisNames, Inter.getLocText("Plugin-ChartF_CustomIntervalBackground"), VanChartCustomIntervalBackground.class, VanChartCustomIntervalBackgroundPane.class)};
BackgroundNameObjectCreator[] creators = {new BackgroundNameObjectCreator(getCustomIntervalBackgroundAxisName(axisNames), Inter.getLocText("Plugin-ChartF_CustomIntervalBackground"), VanChartCustomIntervalBackground.class, getIntervalPaneClass())};
refreshNameableCreator(creators);
@ -123,4 +124,12 @@ public class BackgroundListControlPane extends VanChartUIListControlPane {
axis.setCustomIntervalBackgroundArray(axisCustomBackground);
}
}
protected Class<? extends BasicBeanPane> getIntervalPaneClass() {
return VanChartCustomIntervalBackgroundPane.class;
}
protected String[] getCustomIntervalBackgroundAxisName(String[] axisNames) {
return axisNames;
}
}

12
designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java

@ -75,12 +75,16 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
}
protected JPanel createAlertLinePane() {
alertLine = new AlertLineListControlPane();
alertLine = getAlertLinePane();
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_AlertLine"), alertLine);
alertLine.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 0));
return panel;
}
protected AlertLineListControlPane getAlertLinePane () {
return new AlertLineListControlPane();
}
protected JPanel createIntervalPane(double[] row, double[] col) {
isDefaultIntervalBackground = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_Default_Interval"), Inter.getLocText("Plugin-ChartF_CustomIntervalBackground")});
horizontalColorBackground = new ColorSelectBox(100);
@ -88,7 +92,7 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
Component[][] components = getIntervalPaneComponents();
JPanel defaultPane = TableLayoutHelper.createTableLayoutPane(components, row, col);
defaultPane.setBorder(BorderFactory.createEmptyBorder(0,12,0,0));
customIntervalBackground = new BackgroundListControlPane();
customIntervalBackground = getBackgroundListControlPane();
cardLayout = new CardLayout();
centerPane = new JPanel(cardLayout);
@ -109,6 +113,10 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
return panel;
}
protected BackgroundListControlPane getBackgroundListControlPane() {
return new BackgroundListControlPane();
}
protected Component[][] getIntervalPaneComponents() {
return new Component[][]{
new Component[]{null, null},

22
designer_chart/src/com/fr/plugin/chart/designer/style/background/radar/VanChartRadarAxisAreaPane.java

@ -3,8 +3,8 @@ package com.fr.plugin.chart.designer.style.background.radar;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.general.Inter;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.plugin.chart.attr.axis.VanChartCustomIntervalBackground;
import com.fr.plugin.chart.designer.style.background.AlertLineListControlPane;
import com.fr.plugin.chart.designer.style.background.BackgroundListControlPane;
import com.fr.plugin.chart.designer.style.background.VanChartAxisAreaPane;
import java.awt.*;
@ -30,19 +30,29 @@ public class VanChartRadarAxisAreaPane extends VanChartAxisAreaPane {
};
}
@Override
protected AlertLineListControlPane getAlertLinePane() {
return new AlertLineListControlPane(){
protected Class<? extends BasicBeanPane> getAlertPaneClass() {
return VanChartRadarAlertValuePane.class;
}
protected void setAlertDemoAxisName(VanChartAlertValue demo, String[] axisNames) {
demo.setAxisName(axisNames[axisNames.length - 1]);//默认y轴,居左居右
protected String[] getAlertAxisName(String[] axisNames) {
return new String[]{axisNames[axisNames.length - 1]};//默认y轴,居左居右
}
};
}
@Override
protected BackgroundListControlPane getBackgroundListControlPane() {
return new BackgroundListControlPane(){
protected Class<? extends BasicBeanPane> getIntervalPaneClass() {
return VanChartRadarCustomIntervalBackgroundPane.class;
}
protected void setCustomIntervalBackgroundDemoAxisName(VanChartCustomIntervalBackground demo, String[] axisNames) {
demo.setAxisName(axisNames[axisNames.length - 1]);
protected String[] getCustomIntervalBackgroundAxisName(String[] axisNames) {
return new String[]{axisNames[axisNames.length - 1]};
}
};
}
}
Loading…
Cancel
Save