Browse Source

加override

master
zack 9 years ago
parent
commit
b6433715ba
  1. 11
      designer_base/src/com/fr/design/data/datapane/TableDataPaneListPane.java
  2. 23
      designer_base/src/com/fr/design/gui/controlpane/JListControlPane.java

11
designer_base/src/com/fr/design/data/datapane/TableDataPaneListPane.java

@ -75,6 +75,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
}); });
} }
@Override
public void rename(String oldName, String newName) { public void rename(String oldName, String newName) {
dsNameChangedMap.put(oldName, newName); dsNameChangedMap.put(oldName, newName);
} }
@ -84,6 +85,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
* *
* @return / * @return /
*/ */
@Override
public boolean isNamePermitted() { public boolean isNamePermitted() {
return isNamePermitted; return isNamePermitted;
} }
@ -92,6 +94,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
/** /**
* 检查按钮可用状态 Check button enabled. * 检查按钮可用状态 Check button enabled.
*/ */
@Override
public void checkButtonEnabled() { public void checkButtonEnabled() {
super.checkButtonEnabled(); super.checkButtonEnabled();
isNamePermitted = !isContainsRename(); isNamePermitted = !isContainsRename();
@ -106,6 +109,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
* *
* @return 数组 * @return 数组
*/ */
@Override
public NameableCreator[] createNameableCreators() { public NameableCreator[] createNameableCreators() {
return TableDataCreatorProducer.getInstance().createServerTableDataCreator(); return TableDataCreatorProducer.getInstance().createServerTableDataCreator();
} }
@ -166,6 +170,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
/** /**
* Populate. * Populate.
*/ */
@Override
public void populate(TableDataSource tds) { public void populate(TableDataSource tds) {
List<NameObject> nameObjectList = new ArrayList<NameObject>(); List<NameObject> nameObjectList = new ArrayList<NameObject>();
@ -185,6 +190,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
/** /**
* Populate. * Populate.
*/ */
@Override
public void populate(DatasourceManagerProvider datasourceManager) { public void populate(DatasourceManagerProvider datasourceManager) {
Iterator<String> nameIt = datasourceManager.getTableDataNameIterator(); Iterator<String> nameIt = datasourceManager.getTableDataNameIterator();
Iterator<String> procedurenameIt = datasourceManager.getProcedureNameIterator(); Iterator<String> procedurenameIt = datasourceManager.getProcedureNameIterator();
@ -201,6 +207,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
populate(nameObjectList.toArray(new NameObject[nameObjectList.size()])); populate(nameObjectList.toArray(new NameObject[nameObjectList.size()]));
} }
@Override
public void update(DatasourceManagerProvider datasourceManager) { public void update(DatasourceManagerProvider datasourceManager) {
datasourceManager.clearAllTableData(); datasourceManager.clearAllTableData();
datasourceManager.clearAllProcedure(); datasourceManager.clearAllProcedure();
@ -211,6 +218,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
} }
} }
@Override
public void update(TableDataSource tds) { public void update(TableDataSource tds) {
tds.clearAllTableData(); tds.clearAllTableData();
@ -256,10 +264,12 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
this.setSelectedName(name); this.setSelectedName(name);
} }
@Override
public Map<String, String> getDsNameChangedMap() { public Map<String, String> getDsNameChangedMap() {
return this.dsNameChangedMap; return this.dsNameChangedMap;
} }
@Override
public JPanel getPanel() { public JPanel getPanel() {
return this; return this;
} }
@ -269,6 +279,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
* *
* @param index 选中项的序列号 * @param index 选中项的序列号
*/ */
@Override
public void setSelectedIndex(int index) { public void setSelectedIndex(int index) {
nameableList.setSelectedIndex(index); nameableList.setSelectedIndex(index);
} }

23
designer_base/src/com/fr/design/gui/controlpane/JListControlPane.java

@ -51,6 +51,7 @@ public abstract class JListControlPane extends JControlPane {
this.initComponentPane(); this.initComponentPane();
} }
@Override
protected JPanel createControlUpdatePane() { protected JPanel createControlUpdatePane() {
return new JControlUpdatePane(); return new JControlUpdatePane();
} }
@ -60,6 +61,7 @@ public abstract class JListControlPane extends JControlPane {
* *
* @return 按钮的NameableCreator * @return 按钮的NameableCreator
*/ */
@Override
public abstract NameableCreator[] createNameableCreators(); public abstract NameableCreator[] createNameableCreators();
@ -107,6 +109,7 @@ public abstract class JListControlPane extends JControlPane {
} }
@Override
protected ShortCut4JControlPane addItemShortCut() { protected ShortCut4JControlPane addItemShortCut() {
ShortCut addItemShortCut; ShortCut addItemShortCut;
NameableCreator[] creators = creators(); NameableCreator[] creators = creators();
@ -118,22 +121,27 @@ public abstract class JListControlPane extends JControlPane {
return new AbsoluteEnableShortCut(addItemShortCut); return new AbsoluteEnableShortCut(addItemShortCut);
} }
@Override
protected ShortCut4JControlPane removeItemShortCut() { protected ShortCut4JControlPane removeItemShortCut() {
return new NormalEnableShortCut(new RemoveItemAction()); return new NormalEnableShortCut(new RemoveItemAction());
} }
@Override
protected ShortCut4JControlPane copyItemShortCut() { protected ShortCut4JControlPane copyItemShortCut() {
return new NormalEnableShortCut(new CopyItemAction()); return new NormalEnableShortCut(new CopyItemAction());
} }
@Override
protected ShortCut4JControlPane moveUpItemShortCut() { protected ShortCut4JControlPane moveUpItemShortCut() {
return new NormalEnableShortCut(new MoveUpItemAction()); return new NormalEnableShortCut(new MoveUpItemAction());
} }
@Override
protected ShortCut4JControlPane moveDownItemShortCut() { protected ShortCut4JControlPane moveDownItemShortCut() {
return new NormalEnableShortCut(new MoveDownItemAction()); return new NormalEnableShortCut(new MoveDownItemAction());
} }
@Override
protected ShortCut4JControlPane sortItemShortCut() { protected ShortCut4JControlPane sortItemShortCut() {
return new NormalEnableShortCut(new SortItemAction()); return new NormalEnableShortCut(new SortItemAction());
} }
@ -142,6 +150,7 @@ public abstract class JListControlPane extends JControlPane {
this.nameableList.setEditable(editable); this.nameableList.setEditable(editable);
} }
@Override
public Nameable[] update() { public Nameable[] update() {
java.util.List<Nameable> res = new java.util.ArrayList<Nameable>(); java.util.List<Nameable> res = new java.util.ArrayList<Nameable>();
((JControlUpdatePane) this.controlUpdatePane).update(); ((JControlUpdatePane) this.controlUpdatePane).update();
@ -309,6 +318,7 @@ public abstract class JListControlPane extends JControlPane {
* @param prefix 名字前缀 * @param prefix 名字前缀
* @return 名字 * @return 名字
*/ */
@Override
public String createUnrepeatedName(String prefix) { public String createUnrepeatedName(String prefix) {
DefaultListModel model = this.getModel(); DefaultListModel model = this.getModel();
Nameable[] all = new Nameable[model.getSize()]; Nameable[] all = new Nameable[model.getSize()];
@ -349,6 +359,7 @@ public abstract class JListControlPane extends JControlPane {
this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/add.png")); this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/add.png"));
} }
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
Nameable nameable = creator.createNameable(JListControlPane.this); Nameable nameable = creator.createNameable(JListControlPane.this);
@ -386,6 +397,7 @@ public abstract class JListControlPane extends JControlPane {
} }
} }
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (hasInvalid(true)) { if (hasInvalid(true)) {
return; return;
@ -427,6 +439,7 @@ public abstract class JListControlPane extends JControlPane {
.readIcon("/com/fr/base/images/cell/control/remove.png")); .readIcon("/com/fr/base/images/cell/control/remove.png"));
} }
@Override
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
try { try {
JListControlPane.this.nameableList.getCellEditor() JListControlPane.this.nameableList.getCellEditor()
@ -454,6 +467,7 @@ public abstract class JListControlPane extends JControlPane {
.readIcon("/com/fr/base/images/cell/control/copy.png")); .readIcon("/com/fr/base/images/cell/control/copy.png"));
} }
@Override
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
// p:选中的值. // p:选中的值.
ListModelElement selectedValue = (ListModelElement) nameableList.getSelectedValue(); ListModelElement selectedValue = (ListModelElement) nameableList.getSelectedValue();
@ -488,6 +502,7 @@ public abstract class JListControlPane extends JControlPane {
.readIcon("/com/fr/design/images/control/up.png")); .readIcon("/com/fr/design/images/control/up.png"));
} }
@Override
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
int selectedIndex = nameableList.getSelectedIndex(); int selectedIndex = nameableList.getSelectedIndex();
if (selectedIndex == -1) { if (selectedIndex == -1) {
@ -520,6 +535,7 @@ public abstract class JListControlPane extends JControlPane {
.readIcon("/com/fr/design/images/control/down.png")); .readIcon("/com/fr/design/images/control/down.png"));
} }
@Override
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
int selectedIndex = nameableList.getSelectedIndex(); int selectedIndex = nameableList.getSelectedIndex();
if (selectedIndex == -1) { if (selectedIndex == -1) {
@ -550,6 +566,7 @@ public abstract class JListControlPane extends JControlPane {
.readIcon("/com/fr/design/images/control/sortAsc.png")); .readIcon("/com/fr/design/images/control/sortAsc.png"));
} }
@Override
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
// p:选中的值. // p:选中的值.
Object selectedValue = nameableList.getSelectedValue(); Object selectedValue = nameableList.getSelectedValue();
@ -568,6 +585,7 @@ public abstract class JListControlPane extends JControlPane {
// p:排序. // p:排序.
if (isAtoZ) { if (isAtoZ) {
Comparator<Nameable> nameableComparator = new Comparator<Nameable>() { Comparator<Nameable> nameableComparator = new Comparator<Nameable>() {
@Override
public int compare(Nameable o1, Nameable o2) { public int compare(Nameable o1, Nameable o2) {
return -ComparatorUtils.compare(o1.getName(), o2 return -ComparatorUtils.compare(o1.getName(), o2
.getName()); .getName());
@ -577,6 +595,7 @@ public abstract class JListControlPane extends JControlPane {
Arrays.sort(nameableArray, nameableComparator); Arrays.sort(nameableArray, nameableComparator);
} else { } else {
Comparator<Nameable> nameableComparator = new Comparator<Nameable>() { Comparator<Nameable> nameableComparator = new Comparator<Nameable>() {
@Override
public int compare(Nameable o1, Nameable o2) { public int compare(Nameable o1, Nameable o2) {
return ComparatorUtils.compare(o1.getName(), o2 return ComparatorUtils.compare(o1.getName(), o2
.getName()); .getName());
@ -634,6 +653,7 @@ public abstract class JListControlPane extends JControlPane {
evt.getY() - 1); evt.getY() - 1);
} }
@Override
public void mouseMoved(MouseEvent e) { public void mouseMoved(MouseEvent e) {
} }
@ -697,6 +717,7 @@ public abstract class JListControlPane extends JControlPane {
/** /**
* 检查是否可用 * 检查是否可用
*/ */
@Override
public void checkEnable() { public void checkEnable() {
this.shortCut.setEnabled(true); this.shortCut.setEnabled(true);
} }
@ -710,6 +731,7 @@ public abstract class JListControlPane extends JControlPane {
/** /**
* 检查是否可用 * 检查是否可用
*/ */
@Override
public void checkEnable() { public void checkEnable() {
this.shortCut.setEnabled(getModel() this.shortCut.setEnabled(getModel()
.getSize() > 0 .getSize() > 0
@ -918,6 +940,7 @@ public abstract class JListControlPane extends JControlPane {
return -1; return -1;
} }
@Override
protected boolean hasInvalid(boolean isAdd) { protected boolean hasInvalid(boolean isAdd) {
int idx = JListControlPane.this.getInValidIndex(); int idx = JListControlPane.this.getInValidIndex();
if (isAdd || nameableList.getSelectedIndex() != idx) { if (isAdd || nameableList.getSelectedIndex() != idx) {

Loading…
Cancel
Save