kerry 8 years ago
parent
commit
cc59851c59
  1. 29
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/TooltipContentsPane.java
  2. 15
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/DataLabelPane.java
  3. 18
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/MapDataLabelPane.java
  4. 2
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java
  5. 12
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/MeterPlotReportDataContentPane.java
  6. 41
      designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java
  7. 40
      designer_form/src/com/fr/design/mainframe/ShareWidgetButton.java
  8. 17
      designer_form/src/com/fr/design/mainframe/ShareWidgetPane.java

29
designer_chart/src/com/fr/design/chart/series/SeriesCondition/TooltipContentsPane.java

@ -1,28 +1,23 @@
package com.fr.design.chart.series.SeriesCondition; package com.fr.design.chart.series.SeriesCondition;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.Format;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import com.fr.chart.base.AttrContents; import com.fr.chart.base.AttrContents;
import com.fr.chart.base.ChartConstants; import com.fr.chart.base.ChartConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.dialog.BasicPane; import com.fr.design.style.FormatPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.design.style.FormatPane;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.Format;
/** /**
* 数据点提示内容面板包含系列值系列百分比 * 数据点提示内容面板包含系列值系列百分比
@ -58,7 +53,7 @@ public class TooltipContentsPane extends BasicPane{
protected JPanel createJPanel4Value() { protected JPanel createJPanel4Value() {
if (showValueCB == null) { if (showValueCB == null) {
showValueCB = new UICheckBox(Inter.getLocText("Value")); showValueCB = new UICheckBox(getValueString());
} }
showValueCB.setSelected(true); showValueCB.setSelected(true);
@ -75,7 +70,9 @@ public class TooltipContentsPane extends BasicPane{
return valuePane; return valuePane;
} }
protected String getValueString() {
return Inter.getLocText("Value");
}
protected Component[] createComponents4PercentValue() { protected Component[] createComponents4PercentValue() {
if (showPercent == null) { if (showPercent == null) {

15
designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/DataLabelPane.java

@ -1,12 +1,5 @@
package com.fr.design.chart.series.SeriesCondition.dlp; package com.fr.design.chart.series.SeriesCondition.dlp;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import javax.swing.ButtonGroup;
import javax.swing.JPanel;
import com.fr.base.Utils; import com.fr.base.Utils;
import com.fr.chart.base.AttrContents; import com.fr.chart.base.AttrContents;
import com.fr.chart.base.ChartConstants; import com.fr.chart.base.ChartConstants;
@ -21,6 +14,9 @@ import com.fr.general.Inter;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
/** /**
* Created by IntelliJ IDEA. * Created by IntelliJ IDEA.
* Author : Richer * Author : Richer
@ -80,11 +76,14 @@ public class DataLabelPane extends TooltipContentsPane {
protected Component[] createComponents4ShowCategoryName() { protected Component[] createComponents4ShowCategoryName() {
if (showCategoryNameCB == null) { if (showCategoryNameCB == null) {
showCategoryNameCB = new UICheckBox(Inter.getLocText(new String[]{"StyleFormat-Category", "WF-Name"})); showCategoryNameCB = new UICheckBox(getCategoryString());
} }
return new Component[]{null, showCategoryNameCB}; return new Component[]{null, showCategoryNameCB};
} }
protected String getCategoryString(){
return Inter.getLocText(new String[]{"StyleFormat-Category", "WF-Name"});
}
protected Component[] createComponents4ShowGuidLine() { protected Component[] createComponents4ShowGuidLine() {

18
designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/MapDataLabelPane.java

@ -1,6 +1,9 @@
package com.fr.design.chart.series.SeriesCondition.dlp; package com.fr.design.chart.series.SeriesCondition.dlp;
import com.fr.general.Inter;
import javax.swing.*; import javax.swing.*;
import java.awt.*;
/** /**
@ -13,6 +16,21 @@ import javax.swing.*;
*/ */
public class MapDataLabelPane extends DataLabelPane { public class MapDataLabelPane extends DataLabelPane {
@Override
protected Component[] createComponents4ShowSeriesName() {
return new Component[0];
}
@Override
protected String getCategoryString() {
return Inter.getLocText("FR-Chart-Area_Name");
}
@Override
protected String getValueString() {
return Inter.getLocText("FR-Chart-Area_Value");
}
protected JPanel createJPanel4Position() { protected JPanel createJPanel4Position() {
return null; return null;
} }

2
designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java

@ -162,6 +162,8 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
if (state.isDynamicState() && parent != null){ if (state.isDynamicState() && parent != null){
parent.reactorChartTypePane(editingCollection); parent.reactorChartTypePane(editingCollection);
} }
//检查是否可以配置切换
configButton.setEnabled(editingCollection.changeEnable());
} }
ActionListener configListener = new ActionListener() { ActionListener configListener = new ActionListener() {

12
designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/MeterPlotReportDataContentPane.java

@ -46,8 +46,8 @@ public class MeterPlotReportDataContentPane extends AbstractReportDataContentPan
double[] rowSize = { p, p, p}; double[] rowSize = { p, p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(CATENAME), getSingCatePane()}, new Component[]{new UILabel(getCateNameString()), getSingCatePane()},
new Component[]{new UILabel(NVALUE), singValuePane = new TinyFormulaPane()}, new Component[]{new UILabel(getNValueString()), singValuePane = new TinyFormulaPane()},
new Component[]{null, null} new Component[]{null, null}
}; };
@ -66,6 +66,14 @@ public class MeterPlotReportDataContentPane extends AbstractReportDataContentPan
this.add(pane, BorderLayout.CENTER); this.add(pane, BorderLayout.CENTER);
} }
protected String getCateNameString() {
return CATENAME;
}
protected String getNValueString() {
return NVALUE;
}
public void populateBean(ChartCollection collection) { public void populateBean(ChartCollection collection) {
TopDefinitionProvider definition = collection.getSelectedChart().getFilterDefinition(); TopDefinitionProvider definition = collection.getSelectedChart().getFilterDefinition();

41
designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java

@ -95,26 +95,19 @@ public class FormWidgetDetailPane extends FormDockView{
clearDockingView(); clearDockingView();
return; return;
} }
reuWidgetPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel esp = FRGUIPaneFactory.createBorderLayout_S_Pane(); reuWidgetPanel.setBorder(null);
esp.setBorder(null);
if (elCaseBindInfoList == null) { if (elCaseBindInfoList == null) {
elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList();
} }
initReuWidgetPanel(); initReuWidgetPanel();
esp.add(reuWidgetPanel, BorderLayout.CENTER);
createDownloadButton(); createDownloadButton();
JPanel widgetPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); initMenuPanel();
widgetPane.setBorder(BorderFactory.createEmptyBorder(3, 10, 3, 3));
widgetPane.add(new UILabel(Inter.getLocText("FR-Designer_LocalWidget"),
SwingConstants.HORIZONTAL), BorderLayout.WEST);
widgetPane.add(downloadButton, BorderLayout.EAST);
esp.add(widgetPane,BorderLayout.NORTH);
tabbedPane = new UITabbedPane(); tabbedPane = new UITabbedPane();
tabbedPane.setOpaque(true); tabbedPane.setOpaque(true);
tabbedPane.setBorder(null); tabbedPane.setBorder(null);
tabbedPane.setTabPlacement(SwingConstants.BOTTOM); tabbedPane.setTabPlacement(SwingConstants.BOTTOM);
tabbedPane.addTab(Inter.getLocText("FR-Engine_Report"), esp); tabbedPane.addTab(Inter.getLocText("FR-Engine_Report"), reuWidgetPanel);
tabbedPane.addTab(Inter.getLocText("FR-Designer-Form-ToolBar_Chart"), new JPanel()); tabbedPane.addTab(Inter.getLocText("FR-Designer-Form-ToolBar_Chart"), new JPanel());
add(tabbedPane, BorderLayout.CENTER); add(tabbedPane, BorderLayout.CENTER);
@ -124,16 +117,25 @@ public class FormWidgetDetailPane extends FormDockView{
* 初始化组件共享和复用面板 * 初始化组件共享和复用面板
*/ */
private void initReuWidgetPanel() { private void initReuWidgetPanel() {
int rowCount = (elCaseBindInfoList.length + 1)/2;
downPanel = new UIScrollPane(new ShareWidgetPane(elCaseBindInfoList)); downPanel = new UIScrollPane(new ShareWidgetPane(elCaseBindInfoList));
downPanel.setPreferredSize(new Dimension(236, rowCount * 82)); reuWidgetPanel.add(downPanel);
reuWidgetPanel = new JPanel(); }
/**
* 初始化菜单栏面板
*/
private void initMenuPanel() {
JPanel menutPane = new JPanel();
menutPane.setLayout(FRGUIPaneFactory.createBorderLayout());
menutPane.setBorder(BorderFactory.createEmptyBorder(5, 8, 3, 3));
menutPane.add(new UILabel(Inter.getLocText("FR-Designer_LocalWidget"),
SwingConstants.HORIZONTAL), BorderLayout.WEST);
menutPane.add(downloadButton, BorderLayout.EAST);
comboBox = new UIComboBox(getFormCategories()); comboBox = new UIComboBox(getFormCategories());
comboBox.setPreferredSize(new Dimension(236, 30)); comboBox.setPreferredSize(new Dimension(240, 30));
initComboBoxSelectedListener(); initComboBoxSelectedListener();
reuWidgetPanel.add(comboBox, BorderLayout.NORTH); menutPane.add(comboBox, BorderLayout.SOUTH);
reuWidgetPanel.add(downPanel, BorderLayout.CENTER); reuWidgetPanel.add(menutPane,BorderLayout.NORTH);
reuWidgetPanel.setBorder(new LineBorder(Color.gray));
} }
private void initComboBoxSelectedListener() { private void initComboBoxSelectedListener() {
@ -144,7 +146,7 @@ public class FormWidgetDetailPane extends FormDockView{
if (filterIndex == 0) { if (filterIndex == 0) {
elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList();
} else { } else {
String filterName = (String) e.getItem(); String filterName = comboBox.getSelectedItem().toString();
elCaseBindInfoList = ShareLoader.getLoader().getFilterBindInfoList(filterName); elCaseBindInfoList = ShareLoader.getLoader().getFilterBindInfoList(filterName);
} }
refreshDownPanel(); refreshDownPanel();
@ -193,7 +195,6 @@ public class FormWidgetDetailPane extends FormDockView{
public void refreshDownPanel() { public void refreshDownPanel() {
reuWidgetPanel.remove(downPanel); reuWidgetPanel.remove(downPanel);
downPanel = new UIScrollPane(new ShareWidgetPane(elCaseBindInfoList)); downPanel = new UIScrollPane(new ShareWidgetPane(elCaseBindInfoList));
//todo:这个地方有问题
reuWidgetPanel.add(downPanel); reuWidgetPanel.add(downPanel);
repaintContainer(); repaintContainer();

40
designer_form/src/com/fr/design/mainframe/ShareWidgetButton.java

@ -4,7 +4,6 @@ import com.fr.base.BaseUtils;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.form.share.ShareLoader; import com.fr.form.share.ShareLoader;
import com.fr.form.ui.ElCaseBindInfo; import com.fr.form.ui.ElCaseBindInfo;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
@ -20,7 +19,6 @@ import java.awt.dnd.*;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.awt.event.MouseListener; import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener; import java.awt.event.MouseMotionListener;
import java.awt.image.BufferedImage;
import java.io.IOException; import java.io.IOException;
import java.io.Serializable; import java.io.Serializable;
@ -36,42 +34,20 @@ public class ShareWidgetButton extends JPanel implements MouseListener, MouseMot
public ShareWidgetButton(ElCaseBindInfo bindInfo) { public ShareWidgetButton(ElCaseBindInfo bindInfo) {
this.bindInfo = bindInfo; this.bindInfo = bindInfo;
initUI(); initUI();
this.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));
this.addMouseListener(this); this.addMouseListener(this);
this.addMouseMotionListener(this); this.addMouseMotionListener(this);
new DragAndDropDragGestureListener(this, DnDConstants.ACTION_COPY_OR_MOVE); new DragAndDropDragGestureListener(this, DnDConstants.ACTION_COPY_OR_MOVE);
} }
private void initUI() { private void initUI() {
this.setBackground(Color.WHITE); JPanel reportPane = new JPanel(new BorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); reportPane.add(new UILabel(new ImageIcon(bindInfo.getCover())), BorderLayout.CENTER);
setPreferredSize(new Dimension(108, 72)); JPanel labelPane = new JPanel(new BorderLayout());
setLayout(FRGUIPaneFactory.createBorderLayout()); UILabel label = new UILabel(bindInfo.getName(), UILabel.CENTER);
ImagePanel imagePanel = new ImagePanel((BufferedImage) bindInfo.getCover()); labelPane.setBackground(new Color(184, 220, 242));
imagePanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); labelPane.add(label, BorderLayout.CENTER);
reportPane.add(labelPane, BorderLayout.SOUTH);
this.add(imagePanel, BorderLayout.NORTH); add(reportPane);
UILabel label = new UILabel(bindInfo.getName(), SwingConstants.HORIZONTAL);
label.setOpaque(true);
label.setBackground(new Color(184, 220, 242));
this.add(label, BorderLayout.SOUTH);
}
private class ImagePanel extends JPanel {
private BufferedImage image;
public ImagePanel(BufferedImage image) {
this.image = image;
this.setPreferredSize(new Dimension(108, 52));
}
@Override
public void paintComponent(Graphics g) {
g.drawImage(image, 0, 0, null);
}
} }
public ElCaseBindInfo getBindInfo() { public ElCaseBindInfo getBindInfo() {

17
designer_form/src/com/fr/design/mainframe/ShareWidgetPane.java

@ -1,13 +1,10 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import com.fr.form.ui.ElCaseBindInfo;
import com.fr.form.ui.ElCaseBindInfo;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.util.*;
import java.util.List;
/** /**
@ -16,17 +13,15 @@ import java.util.List;
public class ShareWidgetPane extends JPanel { public class ShareWidgetPane extends JPanel {
public ShareWidgetPane(ElCaseBindInfo[] elCaseBindInfoList) { public ShareWidgetPane(ElCaseBindInfo[] elCaseBindInfoList) {
this.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));// 设置面板的边框 ,距离上、左、下、右 的距离 this.setBorder(BorderFactory.createEmptyBorder(10, 3, 0, 0));// 设置面板的边框 ,距离上、左、下、右 的距离
int rowCount = (elCaseBindInfoList.length + 1)/2; int rowCount = (elCaseBindInfoList.length + 1) / 2;
this.setLayout(new GridLayout(rowCount, 2, 10, 10)); this.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
for (ElCaseBindInfo rbModuleInfo : elCaseBindInfoList) { for (ElCaseBindInfo rbModuleInfo : elCaseBindInfoList) {
ShareWidgetButton widgetButton = new ShareWidgetButton(rbModuleInfo); ShareWidgetButton widgetButton = new ShareWidgetButton(rbModuleInfo);
this.add(widgetButton); this.add(widgetButton);
} }
if (elCaseBindInfoList.length == 1) { this.setPreferredSize(new Dimension(240, rowCount * 80));
this.add(new JPanel());
}
} }
} }
Loading…
Cancel
Save