Browse Source

数据集分组接口修改

master
zack 9 years ago
parent
commit
0f2680faea
  1. 41
      designer_base/src/com/fr/design/data/BasicTableDataTreePane.java
  2. 13
      designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java
  3. 5
      designer_base/src/com/fr/design/fun/TableDataTreePaneProcessor.java
  4. 3
      designer_base/src/com/fr/design/gui/frpane/JTreeAutoBuildPane.java
  5. 19
      designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java
  6. 15
      designer_base/src/com/fr/design/gui/itree/refreshabletree/RefreshableJTree.java
  7. 26
      designer_base/src/com/fr/design/mainframe/WestRegionContainerPane.java
  8. 5
      designer_base/src/com/fr/start/BaseDesigner.java
  9. 43
      designer_form/src/com/fr/design/gui/xpane/JTreeAutoBuildPane.java

41
designer_base/src/com/fr/design/data/BasicTableDataTreePane.java

@ -0,0 +1,41 @@
package com.fr.design.data;
import com.fr.design.data.datapane.TableDataTree;
import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane;
import com.fr.design.mainframe.DockingView;
import javax.swing.*;
/**
* Coder: zack
* Date: 2016/4/22
* Time: 16:23
*/
public class BasicTableDataTreePane extends DockingView{
@Override
public void refreshDockingView() {
}
@Override
public String getViewTitle() {
return null;
}
@Override
public Icon getViewIcon() {
return null;
}
@Override
public Location preferredLocation() {
return null;
}
public void dgEdit(final AbstractTableDataPane<?> uPanel, String originalName) {
}
public TableDataTree getDataTree() {
return null;
}
}

13
designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java

@ -6,7 +6,9 @@ import com.fr.base.TableData;
import com.fr.data.TableDataSource; import com.fr.data.TableDataSource;
import com.fr.data.impl.storeproc.StoreProcedure; import com.fr.data.impl.storeproc.StoreProcedure;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.data.BasicTableDataTreePane;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.tabledata.ResponseDataSourceChange; import com.fr.design.data.tabledata.ResponseDataSourceChange;
import com.fr.design.data.tabledata.StoreProcedureWorkerListener; import com.fr.design.data.tabledata.StoreProcedureWorkerListener;
@ -18,6 +20,7 @@ import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.fun.TableDataTreePaneProcessor;
import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
@ -26,7 +29,6 @@ import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.icon.IconPathConstants; import com.fr.design.icon.IconPathConstants;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DockingView;
import com.fr.design.menu.LineSeparator; import com.fr.design.menu.LineSeparator;
import com.fr.design.menu.MenuDef; import com.fr.design.menu.MenuDef;
import com.fr.design.menu.SeparatorDef; import com.fr.design.menu.SeparatorDef;
@ -50,7 +52,7 @@ import java.util.EventObject;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
public class TableDataTreePane extends DockingView implements ResponseDataSourceChange { public class TableDataTreePane extends BasicTableDataTreePane implements ResponseDataSourceChange {
protected static final int PROCEDURE_NAME_INDEX = 4; protected static final int PROCEDURE_NAME_INDEX = 4;
protected static final int TEMPLATE_TABLE_DATA = 0; protected static final int TEMPLATE_TABLE_DATA = 0;
@ -65,7 +67,12 @@ public class TableDataTreePane extends DockingView implements ResponseDataSource
* @param tc * @param tc
* @return * @return
*/ */
public synchronized static TableDataTreePane getInstance(DesignModelAdapter<?, ?> tc) { public synchronized static BasicTableDataTreePane getInstance(DesignModelAdapter<?, ?> tc) {
TableDataTreePaneProcessor treePaneProcessor = ExtraDesignClassManager.getInstance().getTableDataTreePaneProcessor();
if (treePaneProcessor != null) {
return treePaneProcessor.createTableDataTreePane(tc);
}
if (singleton.tc == null) { if (singleton.tc == null) {
singleton.addMenuDef.clearShortCuts(); singleton.addMenuDef.clearShortCuts();
singleton.createAddMenuDef(); singleton.createAddMenuDef();

5
designer_base/src/com/fr/design/fun/TableDataTreePaneProcessor.java

@ -1,6 +1,7 @@
package com.fr.design.fun; package com.fr.design.fun;
import com.fr.design.data.datapane.TableDataTreePane; import com.fr.design.DesignModelAdapter;
import com.fr.design.data.BasicTableDataTreePane;
import com.fr.stable.fun.Level; import com.fr.stable.fun.Level;
/** /**
@ -17,6 +18,6 @@ public interface TableDataTreePaneProcessor extends Level {
* 创建数据集面板 * 创建数据集面板
* @return 数据集面板 * @return 数据集面板
*/ */
TableDataTreePane createTableDataTreePane(); BasicTableDataTreePane createTableDataTreePane(DesignModelAdapter<?, ?> tc);
} }

3
designer_base/src/com/fr/design/gui/frpane/JTreeAutoBuildPane.java

@ -1,6 +1,7 @@
package com.fr.design.gui.frpane; package com.fr.design.gui.frpane;
import com.fr.base.Formula; import com.fr.base.Formula;
import com.fr.design.data.BasicTableDataTreePane;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.datapane.EditOrNewLabel; import com.fr.design.data.datapane.EditOrNewLabel;
import com.fr.design.data.datapane.TableDataTreePane; import com.fr.design.data.datapane.TableDataTreePane;
@ -207,7 +208,7 @@ public class JTreeAutoBuildPane extends BasicPane implements PreviewLabel.Previe
public void edit(JPanel jPanel) { public void edit(JPanel jPanel) {
RecursionTableData rtd = null; RecursionTableData rtd = null;
String name = ""; String name = "";
TableDataTreePane tdtp = TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()); BasicTableDataTreePane tdtp = TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter());
if (treeTableDataComboBox.getSelectedItem() == null) { if (treeTableDataComboBox.getSelectedItem() == null) {
//新建 //新建
rtd = new RecursionTableData(); rtd = new RecursionTableData();

19
designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java

@ -86,6 +86,25 @@ public class UIResizableContainer extends JPanel {
add(downPane); add(downPane);
add(verticalToolPane); add(verticalToolPane);
} }
public UIResizableContainer(JComponent upPane, int direction) {
setBackground(UIConstants.NORMAL_BACKGROUND);
this.upPane = upPane;
this.direction = direction;
this.horizontToolPane = new HorizotalToolPane();
setLayout(containerLayout);
add(upPane);
add(horizontToolPane);
}
public void setDownPane(JComponent downPane) {
this.verticalToolPane = new VerticalToolPane();
this.downPane = downPane;
add(downPane);
add(verticalToolPane);
}
/** /**
* 将面板设置成最佳的宽度 * 将面板设置成最佳的宽度

15
designer_base/src/com/fr/design/gui/itree/refreshabletree/RefreshableJTree.java

@ -1,19 +1,18 @@
package com.fr.design.gui.itree.refreshabletree; package com.fr.design.gui.itree.refreshabletree;
import javax.swing.*;
import javax.swing.event.TreeExpansionEvent;
import javax.swing.event.TreeExpansionListener;
import javax.swing.event.TreeWillExpandListener;
import javax.swing.tree.*;
import com.fr.general.NameObject;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.gui.itooltip.UIToolTip; import com.fr.design.gui.itooltip.UIToolTip;
import com.fr.design.gui.itree.checkboxtree.CheckBoxTree; import com.fr.design.gui.itree.checkboxtree.CheckBoxTree;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.NameObject;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.event.TreeExpansionEvent;
import javax.swing.event.TreeExpansionListener;
import javax.swing.event.TreeWillExpandListener;
import javax.swing.tree.*;
import java.awt.*; import java.awt.*;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
@ -249,7 +248,7 @@ public abstract class RefreshableJTree extends CheckBoxTree {
isExpanded(selRow), getModel().isLeaf(lastPath), selRow, isExpanded(selRow), getModel().isLeaf(lastPath), selRow,
true); true);
if (rComponent instanceof JComponent && rComponent.getPreferredSize().getWidth() + i * WIDTH_BETWEEN_NODES > getVisibleRect().getWidth()) { if (r instanceof DefaultTreeCellRenderer && rComponent instanceof JComponent && rComponent.getPreferredSize().getWidth() + i * WIDTH_BETWEEN_NODES > getVisibleRect().getWidth()) {
tip = ((DefaultTreeCellRenderer) r).getText(); tip = ((DefaultTreeCellRenderer) r).getText();
icon = ((DefaultTreeCellRenderer) r).getIcon(); icon = ((DefaultTreeCellRenderer) r).getIcon();
} }

26
designer_base/src/com/fr/design/mainframe/WestRegionContainerPane.java

@ -2,13 +2,11 @@ package com.fr.design.mainframe;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.data.datapane.TableDataTreePane; import com.fr.design.data.datapane.TableDataTreePane;
import com.fr.design.fun.TableDataTreePaneProcessor;
import com.fr.design.gui.icontainer.UIResizableContainer; import com.fr.design.gui.icontainer.UIResizableContainer;
import com.fr.general.GeneralContext;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.plugin.PluginReadListener;
import javax.swing.*;
public class WestRegionContainerPane extends UIResizableContainer { public class WestRegionContainerPane extends UIResizableContainer {
@ -20,23 +18,21 @@ public class WestRegionContainerPane extends UIResizableContainer {
*/ */
public static final WestRegionContainerPane getInstance() { public static final WestRegionContainerPane getInstance() {
if (THIS == null) { if (THIS == null) {
TableDataTreePane tableDataTreePane = null; THIS = new WestRegionContainerPane();
TableDataTreePaneProcessor treePaneProcessor = ExtraDesignClassManager.getInstance().getTableDataTreePaneProcessor();
if (treePaneProcessor != null) {
tableDataTreePane = treePaneProcessor.createTableDataTreePane();
} else {
tableDataTreePane = TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter());
}
THIS = new WestRegionContainerPane(tableDataTreePane);
THIS.setLastToolPaneY(DesignerEnvManager.getEnvManager().getLastWestRegionToolPaneY()); THIS.setLastToolPaneY(DesignerEnvManager.getEnvManager().getLastWestRegionToolPaneY());
THIS.setLastContainerWidth(DesignerEnvManager.getEnvManager().getLastWestRegionContainerWidth()); THIS.setLastContainerWidth(DesignerEnvManager.getEnvManager().getLastWestRegionContainerWidth());
} }
return THIS; return THIS;
} }
public WestRegionContainerPane(JComponent pane) { public WestRegionContainerPane() {
super(DesignerFrameFileDealerPane.getInstance(), pane, Constants.RIGHT); super(DesignerFrameFileDealerPane.getInstance(), Constants.RIGHT);
GeneralContext.addPluginReadListener(new PluginReadListener() {
@Override
public void success() {
setDownPane(TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()));
}
});
setContainerWidth(165); setContainerWidth(165);
} }
} }

5
designer_base/src/com/fr/start/BaseDesigner.java

@ -83,7 +83,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
DesignUtils.creatListeningServer(getStartPort(), startFileSuffix()); DesignUtils.creatListeningServer(getStartPort(), startFileSuffix());
// 初始化Log Handler // 初始化Log Handler
DesignerEnvManager.loadLogSetting(); DesignerEnvManager.loadLogSetting();
DesignerFrame df = createDesignerFrame();
// 默认加载工作目录,用于读取License // 默认加载工作目录,用于读取License
switch2LastEnv(); switch2LastEnv();
@ -92,9 +92,6 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
// 必须先初始化Env再去startModule, 不然会导致lic读取不到 // 必须先初始化Env再去startModule, 不然会导致lic读取不到
ModuleContext.startModule(module2Start()); ModuleContext.startModule(module2Start());
//这个放在读插件的后面,数据集分组的插件用到
DesignerFrame df = createDesignerFrame();
// 再次加载工作目录,用于读取工作目录下的各种插件 // 再次加载工作目录,用于读取工作目录下的各种插件
switch2LastEnv(); switch2LastEnv();

43
designer_form/src/com/fr/design/gui/xpane/JTreeAutoBuildPane.java

@ -1,41 +1,38 @@
package com.fr.design.gui.xpane; package com.fr.design.gui.xpane;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.List;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel;
import com.fr.base.Formula; import com.fr.base.Formula;
import com.fr.design.layout.TableLayoutHelper; import com.fr.data.impl.NameTableData;
import com.fr.general.Inter; import com.fr.data.impl.RecursionTableData;
import com.fr.data.impl.TableDataDictionary;
import com.fr.design.DesignModelAdapter;
import com.fr.design.data.BasicTableDataTreePane;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.datapane.EditOrNewLabel; import com.fr.design.data.datapane.EditOrNewLabel;
import com.fr.design.data.datapane.EditOrNewLabel.Editable;
import com.fr.design.data.datapane.TableDataTreePane; import com.fr.design.data.datapane.TableDataTreePane;
import com.fr.design.data.datapane.TreeTableDataComboBox; import com.fr.design.data.datapane.TreeTableDataComboBox;
import com.fr.design.data.datapane.EditOrNewLabel.Editable;
import com.fr.data.impl.NameTableData;
import com.fr.data.impl.RecursionTableData;
import com.fr.data.impl.TableDataDictionary;
import com.fr.design.data.datapane.preview.PreviewLabel; import com.fr.design.data.datapane.preview.PreviewLabel;
import com.fr.design.data.datapane.preview.PreviewLabel.Previewable; import com.fr.design.data.datapane.preview.PreviewLabel.Previewable;
import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper;
import com.fr.design.data.tabledata.wrapper.AbstractTableDataWrapper; import com.fr.design.data.tabledata.wrapper.AbstractTableDataWrapper;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper; import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.DesignModelAdapter; import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.editor.ValueEditorPane; import com.fr.design.editor.ValueEditorPane;
import com.fr.design.editor.ValueEditorPaneFactory; import com.fr.design.editor.ValueEditorPaneFactory;
import com.fr.design.editor.editor.OldColumnIndexEditor;
import com.fr.design.editor.editor.Editor; import com.fr.design.editor.editor.Editor;
import com.fr.design.editor.editor.FormulaEditor; import com.fr.design.editor.editor.FormulaEditor;
import com.fr.design.editor.editor.OldColumnIndexEditor;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.List;
public class JTreeAutoBuildPane extends BasicPane implements Previewable, Editable { public class JTreeAutoBuildPane extends BasicPane implements Previewable, Editable {
private TreeTableDataComboBox treeTableDataComboBox; private TreeTableDataComboBox treeTableDataComboBox;
@ -176,7 +173,7 @@ public class JTreeAutoBuildPane extends BasicPane implements Previewable, Editab
public void edit(JPanel jPanel) { public void edit(JPanel jPanel) {
RecursionTableData rtd = null; RecursionTableData rtd = null;
String name = ""; String name = "";
TableDataTreePane tdtp = TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()); BasicTableDataTreePane tdtp = TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter());
if (treeTableDataComboBox.getSelectedItem() == null) { if (treeTableDataComboBox.getSelectedItem() == null) {
//新建 //新建
rtd = new RecursionTableData(); rtd = new RecursionTableData();

Loading…
Cancel
Save