|
|
@ -4,6 +4,7 @@ import com.fr.design.constants.UIConstants; |
|
|
|
import com.fr.design.designer.creator.XCreator; |
|
|
|
import com.fr.design.designer.creator.XCreator; |
|
|
|
import com.fr.design.designer.creator.XCreatorUtils; |
|
|
|
import com.fr.design.designer.creator.XCreatorUtils; |
|
|
|
import com.fr.design.designer.creator.XLayoutContainer; |
|
|
|
import com.fr.design.designer.creator.XLayoutContainer; |
|
|
|
|
|
|
|
import com.fr.design.designer.creator.XWTitleLayout; |
|
|
|
import com.fr.design.designer.treeview.ComponentTreeCellRenderer; |
|
|
|
import com.fr.design.designer.treeview.ComponentTreeCellRenderer; |
|
|
|
import com.fr.design.designer.treeview.ComponentTreeModel; |
|
|
|
import com.fr.design.designer.treeview.ComponentTreeModel; |
|
|
|
import com.fr.design.file.HistoryTemplateListCache; |
|
|
|
import com.fr.design.file.HistoryTemplateListCache; |
|
|
@ -378,8 +379,6 @@ public class ComponentTree extends JTree { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void mouseClicked(MouseEvent e) { |
|
|
|
public void mouseClicked(MouseEvent e) { |
|
|
|
// 鼠标左键 双击
|
|
|
|
|
|
|
|
if (e.getClickCount() == 2 && e.getButton() == MouseEvent.BUTTON1 && !designer.isFormParaDesigner()) { |
|
|
|
|
|
|
|
Point p = e.getPoint(); |
|
|
|
Point p = e.getPoint(); |
|
|
|
// 解析组件树路径 获取选中的组件
|
|
|
|
// 解析组件树路径 获取选中的组件
|
|
|
|
int selRow = tree.getRowForLocation(p.x, p.y); |
|
|
|
int selRow = tree.getRowForLocation(p.x, p.y); |
|
|
@ -389,11 +388,21 @@ public class ComponentTree extends JTree { |
|
|
|
Point point = bounds.getLocation(); |
|
|
|
Point point = bounds.getLocation(); |
|
|
|
SwingUtilities.convertPointToScreen(point, tree); |
|
|
|
SwingUtilities.convertPointToScreen(point, tree); |
|
|
|
XCreator comp = (XCreator) path.getLastPathComponent(); |
|
|
|
XCreator comp = (XCreator) path.getLastPathComponent(); |
|
|
|
|
|
|
|
// 鼠标左键 双击
|
|
|
|
|
|
|
|
if (e.getClickCount() == 2 && e.getButton() == MouseEvent.BUTTON1 && !designer.isFormParaDesigner()) { |
|
|
|
startEditing(comp, e); |
|
|
|
startEditing(comp, e); |
|
|
|
|
|
|
|
} else if (e.getClickCount() == 1 && e.getButton() == MouseEvent.BUTTON1) { |
|
|
|
|
|
|
|
showSelectedPopup(comp); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void showSelectedPopup(XCreator comp) { |
|
|
|
|
|
|
|
Rectangle rectangle = getRelativeBounds(comp); |
|
|
|
|
|
|
|
comp.showSelectedPopup(designer, rectangle, comp.acceptType(XWTitleLayout.class)); |
|
|
|
|
|
|
|
comp.setSelected(true); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 组件进入编辑状态 |
|
|
|
* 组件进入编辑状态 |
|
|
|
* |
|
|
|
* |
|
|
|