fr_shine 9 years ago
parent
commit
10288639cd
  1. 1
      designer_base/src/com/fr/design/beans/BasicBeanPane.java
  2. 3
      designer_base/src/com/fr/design/gui/columnrow/ColumnRowPane.java
  3. 123
      designer_base/src/com/fr/design/gui/ispinner/ColumnRowSpinner.java
  4. BIN
      designer_base/src/com/fr/design/images/form/toolbar/ChartF-MultiPie.png
  5. BIN
      designer_base/src/com/fr/design/images/form/toolbar/ChartF-TreeMap.png
  6. BIN
      designer_base/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewMultiPie.png
  7. BIN
      designer_base/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewTreeMap.png
  8. 44
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java

1
designer_base/src/com/fr/design/beans/BasicBeanPane.java

@ -6,6 +6,7 @@ import com.fr.design.dialog.BasicPane;
* Update Pane
*/
public abstract class BasicBeanPane<T> extends BasicPane {
/**
* Populate.

3
designer_base/src/com/fr/design/gui/columnrow/ColumnRowPane.java

@ -22,6 +22,7 @@ import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.gui.ispinner.UpperCaseSpinner;
import com.fr.design.gui.ispinner.ColumnRowSpinner;
import com.fr.general.ComparatorUtils;
import com.fr.stable.ColumnRow;
import com.fr.stable.StableUtils;
@ -119,7 +120,7 @@ public class ColumnRowPane extends JPanel implements UIObserver {
protected void initRowSpinner() {
rowSpinner = new UIBasicSpinner((new SpinnerListModel(rowarray))) {
rowSpinner = new ColumnRowSpinner((new SpinnerListModel(rowarray))) {
public boolean shouldResponseChangeListener() {
return false;
}

123
designer_base/src/com/fr/design/gui/ispinner/ColumnRowSpinner.java

@ -0,0 +1,123 @@
package com.fr.design.gui.ispinner;
import java.text.ParseException;
import java.util.List;
import javax.swing.JComponent;
import javax.swing.JFormattedTextField;
import javax.swing.JSpinner;
import javax.swing.SpinnerDateModel;
import javax.swing.SpinnerListModel;
import javax.swing.SpinnerModel;
import javax.swing.SpinnerNumberModel;
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.DefaultFormatterFactory;
import javax.swing.text.DocumentFilter;
import com.fr.stable.StableUtils;
//_kerry: 用来修复Spinner输入数字自动填充的bug
public class ColumnRowSpinner extends UIBasicSpinner {
public ColumnRowSpinner(SpinnerModel model) {
super(model);
}
protected JComponent createEditor(SpinnerModel model) {
if (model instanceof SpinnerDateModel) {
return new DateEditor(this);
} else if (model instanceof SpinnerListModel) {
return new FillBugEditor(this);
} else if (model instanceof SpinnerNumberModel) {
return new NumberEditor(this);
} else {
return new DefaultEditor(this);
}
}
private class FillBugEditor extends DefaultEditor {
public FillBugEditor(JSpinner spinner) {
super(spinner);
if (!(spinner.getModel() instanceof SpinnerListModel)) {
throw new IllegalArgumentException(
"model not a SpinnerListModel");
}
getTextField().setEditable(true);
getTextField().setFormatterFactory(
new DefaultFormatterFactory(new ListFormatter()));
}
public SpinnerListModel getModel() {
return (SpinnerListModel) (getSpinner().getModel());
}
private class ListFormatter extends
JFormattedTextField.AbstractFormatter {
private DocumentFilter filter;
public String valueToString(Object value) throws ParseException {
if (value == null) {
return "";
}
return value.toString();
}
public Object stringToValue(String string)
throws ParseException {
//add将行数转换成ABC
return string;
}
protected DocumentFilter getDocumentFilter() {
if (filter == null) {
filter = new Filter();
}
return filter;
}
private class Filter extends DocumentFilter {
public void replace(FilterBypass fb, int offset,
int length, String string, AttributeSet attrs)
throws BadLocationException {
if (string != null
&& (offset + length) == fb.getDocument()
.getLength()) {
List list = getModel().getList();
Object next = null;
for (int counter = 0; counter < list.size(); counter++) {
Object value = list.get(counter);
String str = value.toString();
if (str != null
&& str.startsWith(fb.getDocument()
.getText(0, offset)
+ string)) {
next = value;
break;
}
}
String value = (next != null) ? next.toString()
: null;
if (value != null) {
fb.remove(0, offset + length);
fb.insertString(0, value, null);
getFormattedTextField().select(
offset + string.length(),
value.length());
return;
}
}
super.replace(fb, offset, length, string, attrs);
}
public void insertString(FilterBypass fb, int offset,
String string, AttributeSet attr)
throws BadLocationException {
replace(fb, offset, 0, string, attr);
}
}
}
}
}

BIN
designer_base/src/com/fr/design/images/form/toolbar/ChartF-MultiPie.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 861 B

BIN
designer_base/src/com/fr/design/images/form/toolbar/ChartF-TreeMap.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 269 B

BIN
designer_base/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewMultiPie.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 861 B

BIN
designer_base/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewTreeMap.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 269 B

44
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java

@ -23,7 +23,7 @@ import com.fr.general.Inter;
import java.awt.*;
/**
* 类说明: 图表超链 -- 弹出 悬浮窗.
* 类说明: 图表超链 -- 弹出 悬浮窗.
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2011-12-28 上午10:41:39
*/
@ -32,7 +32,7 @@ public class ChartHyperPoplinkPane extends BasicBeanPane<ChartHyperPoplink> {
private UITextField itemNameTextField;
private ChartHyperEditPane hyperEditPane;
private ChartComponent chartComponent;
public ChartHyperPoplinkPane() {
this.setLayout(FRGUIPaneFactory.createM_BorderLayout());
@ -43,8 +43,23 @@ public class ChartHyperPoplinkPane extends BasicBeanPane<ChartHyperPoplink> {
hyperEditPane = new ChartHyperEditPane(getChartParaType(), getValueEditorPane(), getValueEditorPane());
this.add(hyperEditPane, BorderLayout.CENTER);
ChartCollection cc = new ChartCollection();
ChartCollection cc = createChartCollection();
chartComponent = new ChartComponent();
chartComponent.setPreferredSize(new Dimension(220, 170));// 在单元格弹出时 需要调整保证属性表的大小.
chartComponent.setSupportEdit(false);
chartComponent.populate(cc);
this.add(chartComponent, BorderLayout.EAST);
hyperEditPane.populate(cc);
hyperEditPane.useChartComponent(chartComponent);
}
private ChartCollection createChartCollection() {
ChartCollection cc = new ChartCollection();
Chart chart = ChartTypeManager.getFirstChart();
if (chart != null){
@ -57,19 +72,9 @@ public class ChartHyperPoplinkPane extends BasicBeanPane<ChartHyperPoplink> {
}else {
cc.addChart(new Chart(new Bar2DPlot()));
}
chartComponent = new ChartComponent();
chartComponent.setPreferredSize(new Dimension(220, 170));// 在单元格弹出时 需要调整保证属性表的大小.
chartComponent.setSupportEdit(false);
chartComponent.populate(cc);
this.add(chartComponent, BorderLayout.EAST);
hyperEditPane.populate(cc);
hyperEditPane.useChartComponent(chartComponent);
}
return cc;
}
protected int getChartParaType() {
return ParameterTableModel.CHART_NORMAL_USE;
}
@ -85,7 +90,7 @@ public class ChartHyperPoplinkPane extends BasicBeanPane<ChartHyperPoplink> {
protected boolean needRenamePane(){
return true;
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText("FR-Chart-Pop_Chart");
@ -99,8 +104,7 @@ public class ChartHyperPoplinkPane extends BasicBeanPane<ChartHyperPoplink> {
BaseChartCollection cc = chartHyperlink.getChartCollection();
if (cc == null || cc.getChartCount() < 1) {
cc = new ChartCollection();
cc.addChart(new Chart(ChartFactory.createBar2DPlot()));
cc = createChartCollection();
chartHyperlink.setChartCollection(cc);
}

Loading…
Cancel
Save