Browse Source

Merge pull request #1498 in DESIGN/design from ~BJORN/design:release/10.0 to release/10.0

* commit 'd44fd448c9468ee04d50736ed763d741237bab47':
  CHART-12992&&CHART-13025 bugFix
feature/big-screen
Bjorn 5 years ago
parent
commit
c22791dea7
  1. 3
      designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java
  2. 1
      designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java
  3. 16
      designer-chart/src/main/java/com/fr/design/chartx/component/TableTreeComboBox.java
  4. 55
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanMapTableDataContentPane.java

3
designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java

@ -250,7 +250,8 @@ public class MapAreaMatchPane extends BasicBeanPane<MapMatchResult> {
int size = dataModel.getRowCount();
HashSet<Object> columnData = new LinkedHashSet<>();
for (int i = 0; i < size; i++) {
columnData.add(dataModel.getValueAt(i, colIndex));
Object valueAt = dataModel.getValueAt(i, colIndex);
columnData.add(valueAt == null ? StringUtils.EMPTY : valueAt);
}
return columnData.toArray();
} catch (TableDataException ignore) {

1
designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java

@ -125,6 +125,7 @@ public class MatchAreaTable extends JTable {
}
public Object getCellEditorValue() {
comboBox.resetText();
return comboBox.getSelectedItem();
}
}

16
designer-chart/src/main/java/com/fr/design/chartx/component/TableTreeComboBox.java

@ -2,6 +2,8 @@ package com.fr.design.chartx.component;
import com.fr.design.gui.icombobox.FRTreeComboBox;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralUtils;
import com.fr.plugin.chart.map.server.ChartGEOJSONHelper;
import javax.swing.JTextField;
@ -39,6 +41,19 @@ public class TableTreeComboBox extends FRTreeComboBox {
matchLeafNode(parent, node, textField);
}
@Override
public void setSelectedItemString(String name) {
super.setSelectedItemString(name);
this.textField.setText(name);
}
public void resetText() {
Object selectedItem = this.getSelectedItem();
if(!ComparatorUtils.equals(selectedItem, textField.getText())){
textField.setText(GeneralUtils.objectToString(selectedItem));
}
}
private boolean matchLeafNode(TreePath parent, TreeNode node, UITextField textField) {
for (Enumeration e = node.children(); e.hasMoreElements(); ) {
TreeNode n = (TreeNode) e.nextElement();
@ -71,7 +86,6 @@ public class TableTreeComboBox extends FRTreeComboBox {
.getLastPathComponent();
if (node.isLeaf()) {
TableTreeComboBox.this.setSelectedItem(treePath);
textField.setText(pathToString(treePath));
MenuSelectionManager.defaultManager().clearSelectedPath();
}
}

55
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanMapTableDataContentPane.java

@ -21,6 +21,8 @@ import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
/**
* @author Bjorn
@ -52,12 +54,18 @@ public abstract class VanMapTableDataContentPane extends AbstractTableDataConten
this.matchResult = matchResult;
}
public JPanel createAreaPanel(final UIComboBox areaBox) {
public JPanel createAreaPanel(UIComboBox areaBox) {
JPanel areaPanel = new JPanel(new BorderLayout(4, 0));
areaBox.setPreferredSize(new Dimension(70, 20));
areaPanel.add(areaBox, BorderLayout.CENTER);
UIButton uiButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/config.png"));
uiButton.addActionListener(new ActionListener() {
uiButton.addActionListener(createActionListener(areaBox));
areaPanel.add(uiButton, BorderLayout.EAST);
return areaPanel;
}
private ActionListener createActionListener(final UIComboBox areaBox){
return new ActionListener() {
private TwoTuple<DefaultMutableTreeNode, Set<String>> treeNodeAndItems;
@Override
@ -67,9 +75,8 @@ public abstract class VanMapTableDataContentPane extends AbstractTableDataConten
}
final MapAreaMatchPane pane = new MapAreaMatchPane(treeNodeAndItems);
String nameTable = getTableName();
final String nameTable = getTableName();
pane.populateBean(matchResult, nameTable, Utils.objectToString(areaBox.getSelectedItem()));
BasicDialog dialog = pane.showWindow(new JFrame());
dialog.addDialogActionListener(new DialogActionListener() {
@Override
@ -82,11 +89,45 @@ public abstract class VanMapTableDataContentPane extends AbstractTableDataConten
}
});
dialog.addWindowListener(new WindowListener() {
@Override
public void windowOpened(WindowEvent e) {
pane.populateBean(matchResult, nameTable, Utils.objectToString(areaBox.getSelectedItem()));
}
@Override
public void windowClosing(WindowEvent e) {
}
@Override
public void windowClosed(WindowEvent e) {
}
@Override
public void windowIconified(WindowEvent e) {
}
@Override
public void windowDeiconified(WindowEvent e) {
}
@Override
public void windowActivated(WindowEvent e) {
}
@Override
public void windowDeactivated(WindowEvent e) {
}
});
dialog.setVisible(true);
}
});
areaPanel.add(uiButton, BorderLayout.EAST);
return areaPanel;
};
}
@Override

Loading…
Cancel
Save