技术开发 频道

Swing第二刀:枝间新绿一重重

  上面例子中的Network.xml内容举例如下:

<?xml version="1.0" encoding="UTF-8"?>   <network>
<node x="30" y="50"
text
="AP Prepay"
network_text
="AP Prepay"
tooltip
="This is a tooltip of a node"
icon
="/free/test/module.png"           
 list_icon="/free/test/submodule.png">  
<button1tooltip="Tooltip"                      
icon="/free/test/module_attachment.png" action="X002"/>  
<button2tooltip="Tooltip"                      
icon="/free/test/module_attachment.png" action="X002"/>  
<button3tooltip="Tooltip"                      
icon="/free/test/module_attachment.png" action="X002"/>  
<shortcuts>  
<separator text="Most Often Used Reports"/>  
<shortcut text="Add aPart"tooltip="Tooltip"                        
icon="/free/submodule.png" action="Z010"/>  
<shortcut text="Delete a Part" tooltip="Tooltip"                          
icon="/free/submodule.png" action="Z010"/>  
<shortcut text="AP Aging Report" tooltip="Tooltip"
icon
="/free/chart.png" action="Z010"/>  
<shortcut text="MRP for All Parts Used this Month" tooltip="Tooltip"                           
 icon="/free/user.png" action="Z010"/>  
<shortcut text="Dashboard of this Month" tooltip="Tooltip"                             
 icon="/free/email.png" action="Z010"/>  
<shortcut text="All Open Purchase Orders" tooltip="Tooltip"                            
icon="/free/chart.png" action="Z010"/>  
<shortcut text="Search in Address Book" tooltip="Tooltip"                            
icon="/free/user.png" action="Z010"/>  
<shortcut text="All Online Users" tooltip="Tooltip"
icon
="/free/email.png" action="Z010"/>  
<separator text="Common Reports"/>  
<shortcut text="All Open Purchase Orders" tooltip="Tooltip"
icon
="/free/chart.png" action="Z010"/>  
<shortcut text="Search in Address Book" tooltip="Tooltip"
icon
="/free/user.png" action="Z010"/>  
<shortcut text="All Online Users" tooltip="Tooltip"
icon
="/free/email.png" action="Z010"/>  
<shortcut text="All Open Purchase Orders" tooltip="Tooltip"
icon
="/free/chart.png" action="Z010"/>  
<shortcut text="Search in Address Book" tooltip="Tooltip"
icon
="/free/user.png" action="Z010"/>  
<shortcut text="All Online Users" tooltip="Tooltip"
icon
="/free/email.png" action="Z010"/>  
<shortcut text="All Open Purchase Orders" tooltip="Tooltip"
icon
="/free/chart.png" action="Z010"/>  
<shortcut text="Search in Address Book" tooltip="Tooltip"                              
icon="/test/user.png" action="Z010"/>  
<shortcut text="All Online Users" tooltip="Tooltip"                        
  icon="/free/email.png" action="Z010"/>  
</shortcuts>  
</node>
</network>

  其中,每个node定义了一个子模块节点。节点上包含x、y坐标信息、文本信息、tooltip、icon图标(中间大的主图标),以及三个按钮。每个node如图所示,可以携带3个按钮。每个按钮可以挂一个图标、tooltip、icon以及动作码。我们可以定义其任意动作。

上面例子中的Network.xml内容举例如下

  然后,每个node又携带了一个shortcuts列表,包含了这个节点所有相关的功能点,在node被选中后,以右侧的列表方式列出。如图所示:

上面例子中的Network.xml内容举例如下

  此外,流程图中的箭头是通过类似如下XML在network.xml中定义:

<arrow x="170" y="80" direction="left" rotation="0"/>

  其中x、y是坐标,direction是方向,可以是上下左右以及斜向共8个方向。此外rotation还提供了旋转角度。如果right_up这个45度的右上角度不符合要求,可以在增加rotation进行进一步调节。

0