Browse Source

Merge pull request #498 in BA/design from ~ZHENG/design:dev to dev

* commit '5b1134f2370a3afd8056a0d6a561a02634e2ae9b':
  无意义
  日文语言下,调排版和tooltip显示
master
superman 8 years ago
parent
commit
710ec288e3
  1. 3
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChartDataPane.java
  2. 2
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java
  3. 2
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/TableDataPane.java
  4. 2
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotTableDataContentPane.java
  5. 9
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java
  6. 2
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java
  7. 22
      designer_chart/src/com/fr/design/mainframe/chart/gui/type/ChartTabPane.java

3
designer_chart/src/com/fr/design/mainframe/chart/gui/ChartDataPane.java

@ -16,6 +16,9 @@ import java.awt.*;
public class ChartDataPane extends AbstractChartAttrPane { public class ChartDataPane extends AbstractChartAttrPane {
public static final int LABEL_WIDTH = 85;
public static final int LABEL_HEIGHT = 20;
protected DataContentsPane contentsPane; protected DataContentsPane contentsPane;
protected AttributeChangeListener listener; protected AttributeChangeListener listener;

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

@ -57,7 +57,7 @@ public class NormalChartDataPane extends DataContentsPane {
JPanel northPane = new JPanel(new BorderLayout(LayoutConstants.HGAP_LARGE,0)); JPanel northPane = new JPanel(new BorderLayout(LayoutConstants.HGAP_LARGE,0));
northPane.add(jcb, BorderLayout.CENTER); northPane.add(jcb, BorderLayout.CENTER);
UILabel label1 = new UILabel(Inter.getLocText("Chart-Data_Resource") + ":", SwingConstants.RIGHT); UILabel label1 = new UILabel(Inter.getLocText("Chart-Data_Resource") + ":", SwingConstants.RIGHT);
label1.setPreferredSize(new Dimension(75,20)); label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH,ChartDataPane.LABEL_HEIGHT));
northPane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{jcb, null, null, label1, null})); northPane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{jcb, null, null, label1, null}));
this.add(northPane, BorderLayout.NORTH); this.add(northPane, BorderLayout.NORTH);
this.add(cardPane, BorderLayout.CENTER); this.add(cardPane, BorderLayout.CENTER);

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

@ -32,7 +32,7 @@ public class TableDataPane extends FurtherBasicBeanPane<ChartCollection>{
private void initDataPane() { private void initDataPane() {
UILabel label = new BoldFontTextLabel(Inter.getLocText("Chart-DS_TableData") + ":", SwingConstants.RIGHT) ; UILabel label = new BoldFontTextLabel(Inter.getLocText("Chart-DS_TableData") + ":", SwingConstants.RIGHT) ;
label.setPreferredSize(new Dimension(75,20)); label.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH,ChartDataPane.LABEL_HEIGHT));
tableDataPane = new DatabaseTableDataPane(label) { tableDataPane = new DatabaseTableDataPane(label) {
@Override @Override
protected void userEvent() { protected void userEvent() {

2
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotTableDataContentPane.java

@ -42,7 +42,7 @@ public class CategoryPlotTableDataContentPane extends AbstractTableDataContentPa
JPanel categoryPane = new JPanel(new BorderLayout(4,0)); JPanel categoryPane = new JPanel(new BorderLayout(4,0));
categoryPane.setBorder(BorderFactory.createMatteBorder(0, 0, 6, 1, getBackground())); categoryPane.setBorder(BorderFactory.createMatteBorder(0, 0, 6, 1, getBackground()));
UILabel label1 = new BoldFontTextLabel(Inter.getLocText("FR-Chart-Category_Name") + ":", SwingConstants.RIGHT) ; UILabel label1 = new BoldFontTextLabel(Inter.getLocText("FR-Chart-Category_Name") + ":", SwingConstants.RIGHT) ;
label1.setPreferredSize(new Dimension(75,20)); label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH,ChartDataPane.LABEL_HEIGHT));
categoryCombox.setPreferredSize(new Dimension(100,20)); categoryCombox.setPreferredSize(new Dimension(100,20));
categoryCombox.addItem(Inter.getLocText("Chart-Use_None")); categoryCombox.addItem(Inter.getLocText("Chart-Use_None"));

9
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java

@ -11,6 +11,7 @@ import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
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.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.CalculateComboBox; import com.fr.design.mainframe.chart.gui.data.CalculateComboBox;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
@ -76,12 +77,12 @@ public class SeriesNameUseFieldValuePane extends FurtherBasicBeanPane<ChartColle
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {f}; double[] columnSize = {f};
double[] rowSize = {p, p, p, p, p}; double[] rowSize = {p, p, p, p, p};
UILabel Label1 = new UILabel(Inter.getLocText("Chart-Series_Name") + ":", SwingConstants.RIGHT); UILabel Label1 = new UILabel(Inter.getLocText("FR-Chart-Series_Name") + ":", SwingConstants.RIGHT);
Label1.setPreferredSize(new Dimension(75, 20)); Label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT));
UILabel Label2 = new UILabel(Inter.getLocText("Chart-Series_Value") + ":", SwingConstants.RIGHT); UILabel Label2 = new UILabel(Inter.getLocText("Chart-Series_Value") + ":", SwingConstants.RIGHT);
Label2.setPreferredSize(new Dimension(75, 20)); Label2.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT));
UILabel Label3 = new UILabel(Inter.getLocText("Chart-Summary_Method") + ":", SwingConstants.RIGHT); UILabel Label3 = new UILabel(Inter.getLocText("Chart-Summary_Method") + ":", SwingConstants.RIGHT);
Label3.setPreferredSize(new Dimension(75, 20)); Label3.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT));
Component[][] components = getUseComponent(Label1, Label2, Label3); Component[][] components = getUseComponent(Label1, Label2, Label3);
centerPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 4, 6); centerPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 4, 6);

2
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java

@ -48,7 +48,7 @@ public class SeriesTypeUseComboxPane extends UIComboBoxPane<ChartCollection> {
this.setLayout(new BorderLayout(4, LayoutConstants.VGAP_MEDIUM)); this.setLayout(new BorderLayout(4, LayoutConstants.VGAP_MEDIUM));
JPanel northPane = new JPanel(new BorderLayout(4, 0)); JPanel northPane = new JPanel(new BorderLayout(4, 0));
UILabel label1 = new UILabel(Inter.getLocText("ChartF-Series_Name_From") + ":", SwingConstants.RIGHT); UILabel label1 = new UILabel(Inter.getLocText("ChartF-Series_Name_From") + ":", SwingConstants.RIGHT);
label1.setPreferredSize(new Dimension(75, 20)); label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT));
northPane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{jcb, null, null, label1, null})); northPane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{jcb, null, null, label1, null}));
northPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 1)); northPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 1));
this.add(northPane, BorderLayout.NORTH); this.add(northPane, BorderLayout.NORTH);

22
designer_chart/src/com/fr/design/mainframe/chart/gui/type/ChartTabPane.java

@ -2,6 +2,7 @@ package com.fr.design.mainframe.chart.gui.type;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.design.dialog.MultiTabPane; import com.fr.design.dialog.MultiTabPane;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.mainframe.chart.gui.style.legend.AutoSelectedPane; import com.fr.design.mainframe.chart.gui.style.legend.AutoSelectedPane;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -15,6 +16,7 @@ import java.awt.*;
public abstract class ChartTabPane extends MultiTabPane<Chart> { public abstract class ChartTabPane extends MultiTabPane<Chart> {
private static final long serialVersionUID = 8633385688766835240L; private static final long serialVersionUID = 8633385688766835240L;
private boolean setTooltip = true;
@Override @Override
protected void initLayout() { protected void initLayout() {
@ -26,6 +28,26 @@ public abstract class ChartTabPane extends MultiTabPane<Chart> {
this.add(centerPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);
} }
//日文环境下,显示不全的,用tooltip
private void setSomeTooltipText() {
for(int i = 0, size = paneList.size(); i<size; i++){
String tooltip = paneList.get(i).getTitle();
UIToggleButton button = tabPane.getButton(i);
if(button.getPreferredSize().getWidth() > button.getSize().getWidth()) {
button.setToolTipText(tooltip);
}
}
}
@Override
public void paint(Graphics g) {
super.paint(g);
if(setTooltip) {
setSomeTooltipText();
setTooltip = false;
}
}
@Override @Override
public boolean accept(Object ob) { public boolean accept(Object ob) {
return false; return false;

Loading…
Cancel
Save